I can make a native extension to render text using system font, which correctly renders such things into a texture. Plus you don’t have to generate the font atlas in Defold, which can free up significant amount of disk space. If you are interested.
The system font is not satisfaction our needs. As I am understand, the game will have different font style, which depends from device fonts (for example, font size)? Not very good.
We are need to have ability to correct render our fonts in different languages and make sure, what game will look similar across all devices. And better to do this with default Defold tools.
OK. System fonts are different on Android and iOS, but they are similar enough. Font size can be set to any value, plus outline, shadow, spacing. I can also implement loading font from a file, that should look almost identical.
We rasterize each glyph individually as it is returned from the java font loader. We don’t take into account any other characters.
Is the height of this ligature dependent on the previous/next character(s)?
I don’t think there’s an easy way to fix this currently without some major refactoring of our font system.
I have been playing with the idea how to make it possible for extension writers to supply their own glyphs to the engine. You use case is a good reminder that we need some context for the glyphs to render.
This is not in the roadmap yet though, so no ETA on this feature.
The more I think about it, the upcoming Vertex format/Mesh Component feature from @sven should provide the tools for an extension writer to write their own font renderer. E.g. loading the (local) fonts on the device, and rasterize the glyphs into a texture on demand, and outputting a mesh.
This should also solve the old outstanding issue of being able to use the local fonts on a device for download size reasons.
If you remember I already have written a native extension for font rendering. It lacks support for Windows/Linux/HTML5, maybe someone could help with that. And loading local TTF files is on my todo list.
But I wanted to ask how meshes would help with such extension?
Sure, if you already rasterize directly to a texture, that works too.
It depends on what limitations you hit first I guess?
For instance, a glyph cache texture will most likely be much smaller than a unique texture with a lot of text. With a glyph cache texture you can also reuse that for multiple text nodes.