Detailed Description

A font face for a particular font family. Note that you must consider if this font face has been loaded (see RequiresLoad) yet if you use deferred loading. The metrics will always be available however - just the glyphs will not be if RequiresLoad is true.

Public Member Functions

void AllGlyphsLoaded ()
 Called when all glyphs in this font face have been loaded up. Note that this may occur very late or, more likely never, when glyphs are loaded on demand. More...
 
void Load ()
 Loads the glyph info for this font face now. See RequiresLoad. More...
 
void Derive (FontFace from, int styleCode, int weight, int stretch)
 Derives this font face from the given one, with the given settings. More...
 
void SetItalicAngle (float angle)
 Applies the angle, in degrees, used for synthesizing italic chars. More...
 
void SetFlags (int style, int weight, int stretch)
 Sets the weight of this face and if it's italic. More...
 
FontFace CreateSynthetic (int styleCode, int weight, int stretch)
 Creates a synthetic derivative of this font. Used when a font does not have e.g. an italic face. More...
 
Glyph Synthesize (int charCode)
 Synthesizes a glyph of the given charcode. More...
 
Glyph GetGlyphOrEmoji (int charcode)
 Gets a glyph which can be optionally overriden by a 'character provider'. More...
 
Glyph GetGlyphDirect (int charCode)
 Gets a glyph for a particular charcode without loading anything. More...
 
Glyph GetGlyph (int charCode)
 Gets a glyph for a particular charcode. Note that no glyphs are ever empty. More...
 
Glyph GetGlyph (int charCode, out bool firstTime)
 Gets a glyph for a particular charcode. Note that no glyphs are ever empty. More...
 

Public Attributes

int Weight
 The font weight. 1-9. More...
 
int Style
 The font style. 0-2. More...
 
int Stretch
 The font stretch. 1-9. More...
 
string Name
 The full name of this font face. More...
 
bool Clockness
 The winding order of glyphs of this font. More...
 
bool DisableExtrude
 Use this to disable the SDF extrusion of a font face which may cause the letters to go streaky in rare cases. More...
 
bool WindingUnknown =true
 Is the clockness of this face known yet? If so, the first loaded glyph will figure it out. More...
 
bool RequiresLoad =false
 Is this font face loaded at all? If it requires a load, call Load(). Note that metrics are available if it's not loaded. More...
 
float HalfLineGap =0.1f
 The spacing between the text, divided by two. It's divided because it gets shared. More...
 
float LineGap
 The gap between lines. It gets placed below the line when it's necessary. Note that this is not the line height (or leading). More...
 
float ItalicAngle =0.213f
 The computed amount of units to "push" (sheer) the top of a glyph over by. Std default is 12 degrees; tan(12d) units. More...
 
float Ascender
 The size of the ascender. Relative to em size. More...
 
float Descender
 The size of the descender. Relative to em size and is used to define where the baseline is. More...
 
FontFamily Family
 The family that this font is in. Created by the first font in the family. More...
 
int CharacterCount
 The number of characters in this font face. More...
 
float MaxAdvanceWidth
 The maximum advance width. More...
 
float MinLeftSideBearing
 The minimum left side bearing. More...
 
float MinRightSideBearing
 The minimum right side bearing. More...
 
float MaxXExtent
 The maximum x extent. More...
 
float CaretAngle
 The angle of the caret when this font is used. More...
 
float CaretOffset
 The horizontal caret offset. More...
 
int NumberOfHMetrics
 The number of glyphs in this font face. More...
 
int UnitsPerEm =1000
 The glyph units per em value. More...
 
Glyph NotDefined
 The .notdef glyph. More...
 
float UnitsPerEmF =1000f
 The glyph units per em value, as a float. More...
 
float StrikeSize =0.1f
 The thickness of a strikethrough line. More...
 
float StrikeOffset =0.25f
 The offset to a strikethrough line. More...
 
FontFace SyntheticDerivative
 The font that this is a derivative of. More...
 
int StyleFlags =FontFaceFlags.None
 The flags for this font face. A style bitmask. More...
 
Dictionary< string, FontFeatureFeatures =new Dictionary<string,FontFeature>()
 All available typographic features. Ligatures, smallcaps etc. More...
 
Dictionary< int, GlyphGlyphs =new Dictionary<int,Glyph>()
 All raw glyphs in this font face. Indexed by charcode. Note that if you have Font.Preload false, they may not be loaded. Check glyph.RequiresLoad if you access this directly. More...
 
CffGlyphParser CffParser
 The CFF parser, if this is a CFF format font. Used to load glyphs on demand. More...
 
FontParser Parser
 The raw parser. Used to load glyphs on demand. More...
 
int UnloadedGlyphs
 The number of not yet loaded glyphs in this font. More...
 

Package Functions

void FindWinding (Glyph glyph)
 Figures out the winding order of this font face from the given glyph. More...
 

Package Attributes

Glyph[] ParserGlyphs
 Don't use this! Use Glyphs instead. The raw glyph set used by the parser. May be null. More...
 

Properties

float BaselineToBaseline [get]
 Baseline to baseline height. Same as 'line-height' in CSS. More...
 
float MWidth [get]
 The width of an 'M'. Relative. More...
 
float ExHeight [get]
 The height of a lowercase 'x'. Relative. More...
 
float ChHeight [get]
 The height of a '0'. Relative. More...
 
bool Synthetic [get]
 Is this a synthetic font? More...
 
bool Regular [get]
 Is this the regular font for this family? More...
 
bool Stylized [get]
 True if this is an italic or oblique face. More...
 
bool Bold [get]
 True if this is a bold face. More...
 
Glyph this[int charCode] [get, set]
 Gets or sets the given charcode glyph. More...
 
string FamilyName [get, set]
 The name of the family this font is in. Set is for internal use only. More...
 

Private Attributes

float ExHeightRaw
 The cached height of a lowercase 'x'. Relative. More...
 
float MWidthRaw
 The cached width of an 'M'. Relative. More...
 
float ChHeightRaw
 The cached height of a '0'. Relative. More...
 

Member Function Documentation

void InfiniText.FontFace.AllGlyphsLoaded ( )
inline

Called when all glyphs in this font face have been loaded up. Note that this may occur very late or, more likely never, when glyphs are loaded on demand.

FontFace InfiniText.FontFace.CreateSynthetic ( int  styleCode,
int  weight,
int  stretch 
)
inline

Creates a synthetic derivative of this font. Used when a font does not have e.g. an italic face.

void InfiniText.FontFace.Derive ( FontFace  from,
int  styleCode,
int  weight,
int  stretch 
)
inline

Derives this font face from the given one, with the given settings.

void InfiniText.FontFace.FindWinding ( Glyph  glyph)
inlinepackage

Figures out the winding order of this font face from the given glyph.

Glyph InfiniText.FontFace.GetGlyph ( int  charCode)
inline

Gets a glyph for a particular charcode. Note that no glyphs are ever empty.

Glyph InfiniText.FontFace.GetGlyph ( int  charCode,
out bool  firstTime 
)
inline

Gets a glyph for a particular charcode. Note that no glyphs are ever empty.

Parameters
firstTimeTrue if this glyph was seen for the very first time.
Glyph InfiniText.FontFace.GetGlyphDirect ( int  charCode)
inline

Gets a glyph for a particular charcode without loading anything.

Returns
A glyph if it's available. Null otherwise.
Glyph InfiniText.FontFace.GetGlyphOrEmoji ( int  charcode)
inline

Gets a glyph which can be optionally overriden by a 'character provider'.

void InfiniText.FontFace.Load ( )
inline

Loads the glyph info for this font face now. See RequiresLoad.

void InfiniText.FontFace.SetFlags ( int  style,
int  weight,
int  stretch 
)
inline

Sets the weight of this face and if it's italic.

void InfiniText.FontFace.SetItalicAngle ( float  angle)
inline

Applies the angle, in degrees, used for synthesizing italic chars.

Glyph InfiniText.FontFace.Synthesize ( int  charCode)
inline

Synthesizes a glyph of the given charcode.

Member Data Documentation

float InfiniText.FontFace.Ascender

The size of the ascender. Relative to em size.

float InfiniText.FontFace.CaretAngle

The angle of the caret when this font is used.

float InfiniText.FontFace.CaretOffset

The horizontal caret offset.

CffGlyphParser InfiniText.FontFace.CffParser

The CFF parser, if this is a CFF format font. Used to load glyphs on demand.

int InfiniText.FontFace.CharacterCount

The number of characters in this font face.

float InfiniText.FontFace.ChHeightRaw
private

The cached height of a '0'. Relative.

bool InfiniText.FontFace.Clockness

The winding order of glyphs of this font.

float InfiniText.FontFace.Descender

The size of the descender. Relative to em size and is used to define where the baseline is.

bool InfiniText.FontFace.DisableExtrude

Use this to disable the SDF extrusion of a font face which may cause the letters to go streaky in rare cases.

float InfiniText.FontFace.ExHeightRaw
private

The cached height of a lowercase 'x'. Relative.

FontFamily InfiniText.FontFace.Family

The family that this font is in. Created by the first font in the family.

Dictionary<string,FontFeature> InfiniText.FontFace.Features =new Dictionary<string,FontFeature>()

All available typographic features. Ligatures, smallcaps etc.

Dictionary<int,Glyph> InfiniText.FontFace.Glyphs =new Dictionary<int,Glyph>()

All raw glyphs in this font face. Indexed by charcode. Note that if you have Font.Preload false, they may not be loaded. Check glyph.RequiresLoad if you access this directly.

float InfiniText.FontFace.HalfLineGap =0.1f

The spacing between the text, divided by two. It's divided because it gets shared.

float InfiniText.FontFace.ItalicAngle =0.213f

The computed amount of units to "push" (sheer) the top of a glyph over by. Std default is 12 degrees; tan(12d) units.

float InfiniText.FontFace.LineGap

The gap between lines. It gets placed below the line when it's necessary. Note that this is not the line height (or leading).

float InfiniText.FontFace.MaxAdvanceWidth

The maximum advance width.

float InfiniText.FontFace.MaxXExtent

The maximum x extent.

float InfiniText.FontFace.MinLeftSideBearing

The minimum left side bearing.

float InfiniText.FontFace.MinRightSideBearing

The minimum right side bearing.

float InfiniText.FontFace.MWidthRaw
private

The cached width of an 'M'. Relative.

string InfiniText.FontFace.Name

The full name of this font face.

Glyph InfiniText.FontFace.NotDefined

The .notdef glyph.

int InfiniText.FontFace.NumberOfHMetrics

The number of glyphs in this font face.

FontParser InfiniText.FontFace.Parser

The raw parser. Used to load glyphs on demand.

Glyph [] InfiniText.FontFace.ParserGlyphs
package

Don't use this! Use Glyphs instead. The raw glyph set used by the parser. May be null.

bool InfiniText.FontFace.RequiresLoad =false

Is this font face loaded at all? If it requires a load, call Load(). Note that metrics are available if it's not loaded.

int InfiniText.FontFace.Stretch

The font stretch. 1-9.

float InfiniText.FontFace.StrikeOffset =0.25f

The offset to a strikethrough line.

float InfiniText.FontFace.StrikeSize =0.1f

The thickness of a strikethrough line.

int InfiniText.FontFace.Style

The font style. 0-2.

int InfiniText.FontFace.StyleFlags =FontFaceFlags.None

The flags for this font face. A style bitmask.

FontFace InfiniText.FontFace.SyntheticDerivative

The font that this is a derivative of.

int InfiniText.FontFace.UnitsPerEm =1000

The glyph units per em value.

float InfiniText.FontFace.UnitsPerEmF =1000f

The glyph units per em value, as a float.

int InfiniText.FontFace.UnloadedGlyphs

The number of not yet loaded glyphs in this font.

int InfiniText.FontFace.Weight

The font weight. 1-9.

bool InfiniText.FontFace.WindingUnknown =true

Is the clockness of this face known yet? If so, the first loaded glyph will figure it out.

Property Documentation

float InfiniText.FontFace.BaselineToBaseline
get

Baseline to baseline height. Same as 'line-height' in CSS.

bool InfiniText.FontFace.Bold
get

True if this is a bold face.

float InfiniText.FontFace.ChHeight
get

The height of a '0'. Relative.

float InfiniText.FontFace.ExHeight
get

The height of a lowercase 'x'. Relative.

string InfiniText.FontFace.FamilyName
getset

The name of the family this font is in. Set is for internal use only.

float InfiniText.FontFace.MWidth
get

The width of an 'M'. Relative.

bool InfiniText.FontFace.Regular
get

Is this the regular font for this family?

bool InfiniText.FontFace.Stylized
get

True if this is an italic or oblique face.

bool InfiniText.FontFace.Synthetic
get

Is this a synthetic font?

Glyph InfiniText.FontFace.this[int charCode]
getset

Gets or sets the given charcode glyph.