Static
DEBUGthis.size
is specified in points. Convert to pixels.
Retrieve the character's advanceWidth as a fraction of an em
unit.
For the space character ' ' as defined in the:
petalumascript_glyphs.ts: 250 advanceWidth in the 1000 unitsPerEm font returns 0.25.
robotoslab_glyphs.ts: 509 advanceWidth in the 2048 unitsPerEm font returns 0.2485.
in pt.
Static
createCall TextFormatter.registerInfo(info)
to register font information before using this method.
This method creates a formatter for the font that most closely matches the requested font. We compare font family, bold, and italic attributes. This method will return a fallback formatter if there are no matches.
Static
getReturn all registered font families.
Static
getused as a key to the font registry.
the same info object that was passed in via TextFormatter.registerInfo(info)
Static
registerApps may register their own fonts and metrics, and those metrics will be available to the app for formatting.
Metrics can be generated from a font file using fontgen_text.js in the tools/fonts directory.
To enable logging for this class. Set
Vex.Flow.TextFormatter.DEBUG
totrue
.