Stumbled on this one again whilst adding translations for a new game, so I did a little digging. It turns out the issue only happens when the text is displayed on screen.
This means that the glyphs aren’t cached before the text is displayed, which is a likely cause of the stutter problem mentioned above. It also seems that the text becomes uncached when the collection is removed, which explains why keeping a text field with all glyphs visible att all time fixes the stutter issue.
Yes, the error happens if the font size is too big and is resolved if the font is made smaller. In my tests setting the value to 0, 0 breaks earlier than setting it to 2048, 2048.
If cache_width and cache_height is set to 0, what is the upper limits before the “Out of available cache cells!” error happens?
In this test project font size 100 works, size 101 breaks with automatic caching: JapaneseGlyphs.zip (3.9 MB)
Hi @totebo . Sorry to bump an old thread. I’m in the process of localising a game for the first time and I’m stumped by how to get a unique list of glyphs to embed. Hitting “All Chars” just freezes my computer, and I presume it wouldn’t work well in game anyway.
Then use a code snippet like this (you’ll need to modify for your setup, this case was for Korean hence the ‘KO’):
local function uniqueSymbols()
local unique={}
local extra_characters=""
for k,v in pairs(M.texts) do
if v.KO then
utf8.gsub(v.KO,".", function(c)
if not unique[c] then
unique[c]=1
extra_characters=extra_characters..c
else
unique[c]=unique[c]+1
end
end)
end
end
print(extra_characters)
end
To make this list into something I can just paste into the “Extra characters” field, I just did this:
local output = ""
for char, num in pairs(unique) do
output = output .. char
end
print(output)