OpenTTD / OpenTTD/OpenTTD

[Bug]: Game switches to fallback font when refreshing

Open
#12,664 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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
  1. (May be unnecessary) switch system language to Simplified Chinese;
  2. Change game language to Simplified Chinese
  3. start the console and type the following commands:
font medium "" 0 aa
font medium (font) 0 aa // font == Unifont-JP, Unifont or "寒蝉全圆体"
  1. Start a new game, or open the game options menu
  2. close the game options menu, or abandon the game
  3. notice that the font changes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.