Skip to content

Commit 42a5a74

Browse files
committed
Note to Windows users that FreeType will keep the font file open
1 parent 3b0f046 commit 42a5a74

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/PIL/ImageFont.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,10 @@ def truetype(font=None, size=10, index=0, encoding="", layout_engine=None):
906906
This function loads a font object from the given file or file-like
907907
object, and creates a font object for a font of the given size.
908908
909-
Pillow uses FreeType to open font files. If you are opening many fonts
910-
simultaneously on Windows, be aware that Windows limits the number of files
911-
that can be open in C at once to 512. If you approach that limit, an
909+
Pillow uses FreeType to open font files. On Windows, be aware that FreeType
910+
will keep the file open as long as the FreeTypeFont object exists. Windows
911+
limits the number of files that can be open in C at once to 512, so if many
912+
fonts are opened simultaneously and that limit is approached, an
912913
``OSError`` may be thrown, reporting that FreeType "cannot open resource".
913914
914915
This function requires the _imagingft service.

0 commit comments

Comments
 (0)