TextMeshPro - Glyphs are offset when Font Asset is generated with SDF/SDF8/SDF16/SDF32

Hello,

When generating font atlas with SDFAA/SDFAA-HINTED it all looks good, but when generated with SDF/SDF8/SDF16/SDF32, some of the glyphs are vertically offset. And which glyphs are offset and for how much, depends on Sampling Point Size setting.

For example, number zero is too high when generated with SDF8/16/32 and Sampling Point Size (SPS) of 32, while when generating with SPS=45, both numbers 1 and 0 are a bit too high, and number 1 a bit more than 0:

Or up close:

For that reason, we can’t use SDF16/32 in our game, and we had to switch to SDFAA-Hinted instead. Letters looked too much all around, as some letters are higher and some lower than they should be.

Steps to reproduce:

  • Noto Sans Black font (Noto Home - Google Fonts)
  • Generate font atlas with SDF8/16/32, and with custom “Sampling Point Size”, e.g. 32
  • Create TextMeshProUGUI component, add some text to it. Some glyphs will be a bit too high or too low.

Would it be any chance to fix this in upcoming TextMeshPro updates? We would really like to use higher quality SDF fonts.

Thanks in advance!

Bump for this issue - if this is not fixed, basically we can only use SDFAA and SDFAA-Hinted fonts in production, SDF8/SDF16/SDF32 are unfortunately unusable, even though they’re of better quality.

What version of Unity are you using as I did fix a similar issue a few months ago.

Unity 2019.3.15f1 with TextMeshPro version 2.1.1.

This issue was fixed in 2019.4.1f1.

In the event you cannot upgrade to 2019.4, you can always create the font assets in 2019.4 and then copy them into your 2019.3 project.

2 Likes

Thanks Stephan!