load Function

Defined in pyglet.font

load(name=None, size=None, bold=False, italic=False, dpi=None)

Load a font for rendering.

Parameters:
  • name (str, or list of str) – Font family, for example, “Times New Roman”. If a list of names is provided, the first one matching a known font is used. If no font can be matched to the name(s), a default font is used. In pyglet 1.1, the name may be omitted.
  • size (float) – Size of the font, in points. The returned font may be an exact match or the closest available. In pyglet 1.1, the size may be omitted, and defaults to 12pt.
  • bold (bool) – If True, a bold variant is returned, if one exists for the given family and size.
  • italic (bool) – If True, an italic variant is returned, if one exists for the given family and size.
  • dpi (float) – The assumed resolution of the display device, for the purposes of determining the pixel size of the font. Defaults to 96.
Return type:

Font

Previous topic

have_font Function

Next topic

pyglet.gl