hxn

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):Font

An object for a value the library returned.

function system(family:String, weight:Int, italic:Bool):Font

Platform font lookup. Browser applications supply their own font bytes.

Properties

var hxnRaw:Handle

Methods

function family():String
function faceIndex():UInt
function metrics(size:Float):FontMetrics
function supports(text:String):Bool
function shape(text:String, size:Float):GlyphRun

Shapes one segment. Clusters are byte offsets, not Haxe string indexes.

function rasterize(glyphId:UInt, size:Float, kind:AtlasKind):GlyphBitmap
function same(other:Null<Font>):Bool

Whether 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():FontWeak

A reference to the value that does not keep it alive.

function close():Void

Gives 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.