docs: Actualizar REFERENCE.md con fuente embebida
- Cambiar ejemplo TTF a usar initEmbedded() (recomendado) - Añadir nota sobre fuente embebida en Features 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
22d5e51769
commit
42a9e97a6b
1 changed files with 6 additions and 2 deletions
|
|
@ -652,10 +652,13 @@ TTF fonts are fully supported with real glyph rasterization and antialiasing.
|
|||
const TtfFont = zcatgui.render.TtfFont;
|
||||
const FontRef = zcatgui.render.FontRef;
|
||||
|
||||
// Load TTF from file
|
||||
var ttf = try TtfFont.loadFromFile(allocator, "/usr/share/fonts/adwaita-sans-fonts/AdwaitaSans-Regular.ttf");
|
||||
// RECOMMENDED: Use embedded font (zero dependencies)
|
||||
var ttf = try TtfFont.initEmbedded(allocator);
|
||||
defer ttf.deinit();
|
||||
|
||||
// Alternative: Load TTF from file
|
||||
// var ttf = try TtfFont.loadFromFile(allocator, "/path/to/font.ttf");
|
||||
|
||||
// Set render size (glyphs cached per size)
|
||||
ttf.setSize(14); // 14pt
|
||||
|
||||
|
|
@ -675,6 +678,7 @@ font_ref.drawText(&framebuffer, x, y, "Hello", color, clip);
|
|||
```
|
||||
|
||||
**Features:**
|
||||
- **Embedded font**: AdwaitaSans-Regular included (~860KB), zero external dependencies
|
||||
- Real bezier curve rasterization (quadratic beziers)
|
||||
- Antialiasing via 2x supersampling
|
||||
- Glyph caching (by codepoint + size)
|
||||
|
|
|
|||
Loading…
Reference in a new issue