From 62cd236d1a4ed4afbe311ff9bc97c44bc9eb8a39 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 25 Jul 2023 12:31:58 +0300 Subject: [PATCH] Clarify that a single value is returned, and depends on the text direction --- docs/reference/ImageDraw.rst | 2 +- src/PIL/ImageFont.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst index 31f63695ef5..95a40007b9b 100644 --- a/docs/reference/ImageDraw.rst +++ b/docs/reference/ImageDraw.rst @@ -538,7 +538,7 @@ Methods It should be a `BCP 47 language code`_. Requires libraqm. :param embedded_color: Whether to use font embedded color glyphs (COLR, CBDT, SBIX). - :return: Width for horizontal, height for vertical text. + :return: Either width for horizontal text, or height for vertical text. .. py:method:: ImageDraw.textbbox(xy, text, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0, embedded_color=False) diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index 05828a72fdf..b77dc6ab1b6 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -318,7 +318,7 @@ def getlength(self, text, mode="", direction=None, features=None, language=None) `_ Requires libraqm. - :return: Width for horizontal, height for vertical text. + :return: Either width for horizontal text, or height for vertical text. """ _string_length_check(text) return self.font.getlength(text, mode, direction, features, language) / 64