freetype-py

Why does num_glyphs not match the number of glyphs enumerated by FT_Get_First_Char / FT_Get_Next_Char

大憨熊 提交于 2019-12-24 23:17:23
问题 Consider the following example. It uses freetype (through a python wrapper) to load a font and then counts the glyphs . import freetype as FT f = FT.Face('/usr/share/fonts/truetype/Hack-Regular.ttf') f.num_glyphs # 1573 len([*f.get_chars()]) # 1549 As you can see the number obtained by counting does not match the number reported by the library when asked directly. Why? Note: Knowledge of the python wrapper shouldn't be necessary to address this question. The python functions used here are