"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:
parent
6839a7e06c
commit
ccca2be496
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user