From ba78f5d0dad12a5fb54930a220f8b0dd2ffe64d7 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 3 Oct 2022 09:39:37 +1100 Subject: [PATCH 1/3] Document the default layout engine --- src/PIL/ImageFont.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index 310072dfc86..6c747fc3e42 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -945,6 +945,8 @@ def truetype(font=None, size=10, index=0, encoding="", layout_engine=None): encoding of any text provided in subsequent operations. :param layout_engine: Which layout engine to use, if available: :data:`.ImageFont.Layout.BASIC` or :data:`.ImageFont.Layout.RAQM`. + If it is available, Raqm layout will be used by default. + Otherwise, basic layout will be used. You can check support for Raqm layout using :py:func:`PIL.features.check_feature` with ``feature="raqm"``. From 74f47d8c1a6152a4dd05ccf4a74079fc438673e0 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 3 Oct 2022 10:03:13 +1100 Subject: [PATCH 2/3] Document that basic layout is faster than raqm --- src/PIL/ImageFont.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index 6c747fc3e42..6a66f8a7126 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -948,6 +948,9 @@ def truetype(font=None, size=10, index=0, encoding="", layout_engine=None): If it is available, Raqm layout will be used by default. Otherwise, basic layout will be used. + If complex text layout is not required, basic layout will have + better performance. + You can check support for Raqm layout using :py:func:`PIL.features.check_feature` with ``feature="raqm"``. From 397167569a3ec91a787ffc3c43ab6cec62193e18 Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Mon, 10 Oct 2022 09:11:41 +1100 Subject: [PATCH 3/3] Recommend raqm for non-English text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondrej Baranovič --- src/PIL/ImageFont.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index 6a66f8a7126..60d4ca97fcf 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -948,8 +948,8 @@ def truetype(font=None, size=10, index=0, encoding="", layout_engine=None): If it is available, Raqm layout will be used by default. Otherwise, basic layout will be used. - If complex text layout is not required, basic layout will have - better performance. + Raqm layout is recommended for all non-English text. If Raqm layout + is not required, basic layout will have better performance. You can check support for Raqm layout using :py:func:`PIL.features.check_feature` with ``feature="raqm"``.