当前位置: 首页>>代码示例>>Python>>正文


Python pango.WEIGHT_NORMAL属性代码示例

本文整理汇总了Python中pango.WEIGHT_NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Python pango.WEIGHT_NORMAL属性的具体用法?Python pango.WEIGHT_NORMAL怎么用?Python pango.WEIGHT_NORMAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在pango的用法示例。


在下文中一共展示了pango.WEIGHT_NORMAL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: set_weight

# 需要导入模块: import pango [as 别名]
# 或者: from pango import WEIGHT_NORMAL [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") 
开发者ID:OpenXenManager,项目名称:openxenmanager,代码行数:18,代码来源:label.py

示例2: __init__

# 需要导入模块: import pango [as 别名]
# 或者: from pango import WEIGHT_NORMAL [as 别名]
def __init__(
        self,
        family="Noto Sans",
        language=None,
        rtl=False,
        vertical=False,
        width=1370,
        font_size=32,
        line_spacing=50,
        weight=pango.WEIGHT_NORMAL,
        style=pango.STYLE_NORMAL,
        stretch=pango.STRETCH_NORMAL,
        maxheight=0,
        horiz_margin=0,
    ):
        self.family = family
        self.language = language
        self.rtl = rtl
        self.vertical = vertical
        self.width = width
        self.font_size = font_size
        self.line_spacing = line_spacing
        self.weight = weight
        self.style = style
        self.stretch = stretch
        self.maxheight = maxheight
        self.horiz_margin = horiz_margin 
开发者ID:googlefonts,项目名称:nototools,代码行数:29,代码来源:create_image.py

示例3: _get_weight

# 需要导入模块: import pango [as 别名]
# 或者: from pango import WEIGHT_NORMAL [as 别名]
def _get_weight(weight_name):
    if not weight_name:
        return pango.WEIGHT_NORMAL
    if isinstance(weight_name, pango.Weight) or isinstance(weight_name, int):
        return weight_name
    if not isinstance(weight_name, basestring):
        raise ValueError("unexpected weight name type (%s)", type(weight_name))
    if weight_name not in _weight_map:
        raise ValueError(
            "could not recognize weight '%s'\naccepted values are %s"
            % (weight_name, ", ".join(sorted(_weight_map.keys())))
        )
    return _weight_map.get(weight_name) 
开发者ID:googlefonts,项目名称:nototools,代码行数:15,代码来源:create_image.py

示例4: __init__

# 需要导入模块: import pango [as 别名]
# 或者: from pango import WEIGHT_NORMAL [as 别名]
def __init__(self, position, text, size=None,
                    slant=pango.STYLE_NORMAL,
                    weight=pango.WEIGHT_NORMAL,
                    underline=pango.UNDERLINE_NONE,
                    anchor=ANCHOR_BOTTOM_LEFT, max_width=99999,
                    fixed=False):
        ChartObject.__init__(self)
        self._position = position
        self._text = text
        self._size = size
        self._slant = slant
        self._weight = weight
        self._underline = underline
        self._anchor = anchor
        self._rotation = 0
        self._color = gtk.gdk.Color()
        self._max_width = max_width
        self._fixed = fixed
        self._wrap = True
        
        self._real_dimensions = (0, 0)
        self._real_position = (0, 0)
        self._line_count = 1
        
        self._context = None
        self._layout = None 
开发者ID:OpenXenManager,项目名称:openxenmanager,代码行数:28,代码来源:label.py


注:本文中的pango.WEIGHT_NORMAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。