-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getlength output varies for prebuilt vs "build_ext" wheels #6871
Comments
I would be looking at raqm. >>> from PIL import features
>>> features.check_feature("raqm")
True https://pillow.readthedocs.io/en/stable/installation.html#basic-installation
|
https://pillow.readthedocs.io/en/latest/installation.html#build-options You probably want one of the Raqm flags, Alternatively you can try I'd guess you have |
#6876 has been merged, so you will find those options in the documentation now. |
@kdumontnu did that answer your question? |
I don't think so, unless I'm missing something. The discrepancy I'm seeing is that my outputs matched correctly when I was building from source (using the flags I posted above). However, now that I'm using the prebuilt wheels my outputs no longer match. Are the prebuilt pillow wheels referencing any external dependencies? |
So, to rewind a bit, raqm is an optional dependency that handles complex text layout. The previous comments were about enabling or disabling raqm in your prebuilt wheels. If you aren't worried about non-English languages though, you can choose to not use it, regardless of whether or not it is enabled. If you switch to ImageFont.truetype(myttffontfile, size=50000, layout_engine=ImageFont.Layout.BASIC) you should find your results to be consistent, regardless of whether you're using the wheels or building Pillow from source. |
As I said,
|
What is your reason for wanting consistency across operating systems? If it is because you are developing a library, and have little control over how Pillow is installed, then using If you do have control over how Pillow is installed, and would like to consider complex text layout, then this comes down to a need to get raqm working on different operating systems. Which operating systems do not have raqm installed correctly? >>> from PIL import features
>>> features.check_feature("raqm")
True |
Closing this issue as no feedback has been received. |
What did you do?
I had been using a pip option to build pillow because there previously weren't prebuilt wheels for some of my (unix) OSes I needed:
This worked well, and I had consistent behavior between operating systems (alpine, windows, MacOS, ubuntu).
However, I've tried moving to the prebuilt wheel, and now I'm seeing slightly different behavior from my text-wrapping built using
getlength
on ubuntu (tested 22.04 and 20.04)I assume it's related to a dependency I need to lock, but I'm not sure where to start looking.
What did you expect to happen?
I expected the wrapping to be the same between operating systems and previous builds.
What actually happened?
I'm seeing different length results from
getlength
, causing differences in behavior between ubuntu vs other OSes and also vs previous "build_ext" versions.What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: