Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
7 changes: 4 additions & 3 deletions Generals/Code/GameEngine/Source/GameClient/GlobalLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ void GlobalLanguage::parseFontFileName( INI *ini, void * instance, void *store,

Int GlobalLanguage::adjustFontSize(Int theFontSize)
{
Real adjustFactor = TheGlobalData->m_xResolution / (Real)DEFAULT_DISPLAY_WIDTH;
adjustFactor = 1.0f + (adjustFactor-1.0f) * m_resolutionFontSizeAdjustment;
// TheSuperHackers @bugfix Mauller 25/08/2025 Scale fonts based on the smallest screen dimension so they are independent of aspect ratio
// We also rescale the font size adjustment to make the ingame fonts closer to what players have been used to with the original scaling
Real adjustFactor = min(TheGlobalData->m_xResolution / (Real)DEFAULT_DISPLAY_WIDTH, TheGlobalData->m_yResolution/ (Real)DEFAULT_DISPLAY_HEIGHT );
adjustFactor = 1.0f + (adjustFactor-1.0f) * ( 0.25f + m_resolutionFontSizeAdjustment );
if (adjustFactor<1.0f) adjustFactor = 1.0f;
if (adjustFactor>2.0f) adjustFactor = 2.0f;
Int pointSize = REAL_TO_INT_FLOOR(theFontSize*adjustFactor);
return pointSize;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ void GlobalLanguage::parseFontFileName( INI *ini, void * instance, void *store,

Int GlobalLanguage::adjustFontSize(Int theFontSize)
{
Real adjustFactor = TheGlobalData->m_xResolution / (Real)DEFAULT_DISPLAY_WIDTH;
adjustFactor = 1.0f + (adjustFactor-1.0f) * m_resolutionFontSizeAdjustment;
// TheSuperHackers @bugfix Mauller 25/08/2025 Scale fonts based on the smallest screen dimension so they are independent of aspect ratio
// We also rescale the font size adjustment to make the ingame fonts closer to what players have been used to with the original scaling
Real adjustFactor = min(TheGlobalData->m_xResolution / (Real)DEFAULT_DISPLAY_WIDTH, TheGlobalData->m_yResolution/ (Real)DEFAULT_DISPLAY_HEIGHT );
adjustFactor = 1.0f + (adjustFactor-1.0f) * ( 0.25f + m_resolutionFontSizeAdjustment );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.25f is a magic value that does not belong here. It will also change the scaling in 1600 x 1200 (4:3). I do not like this solution, because it changes the promise of m_resolutionFontSizeAdjustment.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to use the default value of the new scaler in the Options.ini to apply the new adjustment.

if (adjustFactor<1.0f) adjustFactor = 1.0f;
if (adjustFactor>2.0f) adjustFactor = 2.0f;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will create very large fonts with the original Control Bar Pro in 2k and 4k presets.

Int pointSize = REAL_TO_INT_FLOOR(theFontSize*adjustFactor);
return pointSize;
}
Expand Down
Loading