The only docs I have seen (Font, TextMesh Pro Documentation) do not go into full detail on TextMeshPro options.
What for instance is SDFAA_HINTED? Is it better at low resolutions?
Hey Andyz,
I am no expert, but as far as I know you have the following âModesâ when it comes to TMP.
SDF(Vector), Smooth(Raster) and Bitmap(Raster)
-
There is the SDF(Signed Distance Field) mode. This is essentially a vector representation of the font data that allows you to zoom in, and it will still look crisp, because it is rendered continuously as you zoom in/out, and uses math to describe the shape.
-
Then there is the Bitmap(Raster) mode, which basically renders the font like a normal sprite or texture. So obviously it will be pixelated when you zoom in. Both the Smooth and Raster options are in fact Rasterized.
Anti-Aliasing (AA)
The Raster fonts are not anti-aliased and will appear jagged, and the Smooth is Anti-Aliased and will appear smooth.
SDF does not really need AA since it is a vector shape, and the anti-aliasing is âbuilt inâ due to the greyscale map it uses to render the font.
-
Due to the nature of a Signed Distance Field you can do all the cool things like softening edges, giving it outlines etc. since the data is just a mathematical representation of the shape of the font, based on a signed(+ or -) distance from a center vector line.
-
The Raster fonts donât have these cool features, and are basically just sprites,described by a certain amount of pixels, based on the font atlas you created for them.
Hinted & Unhinted
Both the Raster and Smooth have Hinted versions and Unhinted versions.
-
Hinting will line up âimportantâ parts of glyphs better with the pixel grid to make certain parts appear less pixelated (Usually Ascenders and Descenders, Serif parts of Serif fonts etc.) because it will sit directly on the pixel grid.
-
So Unhinted fonts donât make these micro adjustments to the glyphs, but that will ensure that your Typeface âlooksâ exactly the way it should, meaning every pixel is exactly where it was designed to be, not neccesarily where it looks the best.
So that is why Hinting is better for Low-Res as you said, because there are fewer pixels available on the display, so it is neccesary to have the âimportantâ parts of each letter sitting exactly on a row(or rows) of pixels, instead of spilling over into other pixel rows, making it look blurry.
So I would guess that SDFAA_HINTED simply refers to SDF(Smooth) with AA(Anti-Aliasing) that is Hinted, although I could not find this reference anywhere on http://digitalnativestudios.com, and as far as I understand SDF does not require AA.
[EDIT] - StephanB clarifies below that SDFAA_ HINTED uses the hinted version of the font.
"SDFAA Hinted uses the hinted version of the glyph to compute the SDF from. This usually produces glyph metrics that are INTs instead of float and may help with small point sizes although a lower sampling value also helps.
For the most part, it can yield slightly different looking glyphs. "
TLDR:
-
Smooth Hinted - Anti-Aliased, Raster Text with small adjustments to make it align better with the pixel grid. Might change the shape of letters very slightly, but will look better at low-res
-
Smooth - Anti-Aliased, Raster Text without adjustments to make it align better with the pixel grid. Wonât change the shape of letters at all, but it wonât look so good at low-res as hinted.
-
Raster Hinted - Aliased(Jagged edges) Rasterized Text with small adjustments to make it align better with the pixel grid. Might change the shape of letters very slightly, but will look better at low-res
-
Raster - Aliased(Jagged edges) Rasterized Text without adjustments to make it align better with the pixel grid.Wonât change the shape of letters at all, but it wonât look so good at low-res as hinted.
-
SDF 16 - Signed Distance field, 16-Bits of data, Vector Text. Can be adjusted for various effects. Always Crisp.
-
SDF 32 - Signed Distance field, 32-Bits of data, Vector Text. Can be adjusted for various effects. Always Crisp.
As I said, this is just my understanding of how it works. I am sure the documentation will be ready soon, and that will probably explain it a little better than I have.
Regards,
V
Yes thanks but this is what I donât get! It builds very fast but what is it!
SDFAA Hinted uses the hinted version of the glyph to compute the SDF from. This usually produces glyph metrics that are INTs instead of float and may help with small point sizes although a lower sampling value also helps.
For the most part, it can yield slightly different looking glyphs.