@:value({ enumerateDeviceFonts : false })staticenumerateFonts(enumerateDeviceFonts:Bool = false):Array<Font>
staticfromBytes(bytes:ByteArray):Font
staticfromFile(path:String):Font
staticinlineregisterFont(font:Dynamic):Void
new()
@:flash.propertyread onlyfontName:String
@:flash.propertyread onlyfontStyle:FontStyle
@:flash.propertyread onlyfontType:FontType
hasGlyphs(str:String):Bool
ascender:Int
The ascender value of the font.
descender:Int
The descender value of the font.
height:Int
The height of the font.
read onlyname:String
The name of the font.
numGlyphs:Int
The number of glyphs in the font.
src:Dynamic
underlinePosition:Int
The underline position of the font.
underlineThickness:Int
The underline thickness of the font.
unitsPerEM:Int
The units per EM of the font.
decompose():NativeFontData
Decomposes the font into outline data.
Returns:
An instance of NativeFontData that contains decomposed font outline information.
NativeFontData
getGlyph(character:String):Glyph
Retrieves a glyph from the font by a character.
Parameters:
character
The character whose glyph to retrieve.
A Glyph instance representing the glyph of the character.
Glyph
getGlyphMetrics(glyph:Glyph):GlyphMetrics
Retrieves metrics for a given glyph.
glyph
The glyph whose metrics to retrieve.
A GlyphMetrics instance containing the metrics of the glyph.
GlyphMetrics
@:value({ characters : "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|:;_-+=?,. " })getGlyphs(characters:String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|):Array<Glyph>
Retrieves an array of glyphs for a set of characters.
characters
The string containing characters to retrieve glyphs for.
An array of Glyph instances representing the glyphs of the characters.
renderGlyph(glyph:Glyph, fontSize:Int):Image
Renders a specific glyph to an image.
The glyph to render.
fontSize
The size to render the glyph at.
An Image instance representing the rendered glyph.
Image
renderGlyphs(glyphs:Array<Glyph>, fontSize:Int):Map<Glyph, Image>
Renders a set of glyphs to images.
glyphs
The glyphs to render.
The size to render the glyphs at.
A Map containing glyphs mapped to their corresponding images.
Map