Open oosyrag opened 7 months ago
There's a function in font_loader.cpp line 8 that dynamically adds the path to unifont to the back of the list if it doesn't find the path to unifont already in the list. In the newer Android versions I'm guessing "data/font/unifont.ttf" doesn't count, so this function appends the full, correct unifont path (for Android, "/storage/emulated/0/Android/data/com.cleverraven.cataclysmdda.experimental/files/data/font/unifont.ttf"). No such functionality for terminus though.
ed: To clarify, the "ensure_unifont_loaded()" function works as intended by adding the correct valid path to unifont in Android, because the existing paths to the two fonts are invalid.
@ZhilkinSerg can you take a look at this when you get a chance? Basically I would like to not have the path specified in fontdata.json, only the name, and use PATH_INFO::fontdir() instead to get and write the correct path to fonts.json for Android. But I saw you did the opposite in #45319 and I'm not really certain I understand the change, so I wanted to ask.
Describe the bug
Android defaults to unifont because it requires the full path to terminus (see https://github.com/CleverRaven/Cataclysm-DDA/issues/63871#issuecomment-1452831314). The fonts.json config file generates with relative paths for terminus and unifont, and then the full path to unifont is added, but not the full path to terminus.
This is the contents of a generated fonts.json on Android, latest experimental:
/storage/emulated/0/Android/data/com.cleverraven.cataclysmdda.experimental/files/data/font/Terminus.ttf
needs to be added ahead of the unifont entry.Attach save file
N/A
Steps to reproduce
Install on Android, run game, see unifont.
Expected behavior
Install on Android, run game, see terminus.
Screenshots
Default (unifont)
I can get terminus to show up by either adding the full path to terminus to the front of the list in fonts.json (
/storage/emulated/0/Android/data/com.cleverraven.cataclysmdda.experimental/files/data/font/Terminus.ttf
), OR by directly renaming/replacing the unifont.ttf file with Terminus.ttf,Versions and configuration
OS: Android OS Version: Manufacturer: OnePlus; Model: HD1900; Release: 12; Incremental: Q.202303230244; Game Version: cdda-experimental-2024-04-07-0018 84dae0b [64-bit] Graphics Version: Tiles Game Language: System language [] Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth] ]
Additional context