Expand description
Font loading, text measurement and glyph rasterization shared by the FerroChart backends.
The crate does not depend on ferrochart-core: backends adapt TextEngine
to the core’s TextMeasurer trait. All metrics are reported both
em-normalized (per 1 px of font size, as the core’s ASCII fast path expects)
and in pixels for a given size.
A subset of JetBrains Mono Regular (SIL Open Font License 1.1, ASCII plus a few symbols, about 11 KB) is bundled and always available as font 0.
Structs§
- Glyph
Bitmap - A rasterized glyph: 8-bit coverage, row-major,
width × height. - Glyph
Cache - Cache of rasterized glyphs, keyed by font, glyph and size.
- Line
Metrics - Vertical metrics of a font at some size (pixels, y down:
descentis positive below the baseline). - Text
Engine - Fonts and metrics.
Enums§
- Font
Error - Error from loading a font.
Constants§
- BUNDLED_
FONT - The bundled font: JetBrains Mono Regular, subset to ASCII and
\u{a0} ° ± · × ÷ – — … ₀-₉ ← ↑ → ↓ − ≈ ≠ ≤ ≥ ▲ ▼. License:assets/fonts/OFL.txt.