I am making a card game, which dictates two things:
Text will sometimes need to be rotated.
Text will sometimes be generated by code. This means no static prerendering as an image.
With several (TTF) fonts, I have tried everything that the documentation suggests:
Turning antialiasing on or off.
Generating mipmaps before the game starts.
Turning MSDF on or off.
Turning hinting on or off.
Using an extra bold font with few details.
However, no matter what I do, the end result is the same:
Note how the two capital “S” look completely different from each other and awful.
Since Godot 4 supposedly has very good 2D text rendering support, I am certain that the problem is with me and not with the engine, but I can not for the life of me figure out how to do this simple thing. Any tips would be appreciated.
Edit: Actually, I see (a less severe version of) this problem even on labels with rotation 0. No matter which font I use, no matter which options, letters are distorted and/or pixelated even though they are scaled up from a vector font. How can this be?
Edit: This happens on a monitor whose native resolution is equal to the resolution of the viewport. It is less noticeable, but still there, on a monitor with double the viewport’s resolution.
Text rendering uses a lot of tricks and optimizations to render crisp text but the moment you rotate it all those tricks and optimizations become useless. Enabling MSDF should help a bit but I don’t think those issues are entirely avoidable and, depending on the font, some glyphs may not render correctly.
Well, existing games somehow manage to do it, so clearly it is not impossible. To cite just the most famous example, Slay the Spire 2 is built in Godot, and it clearly has this exact feature.
Is it possible to render pieces of text into an image at runtime and then have that drawn onto the canvas? And would that even help?
Update: I just played around some more, and I get noticeable artifacting and distortion on essentially all fonts even when I create a fresh project with nothing except a singular Label in it. So really, my question should be “how to make ANY text in Godot not look horrible?”
Manually exporting letters as SVGs and then manually placing them back on the canvas is going to be very annoying especially considering we have a Chinese localisation, so we will only do that if we have no choice …