fixed font

This commit is contained in:
JuiceyDev
2026-03-06 00:34:36 +01:00
parent 1f37e1d422
commit fddd777399
3 changed files with 22 additions and 11 deletions

View File

@@ -155,6 +155,16 @@ CFontData::CFontData(SFontData &sFontData, int *pbRawImage)
{
this->m_sFontData = &sFontData;
if (pbRawImage == nullptr)
{
// Font image failed to load; leave raw buffers null so the font renders nothing
// rather than crashing. UIBitmapFont already logs an error in this case.
m_pbRawImage = nullptr;
m_kerningTable = nullptr;
m_pfAdvanceTable = nullptr;
return;
}
// INITIALISE ALPHA CHANNEL //
// Glyph Archive (1Byte per pixel).