From e6f7e9f6eee59ba361e79e4b78bb3e2139058aca Mon Sep 17 00:00:00 2001 From: Sudipto Kumar <140225127+SudiptoKumar@users.noreply.github.com> Date: Wed, 4 Nov 2026 04:58:02 +0600 Subject: [PATCH] Warn against pre-processing text with arabic_reshaper and python-bidi on Raqm builds --- docs/installation/building-from-source.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/installation/building-from-source.rst b/docs/installation/building-from-source.rst index a0923066afd..239a5a8a0a7 100644 --- a/docs/installation/building-from-source.rst +++ b/docs/installation/building-from-source.rst @@ -74,6 +74,14 @@ Many of Pillow's features require external libraries: * libraqm provides bidirectional text support (using FriBiDi), shaping (using HarfBuzz), and proper script itemization. As a result, Raqm can support most writing systems covered by Unicode. + * Because Raqm already shapes and reorders text, do not pass it + text that has been pre-processed with ``arabic_reshaper`` and + ``python-bidi``. That recipe is only needed on builds without + Raqm; on a Raqm build the text is processed twice and renders + incorrectly, and reshaping also rewrites the string itself, + merging lam-alef into a single presentation form and dropping + diacritics. Only apply the recipe when Raqm is not available, + for example by checking ``features.check("raqm")`` first. * libraqm depends on the following libraries: FreeType, HarfBuzz, FriBiDi, make sure that you install them before installing libraqm if not available as package in your system.