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

Fix: Allow changing size of default OpenTTD font. #12641

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented May 7, 2024

Motivation / Problem

Size configuration for default font was ignored as a different code path to load the font was followed.

Size of default font could only be changed after manually setting the configured font to the default font name.

Description

Resolved by removing this additional path and conditionally selecting the default font.

This allows the normal font size selection to occur, and reduces some special-casing for the default font.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

PeterN added 3 commits May 7, 2024 23:25
Size configuration for default font was ignored as a different code path to load the font was followed.

Resolved by removing this additional path and conditionally selecting the default font.
{
const FontCacheSubSetting *settings = GetFontCacheSubSetting(fs);
if (!settings->font.empty()) return settings->font;
if (_fcsettings.prefer_sprite) return {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the prefer sprite flag override any font name having been set? Wouldn't have a font name set here break the prefer sprites checkbox?

Copy link
Contributor

Choose a reason for hiding this comment

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

prefer sprite only affects default font, if you set a font name the checkbox should be disabled.

Copy link
Contributor

Choose a reason for hiding this comment

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

That is how it works today. I didn't know that.

I am not sure about disabling the checkbox though. That seems to be unrelated to this review though.

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

4 participants