From 647af0d62572cf7b5d3bf88a7c9674232e0c69c1 Mon Sep 17 00:00:00 2001 From: shamsa Date: Wed, 3 Feb 2016 14:50:46 +0400 Subject: [PATCH] Document complex text layout features. --- docs/installation.rst | 6 ++++-- docs/reference/ImageDraw.rst | 10 +++++++--- docs/reference/ImageFont.rst | 4 +++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 4d636d4a8..2ec18501a 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -138,6 +138,8 @@ Many of Pillow's features require external libraries: * Pillow does **not** support the earlier **1.5** series which ships with Ubuntu and Debian. +* **libraqm** provides complex text layout support. + Once you have installed the prerequisites, run:: $ pip install Pillow @@ -168,14 +170,14 @@ Build Options * Build flags: ``--disable-zlib``, ``--disable-jpeg``, ``--disable-tiff``, ``--disable-freetype``, ``--disable-tcl``, - ``--disable-tk``, ``--disable-lcms``, ``--disable-webp``, + ``--disable-tk``, ``--disable-lcms``, ``--disable-raqm``, ``--disable-webp``, ``--disable-webpmux``, ``--disable-jpeg2000``. Disable building the corresponding feature even if the development libraries are present on the building machine. * Build flags: ``--enable-zlib``, ``--enable-jpeg``, ``--enable-tiff``, ``--enable-freetype``, ``--enable-tcl``, - ``--enable-tk``, ``--enable-lcms``, ``--enable-webp``, + ``--enable-tk``, ``--enable-lcms``, ``--enable-raqm``, ``--enable-webp``, ``--enable-webpmux``, ``--enable-jpeg2000``. Require that the corresponding feature is built. The build will raise an exception if the libraries are not found. Webpmux (WebP metadata) relies on WebP diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst index 842407c90..6e379475b 100644 --- a/docs/reference/ImageDraw.rst +++ b/docs/reference/ImageDraw.rst @@ -227,7 +227,7 @@ Methods Draw a shape. -.. py:method:: PIL.ImageDraw.Draw.text(xy, text, fill=None, font=None, anchor=None, spacing=0, align="left") +.. py:method:: PIL.ImageDraw.Draw.text(xy, text, fill=None, font=None, anchor=None, spacing=0, align="left", direction=None, features=None) Draws the string at the given position. @@ -240,9 +240,11 @@ 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. + :param features: A list of font features used for text layout. For example, 'ligature, kerning, Medial ...etc. - -.. py:method:: PIL.ImageDraw.Draw.multiline_text(xy, text, fill=None, font=None, anchor=None, spacing=0, align="left") +.. py:method:: PIL.ImageDraw.Draw.multiline_text(xy, text, fill=None, font=None, anchor=None, spacing=0, align="left", + direction=None, features=[]) Draws the string at the given position. @@ -252,6 +254,8 @@ 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. + :param features: Font features used for text layout. .. py:method:: PIL.ImageDraw.Draw.textsize(text, font=None, spacing=0) diff --git a/docs/reference/ImageFont.rst b/docs/reference/ImageFont.rst index 166d977a6..40e7d7f46 100644 --- a/docs/reference/ImageFont.rst +++ b/docs/reference/ImageFont.rst @@ -51,7 +51,7 @@ Methods :return: (width, height) -.. py:method:: PIL.ImageFont.ImageFont.getmask(text, mode='') +.. py:method:: PIL.ImageFont.ImageFont.getmask(text, mode='', direction=None, features=[]) Create a bitmap for the text. @@ -63,6 +63,8 @@ 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. + :param features: A list of font features used for text layout. .. versionadded:: 1.1.5 :return: An internal PIL storage memory instance as defined by the