I understand that Defold streams in glyphs into memory. Can more about this be explained?
cache_width and cache_height can define the generated font image, which is where the individual glyphs are streamed from. So it doesn’t really matter the size of this and can be as large as is needed because it’s never loaded into memory itself?
How are glyphs streamed in handled? Composed into paged texture atlases in memory?
Also what’s shadow_x and shadow_y for? Offset of shadow? Negative values work? Doesn’t work in preview atm? Shadow alpha greater than 0 seems to do something, but only when outline_alpha is greater than 0. At least looking preview only… preview just buggy?
I can answer the shadow-questions, the streaming can probably be more accurately explained by @sven.
This is a case where in my opinion we have transgressed into the domain of content and convenience too much. We thought it would be great to have a blurred shadow for fonts because it just produces great visual quality. The technique of doing them for bitmaps is simply to use the blue channel in the texture to describe a blurred version of the glyphs. This means you can offset this texture when rendering to produce an underlying soft shadow, which must produce it even when there is none. This turned out to be too expensive for the lowspec cases. So in the end we had to replace the default font shader with something cheaper. We also had to leave the shadow parameters in because otherwise we would break the content (and it’s also nice to have it for people who know what to do with it). But it certainly creates a confusion in the tool.
A better model is to do something like how we deal with sprites and shader constants. They are exposed dynamically and depend on the materials.
It looks like Version 1.2.22 is when you introduced the new shader which removed shadows for fonts. I’m assuming I could grab an earlier version and use that version’s shader to enable shadows for fonts? It’s on my big todo list to test…
Alright, sorry, it was a stab in the dark. The shadow data should come with the vertices anyway, you could start by doing gl_FragColor = var_shadow_color to make sure.