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.
surface.CreateFont( "MyCoolFont", {
font = { "my cool ttf", "comic sans ms", "coolvetica" }
}) -- Will try to load 3 fonts before using the default fallback
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.
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.