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:
reugenio 2025-12-16 01:22:01 +01:00
parent 22d5e51769
commit 42a9e97a6b

View file

@ -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)