Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,12 @@ void W3DDisplayString::setFont( GameFont *font )
// set the font in our renderer
m_textRenderer.Set_Font( static_cast<FontCharsClass *>(m_font->fontData) );

m_textRendererHotKey.Set_Font( static_cast<FontCharsClass *>(TheFontLibrary->getFont(font->nameString,font->pointSize, TRUE)->fontData) );
// TheSuperHackers @fix bobtista 19/07/2026 Guard against null bold font to prevent crash when font loading fails
Comment thread
bobtista marked this conversation as resolved.
Outdated
GameFont *boldFont = TheFontLibrary->getFont( font->nameString, font->pointSize, TRUE );
if( boldFont != nullptr )
Comment thread
bobtista marked this conversation as resolved.
Outdated
{
m_textRendererHotKey.Set_Font( static_cast<FontCharsClass *>(boldFont->fontData) );
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated
// recompute extents for text with new font
computeExtents();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,12 @@ void W3DDisplayString::setFont( GameFont *font )
// set the font in our renderer
m_textRenderer.Set_Font( static_cast<FontCharsClass *>(m_font->fontData) );

m_textRendererHotKey.Set_Font( static_cast<FontCharsClass *>(TheFontLibrary->getFont(font->nameString,font->pointSize, TRUE)->fontData) );
// TheSuperHackers @fix bobtista 19/07/2026 Guard against null bold font to prevent crash when font loading fails
GameFont *boldFont = TheFontLibrary->getFont( font->nameString, font->pointSize, TRUE );
if( boldFont != nullptr )
{
m_textRendererHotKey.Set_Font( static_cast<FontCharsClass *>(boldFont->fontData) );
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated
// recompute extents for text with new font
computeExtents();

Expand Down
Loading