[Bug]: Game switches to fallback font when refreshing
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.3k
- Forks
- 1.3k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 37
Description
Version of OpenTTD
20240511-master-g721cd2b8ad, Windows 11 Home (Simplified Chinese)
Expected result
When changing the font via the font command, the game will automatically use the requested font and will not change it after refreshing the game, restarting, or abandoning a game.
Actual result
After changing the font via the font command, the text does use the glyphs in the requested font; however after restarting or abandoning a game an error message saying "switch to fallback font" appears and the text starts to use the fallback, which, on my system is 微软雅黑(YaHei).
Tested with Unifont, Unifont-JP and 寒蝉全圆体 (ChillRound)
fonts.zip
Steps to reproduce
- (May be unnecessary) switch system language to Simplified Chinese;
- Change game language to Simplified Chinese
- start the console and type the following commands:
font medium "" 0 aa
font medium (font) 0 aa // font == Unifont-JP, Unifont or "寒蝉全圆体"
- Start a new game, or open the game options menu
- close the game options menu, or abandon the game
- notice that the font changes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the console font command and reproduce the fallback after opening and closing the game options or abandoning a game; then trace how the selected font is retained across those lifecycle transitions. Done means the requested font remains active after refresh, restart, and abandoning a game, with no fallback-font error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100