googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
152 stars 43 forks source link

Use `fontTools.cu2qu` on non-CPython? #632

Closed madig closed 1 year ago

madig commented 2 years ago

AFAIU, the separate cu2qu dependency is for building binary wheels, but Pypy is probably better off using the pure-Python code imported into fontTools directly. It will fetch the pure Python wheel regardless, but it's basically an extra depedency that isn't necessary?

anthrotype commented 2 years ago

Yeah. I suggest we do this:

1) change all cu2qu imports inside ufo2ft to try/except ImportError blocks that try to import standalone cu2qu first, if that's missing, use the fontTools.cu2qu. 2) add a new cu2qu extra to ufo2ft's setup.py which installs the standalone (cython accelerated) cu2qu, and remove cu2qu from the required install_requires 3) change fontmake to install_require a cu2qu-less ufo2ft for pypy implementations, otherwise ufo2ft[cu2qu]

anthrotype commented 1 year ago

the next fonttools release will include binary wheels for all cpythons/platforms except pypy (where pure python works best). once that is out we can finally change the imports and drop the dependency on the standalone cu2qu (which we were using only because of the binary wheels basically).