Update docs to reflect that font can be loaded from a stream, not just by filename

This commit is contained in:
Robin Norwood 2017-11-17 12:41:05 -06:00
parent c3d6831610
commit 8293fe0aa7

View File

@ -233,15 +233,16 @@ def load(filename):
def truetype(font=None, size=10, index=0, encoding="", def truetype(font=None, size=10, index=0, encoding="",
layout_engine=None): layout_engine=None):
""" """
Load a TrueType or OpenType font file, and create a font object. Load a TrueType or OpenType font from a file or stream, and create
This function loads a font object from the given file, and creates a font object.
a font object for a font of the given size. This function loads a font object from the given file or stream,
and creates a font object for a font of the given size.
This function requires the _imagingft service. This function requires the _imagingft service.
:param font: A truetype font file. Under Windows, if the file :param font: A filename or binary stream containing a TrueType font.
is not found in this filename, the loader also looks in Under Windows, if the file is not found in this filename,
Windows :file:`fonts/` directory. the loader also looks in Windows :file:`fonts/` directory.
: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