memononen / nanovg

Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
zlib License
5.06k stars 767 forks source link

Forward bitmapOption to fons__tt_buildGlyphBitmap #645

Closed mulle-nat closed 5 months ago

mulle-nat commented 1 year ago

This can avoid unneccessary rasterization. (see #643) In one demo, where I am using glyph measurements quite a lot, I could get 360fps instead of 330fps with this change.

I also added two functions fons__tt_getGlyphRenderFlags and fons__tt_setGlyphRenderFlags so that flags like FT_LOAD_TARGET_LIGHT for rasterization can be set or unset and don't have to be compiled in.