FontDescription

Qualified name: manimpango.fonts.FontDescription

class FontDescription(family=None, size=None, style=None, weight=None, variant=None)

A FontDescription describes a font.

This describes the characteristics of a font to load.

Parameters
_font_desc

Reference to the C-implementation of font description.

Type

manimpango.fonts._font_desc._FontDescription

Methods

from_string

Parse a string and form FontDescription from it.

property family: str

The family name of the font.

The family name represents a family of related font styles, and will resolve to a particular family. It is also possible to use a comma separated list of family names for this field.

classmethod from_string(string)

Parse a string and form FontDescription from it.

See https://docs.gtk.org/Pango/type_func.FontDescription.from_string.html#description for the syntax of the string.

Parameters

string (str) – The string to be parsed.

Returns

The FontDescription that is based on the string.

Return type

FontDescription

property size: int

The size of the font of the text.

property style: Style

The style of the font of the text.

It should be one of Style. Most fonts will either have a italic style or an oblique style, but not both, and font matching in Pango will match italic specifications with oblique fonts and vice-versa if an exact match is not found.

property variant

The variant of the font of the text.

Should be one of Variant.

property weight: Weight

The weight of the font of the text.

The weight field specifies how bold or light the font should be. Should be one of Weight.