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

@@ -98,9 +98,17 @@ UIBitmapFont::UIBitmapFont( SFontData &sfontdata )
BufferedImage bimg(sfontdata.m_wstrFilename);
int *bimgData = bimg.getData();
if (bimgData == nullptr)
{
fprintf(stderr, "[UIBitmapFont] ERROR: failed to load font image for '%s' — font file missing or corrupt.\n",
sfontdata.m_strFontName.c_str());
m_cFontData = new CFontData(); // default/empty — avoids null deref downstream
return;
}
m_cFontData = new CFontData(sfontdata, bimgData);
//delete [] bimgData;
}