font

Module Contents

setFontFamilies(families[, save])

set the font families used by all widgets

fontFamilies(→ List[str])

Returns the font families used by all widgets

setFont(widget[, fontSize, weight])

set the font of widget

getFont([fontSize, weight])

create font

fontStyleSheet(font)

Returns the style sheet of font

setFontFamilies(families: List[str], save=False)

set the font families used by all widgets

Parameters

families: List[str]

font family names, the default value is [‘Segoe UI’, ‘Microsoft YaHei’, ‘PingFang SC’]

save: bool

whether to save the change to config file

fontFamilies() List[str]

Returns the font families used by all widgets

setFont(widget: PyQt5.QtWidgets.QWidget, fontSize=14, weight=QFont.Normal)

set the font of widget

Parameters

widget: QWidget

the widget to set font

fontSize: int

font pixel size

weight: QFont.Weight

font weight

getFont(fontSize=14, weight=QFont.Normal)

create font

Parameters

fontSize: int

font pixel size

weight: QFont.Weight

font weight

fontStyleSheet(font: PyQt5.QtGui.QFont)

Returns the style sheet of font