From e0b53f0014d4f524e545c60449546c55522d63c7 Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 23 Jul 2020 00:04:16 +0200 Subject: [PATCH] fix lint and docs --- Tests/test_imagefontctl.py | 2 -- docs/handbook/text-anchors.rst | 2 +- docs/reference/ImageDraw.rst | 2 +- src/PIL/ImageFont.py | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Tests/test_imagefontctl.py b/Tests/test_imagefontctl.py index 4fb2d3bfd..4c3100f92 100644 --- a/Tests/test_imagefontctl.py +++ b/Tests/test_imagefontctl.py @@ -1,5 +1,3 @@ -import distutils.version - import pytest from packaging.version import parse as parse_version from PIL import Image, ImageDraw, ImageFont, features diff --git a/docs/handbook/text-anchors.rst b/docs/handbook/text-anchors.rst index e62210edd..f474362b4 100644 --- a/docs/handbook/text-anchors.rst +++ b/docs/handbook/text-anchors.rst @@ -19,7 +19,7 @@ horizontal alignment, the second character is the vertical alignment. For example, the default value of ``la`` for horizontal text means left--ascender aligned text. -When drawing text with :py:meth:`PIL.ImageDraw.Draw.text` with a specific anchor, +When drawing text with :py:meth:`PIL.ImageDraw.ImageDraw.text` with a specific anchor, text will be placed such that the specified anchor point is at the ``xy`` coordinates. For example, in the following image, text is ``ms`` (middle--baseline) aligned, with ``xy`` at diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst index 69bcd8d60..c2348b070 100644 --- a/docs/reference/ImageDraw.rst +++ b/docs/reference/ImageDraw.rst @@ -392,7 +392,7 @@ Methods .. note:: For historical reasons this function measures text height from 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:`.FreeTypeFont.getbbox` with `anchor='lt'` instead. + to use :meth:`.FreeTypeFont.getbbox` with ``anchor='lt'`` instead. :param text: Text to be measured. If it contains any newline characters, diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index daba03a3a..07090c987 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -337,7 +337,7 @@ class FreeTypeFont: .. note:: For historical reasons this function measures text height from 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:`getbbox` with `anchor='lt'` instead. + to use :meth:`getbbox` with ``anchor='lt'`` instead. :param text: Text to measure.