Static methods
staticfromBytes(bytes:Bytes):Font
Creates a Font instance from byte data.
Parameters:
bytes | The byte data containing the font. |
---|
Returns:
A Font
instance.
staticfromFile(path:String):Font
Creates a Font instance from a file path.
Parameters:
path | The file path of the font. |
---|
Returns:
A Font
instance.
staticloadFromBytes(bytes:Bytes):Future<Font>
staticloadFromFile(path:String):Future<Font>
staticloadFromName(path:String):Future<Font>
Constructor
Variables
Methods
decompose():NativeFontData
Decomposes the font into outline data.
Returns:
An instance of NativeFontData
that contains decomposed font outline information.
getGlyph(character:String):Glyph
Retrieves a glyph from the font by a character.
Parameters:
character | The character whose glyph to retrieve. |
---|
Returns:
A Glyph
instance representing the glyph of the character.
getGlyphMetrics(glyph:Glyph):GlyphMetrics
Retrieves metrics for a given glyph.
Parameters:
glyph | The glyph whose metrics to retrieve. |
---|
Returns:
A GlyphMetrics
instance containing the metrics of the glyph.
getGlyphs(characters:String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|):Array<Glyph>
Retrieves an array of glyphs for a set of characters.
Parameters:
characters | The string containing characters to retrieve glyphs for. |
---|
Returns:
An array of Glyph
instances representing the glyphs of the characters.
renderGlyph(glyph:Glyph, fontSize:Int):Image
Renders a specific glyph to an image.
Parameters:
glyph | The glyph to render. |
---|---|
fontSize | The size to render the glyph at. |
Returns:
An Image
instance representing the rendered glyph.
renderGlyphs(glyphs:Array<Glyph>, fontSize:Int):Map<Glyph, Image>
Renders a set of glyphs to images.
Parameters:
glyphs | The glyphs to render. |
---|---|
fontSize | The size to render the glyphs at. |
Returns:
A Map
containing glyphs mapped to their corresponding images.