nanovg uses the FONS_GLYPH_BITMAP_OPTIONAL flag in various places to avoid the creation of superflous font atlas entries for glyphs. The actual glyph information is queried by fons__tt_buildGlyphBitmap, which always uses FT_LOAD_RENDER to render a (then unneeded) bitmap though. This is probably expensive and could be avoided, by passing an extra parameter to fons__tt_buildGlyphBitmap, telling FreeType not to.
nanovg uses the
FONS_GLYPH_BITMAP_OPTIONAL
flag in various places to avoid the creation of superflous font atlas entries for glyphs. The actual glyph information is queried byfons__tt_buildGlyphBitmap
, which always usesFT_LOAD_RENDER
to render a (then unneeded) bitmap though. This is probably expensive and could be avoided, by passing an extra parameter tofons__tt_buildGlyphBitmap
, telling FreeType not to.fontstash.h
:The same should be done for stb_truetype (or could be harmlessly ignored, if not supported there).