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)