TkinterEP / python-tkextrafont

C-extension for Tcl to allow loading custom font files into Tcl/Tk applications, packaged for Python's Tkinter
MIT License
21 stars 3 forks source link

manylinux wheels depend on local availability of fontconfig binary #1

Open RedFantom opened 3 years ago

RedFantom commented 3 years ago

The manylinux wheels provided in this repository have an important limitation, specifically that they require the availability of a binary libfontconfig.so.1 being available in the PATH in order to be used.

Why does this limitation exist?

The loading of fonts is application context dependent. This context can only be shared between tkextrafont and the Tcl/Tk application if tk and tkextrafont have loaded the same libfontconfig.so.1 file. Hence, the manylinux wheels still depend on the presence of a libfontconfig.so.1 binary file.

How is loading of the sytem shared library forced?

The manylinux wheels built by the GitHub action are post-processed such that instead of the manylinux-platform version of the fontconfig is removed and the extrafont.so file loads the system-wide libfontconfig.so.1 instead. See post_process_manylinux.py for more details on how this is done.

This sounds like a dirty hack and I don't like it.

Feel free to build your own wheels on your local machine. You'll need the build dependencies though.

How do you know this works?

The wheels produced this way have been tested and shown to work on Ubuntu 20.04 and Fedora 33. Additional distributions can be tested in the future.