rougier / freetype-py

Python binding for the freetype library
Other
298 stars 88 forks source link

build embedded freetype lib with color font support? #123

Open anthrotype opened 4 years ago

anthrotype commented 4 years ago

Currently the freetype2 embedded library that freetype-py includes is built without PNG support so loading emoji fonts doesn't work. One has to build their own freetype2 library with color support and have freetype-py load from that.

the setup-build-freetype.py script is configured to disable external dependencies, for good reasons since we want to make sure the compiled library is standalone and portable: https://github.com/rougier/freetype-py/blob/c578643b5736130c4341584655cb9813c32b5482/setup-build-freetype.py#L143-L146

Maybe we could see if we can also build the other external dependencies (zlib, png, perhaps even harfbuzz) and statically link them into the shared library that we are embedding in the freetype-py distribution.

anthrotype commented 4 years ago

correction sorry we already support harbuzz in the setup-build-freetype.py script: https://github.com/rougier/freetype-py/blob/c578643b5736130c4341584655cb9813c32b5482/setup-build-freetype.py#L161

rougier commented 4 years ago

Stupid question: do we need the "official" png library of can freetype uses something like https://github.com/nothings/stb/blob/master/stb_image.h ?

HinTak commented 4 years ago

Freetype uses the official libpng.