Renderer · interface
SdfFont
Explained in Hello world.
interface SdfFontimport type { SdfFont } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
familyreadonly | string | |
unitsPerEmreadonly | number | |
ascenderreadonly | number | |
descenderreadonly | number | |
lineHeightreadonly | number | |
distanceRangereadonly | number | |
atlasWidthreadonly | number | |
atlasHeightreadonly | number | |
runsreadonly | readonly string[] | Keys in the glyph table that are more than one character, longest first.MoreA pre-shaped run: a string the generator handed to the platform's own text stack,
which joined, reordered and shaped it, baked as one atlas cell. The runtime draws
quads from metrics and does no shaping at all, so a script that joins its letters or
reads right to left cannot be assembled from single glyphs at draw time. Longest first because |
Methods
glyph
glyph(character: string): SdfGlyph | null| Parameter | Type | Description |
|---|---|---|
character | string |
kerning
kerning(left: string, right: string): number| Parameter | Type | Description |
|---|---|---|
left | string | |
right | string |