Api - Text Class
Hierarchy
- Text
Implements
Index
Constructors
constructor
-
Parameters
-
font: Font | Font
OpenType.Font object or fontkit font object.
-
text: string
String of text to render.
-
fontSize: number
Font size.
-
Default value combine: boolean = false
Flag (default false) to perform a combineUnion upon each character with characters to the left and right.
-
Default value centerCharacterOrigin: boolean = false
Flag (default false) to move the x origin of each character to the center. Useful for rotating text characters.
-
Optional bezierAccuracy: number
Optional accuracy of Bezier curves.
-
Optional opentypeOptions: RenderOptions | IFontkitLayoutOptions
Optional opentype.RenderOptions object or fontkit layout options.
Returns Text
Model of the text.
-
Properties
models
Methods
Static glyphToModel
-
Convert an opentype glyph or fontkit glyph to a model.
Parameters
-
glyph: any
Opentype.Glyph object or fontkit glyph.
-
fontSize: number
Font size.
-
Optional bezierAccuracy: number
Optional accuracy of Bezier curves.
-
Optional font: any
Optional font object (needed for fontkit to get scale).
Returns IModel
Model of the glyph.
-
Generated using TypeDoc

Renders text in a given font to a model.