Verify font can be rendered successfully at runtime#52133
Verify font can be rendered successfully at runtime#52133kevingranade merged 2 commits intoCleverRaven:masterfrom
Conversation
|
There is an issue with rendering of bitmap fonts in Freetype 2.11.0 (see https://gitlab.freedesktop.org/freetype/freetype/-/issues/1076). Freetype port in vcpkg repo (see https://github.com/microsoft/vcpkg/tree/master/ports/freetype) was recently updated to 2.11.0 (see microsoft/vcpkg#19284), so anyone using latest Note that it is not affecting our CI as we are using specific vcpkg version (see Cataclysm-DDA/.github/workflows/release.yml Line 160 in 8256058 |
|
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/no-text-is-showing-on-menu-screen/27316/2 |
Summary
Infrastructure "Verify font can be rendered successfully at runtime"
Purpose of change
Describe the solution
This is probably a more proper fix to tackle the font related "black screen" issue (#50149, #52046). Check whether the glyph can really be rendered successfully at runtime, and fallback to GNU Unifont if the glyph can not be rendered in the preferred font.
Describe alternatives you've considered
Hardcode a blacklist to not load Terminus.TTF
Testing
{ "typeface": [ "data/font/Terminus.ttf", "data/font/unifont.ttf" ], "map_typeface": [ "data/font/Terminus.ttf", "data/font/unifont.ttf" ], "overmap_typeface": [ "data/font/Terminus.ttf", "data/font/unifont.ttf" ] }Automatically falls back to GNU Unifont:

{ "typeface": [ "data/font/VecTerminus12Medium.otf", "data/font/unifont.ttf" ], "map_typeface": [ "data/font/VecTerminus12Medium.otf", "data/font/unifont.ttf" ], "overmap_typeface": [ "data/font/VecTerminus12Medium.otf", "data/font/unifont.ttf" ] }VecTerminus OTF font is used:

Additional context