當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。