[solved] Ability to add custom fonts
Posted: Wed Aug 31, 2016 1:11 am
UPDATE: Fixed in 0.14.3
Looking at many of the mod GUIs that are on the portal, there seems to be an aversion to sprite buttons - in many cases mods are using single alpha characters, and < >, etc., rather than sprites... a glyph font would provide a trivial way for those mods (and mine) to quickly spice up GUI buttons without resorting to sprites.
In __core__/prototypes/fonts.lua, the various font prototypes are defined, but there seems to be no way to associate a font proto with an actual .ttf file. The link between font protos and .ttf files seems to be hardcoded and not accessible to the lua API?
I was hoping to add an icon font, which would make lots of glyphs available for use in captions via simple locale strings like `{ glyph.settings }' (which would equate to the char code for a cog glyph).
This would make it much easier for mods to quickly get nice glyphs for their buttons, with added benefits of font scaling and runtime color changing (I'm aware graphic sprites can be tinted, but only at design time in the prototypes, which is somewhat limiting, and even then they still wouldn't scale as nicely as a font).
Looking at many of the mod GUIs that are on the portal, there seems to be an aversion to sprite buttons - in many cases mods are using single alpha characters, and < >, etc., rather than sprites... a glyph font would provide a trivial way for those mods (and mine) to quickly spice up GUI buttons without resorting to sprites.
In __core__/prototypes/fonts.lua, the various font prototypes are defined, but there seems to be no way to associate a font proto with an actual .ttf file. The link between font protos and .ttf files seems to be hardcoded and not accessible to the lua API?
I was hoping to add an icon font, which would make lots of glyphs available for use in captions via simple locale strings like `{ glyph.settings }' (which would equate to the char code for a cog glyph).
This would make it much easier for mods to quickly get nice glyphs for their buttons, with added benefits of font scaling and runtime color changing (I'm aware graphic sprites can be tinted, but only at design time in the prototypes, which is somewhat limiting, and even then they still wouldn't scale as nicely as a font).