Very interesting, Hai!
When I read about msdfgen, I was eager to try for myself, but I haven't been in the mood for coding lately so you beat me to it. This implementation is a nice first step, although I do see quite a few issues with it in the current version. Please allow me to name a few.
First of all, regarding the ideal font size to create the texture for: while experimenting with my own SDF text stuff, I noticed that a font size of at least 50 pixels (roughly equivalent to 50pt) yields the best results, as this captures most fonts' details. Only fonts with very thin features, like an elegant handwritten font, need larger font sizes. A size of 24 pixels, which is the default in your sample application, almost never yields great results.
I also noticed that the text still shows a bunch of aliasing, due to a naive shader implementation. Here is what it looks like by default:
By changing the way
opacity is calculated, it looks like this:
float sigDist = median( sample.r, sample.g, sample.b );
float w = fwidth( sigDist );
float opacity = smoothstep( 0.5 - w, 0.5 + w, sigDist );
Especially note the difference in quality of the capital "A". Kerning is not great, the "O" in "Philosophic" for instance seems to float a bit. But that is probably a limitation of FreeType. If not, it might be a good idea to change the way the mesh is created. But I believe that's something on Cinder's TODO list, not necessarily yours. Although this one seems to be a bug:
Some fonts exhibit incorrect mapping:
Finally, there seems to be a blending issue: note the grey outlines in the overlapping white text. I enabled pre-multiplied alpha blending in the sample app, but this did not have the desired effect.
If you're interested, I created a cinderblock.xml that turns your code into a proper Cinder Block. The only manual change required after creating the project, is to add a
FT2_BUILD_LIBRARY pre-processor define for all targets. Sadly, this is something TinderBox can not do for you.