Renderer · interface
SdfGlyph
An SDF font's metrics, parsed once and asked many times.
Explained in Hello world.
interface SdfGlyphimport type { SdfGlyph } from '@driftengine/core';In depth
The atlas image is the consumer's business — it arrives as a TexImageSource like every
other texture this engine takes, and the engine still fetches nothing. This owns only
the numbers that turn a string into quads.
Properties
| Name | Type | Description |
|---|---|---|
advancereadonly | number | |
planeLeftreadonly | number | The glyph's ink box in font units, y-up: planeTop is above planeBottom. |
planeBottomreadonly | number | |
planeRightreadonly | number | |
planeTopreadonly | number | |
atlasLeftreadonly | number | The glyph's cell in the atlas texture, in texels.MoreThe single statement of this convention — nowhere else should restate it, only rely on
it. These run the same direction the atlas PNG's own rows do, and the same direction
A version that flipped these to be y-up — matching the plane box's own sign, so that
"a texel and a plane coordinate agree on which way is up" — shipped for two days
(2026-08-16) and flipped every glyph onto the wrong row of its atlas, because
|
atlasBottomreadonly | number | |
atlasRightreadonly | number | |
atlasTopreadonly | number |