Forgive me for coming into this late -- a colleague pointed me to this
thread a couple of days ago and I'm just catching up. I work on Skia, and
we've been generating SDFs from glyphs for quite some time now, so the
possibility of just getting them from Freetype is pretty exciting.

I hope you don't mind some comments on what we have now. We currently use
the Gustavson algorithm to generate them from bitmaps but it produces
slightly fuzzy results. I have wanted to move to use this algorithm to
generate them directly from the outline which might be useful to you:

https://skia.googlesource.com/skia/+/refs/heads/master/src/gpu/GrDistanceFieldGenFromVector.cpp
We use it to store atlased paths at the moment and it produces much better
results.

As far as format, we use an 8-bit 3.5 fixed point format, because it allows
us to combine the SDF and bitmap glyphs into the same atlas to conserve
space. There is a sacrifice in quality, but we only use the SDFs for larger
glyphs so it's acceptable.

If you would like more details on our implementation please let me know.
I'm looking forward to seeing how this turns out.

Reply via email to