mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-17 18:54:46 +03:00
Document complex text layout features.
This commit is contained in:
parent
8b3ed968c4
commit
228af633b2
|
@ -170,6 +170,8 @@ Many of Pillow's features require external libraries:
|
||||||
* Windows support: Libimagequant requires VS2013/MSVC 18 to compile,
|
* Windows support: Libimagequant requires VS2013/MSVC 18 to compile,
|
||||||
so it is unlikely to work with any Python prior to 3.5 on Windows.
|
so it is unlikely to work with any Python prior to 3.5 on Windows.
|
||||||
|
|
||||||
|
* **libraqm** provides complex text layout support.
|
||||||
|
|
||||||
Once you have installed the prerequisites, run::
|
Once you have installed the prerequisites, run::
|
||||||
|
|
||||||
$ pip install Pillow
|
$ pip install Pillow
|
||||||
|
@ -222,7 +224,6 @@ Build Options
|
||||||
library search process to dump all paths searched for and found to
|
library search process to dump all paths searched for and found to
|
||||||
stdout.
|
stdout.
|
||||||
|
|
||||||
|
|
||||||
Sample Usage::
|
Sample Usage::
|
||||||
|
|
||||||
$ MAX_CONCURRENCY=1 python setup.py build_ext --enable-[feature] install
|
$ MAX_CONCURRENCY=1 python setup.py build_ext --enable-[feature] install
|
||||||
|
|
|
@ -227,7 +227,7 @@ Methods
|
||||||
|
|
||||||
Draw a shape.
|
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.
|
Draws the string at the given position.
|
||||||
|
|
||||||
|
@ -240,9 +240,11 @@ Methods
|
||||||
the number of pixels between lines.
|
the number of pixels between lines.
|
||||||
:param align: If the text is passed on to multiline_text(),
|
:param align: If the text is passed on to multiline_text(),
|
||||||
"left", "center" or "right".
|
"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.
|
Draws the string at the given position.
|
||||||
|
|
||||||
|
@ -252,6 +254,8 @@ Methods
|
||||||
:param font: An :py:class:`~PIL.ImageFont.ImageFont` instance.
|
:param font: An :py:class:`~PIL.ImageFont.ImageFont` instance.
|
||||||
:param spacing: The number of pixels between lines.
|
:param spacing: The number of pixels between lines.
|
||||||
:param align: "left", "center" or "right".
|
: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)
|
.. py:method:: PIL.ImageDraw.Draw.textsize(text, font=None, spacing=0)
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ Methods
|
||||||
|
|
||||||
:return: (width, height)
|
: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.
|
Create a bitmap for the text.
|
||||||
|
|
||||||
|
@ -63,6 +63,8 @@ Methods
|
||||||
driver prefers; if empty, the renderer may return either
|
driver prefers; if empty, the renderer may return either
|
||||||
mode. Note that the mode is always a string, to simplify
|
mode. Note that the mode is always a string, to simplify
|
||||||
C-level implementations.
|
C-level implementations.
|
||||||
|
:param direction: Direction of the text.
|
||||||
|
:param features: A list of font features used for text layout.
|
||||||
|
|
||||||
.. versionadded:: 1.1.5
|
.. versionadded:: 1.1.5
|
||||||
:return: An internal PIL storage memory instance as defined by the
|
:return: An internal PIL storage memory instance as defined by the
|
||||||
|
|
Loading…
Reference in New Issue
Block a user