Open Denneisk opened 1 month ago
This or surface.IsFontValid
so we could implement it ourselves, would much prefer that.
The idea did cross my mind, but I feel like the convenience of not having to write your own parser for a list of desired fonts would be helpful, too. If anything, with such a function, it could be implemented entirely in Lua.
I think having a feature to specify a fallback font(s), in the case that a certain desired font can't be loaded, would be helpful. My ideal implementation would be to allow a list of font names instead of a single font name string for the
font
field.The error
Couldn't find/load font 'my cool ttf', falling back to 'Tahoma'..
should not occur, and instead an error would only appear if the last case "coolvetica" fails to load. Any failures before the last case should be silent.My intention for this is for developers who would like to leverage OS-installed fonts without having to require the user to download any additional fonts from an addon/server. Similar to their use in web design, fallback fonts allow for a more consistent visual style in the case that a certain desired font cannot load for any reason.