freetype-py
freetype-py copied to clipboard
Mac M1 support please
freetype/raw.py", line 52, in
Do you have freetype library installed on your system?
I have installed via brew
Do you know where it has been installed and if it is reachable by ctypes?
@rougier if you can do a release, M1 packages will be available on pypi. We've already merged the CI build scripts (#139)!
If you need assistance I can help out.
I would need help to fill the description of the release, sorry, I lost tracks of all the changes since lase release.
Do you know where it has been installed and if it is reachable by ctypes?
brew installed mine in /opt/homebrew/lib instead of /usr/local/lib, not sure when/why that changed or if that's specific to my corporate setup. Also, note I am not using the brew python3, but compiled my own python using pyenv (maybe brew's python can find the brew prefix automatically)
In case it may help anyone, I ended up doing export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH and then I was able to import freetype using the pure-python freetype-py wheel and the brew-installed libfreetype.dylib.
Of course, it'd be better to download and use the universal2/arm64 wheel for M1 macs from #139. Looking forward to the upcoming release :+1
According to https://github.com/rougier/freetype-py/compare/v2.2.0...master, the changes are:
- Add build rules for ARM 32 and 64 bits (https://github.com/rougier/freetype-py/pull/134).
- Add ARM64 builds for PyPI (https://github.com/rougier/freetype-py/pull/139)
- Add aarch64 builds for PyPI (#144)
- Update bundled FreeType version to 2.11.0 and add support for SDF rendering (https://github.com/rougier/freetype-py/pull/141)
- Fix bindings for FT_Outline (#142)
- Expose binding to FT_Outline_EmboldenXY (#143)
- Fix a Python 2 era print statement into a function call (#147)
@anthrotype found that the bundled library for macOS/ARM64 contains just the x86_64 part, so of course it doesn't work. The build script needs to be updated to also build the ARM part and merge it all, as well as the CI script. I don't have time for this currently and wouldn't even know what exactly needs to be done...
I believe this is solved now?
Maybe! I don't have an M1 to test.
@almarklein you can confirm this is working right?
Yes I can!
Sorry for coming to this a little late - I think Apple announced that dynamic loader overrides like "export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH" was supposed to stop working one or two OS releases ago? Unless you disable SIP - short for "system integrity protection", I think. What's the verdict on that? (Or does homebrew tell people to disable SIP?)