Font Class
Font class stores font data, font data can be stored as an json or as a TTF file (stored in Base64).
Font objects are used to draw text using the TextMesh object and/or generate text bitmap.
Item Index
Methods
Methods
fileIsFont
(
Boolean
static
-
fname
Check if a file name refers to a font file.
Parameters:
-
fnameString
Returns:
Boolean:
True if the fname refers to a supported font format.
generateShapes
(
Array
-
text -
size -
divisions
Generate shapes from font data.
The shapes generated can be extruded to create 3D geometry.
Parameters:
-
textString -
sizeNumber -
divisionsNumber
Returns:
Array:
paths
loadTTF
()
Load font from data using the TTF loader.
reverseGlyphs
()
Reverse the font glyphs.
Can be used to fix fonts that have paths defined CW.
toJSON
(
Object
-
meta
Serialize font resource to json.
Font data is stored as Base64 is present in a binary format, or JSON otherwise.
Parameters:
-
metaObject
Returns:
Object:
json
Properties
font
Object
Font data, can be an ArrayBuffer or JSON.
Default: null
reversed
Boolean
If true the font glyphs are reversed.
Default: false
