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

[Bug]: Interface including fonts and viewports doesn’t scale properly on Mac OS with retina display #10660

Closed
dpk opened this issue Apr 16, 2023 · 12 comments
Labels
regression It used to work, and now it's broken.

Comments

@dpk
Copy link

dpk commented Apr 16, 2023

Version of OpenTTD

OpenTTD 13.1, also current nightly (20230415-master), Mac OS 13.3 (ARM)

Expected result

Opening OpenTTD on a Mac with a retina display and setting interface scaling to 2x should cause everything, including fonts, to scale. Only the margins around the fonts changes. The scale of the actual game is also too small, including in the startup screen.

Actual result

1x scaling, everything ‘correct’ in terms of proportions but too small to be seen on a high-resolution screen:
Screenshot 2023-04-16 at 11 51 20

2x scaling, margins around interface elements increased but nothing else, and everything still too small to comfortably read:
Screenshot 2023-04-16 at 11 51 16

If I enable ‘Auto-detect size’, it just changes to 2x scaling and looks exactly the same as when I select that manually.

Steps to reproduce

Open OpenTTD 13.1 on Mac OS. Fiddle with the Interface scale option in Game Options.

I’m using the original_windows graphics set, if that might make a difference. @LordAro suggested this might also be helpful info:

Screenshot 2023-04-16 at 11 59 19

@glx22
Copy link
Contributor

glx22 commented Apr 16, 2023

Sprite font is not resizable, but you can set a TrueType font with the font command.

@LordAro
Copy link
Member

LordAro commented Apr 16, 2023

That's not true, it resizes for me on Linux

@dpk
Copy link
Author

dpk commented Apr 16, 2023

To show this is a regression at some point, this is what it looked like on the last version of OpenTTD I played before trying again today, 1.9.0 from 2019 (under Rosetta):

Screenshot 2023-04-16 at 12 47 55

I consider this to be the correct behaviour in all regards. (The ‘interface size’ option is set to ‘normal’.)

@PeterN
Copy link
Member

PeterN commented Apr 16, 2023

This happens if you've changed the max sprite zoom setting to be 1x instead of 4x

@2TallTyler
Copy link
Member

Related issue of that setting changing things it probably shouldn't: #8873

@PeterN
Copy link
Member

PeterN commented Apr 16, 2023

Hmm, that one is even worse as those gui sprites are handled in the same way as viewport sprites, and some sprites are drawn in both viewport and gui. At least fonts is an easier case to deal with :)

@dpk
Copy link
Author

dpk commented Apr 16, 2023

This happens if you've changed the max sprite zoom setting to be 1x instead of 4x

I assume you mean this setting:
Screenshot 2023-04-16 at 18 21 06

As you can see, I have it set to 4x and the wrong result is the one I get. (Changing it doesn’t seem to affect anything at all, at least on the startup screen.)

@PeterN
Copy link
Member

PeterN commented Apr 16, 2023

Ah, not that one, "Maximum zoom in level".

@dpk
Copy link
Author

dpk commented Apr 16, 2023

I have that set to ‘Normal’ (and the corresponding zoom out to 8x). As far as I know, I’ve never touched these settings.

@PeterN
Copy link
Member

PeterN commented Apr 16, 2023

Change it to 4x. 4x is the default value, normal means 1x. The context is a bit wrong for how it ends up being used here...

You'll also need to tweak the interface scale again to make it reload after this change (or just restart the game.)

@dpk
Copy link
Author

dpk commented Apr 16, 2023

Aha, that did indeed fix it!

So I think there are two usability issues here:

  1. I’m pretty sure I was using the default setting for this, but if not, it was something taken over from an older version of OpenTTD which worked and made sense there, but the same setting caused broken scaling on 13.1. If it was just an issue to do with interpretations of legacy values of an equivalent setting, maybe it’s not worth doing anything about.
  2. I actually tried changing the setting when you pointed out which one but I assumed it didn’t work because nothing changed when I changed that setting alone. Changing that setting should probably cause a total interface redraw at the intended scale.

@PeterN PeterN added the regression It used to work, and now it's broken. label Apr 16, 2023
@PeterN
Copy link
Member

PeterN commented Apr 16, 2023

You are right, this setting didn't previously affect font sprites before 13.0.

PeterN added a commit to PeterN/OpenTTD that referenced this issue Apr 16, 2023
…limits.

Add separate _font_zoom which is only used to scale the sprite font. This is not clamped to the viewport zoom level limits, so always follows interface scale.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression It used to work, and now it's broken.
Projects
None yet
Development

No branches or pull requests

5 participants