add release notes for text rendering improvements

(cherry picked from commit 1e9dfb5b7c9fc80f40544260286c0c5955f6a88e)
This commit is contained in:
nulano 2020-10-12 00:10:26 +01:00
parent 9a93f6ee45
commit 3de972cc3e

View File

@ -41,6 +41,20 @@ Removed Use instead
API Changes
===========
ImageDraw.text: stroke_width
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fixed issue where passing ``stroke_width`` with a non-zero value
to :py:meth:`.ImageDraw.text` would cause the text to be offset by that amount.
ImageDraw.text: anchor
^^^^^^^^^^^^^^^^^^^^^^
The ``anchor`` parameter of :py:meth:`.ImageDraw.text` has been implemented.
Use this parameter to change the position of text relative to the
specified ``xy`` point. See :ref:`text-anchors` for details.
Add MIME type to PsdImagePlugin
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -86,9 +100,52 @@ A new method :py:meth:`.ImageDraw.regular_polygon`, draws a regular polygon of `
For example ``draw.regular_polygon(((100, 100), 50), 5)``
draws a pentagon centered at the point ``(100, 100)`` with a polygon radius of ``50``.
ImageDraw.text: embedded_color
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The methods :py:meth:`.ImageDraw.text` and :py:meth:`.ImageDraw.multiline_text`
now support fonts with embedded color data.
To render text with embedded color data, use the parameter ``embedded_color=True``.
Support for CBDT fonts requires FreeType 2.5 compiled with libpng.
Support for COLR fonts requires FreeType 2.10.
SBIX and SVG fonts are not yet supported.
ImageDraw.textlength
^^^^^^^^^^^^^^^^^^^^
Two new methods :py:meth:`.ImageDraw.textlength` and :py:meth:`.FreeTypeFont.getlength`
were added, returning the exact advance length of text with 1/64 pixel precision.
These can be used for word-wrapping or rendering text in parts.
ImageDraw.textbbox
^^^^^^^^^^^^^^^^^^
Three new methods :py:meth:`.ImageDraw.textbbox`, :py:meth:`.ImageDraw.multiline_textbbox`,
and :py:meth:`.FreeTypeFont.getbbox` return the bounding box of rendered text.
These functions accept an ``anchor`` parameter, see :ref:`text-anchors` for details.
Security
========
TODO
Other Changes
=============
ImageDraw.text and ImageDraw.multiline_text
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fixed multiple issues in methods :py:meth:`.ImageDraw.text` and :py:meth:`.ImageDraw.multiline_text`
sometimes causing unexpected text alignment issues.
The ``align`` parameter of :py:meth:`.ImageDraw.multiline_text` now gives better results in some cases.
TrueType fonts with embedded bitmaps are now supported.
Error for large BMP files
^^^^^^^^^^^^^^^^^^^^^^^^^