Hey. I’ve been trying to get unity to render UI text as crisp as possible, but I just can’t seem to get it right. I’ve tried dynamic setting, unicode with increased font size and setting font texture’s filtering to point. I even tried TextMesh Pro, but to be honest I haven’t noticed a significant difference.
Here’s how Open Sans looks for me at text size = 12, with font settings being (from top to bottom):
font size 12, rendering mode “hinted smooth”, character “unicode”
font size 24, rendering mode “hinted smooth”, character “unicode”
font size 48, rendering mode “hinted smooth”, character “unicode”
font size 64, rendering mode “hinted smooth”, character “unicode”
font size 12, rendering mode “smooth”, character “dynamic”
font size 12, rendering mode “smooth”, character “dynamic”
Is this as good as Unity’s text rendering gets? Could this be somehow related to my canvas scaler? I have it set at Constant Pixel Size, with scale factor = 1 and reference pixels per unit = 16 (though I haven’t noticed this to affect text rendering at all)
So honestly yes, with the default UI text the rendering is not very clear. TextMesh Pro should solve this issue for you though so i’m surprised when you say “but to be honest I haven’t noticed a significant difference.”. By chance do you have pixel perfect on or off (Canvas setting)? You can get around any performance costs of pixel perfect by ensuring the rect transform bounds for the text objects are at whole numbers for both position and size, even fractions of pixel off could make it look even worse.
Thanks for the reply! Yes, unfortunately TextMesh Pro looks very similar (the bottom one is TextMesh Pro with 16bit SDF, font import and material settings left default, both text sizes set at 12)
I have pixel perfect setting turned on, but it doesn’t seem to change anything. I’d like to try it with different unity version, as I am on 2017.4.1f1 right now. I suppose it’s unlikely it’s a bug? I haven’t noticed any changes to text rendering in unity changelog for the version I’m using, or for 2018.
Essentially BitmapFont + SDF shader can get you much better results after some tweaking.
No response from anyone there still, but at least there are some ways.
Downside is not being able to set any kinds of outlines on the text though, and probably some more stuff.
which could be fixed by taking a SDF atlast and essentially “pixelating” the glyphs so you get crisp text and outlines.
Alright, I’ve tried more presets, and it looks best with bitmap prerendered at 12px. Too bad there’s some kind of bug present that won’t let me change the color of my text from black (even though the prerendered font bitmap clearly has white characters [edit: actually the atlas contains black characters…]).
Point 5 is the same font rendered by GIMP. As you can see, all unity rendered texts look bad (to the point that there’s little gain to using TextMesh Pro). Is this really impossible for us to get text rendering in unity up to par with point 5?
When rendering small text using SDF, make sure you enable Extra Padding in the text object inspector. Switching to Linear Color space should also help when rendering SDF text.
I will take a closer look later today using this OpenSans font to compare what results I get on my end and post the results.
I’ve tried enabling Extra Padding [text no. 2], and it got rid of some letters appearing malformed/too thin at times, at the expense of added shadow. However, setting the color space to linear butchers the effect [text no. 3].
@Stephan_B were you ever able to take a look at this? I’ve noticed consistent text rendering blurriness with Unity ever since I started using it. Any additional info would be great to hear how we could get crisp text in our games.