Class Font
A Font instance contains methods to access font and glyph data stored in a font description (TrueType or OpenType fonts).
Inheritance
Inherited Members
Namespace: Fusee.Base.Core
Assembly: Fusee.Base.Core.dll
Syntax
public class Font
Fields
_fontImp
For implementation purposes only. Do not use this.
Declaration
public FontImpBase _fontImp
Field Value
Type | Description |
---|---|
FontImpBase |
Properties
PixelHeight
Gets and sets the size in pixels.
Declaration
public uint PixelHeight { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 | The vertical size of the font in pixels. |
UseKerning
Gets and sets a value indicating whether the kerning definition of a font should be used.
Declaration
public bool UseKerning { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
GetGlyphCurve(UInt32)
Gets the character's points, contours and tags and translates them into a curve.
Declaration
public Curve GetGlyphCurve(uint c)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | c | The character from which the information is to be read. |
Returns
Type | Description |
---|---|
Curve |
GetGlyphInfo(UInt32)
Gets the character information.
Declaration
public GlyphInfo GetGlyphInfo(uint c)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | c | The character to retrieve information. |
Returns
Type | Description |
---|---|
GlyphInfo | An information record about the character. |
GetImageDataForGlyph(UInt32, in GlyphInfo)
Renders the given glyph.
Declaration
public IImageData GetImageDataForGlyph(uint c, in GlyphInfo info)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | c | The character code (Unicode) of the character to render. |
GlyphInfo | info | Provides info about a character. |
Returns
Type | Description |
---|---|
IImageData | An image data structure containing an image of the given character. |
GetKerning(UInt32, UInt32)
Gets the kerning offset between a pair of two consecutive characters in a text string.
Declaration
public float GetKerning(uint leftC, uint rightC)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | leftC | The left character. |
System.UInt32 | rightC | The right character. |
Returns
Type | Description |
---|---|
System.Single | An offset to add to the normal advance. Typically negative since kerning rather compacts text lines. |
GetUnscaledAdvance(UInt32)
Get the unscaled advance from a character.
Declaration
public float GetUnscaledAdvance(uint c)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | c | The character from which the information is to be read. |
Returns
Type | Description |
---|---|
System.Single |
GetUnscaledKerning(UInt32, UInt32)
Gets the unscaled kerning offset between a pair of two consecutive characters in a text string.
Declaration
public float GetUnscaledKerning(uint leftC, uint rightC)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | leftC | The left character. |
System.UInt32 | rightC | The right character. |
Returns
Type | Description |
---|---|
System.Single |