Skip to content

Commit 07623d1

Browse files
authored
Merge pull request #7305 from hugovk/docs-clarify-textlength-return
Docs: Clarify that a single value is returned, and depends on the text direction
2 parents 3c5324b + 62cd236 commit 07623d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/reference/ImageDraw.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ Methods
538538
It should be a `BCP 47 language code`_.
539539
Requires libraqm.
540540
:param embedded_color: Whether to use font embedded color glyphs (COLR, CBDT, SBIX).
541-
:return: Width for horizontal, height for vertical text.
541+
:return: Either width for horizontal text, or height for vertical text.
542542

543543
.. 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)
544544

src/PIL/ImageFont.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def getlength(self, text, mode="", direction=None, features=None, language=None)
318318
<https://www.w3.org/International/articles/language-tags/>`_
319319
Requires libraqm.
320320
321-
:return: Width for horizontal, height for vertical text.
321+
:return: Either width for horizontal text, or height for vertical text.
322322
"""
323323
_string_length_check(text)
324324
return self.font.getlength(text, mode, direction, features, language) / 64

0 commit comments

Comments
 (0)