|
| | TextLayoutEngine (unsigned atlas_size=512) |
| | Create a text layout engine.
|
| |
|
| ~TextLayoutEngine () |
| | Destroy the engine; already returned layouts remain valid.
|
| |
|
| TextLayoutEngine (const TextLayoutEngine &)=delete |
| | Copying is disabled because the engine owns mutable font and glyph caches.
|
| |
|
TextLayoutEngine & | operator= (const TextLayoutEngine &)=delete |
| |
| std::size_t | add_font (const std::string &filename) |
| | Load a TrueType font.
|
| |
| const std::vector< std::string > & | font_names () const |
| |
| TextLayout | layout (const std::string &utf8, unsigned width, unsigned height, const TextOptions &options={}) |
| | Lay out UTF-8 text into immutable glyph draw commands.
|
| |
| void | clear_cache () |
| | Release cached glyphs and atlas pages.
|
| |
Rasterize TrueType glyphs and produce backend-independent text commands.
Layout is performed on the CPU and requires no graphics context. Input is decoded as UTF-8 Unicode scalar values; a missing glyph uses the font's glyph zero. This engine provides basic horizontal layout only: it does not perform script shaping, bidirectional reordering, or font fallback. Returned layouts own immutable geometry and atlas snapshots and remain valid after the engine is destroyed or its cache is cleared. Calls on one engine must be externally synchronized.
- Examples
- Tutorial_309_TextRendering.