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.

See: SVGTextEngineImpl

Summary


Methods from SVGTextEngine

Public Methods


clear SVGTextEngine.ts:17
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.

Returns:
Type Description
Promise<void>
put SVGTextEngine.ts:23
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.

Parameters:
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>

Returns:
Type Description
Promise<IPointData>

Powered by webdoc!