Apply suggestions from code review

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
nulano 2020-10-11 21:55:32 +02:00 committed by GitHub
parent 9b5931f212
commit 067a254366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -411,8 +411,6 @@ Methods
the ascender line instead of the top, see :ref:`text-anchors`.
If you wish to measure text height from the top, it is recommended
to use :meth:`textbbox` with ``anchor='lt'`` instead.
:param text: Text to be measured. If it contains any newline characters,
the text is passed on to :py:meth:`~PIL.ImageDraw.ImageDraw.multiline_textsize`.
:param font: An :py:class:`~PIL.ImageFont.ImageFont` instance.
@ -498,7 +496,7 @@ Methods
.. py:method:: ImageDraw.textlength(text, font=None, direction=None, features=None, language=None)
Returns length (in pixels with 1/64 precision) of given text if rendered
Returns length (in pixels with 1/64 precision) of given text when rendered
in font with provided direction, features, and language.
This is the amount by which following text should be offset.
@ -567,7 +565,7 @@ Methods
.. py:method:: ImageDraw.textbbox(xy, text, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0)
Returns bounding box (in pixels) of given text relative to given anchor
if rendered in font with provided direction, features, and language.
when rendered in font with provided direction, features, and language.
Only supported for TrueType fonts.
Use :py:meth:`textlength` to get the offset of following text with
@ -615,7 +613,7 @@ Methods
.. py:method:: ImageDraw.multiline_textbbox(xy, text, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0)
Returns bounding box (in pixels) of given text relative to given anchor
if rendered in font with provided direction, features, and language.
when rendered in font with provided direction, features, and language.
Only supported for TrueType fonts.
Use :py:meth:`textlength` to get the offset of following text with

View File

@ -217,7 +217,7 @@ class FreeTypeFont:
def getlength(self, text, mode="", direction=None, features=None, language=None):
"""
Returns length (in pixels with 1/64 precision) of given text if rendered
Returns length (in pixels with 1/64 precision) of given text when rendered
in font with provided direction, features, and language.
This is the amount by which following text should be offset.
@ -306,7 +306,7 @@ class FreeTypeFont:
):
"""
Returns bounding box (in pixels) of given text relative to given anchor
if rendered in font with provided direction, features, and language.
when rendered in font with provided direction, features, and language.
Use :py:meth:`getlength()` to get the offset of following text with
1/64 pixel precision. The bounding box includes extra margins for