Repository navigation
Warn against pre-processing text with arabic_reshaper and python-bidi when libraqm is available - #10576
Warn against pre-processing text with arabic_reshaper and python-bidi when libraqm is available#10576FullStraing wants to merge 1 commit into
Conversation
… when libraqm is available
|
#9925 has already been created by the author of the issue. Do you think that your suggestion has anything to offer beyond that PR? |
|
Thanks for pointing to #9925 — I compared the two. The core warning is the same, but this PR adds a few things #9925 doesn't have:
Happy to fold the diacritics note and the call-site placement into #9925 instead, or to close this one if you'd rather keep a single PR — whichever you prefer. |
|
Would you mind closing this, and creating a PR in the fork of that PR? |
|
I tried to do this, but I can't rebase onto #9925's branch from the web UI: #9925 branched from main on Sep 2, and a branch built on current main shows a 357-file diff against it, so a PR from there would be wrong. The additions are ready on my fork (FullStraing/Pillow, branch docs/raqm-additions-for-9925) if that's useful, but I can't open a clean PR against #9925's fork without git access to rebase. Would you prefer I instead open a small separate PR to main with just the ImageDraw.text() note, or should Syamjith-NK pick the note up into #9925? |
|
Closing this as requested — the additions are now proposed against the branch of #9925 in Syamjith-NK#2. Thanks! |
Fixes #9907
Changes proposed in this pull request:
ImageDraw.text()warning that pre-processing text witharabic_reshaperandpython-bidicorrupts it on builds with libraqm, since Pillow already performs shaping and applies the bidirectional algorithm itself. The note includes thePIL.features.check("raqm")check to decide at runtime whether the pre-processing is needed, and mentions thatarabic_reshaperdrops diacritics.Verified against the reproducer in #9907 on a Raqm build (Pillow 10.2.0, raqm 0.10.1): the recipe shortens "الإمارات" from 8 to 7 codepoints, drops all 4 diacritics from 'مَرْحَبًا', and renders differently from the plain text (4,202 differing pixels); undoing one bidi pass restores the plain rendering exactly. Docs build passes with no warnings on the changed file.