Skip to main content

Crate ferrochart_text

Crate ferrochart_text 

Source
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§

GlyphBitmap
A rasterized glyph: 8-bit coverage, row-major, width × height.
GlyphCache
Cache of rasterized glyphs, keyed by font, glyph and size.
LineMetrics
Vertical metrics of a font at some size (pixels, y down: descent is positive below the baseline).
TextEngine
Fonts and metrics.

Enums§

FontError
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.