From 9f7aae3505e813e4fc983139f082ace258c73497 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Thu, 29 Jun 2017 07:02:02 -0700 Subject: [PATCH] Doc changes/additions --- docs/reference/ImageDraw.rst | 99 +++++++++++++++++++++++++++++------- docs/reference/ImageFont.rst | 28 +++++++--- 2 files changed, 103 insertions(+), 24 deletions(-) diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst index e8f67f39b..7a2666b10 100644 --- a/docs/reference/ImageDraw.rst +++ b/docs/reference/ImageDraw.rst @@ -240,16 +240,28 @@ Methods the number of pixels between lines. :param align: If the text is passed on to multiline_text(), "left", "center" or "right". - :param direction: Direction of the text. It can be 'rtl', 'ltr', 'ttb' or 'btt'. Requires libraqm - :param features: A list of font feature to be used during text layout. - This is usually used to turn on optional font features that are not enabled by - default, for example 'dlig' or 'ss01', but can be also used to turn off default - font features for example '-liga' to disable ligatures or '-kern' to disable kerning. - To get all supported features, see https://www.microsoft.com/typography/otspec/featurelist.htm - Requires libraqm. + :param direction: Direction of the text. It can be 'rtl' (right to + left), 'ltr' (left to right), 'ttb' (top to + bottom) or 'btt' (bottom to top). Requires + libraqm. + + .. versionadded:: 4.2.0 + + :param features: A list of OpenType font features to be used during text + layout. This is usually used to turn on optional + font features that are not enabled by default, + for example 'dlig' or 'ss01', but can be also + used to turn off default font features for + example '-liga' to disable ligatures or '-kern' + to disable kerning. To get all supported + features, see + https://www.microsoft.com/typography/otspec/featurelist.htm + Requires libraqm. + + .. versionadded:: 4.2.0 .. py:method:: PIL.ImageDraw.Draw.multiline_text(xy, text, fill=None, font=None, anchor=None, spacing=0, align="left", - direction=None, features=[]) + direction=None, features=None) Draws the string at the given position. @@ -259,15 +271,28 @@ Methods :param font: An :py:class:`~PIL.ImageFont.ImageFont` instance. :param spacing: The number of pixels between lines. :param align: "left", "center" or "right". - :param direction: Direction of the text. It can be 'rtl', 'ltr', 'ttb' or 'btt'. Requires libraqm. - :param features: A list of font feature to be used during text layout. - This is usually used to turn on optional font features that are not enabled by - default, for example 'dlig' or 'ss01', but can be also used to turn off default - font features for example '-liga' to disable ligatures or '-kern' to disable kerning. - To get all supported features, see https://www.microsoft.com/typography/otspec/featurelist.htm - Requires libraqm. + :param direction: Direction of the text. It can be 'rtl' (right to + left), 'ltr' (left to right), 'ttb' (top to + bottom) or 'btt' (bottom to top). Requires + libraqm. -.. py:method:: PIL.ImageDraw.Draw.textsize(text, font=None, spacing=0) + .. versionadded:: 4.2.0 + + :param features: A list of OpenType font features to be used during text + layout. This is usually used to turn on optional + font features that are not enabled by default, + for example 'dlig' or 'ss01', but can be also + used to turn off default font features for + example '-liga' to disable ligatures or '-kern' + to disable kerning. To get all supported + features, see + https://www.microsoft.com/typography/otspec/featurelist.htm + Requires libraqm. + + .. versionadded:: 4.2.0 + +.. py:method:: PIL.ImageDraw.Draw.textsize(text, font=None, spacing=4, direction=None, + features=None) Return the size of the given string, in pixels. @@ -276,11 +301,51 @@ Methods :param font: An :py:class:`~PIL.ImageFont.ImageFont` instance. :param spacing: If the text is passed on to multiline_textsize(), the number of pixels between lines. + :param direction: Direction of the text. It can be 'rtl' (right to + left), 'ltr' (left to right), 'ttb' (top to + bottom) or 'btt' (bottom to top). Requires + libraqm. -.. py:method:: PIL.ImageDraw.Draw.multiline_textsize(text, font=None, spacing=0) + .. versionadded:: 4.2.0 + + :param features: A list of OpenType font features to be used during text + layout. This is usually used to turn on optional + font features that are not enabled by default, + for example 'dlig' or 'ss01', but can be also + used to turn off default font features for + example '-liga' to disable ligatures or '-kern' + to disable kerning. To get all supported + features, see + https://www.microsoft.com/typography/otspec/featurelist.htm + Requires libraqm. + + .. versionadded:: 4.2.0 + + +.. py:method:: PIL.ImageDraw.Draw.multiline_textsize(text, font=None, spacing=4, direction=None, + features=None) Return the size of the given string, in pixels. :param text: Text to be measured. :param font: An :py:class:`~PIL.ImageFont.ImageFont` instance. :param spacing: The number of pixels between lines. + :param direction: Direction of the text. It can be 'rtl' (right to + left), 'ltr' (left to right), 'ttb' (top to + bottom) or 'btt' (bottom to top). Requires + libraqm. + + .. versionadded:: 4.2.0 + + :param features: A list of OpenType font features to be used during text + layout. This is usually used to turn on optional + font features that are not enabled by default, + for example 'dlig' or 'ss01', but can be also + used to turn off default font features for + example '-liga' to disable ligatures or '-kern' + to disable kerning. To get all supported + features, see + https://www.microsoft.com/typography/otspec/featurelist.htm + Requires libraqm. + + .. versionadded:: 4.2.0 diff --git a/docs/reference/ImageFont.rst b/docs/reference/ImageFont.rst index d8790ca01..76fde44ff 100644 --- a/docs/reference/ImageFont.rst +++ b/docs/reference/ImageFont.rst @@ -63,14 +63,28 @@ Methods driver prefers; if empty, the renderer may return either mode. Note that the mode is always a string, to simplify C-level implementations. - :param direction: Direction of the text. It can be 'rtl', 'ltr', 'ttb' or 'btt'. Requires libraqm - :param features: A list of font feature to be used during text layout. This is - usually used to turn on optional font features that are not enabled by default, - for example 'dlig' or 'ss01', but can be also used to turn off default font - features for example '-liga' to disable ligatures or '-kern' to disable kerning. - To get all supported features, see https://www.microsoft.com/typography/otspec/featurelist.htm - Requires libraqm .. versionadded:: 1.1.5 + + :param direction: Direction of the text. It can be 'rtl' (right to + left), 'ltr' (left to right), 'ttb' (top to + bottom) or 'btt' (bottom to top). Requires + libraqm. + + .. versionadded:: 4.2.0 + + :param features: A list of OpenType font features to be used during text + layout. This is usually used to turn on optional + font features that are not enabled by default, + for example 'dlig' or 'ss01', but can be also + used to turn off default font features for + example '-liga' to disable ligatures or '-kern' + to disable kerning. To get all supported + features, see + https://www.microsoft.com/typography/otspec/featurelist.htm + Requires libraqm. + + .. versionadded:: 4.2.0 + :return: An internal PIL storage memory instance as defined by the :py:mod:`PIL.Image.core` interface module.