I am working on a CAD type project where i need to render font ( which can be super zoomed, rotate,translate etc)
Below is the screenshot of my need.
Now I started with rendering font
–>using Freetype Library (parsing the .ttf font file)
–> cache the textures and glyphs corresponding to each character
–> a custom fragment shader
The result were good but was not very crisp and sharp.also there were pixelated edges when rotating and transforming text.
Next i started learning the Signed Distance field font rendering, the results seems good and promising.
–> i used a SDF texture ( font atlas) (.png format)
My doubts are that i am very confused with using Freetype and SDF:
- Is alone using Freetype , .ttf file and a custom shader fulfill my need?
- If i use the SDF method should i use the Freetype?
- If i wish to use a single atlas texture(.png) how would i generate the glyphs corresponding to the SDF textures ( a png file)? can Freetype do that?
- Is generating SDF from Freetype a good option ( speed , efficiency?)!
- can i use .fnt file instead of .ttf where the information of SDF atlas is already stored? would be that better?
Or what is the best and efficient method to do this???
Overall i am confused with Freetype and SDF