mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 02:16:19 +03:00
Note a Windows limit on opening fonts (#4020)
Note a Windows limit on opening fonts
This commit is contained in:
commit
a54beca914
|
@ -546,11 +546,20 @@ def truetype(font=None, size=10, index=0, encoding="", layout_engine=None):
|
||||||
This function loads a font object from the given file or file-like
|
This function loads a font object from the given file or file-like
|
||||||
object, and creates a font object for a font of the given size.
|
object, and creates a font object for a font of the given size.
|
||||||
|
|
||||||
|
Pillow uses FreeType to open font files. If you are opening many fonts
|
||||||
|
simultaneously on Windows, be aware that Windows limits the number of files
|
||||||
|
that can be open in C at once to 512. If you approach that limit, an
|
||||||
|
``OSError`` may be thrown, reporting that FreeType "cannot open resource".
|
||||||
|
|
||||||
This function requires the _imagingft service.
|
This function requires the _imagingft service.
|
||||||
|
|
||||||
:param font: A filename or file-like object containing a TrueType font.
|
:param font: A filename or file-like object containing a TrueType font.
|
||||||
Under Windows, if the file is not found in this filename,
|
If the file is not found in this filename, the loader may also
|
||||||
the loader also looks in Windows :file:`fonts/` directory.
|
search in other directories, such as the :file:`fonts/`
|
||||||
|
directory on Windows or :file:`/Library/Fonts/`,
|
||||||
|
:file:`/System/Library/Fonts/` and :file:`~/Library/Fonts/` on
|
||||||
|
macOS.
|
||||||
|
|
||||||
:param size: The requested size, in points.
|
:param size: The requested size, in points.
|
||||||
:param index: Which font face to load (default is first available face).
|
:param index: Which font face to load (default is first available face).
|
||||||
:param encoding: Which font encoding to use (default is Unicode). Common
|
:param encoding: Which font encoding to use (default is Unicode). Common
|
||||||
|
|
Loading…
Reference in New Issue
Block a user