Static methods

@:value({ enumerateDeviceFonts : false })staticenumerateFonts(enumerateDeviceFonts:Bool = false):Array<Font>

staticfromBytes(bytes:ByteArray):Font

staticfromFile(path:String):Font

staticinlineregisterFont(font:Dynamic):Void

Constructor

new()

Variables

@:flash.propertyread onlyfontName:String

@:flash.propertyread onlyfontStyle:FontStyle

@:flash.propertyread onlyfontType:FontType

Methods

Inherited Variables

Defined by Font

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.

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.

Inherited Methods

Defined by Font

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.

@:value({ characters : "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|:;_-+=?,. " })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.