"fixed" segfault with >00

idk if this is a compiler error but leaving the ascii pre-caching in results
in the pointer to the font structure to be corrupted before font.get_glyph()
This commit is contained in:
Alessandro Mauri 2025-09-23 23:30:22 +02:00
parent 6839a7e06c
commit ccca2be496

View File

@ -112,10 +112,11 @@ fn void? Font.load(&font, String name, ZString path, uint height, float scale)
ushort size = (ushort)font.size*(ushort)($$sqrt((float)FONT_CACHED)); ushort size = (ushort)font.size*(ushort)($$sqrt((float)FONT_CACHED));
font.atlas.new(font.id, ATLAS_GRAYSCALE, size, size)!; font.atlas.new(font.id, ATLAS_GRAYSCALE, size, size)!;
// preallocate the ASCII range // FIXME: this crashes with O1 or greater, why??
for (char c = ' '; c < '~'; c++) { // // preallocate the ASCII range
font.get_glyph((Codepoint)c)!; // for (char c = ' '; c < '~'; c++) {
} // font.get_glyph((Codepoint)c)!;
// }
} }
fn Glyph*? Font.get_glyph(&font, Codepoint code) fn Glyph*? Font.get_glyph(&font, Codepoint code)