For some reason, attempting to load custom fonts from a dynamically-allocated buffer fails. I'm currently using a hard-coded, pre-allocated 50MB buffer to hold custom font data (see here). This is obviously suboptimal, as most custom fonts are under 5MB, but the font with Chinese characters is ~45MB. Preferably, an appropriately-sized buffer should be allocated for the specific font file in use.
So far, I've tried the following methods of dynamic memory allocation, and although the memory appears to be allocated correctly, the game behaves as if no font was loaded (all characters are broken/missing):
If I had to guess, the game might have some kind of custom memory allocator that's messing with my code/data. I've also confirmed that this issue exists on the Steam and GoG builds of the game, so it's probably not related to the weird packing behavior of the Steam release.
For some reason, attempting to load custom fonts from a dynamically-allocated buffer fails. I'm currently using a hard-coded, pre-allocated 50MB buffer to hold custom font data (see here). This is obviously suboptimal, as most custom fonts are under 5MB, but the font with Chinese characters is ~45MB. Preferably, an appropriately-sized buffer should be allocated for the specific font file in use.
So far, I've tried the following methods of dynamic memory allocation, and although the memory appears to be allocated correctly, the game behaves as if no font was loaded (all characters are broken/missing):
If I had to guess, the game might have some kind of custom memory allocator that's messing with my code/data. I've also confirmed that this issue exists on the Steam and GoG builds of the game, so it's probably not related to the weird packing behavior of the Steam release.