see: more than 64 fonts in the same gui causes a crash · Issue #8810 · defold/defold · GitHub
Describe the bug
when putting more than 64 fonts in the game gui, it will cause a crash with the following error
ERROR:GAMESYS: Unable to add font 'font_name' to scene (-4)
WARNING:RESOURCE: Unable to create resource: /main/main.collectionc: FORMAT_ERROR
Steps to reproduce the behavior:
- create a gui
- add more than 64 fonts
- try to run the game
Expected behavior (REQUIRED)
The engine does not crash
Defold version
Platforms (REQUIRED):
You don’t have to report github issues in the forum. We read the issues on github several times per week.
oh, ok
there’s a bugs tab, so i figured i would put it here
Yeah, it’s more for asking about potential new bugs 
ahh, got it.
noted for future reference
I’m asking this out of pure curiosity; How did you end up with that many fonts?
1 Like
for my project i have to make any font that could be used ahead of time, since the engine doesn’t allow them to be made at runtime.
i’ve had to severely cut down on them, even, but currently:
2 font faces (monospaced, sans-serif)
4 font styles (regular, bold, italic, bold italic)
2 outline styles (none, outlined)
4 font sizes
Is it better to use scale on text nodes instead of font variants?
1 Like
well, the last time i used a really big font (if it’s not bigger, then the font will look bad when you upscale it), it used all the cache and also led to the UI failing to load properly
It seems you are using Bitmap fonts? You can try Distance Field fonts which could keep your texts display well on scaling
yeah, using a distance field frees up some slots, but those are quickly backfilled again
Ah I see! That will indeed quickly add up. Thanks.