Unfortunately, it’s correct that Gargoyle doesn’t support fallback fonts for missing glyphs. It’s a feature that would be really nice to have, but it’s not simple, and there are three font systems (Unix {fontconfig}, Windows, and Mac) that would need to be updated. I’ve done some experimenting with Fontconfig but nothing anywhere near useable.
There is a possible approach, though, that may work some/most of the time. Gargoyle allows authors to supply their own .ini file to configure Gargoyle, with the idea being that you can override certain settings appropriate for your game. The config file also allows you to specify font files rather than font names. So, you can distribute an appropriate font with your game, and then point the config file to the font. If your game is named game.z3
, for example, then the config file would be called game.ini
, and be in the same directory. There are 8 config options associated with fonts:
propr ProportionalRoman.ttf
propi ProportionalItalic.ttf
propb ProportionalBold.ttf
propz ProportionalBoldItalic.ttf
And monor
, monoi
, monob
, monoz
.
The problem is this: you can’t, obviously, specify absolute font paths since you won’t know where the game file will be. So it has to be a relative path, as above. And that will only work if Gargoyle is running in the game directory. Whether it is depends on how the user launches it, so there’s no guarantee that it’ll work.
But this seems like a pretty useful use-case. I think it should be easy to add the ability to look in the game directory if the font paths are relative. That would make this much more robust. There is a 2023.1 release coming up, and I can ensure this feature makes it into that release. On that note, I also added a feature to allow users to disable these per-game configs (since it’s possible to abuse this feature and completely override a user’s config), so there’s no guarantee now, either, but at least that’s a conscious choice by the user.
Would this be an acceptable approach, at least until fallback fonts are properly supported?