From ccca2be49684cdcc905d1acc0b8d2c4cb126c4b4 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Tue, 23 Sep 2025 23:30:22 +0200 Subject: [PATCH] "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() --- lib/ugui.c3l/src/ugui_font.c3 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ugui.c3l/src/ugui_font.c3 b/lib/ugui.c3l/src/ugui_font.c3 index d481dbd..9ababd4 100644 --- a/lib/ugui.c3l/src/ugui_font.c3 +++ b/lib/ugui.c3l/src/ugui_font.c3 @@ -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)); font.atlas.new(font.id, ATLAS_GRAYSCALE, size, size)!; - // preallocate the ASCII range - for (char c = ' '; c < '~'; c++) { - font.get_glyph((Codepoint)c)!; - } +// FIXME: this crashes with O1 or greater, why?? +// // preallocate the ASCII range +// for (char c = ' '; c < '~'; c++) { +// font.get_glyph((Codepoint)c)!; +// } } fn Glyph*? Font.get_glyph(&font, Codepoint code)