diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst index b95d8d591..1ba024eea 100644 --- a/docs/reference/ImageDraw.rst +++ b/docs/reference/ImageDraw.rst @@ -436,6 +436,8 @@ Methods .. py:method:: ImageDraw.textsize(text, font=None, spacing=4, direction=None, features=None, language=None, stroke_width=0) + .. deprecated:: 9.2.0 + Return the size of the given string, in pixels. Use :py:meth:`textlength()` to measure the offset of following text with @@ -484,6 +486,8 @@ Methods .. py:method:: ImageDraw.multiline_textsize(text, font=None, spacing=4, direction=None, features=None, language=None, stroke_width=0) + .. deprecated:: 9.2.0 + Return the size of the given string, in pixels. Use :py:meth:`textlength()` to measure the offset of following text with diff --git a/src/PIL/ImageDraw2.py b/src/PIL/ImageDraw2.py index 6e6a307bd..ea9461e92 100644 --- a/src/PIL/ImageDraw2.py +++ b/src/PIL/ImageDraw2.py @@ -173,6 +173,8 @@ class Draw: def textsize(self, text, font): """ + .. deprecated:: 9.2.0 + Return the size of the given string, in pixels. .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.textsize` diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index 0bd92749d..1f356adef 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -137,6 +137,8 @@ class ImageFont: def getsize(self, text, *args, **kwargs): """ + .. deprecated:: 9.2.0 + Returns width and height (in pixels) of given text. :param text: Text to measure. @@ -424,6 +426,8 @@ class FreeTypeFont: __internal__=False, ): """ + .. deprecated:: 9.2.0 + Returns width and height (in pixels) of given text if rendered in font with provided direction, features, and language. @@ -493,6 +497,8 @@ class FreeTypeFont: stroke_width=0, ): """ + .. deprecated:: 9.2.0 + Returns width and height (in pixels) of given text if rendered in font with provided direction, features, and language, while respecting newline characters. @@ -548,6 +554,8 @@ class FreeTypeFont: def getoffset(self, text): """ + .. deprecated:: 9.2.0 + Returns the offset of given text. This is the gap between the starting coordinate and the first marking. Note that this gap is included in the result of :py:func:`~PIL.ImageFont.FreeTypeFont.getsize`. @@ -837,6 +845,9 @@ class TransposedFont: self.orientation = orientation # any 'transpose' argument, or None def getsize(self, text, *args, **kwargs): + """ + .. deprecated:: 9.2.0 + """ if not kwargs.get("__internal__"): deprecate("getsize", 10, "getbbox or getlength") try: