Skip to content
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

Feature #6918: Add option to adjust font size separately from GUI size. #7003

Merged
merged 2 commits into from Feb 23, 2019

Conversation

gregcarlin
Copy link
Contributor

@gregcarlin gregcarlin commented Dec 31, 2018

Adds an option in the "Game Options" next to "Interface Size" called "Font Size". Available options are normal, double, and quad. Tested with both freetype and sprite fonts. The only known hiccup is that I couldn't get sprite fonts to work properly past a complete "quad zoom". Eg. if the interface and font sizes are both set to double, the effective font size will be quad. Increasing either option further will not increase the font size. This works fine for freetype fonts though.

Thanks for taking a look! Super excited to be helping out, I love playing the game!

Fixes #6918

Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

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

Looks broadly fine in principle...

src/lang/english.txt Show resolved Hide resolved
src/script/api/game/game_window.hpp.sq Outdated Show resolved Hide resolved
@gregcarlin gregcarlin force-pushed the adjust-font-size branch 2 times, most recently from a13bb51 to 0243291 Compare January 7, 2019 00:09
@planetmaker
Copy link
Contributor

planetmaker commented Jan 12, 2019

Is it really intended, that the font size selection is relative to the interface size?

With the current PR, if I select 'double size interface size' and 'double size font size', I end up with 4x font size compared to both settings set to 'normal'.

As sprite fonts are the defaults, it should work for those as with non-sprite fonts, too.

@gregcarlin
Copy link
Contributor Author

Without this PR, changing the interface size will also change the font size if the sprite font is used, but it will not affect the font size if a FreeType font is used. Are you proposing to change this behavior so that the interface size never affects the font size?

@PeterN
Copy link
Member

PeterN commented Jan 13, 2019

@gregcarlin I would say exactly that behaviour should happen, as you have added the ability to (almost) independently set the font size.

This may need existing text strings to be altered to indicate that the existing selection is for graphical/icon elements and no longer affects text?

@gregcarlin
Copy link
Contributor Author

Sounds good, I'll get on it!

@gregcarlin
Copy link
Contributor Author

gregcarlin commented Jan 14, 2019

I updated the behavior! I didn't change the strings because I wasn't sure what would be more clear and I think the current strings are fairly easy to understand. However, if someone has a specific recommendation I'd be more than happy to make the change.

src/zoom_type.h Outdated Show resolved Hide resolved
src/settings_gui.cpp Outdated Show resolved Hide resolved
src/fontcache.cpp Outdated Show resolved Hide resolved
src/zoom_type.h Outdated Show resolved Hide resolved
@LordAro
Copy link
Member

LordAro commented Jan 27, 2019

I spotted this at high font size levels. I suspect it's not directly related to your change, but it is revealed by it

@PeterN
Copy link
Member

PeterN commented Jan 27, 2019

@LordAro there is code that changes the width, it probably also needs to be changed to be based on (and happen on) font zoom instead of gui zoom. May well be other instances.

@gregcarlin
Copy link
Contributor Author

@LordAro and @PeterN the issue seems to only appear if the font zoom is adjusted mid-game. If it's adjusted before a game is loaded the town names appear fine. This leads me to believe the issue is with timing (i.e. the width needs to be recalculated when the font zoom changes). I'll investigate further.

@gregcarlin gregcarlin force-pushed the adjust-font-size branch 2 times, most recently from 524f08c to 2ed0c58 Compare February 4, 2019 20:05
@gregcarlin
Copy link
Contributor Author

Got it! Just needed to add a call to UpdateAllVirtCoords.

@LordAro LordAro requested a review from PeterN February 4, 2019 20:26
@gregcarlin
Copy link
Contributor Author

Yay! Thanks!

PeterN added a commit to PeterN/OpenTTD that referenced this pull request Feb 23, 2019
nielsmh pushed a commit to nielsmh/OpenTTD that referenced this pull request Mar 11, 2019
…enTTD#7003)

Adds an option in the "Game Options" next to "Interface Size" called "Font Size". Available options are normal, double, and quad.
nielsmh pushed a commit to nielsmh/OpenTTD that referenced this pull request Mar 11, 2019
douiwby pushed a commit to douiwby/OpenTTD that referenced this pull request Apr 16, 2020
…enTTD#7003)

Adds an option in the "Game Options" next to "Interface Size" called "Font Size". Available options are normal, double, and quad.
douiwby pushed a commit to douiwby/OpenTTD that referenced this pull request Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants