From 42a9e97a6b3fb254b881f099a6ac3c7e6e31a6fd Mon Sep 17 00:00:00 2001 From: reugenio Date: Tue, 16 Dec 2025 01:22:01 +0100 Subject: [PATCH] docs: Actualizar REFERENCE.md con fuente embebida MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- REFERENCE.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 99a2e53..106fc27 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -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)