README: note that Pillow built with Raqm already shapes (reshaping corrupts it) - #103
Open
Syamjith-NK wants to merge 1 commit into
Open
README: note that Pillow built with Raqm already shapes (reshaping corrupts it)#103Syamjith-NK wants to merge 1 commit into
Syamjith-NK wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #102.
The README currently tells every reader that "PIL Image does not support reshaping out of the box,
so ... you would need to reshape the text for sure." That was true when it was written, and is now
false whenever Pillow is built with Raqm — In that
configuration the example produces corrupted Arabic rather than correct Arabic.
This adds the
features.check("raqm")test and states which branch the existing example belongsto. It does not change the example itself, which remains correct for Pillow without Raqm.
Measured before writing this (5 strings × 3 fonts per path):
reshape()+get_display()Note the second row: where the recipe IS needed it is a partial rescue rather than a fix. I have
deliberately kept that out of the README, since it is a separate discussion from "does this
example apply to me" — but it is why the wording says the example is "needed" rather than
"sufficient".
Data and reproduction: https://huggingface.co/datasets/syamjithnk/arshape (CC BY 4.0)
Correction (21 Aug 2026). An earlier version of this description implied that recent Pillow wheels are Raqm-enabled by default. That is not right, and I have corrected it on #102 as well. Whether Pillow shapes Arabic depends on the machine, not the version. The wheels bundle a statically linked libraqm, but libraqm links FriBiDi at runtime and FriBiDi is not in the wheel — so the same wheel answers
Trueon a host that has it andFalseon one that does not. A slim container or a minimal CI image usually does not. So this library is needed more often than that wording implied, and the point of this PR is only that a reader cannot currently tell which case they are in.