Expand description
Text shaping and layout for RavenRS.
TextSystem owns Parley’s font database and scratch space. It ships with
Inter (SIL Open Font License 1.1, see fonts/Inter-LICENSE.txt) embedded,
because browsers expose no system fonts to WebAssembly; the same bytes are used
on the desktop so text looks identical everywhere. System fonts are not loaded.
Layout happens in logical pixels. The renderer rasterizes glyphs at the device scale factor, so text stays sharp on HiDPI screens without re-shaping.
Structs§
- Shaped
Glyph - One glyph of a
TextLayout, as reported byTextLayout::glyphs. - Text
Attrs - Visual attributes of a piece of text.
- Text
Layout - Shaped text, ready to be broken into lines at any width and drawn.
- Text
Line - One line of a broken
TextLayout, as reported byTextLayout::lines. - Text
Stats - Work a
TextSystemhas done since it was created. - Text
System - Font database plus reusable layout scratch space. Create one per app.
Constants§
- DEFAULT_
FAMILY - The family name of the embedded default font.
- ICON_
FAMILY - The family name of the embedded icon font.
- MONO_
FAMILY - The family name of the embedded monospaced font, with the
monofeature. It is also what the genericmonospacefamily resolves to.
Functions§
- builtin_
font - A built-in font by its
builtin_font_number, for drawing shaped glyphs back. - builtin_
font_ number - Which built-in font these bytes are, as a number that does not change between runs: what a recording stores instead of the font itself.
- fold
- Folds a character to what searches compare: lowercase, without accents, so “regiao” finds “Região”. Folding can change how many characters there are.
- inter_
font - The embedded Inter font file, regular or semibold, for documents that embed the font they were measured with.