10.8. font#

class itom.font(family, pointSize=0, weight=-1, italic=False)#

Creates a font object.

This class is a wrapper for the class QFont of the Qt framework. It provides possibilities for creating a font type.

Parameters:
familystr

The family name may optionally also include a foundry name, e.g. “Helvetica [Cronyx]”. If the family is available from more than one foundry and the foundry isn’t specified, an arbitrary foundry is chosen. If the family isn’t available a family will be set using a best-matching algorithm.

pointSizeint, optional

If pointSize is zero or negative, the point size of the font is set to a system-dependent default value. Generally, this is 12 points.

weightint, optional

Weighting scale from 0 to 99, e.g. font.Light, font.Normal (default), font.DemiBold, font.Bold, font.Black.

italicbool, optional

Defines if font is italic or not (default)

static installedFontFamilies() List[str]#

Returns a list of all installed font families.

Returns:
list of str

list of the names of all installed font families

static isFamilyInstalled(family) bool#

Checks if the given font family is installed on this computer.

Parameters:
familystr

The name of the font family that should be checked

Returns:
installedbool

True if family is installed, else False.

Black = 87#
Bold = 75#
DemiBold = 63#
Light = 25#
Normal = 50#
family#

str : gets / sets the family name of the font.

The name is case insensitive. It may optionally also include a foundry name, e.g. “Helvetica [Cronyx]”. If the family is available from more than one foundry and the foundry isn’t specified, an arbitrary foundry is chosen. If the family isn’t available a family will be set using a font matching algorithm.

italic#

bool : gets or sets the italic attribute of the font.

pointSize#

int : gets or sets the point size (> 0) of the font.

strikeOut#

bool : gets or sets the strikeout attribute of the font.

underline#

bool : gets or sets the underline attribute of the font.

weight#

int : gets or sets the weight of the font.

This should be one of the constant values font.Light, font.Normal, font.DemiBold, font.Bold, font.Black enumeration or any value in the range [0, 99].