Python pango.WEIGHT_NORMAL Examples

The following are 4 code examples of pango.WEIGHT_NORMAL(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pango , or try the search function .
Example #1
Source File: label.py    From openxenmanager with GNU General Public License v2.0 6 votes vote down vote up
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") 
Example #2
Source File: create_image.py    From nototools with Apache License 2.0 5 votes vote down vote up
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 
Example #3
Source File: create_image.py    From nototools with Apache License 2.0 5 votes vote down vote up
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) 
Example #4
Source File: label.py    From openxenmanager with GNU General Public License v2.0 5 votes vote down vote up
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