Skip to content

Conversation

Mauller
Copy link

@Mauller Mauller commented Aug 14, 2025

This PR adds user based font scaling adjustment to the game.

The value can be set within the options.ini by setting ResolutionFontAdjustment = 10 etc, where the value is a percentage increase, the default being 0% of the original scale.

This value acts on the normal ini based resolution scaling to give some user flexibility.


TODO:

  • Replicate in generals

@Mauller Mauller self-assigned this Aug 14, 2025
@Mauller Mauller added Enhancement Is new feature or request GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Aug 14, 2025
@Mauller Mauller force-pushed the feat-user-font-adjust branch from 828eaa2 to b632b27 Compare August 14, 2025 19:00
@Mauller
Copy link
Author

Mauller commented Aug 14, 2025

Tweaked some naming but theres likely going to be the odd bit of name tweaking still.

@Mauller Mauller force-pushed the feat-user-font-adjust branch from b632b27 to 654b37e Compare August 15, 2025 13:41
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

I suggest to merge this change before the other, so we can experiment with this.

@Mauller
Copy link
Author

Mauller commented Aug 27, 2025

I suggest to merge this change before the other, so we can experiment with this.

i will tweak and rebase this on main so it can be merged independent of other font scaling tweaks.

@Mauller Mauller force-pushed the feat-user-font-adjust branch from 654b37e to 5b6391f Compare August 31, 2025 09:14
@Mauller
Copy link
Author

Mauller commented Aug 31, 2025

Rebased, removed the other font scaling stuff and tweaked based on feedback.

This now will not scale the font if the value is set to zero, which i have set as the default.

@xezon
Copy link

xezon commented Aug 31, 2025

This is not what I meant :)

adjustFactor = 1.0f + (adjustFactor-1.0f) * m_resolutionFontSizeAdjustment * TheGlobalData->m_resolutionFontAdjustment; was fine, because if TheGlobalData->m_resolutionFontAdjustment is 0, then the adjust factor simply will be one: no resolution scaling, text has same size as with 800 x 600

* (1 + TheGlobalData->m_resolutionFontAdjustment) is misleading, because 1 becomes 2 (doubling).

@Mauller
Copy link
Author

Mauller commented Aug 31, 2025

This is not what I meant :)

adjustFactor = 1.0f + (adjustFactor-1.0f) * m_resolutionFontSizeAdjustment * TheGlobalData->m_resolutionFontAdjustment; was fine, because if TheGlobalData->m_resolutionFontAdjustment is 0, then the adjust factor simply will be one: no resolution scaling, text has same size as with 800 x 600

* (1 + TheGlobalData->m_resolutionFontAdjustment) is misleading, because 1 becomes 2 (doubling).

Yeah i thought you meant that zero would result in the extra user option not having any effect on the current scaling.
So the game essentially just scales like it normally would.

Also this is the game with just the raw Font sizes, so m_resolutionFontAdjustment at zero
image

@Mauller Mauller force-pushed the feat-user-font-adjust branch from 5b6391f to d1843fa Compare August 31, 2025 14:37
@Mauller
Copy link
Author

Mauller commented Aug 31, 2025

Tweaked and pushed.

@xezon
Copy link

xezon commented Aug 31, 2025

One more thought: If a user sets the scale to 1, then we would expect a linear scale. But instead it would "secretly" scale by 0.7 * 1. I wonder if we should do something about that.

@Mauller
Copy link
Author

Mauller commented Aug 31, 2025

One more thought: If a user sets the scale to 1, then we would expect a linear scale. But instead it would "secretly" scale by 0.7 * 1. I wonder if we should do something about that.

Should we override whatever m_resolutionFontSizeAdjustment is set to with the user set option? But take whatever m_resolutionFontSizeAdjustment is as the default?

Situation here ends up a bit like what the scroll Anchor PR is doing.
We consider the user option to be the source of truth and the ini value as the default.

@xezon
Copy link

xezon commented Aug 31, 2025

Maybe start m_resolutionFontSizeAdjustment as -1 and if it less than 0 then we use Language.ini settings, otherwise user setting. Not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Is new feature or request Gen Relates to Generals GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants