pre-cache ascii range in font atlas

c3
Alessandro Mauri 1 week ago
parent 2e0c6333d3
commit 7d9a8a1363
  1. 6
      src/ugui_font.c3

@ -92,9 +92,9 @@ fn void! Font.load(&font, String name, ZString path, uint height, float scale)
font.atlas.new(font.id, ATLAS_GRAYSCALE, size, size)!; font.atlas.new(font.id, ATLAS_GRAYSCALE, size, size)!;
// preallocate the ASCII range // preallocate the ASCII range
// for (char c = ' '; c < '~'; c++) { for (char c = ' '; c < '~'; c++) {
// font.get_glyph((Codepoint)c)!; font.get_glyph((Codepoint)c)!;
// } }
} }
fn Glyph*! Font.get_glyph(&font, Codepoint code) fn Glyph*! Font.get_glyph(&font, Codepoint code)

Loading…
Cancel
Save