Skip to content

Commit

Permalink
Merge pull request #7305 from hugovk/docs-clarify-textlength-return
Browse files Browse the repository at this point in the history
Docs: Clarify that a single value is returned, and depends on the text direction
  • Loading branch information
radarhere authored Jul 25, 2023
2 parents 3c5324b + 62cd236 commit 07623d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/reference/ImageDraw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/ImageFont.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def getlength(self, text, mode="", direction=None, features=None, language=None)
<https://www.w3.org/International/articles/language-tags/>`_
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
Expand Down

0 comments on commit 07623d1

Please sign in to comment.