Detailed Description

Represents a font suitable for displaying text on the screen with. There is one of these per PowerUI.Renderman.

Public Member Functions

 DynamicFont (string name)
 Creates a new displayable font. More...
 
bool LoadFaces ()
 Loads this font from the local project files. Should be a folder named after the font family and in it a series of font files. More...
 
void Load ()
 Loads useful values into this font. More...
 
float GetDescend (float fontSize)
 Gets the max descend at the given font size. More...
 
float GetAscend (float fontSize)
 Gets the max ascend at the given font size. Positive value. More...
 
float GetHeight (float fontSize)
 Gets the height of the font at the given font size. More...
 
float GetSpaceSize (int fontSize)
 Gets the standard size of a space for the given font size. More...
 
Glyph GetCharacter (int charcode, FontFaceFlags style)
 Gets a displayable character as a surrogate pair from this font. More...
 
Glyph GetCharacterDirect (int charcode, FontFaceFlags style)
 Gets a displayable character as a surrogate pair from this font. Avoids checking for alternate providers. More...
 

Static Public Member Functions

static DynamicFont Get (string name)
 Creates a new font by loading the Unity font from resources. More...
 
static DynamicFont GetDefaultFamily ()
 
static bool LoadInternalFont ()
 Loads the internal font which is used as a last resort. More...
 

Public Attributes

string Name
 The font family name. E.g. "Vera". More...
 
FontFamily Family
 The underlying InfiniText font family. More...
 
float Ascender =0.8f
 The biggest ascender in this font. More...
 
float Descender =0.2f
 The biggest descender in this font. More...
 
float LineSize =1f
 The height of a line with this font. More...
 
float StrikeSize =0.1f
 The thickness of a strikethrough line. More...
 
float StrikeOffset =0.25f
 The offset to a strikethrough line. More...
 
DynamicFont Fallback
 A font to fallback on, if one is specified in the HTML. More...
 
float SpaceSize =1/3f
 The width of a standard space at 1px. More...
 

Static Public Attributes

static DynamicFont DefaultFamily
 The default font family. This is just the very first loaded family, or the internal font. More...
 
static string InternalFont ="DejaVu"
 The font that will attempt to load entirely if no other font is available. Absolute last resort. More...
 

Constructor & Destructor Documentation

PowerUI.DynamicFont.DynamicFont ( string  name)
inline

Creates a new displayable font.

Parameters
nameThe name of the font.

Member Function Documentation

static DynamicFont PowerUI.DynamicFont.Get ( string  name)
inlinestatic

Creates a new font by loading the Unity font from resources.

Parameters
nameThe name of the font to load.
Returns
A new dynamic font.
float PowerUI.DynamicFont.GetAscend ( float  fontSize)
inline

Gets the max ascend at the given font size. Positive value.

Glyph PowerUI.DynamicFont.GetCharacter ( int  charcode,
FontFaceFlags  style 
)
inline

Gets a displayable character as a surrogate pair from this font.

Parameters
lowCharacterThe low surrogate character to display.
highCharacterThe high surrogate character to display.
styleThe style of the character.
Returns
The displayable character.
Glyph PowerUI.DynamicFont.GetCharacterDirect ( int  charcode,
FontFaceFlags  style 
)
inline

Gets a displayable character as a surrogate pair from this font. Avoids checking for alternate providers.

static DynamicFont PowerUI.DynamicFont.GetDefaultFamily ( )
inlinestatic
float PowerUI.DynamicFont.GetDescend ( float  fontSize)
inline

Gets the max descend at the given font size.

float PowerUI.DynamicFont.GetHeight ( float  fontSize)
inline

Gets the height of the font at the given font size.

float PowerUI.DynamicFont.GetSpaceSize ( int  fontSize)
inline

Gets the standard size of a space for the given font size.

Parameters
fontSizeThe size of the font.
Returns
The space size.
void PowerUI.DynamicFont.Load ( )
inline

Loads useful values into this font.

bool PowerUI.DynamicFont.LoadFaces ( )
inline

Loads this font from the local project files. Should be a folder named after the font family and in it a series of font files.

Returns
True if at least one font face was loaded.
static bool PowerUI.DynamicFont.LoadInternalFont ( )
inlinestatic

Loads the internal font which is used as a last resort.

Member Data Documentation

float PowerUI.DynamicFont.Ascender =0.8f

The biggest ascender in this font.

DynamicFont PowerUI.DynamicFont.DefaultFamily
static

The default font family. This is just the very first loaded family, or the internal font.

float PowerUI.DynamicFont.Descender =0.2f

The biggest descender in this font.

DynamicFont PowerUI.DynamicFont.Fallback

A font to fallback on, if one is specified in the HTML.

FontFamily PowerUI.DynamicFont.Family

The underlying InfiniText font family.

string PowerUI.DynamicFont.InternalFont ="DejaVu"
static

The font that will attempt to load entirely if no other font is available. Absolute last resort.

float PowerUI.DynamicFont.LineSize =1f

The height of a line with this font.

string PowerUI.DynamicFont.Name

The font family name. E.g. "Vera".

float PowerUI.DynamicFont.SpaceSize =1/3f

The width of a standard space at 1px.

float PowerUI.DynamicFont.StrikeOffset =0.25f

The offset to a strikethrough line.

float PowerUI.DynamicFont.StrikeSize =0.1f

The thickness of a strikethrough line.