Closed ralsina closed 4 years ago
ah! interesting. note that this module doesn't use the system's libharfbuzz so it doesn't matter whether you have it installed with homebrew. I'll look into it.
oh right. We are compiling a static harfbuzz library with the default options, which on macOS will include -DHB_HAVE_CORETEXT:BOOL=ON
; however, we are not also linking the extension module with the ApplicationServices framework (which includes CoreText shaper).
We have two options:
1) pass -DHB_HAVE_CORETEXT:BOOL=OFF
and avoid linking with ApplicationServices; in this case, the coretext shaper will not be available, only the default harfbuzz open type shaper;
2) keep -DHB_HAVE_CORETEXT:BOOL=ON
and add a target_link_libraries
to link with the framework (only on macOS); this way, the coretext fallback shaper will be also available.
I'll go for option 2).
We need to check that on windows we don't incur in the same issue; there the uniscribe and dwrite shapers may be enabled by default in the harfbuzz CMakeLists.txt, and cause a similar linker error at import.
@ralsina please check that it works now. I'll tag a new release shortly. I'd like to write a basic smoke test to catch these things.
Note that we wrote the wrapper but haven't got the chance to use it much yet in the application we built this for (the maintainer of that is busy with other things at the moment). You may well be the only user ;)
Hey, happy to help find the bugs ;-)
It seems fixed now.
actually.. it may make more sense to completely disable coretext fallback shaper instead (-DHB_HAVE_CORETEXT:BOOL=OFF
), because currently in the uharbuzz bindings I don't see a way to select it. If it can't be used yet, better not link with it.
to support selecting the shaper, I believe we need to expose hb_shape_full
and hb_shape_list_shapers
hm.. maybe it's OK to link to the ApplicationServices framework, even if there is currently no way (from the python bindings) to force using the coretext shaper instead of the default one. I think it's still useful even if it's only available as a "fallback"... @khaledhosny what do you think is best?
The coretext_aat
shaper is automatically used for AAT fonts, so it will be used even if you don't manually select it (having the API to call control the shapers would still be nice though since one can then disable it if wanted, but even this can be controlled by an environment variable, HB_SHAPERS
IIRC).
The Uniscribe and DirectWrite should not be enabled, though. They for easily comparing them with HarfBuzz and should not be used in production.
thanks @khaledhosny!
This should be closed. HarfBuzz have native AAT support now and no user action is needed to enable it.
This happens both with the wheel and building from source. I do have libharfbuzz installed via brew, and it works with another binding.