We have an issue that surfaced after we upgraded to TMP 1.4.0 and rebuilt all our font assets in preperation of localization for our game. I’ve so far been unable to pinpoint what’s wrong and I hope you can help me.
Here’s what’s happening:
Glyphs of some fonts get cut off at the sides or the glyph rectangle appears to be misplaced otherwise (i.e. too much whitespace around the actual glyph). This results in both cut-off characters and text that seems to move up and down between characters.
Example:
I’ve prepared an example where it is most apparant, using the Ubuntu font (Ubuntu Light in this case). Here is what the ‘S’ glyph and corresponding text look like when rendered with the following settings:
Ubuntu Light → Static (Extended ASCII), Point Size 50, Padding 5, Atlas 512*512, SDF16:
Note how the ‘S’ right side is cut off and the characters in the text seem to move up and down, not being placed on the same baseline.
However, these are the corresponding results using the exact same settings, but switching the asset to dynamic:
Ubuntu Light → Dynamic, Point Size 50, Padding 5, Atlas 512*512, SDF16:
Not only does the issue disappear, also note the difference in glyph rect width/height and glyph metrics. Unfortunately, we need to build static atlases rather than using dynamic ones, so switching to dynamic is not a possible workaround.
The issue remains observable regardless of atlas size, point size, padding, and across all SDF/8/16/32 render modes and affects many other fonts as well. Interestingly, SDFAA (both hinted and non-hinted) looks fine. Since we used SDF16 throughout our project before we’d like to maintain that render mode so our fonts keep the same visually.
If you have any idea what may be going wrong here, your help would be much appreciated. Thanks!