freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SDF format


From: Alexei Podtelezhnikov
Subject: SDF format
Date: Sun, 27 Dec 2020 10:54:52 -0500

Werner, Anuj,

Please help me to settle on the SDF format. I know that we discussed
it at length early in the days and GRAY16 is more than sufficient. I
went searching for *practical* examples on the internet and found very
few.This blog post
https://blog.mapbox.com/drawing-text-with-signed-distance-fields-in-mapbox-gl-b0933af6f817
and some others refer to OpenGL textures as the next step, Their
format is unclear to me but it seems that we should align. The blog
post that I mentioned is okay with GRAY8 unevenly split at 192, which
brings the question of units too. The units or scale of SDF do not
seem to be important.

Should we connect with OpenGL to align on the format?

Finally, I am not sure if you realize that FreeType gray coverage
antialiased output is conceptually close to a distance field with a
"spread" of half-pixel. A straight line passing through a pixel center
splits it in half and the coverage of 128 represents the distance of
0. The coverage of 0 and 255 correspond to ± half-pixel distance
roughly. So the true distance field essentially makes it possible to
interpolate the coverage values over some range of  pixel sizes up to
the spread value. I wonder if we really need 16 bits for acceptable
interpolation. Probably not.

What do you think?

Alexei



reply via email to

[Prev in Thread] Current Thread [Next in Thread]