-
Notifications
You must be signed in to change notification settings - Fork 92
bugfix(gui): Scale fonts based on the smallest screen dimension so they scale independent of aspect ratio #1442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -187,7 +187,8 @@ void GlobalLanguage::parseFontFileName( INI *ini, void * instance, void *store, | |||
|
|||
Int GlobalLanguage::adjustFontSize(Int theFontSize) | |||
{ | |||
Real adjustFactor = TheGlobalData->m_xResolution/800.0f; | |||
// TheSuperHackers @bugfix Mauller 10/08/2025 Scale fonts based on the smallest screen dimension so they are independent of aspect ratio | |||
Real adjustFactor = min(TheGlobalData->m_xResolution/800.0f, TheGlobalData->m_yResolution/600.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect that this will significantly shrink text size in the most popular resolution: 1920 x 1080
Originally the adjust factor was 2.4, with this change 1.8, which is a 25% size decrease (before m_resolutionFontSizeAdjustment).
How do we deal with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The font was scaled larger than it should have been to begin with and only gets larger on a 21:9 monitor.
If you run this and compare, the fonts often look better and are more in proportion compared to before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look and texts look smaller than we are used to.
How about we make a follow up change and expose a ResolutionFontAdjustment
setting to the Options.ini with a default value of 1.
This would then multiply with the ResolutionFontAdjustment
from Language.ini and give the user the option to modify the default scaling without touching Language.ini
So in code it would then do
adjustFactor = 1.0f + (adjustFactor-1.0f) * m_resolutionFontSizeAdjustment * anotherResolutionFontSizeAdjustment;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, i can make the followup lead off this PR, will sort that in a sec.
96da07e
to
a4caabb
Compare
Just a rebase before making the followup PR for user font adjustment. |
a4caabb
to
a19e332
Compare
A rebase with main before tweaking the implementation |
35e01c7
to
e41707c
Compare
So i have tweaked the implementation of this so the This makes the fonts much closer to what people were used to with the original broken scaling while keeping the ability to use the This then results in uniform font scaling across all resolutions and aspect ratios. |
e41707c
to
235b4dc
Compare
…ey scale independent of aspect ratio
235b4dc
to
cf1f111
Compare
Much better! |
if (adjustFactor<1.0f) adjustFactor = 1.0f; | ||
if (adjustFactor>2.0f) adjustFactor = 2.0f; |
There was a problem hiding this comment.
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.
// 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 ); |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
Alternative to:
This PR adds the ability for the font scaling function to properly handle scaling fonts when non 4:3 aspect ratios are used.
At the moment since only the width is taken into account, fonts can be scaled larger than they should be when playing in a wide aspect ratio.
This PR makes sure that fonts scale with the smallest screen dimension so they scale in a more uniform way independent of the aspect ratio itself.
The PR now also rescales the
m_resolutionFontSizeAdjustment
value to only reduce fonts by 5%. This makes ingame fonts closer to what people have been used to when playing 1080p in retail, although the fonts are still slightly smaller overall.Fonts can now also scale up beyond 2K resolutions as i removed the limit on scaling.