Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Text sometimes becomes garbled.

A topic by JoneWang created 19 days ago Views: 39 Replies: 5
Viewing posts 1 to 2

After exporting the game, some text becomes garbled. How can I solve this?

Thank you!

Developer

Is the pink text there the same mesh as the text on the right side of the screen?

NO. On the right is TextMesh Pro.

Developer

Ok, in that case, what version of Unity are you using? And do you have the latest version of Super Text Mesh? Please try reimporting, I've seen situations where an update doesn't properly apply in the past.


What do the import settings for your font look like? And would it be possible to send a screenshot of the inspector for your Super Text Mesh component?

Developer

Ok, a few things to try:


1) On your Super Text Mesh component, set your Quality to 16, to match the pixel size of the font. (Quality is the font size that is rendered for dynamic fonts, so pixel fonts should usually be kept at their original size to render properly) This font probably has a *lot* of characters, so setting the quality so high *could* be a potential cause of the issue, if it's tripping up Unity's internal font texture tools.

2) On your font import settings, try changing "Character" from "Dynamic" to "Unicode". This will make the font be non-dynamic, so it *usually* eliminates the garbled text problem, with the caveat of the entire font being pre-rendered into a texture. I'll say that this *used* to be a concern back in 2018, but nowadays I think any platform shouldn't see any performance hits from this. (Pre-rendering the entire texture can take up more memory, but with a pixel font it's not really a problem in the first place, even with such a large character set)

3) Are you enabling/disabling the SuperTextMesh *component* at any point? Is it possible to enable/disable the gameObject instead?

4) Is that the only font you have named "Fusion Pixel"?

5) Additionally, and this is really silly, but since you're using a pixel font, *disabling* "pixel snap" may give you better rendering if your text object is grid-aligned in the first place. I'm just using Unity's pixel snap method, and honestly it's just not as good as lining up text yourself. I think it's meant moreso for non-pixel fonts. Unrelated to your issue, just saying this since I'm talking about pixel font rendering!


Please let me know if that has a difference for you. Basically, the garbled text bug is caused by when a dynamic font texture rebuilds, and the text mesh does not receive the "OnFontTextureRebuilt" callback. So... this could be caused by the Super Text Mesh component not being active, Unity's backend not sending the signal for whatever reason, or an error within my OnFontTextureRebuilt method within Super Text Mesh... but looking at it, I can't seem to see what the cause would be from that, unless the text object glitched out and isn't aware of the fonts it has within it.