-
Notifications
You must be signed in to change notification settings - Fork 165
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
Add scaling for vfnts and scale multipler to gr_string() #6481
Add scaling for vfnts and scale multipler to gr_string() #6481
Conversation
f33eaf0
to
9c3f0ad
Compare
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.
Looks good, mostly.
One question.
if (optional_string("+Can Scale:")) { | ||
bool temp; | ||
|
||
stuff_boolean(&temp); | ||
|
||
font->setScaleBehavior(temp); |
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.
What's the default for the scale behaviour?
Would it be sensible to default-allow it, or will that break stuff?
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.
Currently the default scale behavior is not to scale at all. A font must explicitly allow it using this table setting first.
Now that font scaling can handle vfnts, I think there's an argument to be made to make it default allow but I'm unsure how the retail UI would be impacted in all cases... we have a lot of UIs that'd need to be sanity checked just to be sure. Personally, I'd feel better about tackling that in a follow-up to allow for additional retail testing and because there's a couple different ways it could be done. (Default engine-wide, default by editing the built-in fonts.tbl, etc)
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.
Good point.
Presumably, if sanity-checked, it could be auto-enabled if the mod targets an engine version like 25.2 or something.
Will merge later today unless someone else beats me to it |
Adds two features for string handling:
First it adds scaling ability to Volition fonts which brings them into parity with TTF fonts. In doing so it made sense to move the font scale option out of the TTF font cpp file and into the general font cpp file. Notably, allowing players to scale fonts is currently opt-in. Now that all font types can scale, there's possibly an argument to make them opt-out. I could go either way, personally.
Second it adds a scale multiplier to gr_string(). This will be used for the HUD Config upgrade and it basically allows a gr_string() call to multiply the user's font scale up or down by a percentage. Think of it like a C++ version of CSS's
em
font size capability. This did change the signature of gr_string() because I feltscaleMultiplier
had more utility than thelength
parameter and there were only a handful of places wherelength
was used so it was fairly trivial to update them.