rougier / freetype-py

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

About emoji from font file error #154

Open yiwangwuqian opened 2 years ago

yiwangwuqian commented 2 years ago

Traceback (most recent call last): File "/freetype-py-master/examples/emoji-color.py", line 17, in face.load_char('😀') File "/usr/local/lib/python3.9/site-packages/freetype/init.py", line 1547, in load_char if error: raise FT_Exception( error ) freetype.ft_errors.FT_Exception: FT_Exception: (unimplemented feature)

I'm try using python3 on macOS Monterey.

HinTak commented 2 years ago

The line is

face.load_char('😀', freetype.FT_LOAD_COLOR)

why is it different from yours? You have made changes to the example.

yiwangwuqian commented 2 years ago

image I have same result

HinTak commented 2 years ago

Is your freestype  built with libpng? If it isn't, that might be the answer. On Wednesday, 8 June 2022, 18:00:42 GMT+8, yiwangwuqian @.***> wrote:

I have same result

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

yiwangwuqian commented 2 years ago

Is your freestype  built with libpng? If it isn't, that might be the answer. On Wednesday, 8 June 2022, 18:00:42 GMT+8, yiwangwuqian @.> wrote: I have same result — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> When i install, i just copy command pip install freetype-py and run.

HinTak commented 2 years ago

I think we need the result of "otool -L /usr/local/lib/libfreetype.so" or libfreetype.dylib to see if it is linked to libpng or not. Or wherever freetype-py is loading libfreetype.so/dylib from.

huntzhan commented 2 years ago

Having the same issue here. I'm using macOS 12.4 with Python 3.8. Even reinstall the freetype-py with FREETYPEPY_BUNDLE_FT=1 pip install --no-binary :all: --index-url=https://pypi.org/simple freetype-py raises the same exception.

HinTak commented 2 years ago

If it is a issue with libpng , try grabbing this copy of libfreetype https://github.com/HinTak/Font-Validator/tree/master/bin/Darwin and replace the one installed by pip. It is not the latest, but I did build it with libpng. It was for x86 and x86-64, so it won''t work on an arm-based machine.

HinTak commented 2 years ago

As far as I know, freetype-py hasn't included any newer freetype APIs than 2.10 or possibly even 2.8, so the copy of libfreetype built for font validator should support everything that's current in freetype-py. Give it a try.

huntzhan commented 2 years ago

Thanks!