def __init__(self, brown_object, family_name, size, weight, italic):
"""
Args:
brown_object (Brush): The object this interface belongs to
family_name (str): The name of the font family
size (Unit): The size of the font
weight (int or None): The font weight. If `None`,
a normal weight will be used.
italic (bool): Italicized or not
"""
super().__init__(brown_object)
self.family_name = family_name
self.size = size
self.weight = weight
self.italic = italic
self.qt_object = QtGui.QFont(
self.family_name,
GraphicUnit(self.size).value,
self.weight if self.weight is not None else -1,
self.italic)
self._qt_font_info_object = QtGui.QFontInfo(self.qt_object)
self._qt_font_metrics_object = QtGui.QFontMetricsF(
self.qt_object,
brown._app_interface.view)
######## PUBLIC PROPERTIES ########
评论列表
文章目录