Skip to content

Commit 952711a

Browse files
committed
Added release notes
1 parent 1200dd4 commit 952711a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/releasenotes/12.1.0.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ TODO
4141
API additions
4242
=============
4343

44+
FreeTypeFont.has_characters
45+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
46+
47+
``ImageFont.FreeTypeFont`` has a new method for checking whether characters are present
48+
in the font or not. :py:meth:`.ImageFont.FreeTypeFont.has_characters` will return
49+
``True`` if all of the characters in the given string are available::
50+
51+
from PIL import ImageFont
52+
font = ImageFont.truetype("Tests/fonts/FreeMono.ttf")
53+
font.has_characters("Test") # True
54+
font.has_characters(b"Test") # True
55+
font.has_characters("\u2022") # True
56+
font.has_characters("\u0000") # False
57+
4458
Specify window in ImageGrab on macOS
4559
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4660

0 commit comments

Comments
 (0)