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

UI elements (incl. news message) do not resize properly on font size change, causing graphical glitches #8099

Open
James103 opened this issue Apr 26, 2020 · 8 comments

Comments

@James103
Copy link
Contributor

@James103 James103 commented Apr 26, 2020

Version of OpenTTD

OpenTTD: 1.10.0 and 20200426-master
Windows 10
Font: MS Gothic + spritefont

Expected result

News message resizes properly in response to the changed font.

Actual result

News message does not resize properly, causing graphical glitches similar to #6527
image

Steps to reproduce

  1. Install the MS Gothic font (if it didn't already come with Windows 10).
  2. Open the title game as a savegame (execute console commands save a and load a from the main menu).
  3. Make sure that vehicle notifications are turned on.
  4. Switch language to Japanese.
  5. Wait until a news message pops up.
  6. Switch language to English.
  7. Notice the graphical glitches.
@nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Apr 26, 2020

Am I understanding right that this only applies to windows that are already open while the font is changed?
If that's the case, my proposed fix would be to close all open windows (regardless of sticky or not) when the font changes.

@James103
Copy link
Contributor Author

@James103 James103 commented May 1, 2020

I agree with you, @nielsmh. Newly opened news message windows after a font change look normal, but existing news message windows break on a font change. I can reproduce this in master as well.
(Note that this really only breaks news windows.)

@glx22
Copy link
Contributor

@glx22 glx22 commented May 1, 2020

On language change (and many other cases), all windows are re-initialized. I tried to reproduce, but I failed.

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Feb 27, 2021

I too could not reproduce this issue with latest master. Can you still reproduce it @James103 ?

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Feb 27, 2021

Okay, with some more toying around, I can trigger it .. but not by going to English. I had to go to Greek, for example.

@James103
Copy link
Contributor Author

@James103 James103 commented Feb 27, 2021

  • What OS were you running?
  • Which font did OpenTTD use for Japanese?
  • Which font did OpenTTD use for Greek?
  • What video driver were you using?

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Feb 27, 2021

I was doing exactly what you told in the topic :) So all these questions are answered there :D

Important part is that I can reproduce it, and I am sure others can too with this information :)

@James103
Copy link
Contributor Author

@James103 James103 commented Feb 27, 2021

Also note that by having a news window open and switching from English to Japanese (smaller font to bigger font), it pushes the news window viewport above where it is supposed to go and not below. See images:

Smaller font to larger font Larger font to smaller font
e.g. English to Greek Japanese to Dutch
image image

Can also reproduce the same results by not changing the language, but instead changing the "Font size" in Game Options.

  • Set Font Size to Normal, bring up the news message, then set Font Size to Double to reproduce like in the first image.
  • Set Font Size to Double, bring up the news message, then set Font Size to Normal to reproduce like in the second image.

Hypothesis (backed by above evidence): Font size changes aren't properly handled in the news windows.

@James103 James103 changed the title UI elements (incl. news message) do not resize properly, causing graphical glitches UI elements (incl. news message) do not resize properly on font size change, causing graphical glitches Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants