本文整理汇总了Python中pango.WEIGHT_BOLD属性的典型用法代码示例。如果您正苦于以下问题:Python pango.WEIGHT_BOLD属性的具体用法?Python pango.WEIGHT_BOLD怎么用?Python pango.WEIGHT_BOLD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类pango
的用法示例。
在下文中一共展示了pango.WEIGHT_BOLD属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_weight
# 需要导入模块: import pango [as 别名]
# 或者: from pango import WEIGHT_BOLD [as 别名]
def set_weight(self, weight):
"""
Set the font weight. weight has to be one of the following:
- label.WEIGHT_ULTRALIGHT
- label.WEIGHT_LIGHT
- label.WEIGHT_NORMAL
- label.WEIGHT_BOLD
- label.WEIGHT_ULTRABOLD
- label.WEIGHT_HEAVY
@param weight: the font weight
@type weight: one of the constants above.
"""
self.set_property("weight", weight)
self.emit("appearance_changed")
示例2: __init__
# 需要导入模块: import pango [as 别名]
# 或者: from pango import WEIGHT_BOLD [as 别名]
def __init__(self, text=""):
label.Label.__init__(self, (0, 0), text, weight=pango.WEIGHT_BOLD, anchor=label.ANCHOR_TOP_CENTER, fixed=True)
示例3: _font_setup
# 需要导入模块: import pango [as 别名]
# 或者: from pango import WEIGHT_BOLD [as 别名]
def _font_setup(self):
for name, style in self.config.get('font_styles', {}).iteritems():
pfd = pango.FontDescription()
pfd.set_family(style.get('family', 'normal'))
pfd.set_size(style.get('points', 12) * pango.SCALE)
if style.get('italic'): pfd.set_style(pango.STYLE_ITALIC)
if style.get('bold'): pfd.set_weight(pango.WEIGHT_BOLD)
self.font_styles[name] = pfd