Merge pull request #7305 from hugovk/docs-clarify-textlength-return

Docs: Clarify that a single value is returned, and depends on the text direction
This commit is contained in:
Andrew Murray 2023-07-26 08:16:34 +10:00 committed by GitHub
commit 07623d1a7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -318,7 +318,7 @@ class FreeTypeFont:
<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