Font
Immutable font bytes and selected face. Engines retain fonts they prepare.
Constructor
function new(bytes:Bytes, options:FontOptions)Copies and validates TTF, OpenType, collection or WOFF2 bytes.
Static methods
function hxnAdopt(hxnRaw:Handle):FontAn object for a value the library returned.
function system(family:String, weight:Int, italic:Bool):FontPlatform font lookup. Browser applications supply their own font bytes.
Properties
var hxnRaw:HandleMethods
function family():Stringfunction faceIndex():UIntfunction metrics(size:Float):FontMetricsfunction supports(text:String):Boolfunction shape(text:String, size:Float):GlyphRunShapes one segment. Clusters are byte offsets, not Haxe string indexes.
function rasterize(glyphId:UInt, size:Float, kind:AtlasKind):GlyphBitmapfunction same(other:Null<Font>):BoolWhether other holds the value this does. Two objects can: each time the library returns the value, a new object gets a share of it.
function weak():FontWeakA reference to the value that does not keep it alive.
function close():VoidGives up this object's share of the value now. The collector does it otherwise. The value lives while anything else holds a share. Using this object afterwards throws.