SilkTextOptions
import type { SilkTextOptions } from 'pixi-silk/text';
Options of a SilkText: the style plus the text, anchor and atlas.
Extends#
Properties#
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
aaWidth? | number | Width of the anti-aliasing ramp in device pixels. Larger is softer. Default 1. | SilkTextStyle.aaWidth | text/SilkText.ts:94 |
align? | TextAlign | Alignment of the lines. Default left. | SilkTextStyle.align | text/SilkText.ts:76 |
anchor? | number | PointData | Point of the text box at the position: 0 is the top left, 1 the bottom right. Default 0. | - | text/SilkText.ts:102 |
atlas? | SdfAtlas | Atlas to bake glyphs into. Default SdfAtlas.shared. | - | text/SilkText.ts:104 |
breakWords? | boolean | Breaks words that are wider than a line on their own. Default false. | SilkTextStyle.breakWords | text/SilkText.ts:82 |
dilate? | number | Grows (positive) or thins (negative) the glyphs, in local units. Default 0. | SilkTextStyle.dilate | text/SilkText.ts:92 |
fill? | ColorSource | Gradient | A colour, or a pixi-silk gradient over the text box (linear, radial and conic). Default white. | SilkTextStyle.fill | text/SilkText.ts:70 |
fontFamily? | string | CSS font family list. Default system-ui, -apple-system, Segoe UI, Roboto, sans-serif. | SilkTextStyle.fontFamily | text/SilkText.ts:62 |
fontSize? | number | Font size in local units. Default 16. | SilkTextStyle.fontSize | text/SilkText.ts:64 |
fontStyle? | "normal" | "italic" | "oblique" | normal, italic or oblique. Default normal. | SilkTextStyle.fontStyle | text/SilkText.ts:68 |
fontWeight? | string | number | CSS font weight. Default 400. | SilkTextStyle.fontWeight | text/SilkText.ts:66 |
kerning? | boolean | Applies the font’s kerning (measured from Canvas). Default true. | SilkTextStyle.kerning | text/SilkText.ts:86 |
label? | string | Label of the display object. Default SilkText. | - | text/SilkText.ts:106 |
letterSpacing? | number | Extra space after each character, in local units. Default 0. | SilkTextStyle.letterSpacing | text/SilkText.ts:72 |
lineHeight? | number | Distance between baselines. 0 uses the font’s ascent plus descent, like PixiJS Text. Default 0. | SilkTextStyle.lineHeight | text/SilkText.ts:74 |
outline? | TextOutline | null | A line around the glyphs. null for none. Default null. | SilkTextStyle.outline | text/SilkText.ts:88 |
shadow? | TextShadow | null | A drop shadow or glow under the glyphs. null for none. Default null. | SilkTextStyle.shadow | text/SilkText.ts:90 |
tabularNumbers? | boolean | Gives the digits one width, like font-variant-numeric: tabular-nums, for readouts. Default false. | SilkTextStyle.tabularNumbers | text/SilkText.ts:84 |
text? | string | number | The text. \n starts a new line. Default empty. | - | text/SilkText.ts:100 |
wordWrap? | boolean | Breaks lines at spaces to fit wordWrapWidth. Default false. | SilkTextStyle.wordWrap | text/SilkText.ts:78 |
wordWrapWidth? | number | Width that wordWrap breaks lines at, in local units. Default 100. | SilkTextStyle.wordWrapWidth | text/SilkText.ts:80 |