SVGTextEngine
interface SVGTextEngine
The SVGTextEngine
interface is used to layout text content authored in SVG files. The @pixi-essentials/svg
package provides SVGTextEngineImpl as a default implementation for users.
Text engines are allowed to have async behaviour so that fonts can be loaded before text metrics are measured.
It is expected an implementation inherits from PIXI.DisplayObject.
Summary
Methods from SVGTextEngine
Promise<void> |
|
Promise<IPointData> |
|
Public Methods
clear() → {Promise<void>}
Clears the text content laid out already. This should reset the state of the engine to before any calls to SVGTextEngine.put were made.
Type | Description |
---|---|
Promise<void> |
put(id: any, position: IPointData, content: string, style: Partial<PIXI.TextStyle>, matrix: PIXI.Matrix) → {Promise<IPointData>}
Puts the text content
into the local space of the engine at position
. matrix
can
be used to transform the glyphs, although it is as optional feature for implementations.
Name | Type | Attributes | Description |
---|---|---|---|
id | any |
A locally unique ID that can be used to modify the added block of text later. |
|
position | IPointData |
The position of the text in the engine's local space. |
|
content | string |
The text to add. |
|
style | Partial<PIXI.TextStyle> |
The text styling applied. |
|
matrix | PIXI.Matrix |
<optional> |
Type | Description |
---|---|
Promise<IPointData> |