don't load ft_* funcs if freetype2 binding not available
FreeType is recommended, but is not required to build and use HarfBuzz.
It would be nice if harfpy could be used with a harfbuzz library that was built --with-freetype=no
.
Currently, if one tries to do that, one gets a Symbol not found
error from cytpes.
I think that checking if the freetype2
bindings are importable or not is a good marker as to whether one is interested or not in exposing the freetype-related symbols in the harfbuzz library.
There are also other places in harfbuzz.py where you check if freetype != None:
.
(note that None
is a singleton, so one should use is
or is not
instead of ==
or !=
)