Dynamically-created fonts

see: dynamically-added fonts · Issue #8808 · defold/defold · GitHub

Is your feature request related to a problem? Please describe (REQUIRED):

The engine lacks this feature. This feature would improve my experience as a developer (less fonts to juggle), as well as the experience for users (fonts can be tailored to the screen size to avoid fuzziness or accessibility settings to use a bigger font for easier reading)

Describe the solution you’d like (REQUIRED):

The ability to generate and assign a font to a gui with a font file (.ttf or ect.) via code during runtime

Describe alternatives you’ve considered (REQUIRED):

I’ve considered just bundling a bunch of fonts that one might need, but the problem this results in is a massive amount of .font files, which causes compile times to be really long

Additional context (OPTIONAL):

One key feature we want here is the ability to add an extension to provide glyphs to the glyph cache.
E.g. so that users can load a font that’s locally available on the device, and thus skip the big texture of all the glyphs in the download package.

1 Like

Have you considered distance field fonts? Or are those not an option in your case?

i’ve tried using distance field in the past, but every time i have they look too blurry

Ehh, that is the opposite of the purpose of a distance field font. It is important to pick a decent size on the font, and then apply a scale to adjust to the size you want. If you use a small font there’s not enough information stored in the font to render it with good quality.

Make sure you choose the right material for it, “font-df.material”

oh.

distance fields don’t really solve the issue, though, just removes 1 variable

Can you please elaborate on what you mean?

font size isn’t the only thing that i’d like to be able to change easily