The total width of badge.

        >>> badge = Badge('pylint', '5', font_name='DejaVu Sans,Verdana,Geneva,sans-serif',
        ...               font_size=11)
        >>> badge.badge_width
        91
170362
def badge_width(self):
        
        return self.get_text_width('   ' + ' ' * int(float(self.num_padding_chars) * 2.0)) \
            + self.label_width + self.value_width
580864
def sizeHint(self):
        
        width = max([self.fontMetrics().width(word) \
                        for word in self.model().words])
        width = width * 1.4  # FIXME bad hack. invent better formula
        width += 30  # margin

        # drawn with scrollbar without +2. I don't know why
        rowCount = min(self.model().rowCount(), self._MAX_VISIBLE_ROWS)
        height = self.sizeHintForRow(0) * (rowCount + 0.5)  # + 0.5 row margin

        return QSize(width, height)
973234
public float getWidth() {
    if (DocumentElement_Type.featOkTst && ((DocumentElement_Type)jcasType).casFeat_width == null)
      jcasType.jcas.throwFeatMissing("width", "ch.epfl.bbp.uima.types.DocumentElement");
    return jcasType.ll_cas.ll_getFloatValue(addr, ((DocumentElement_Type)jcasType).casFeatCode_width);}
614433
def bar(self, width, **_):
        
        return self.CHAR_LEFT_BORDER + self.CHAR_EMPTY * (width - self._width_offset) + self.CHAR_RIGHT_BORDER
584931
def size(self):
        
        (halfw, halfh) = self._halfdim
        if self.orientation in ["top", "bottom"]:
            return (halfw * 2., halfh * 2.)
        else:
            return (halfh * 2., halfw * 2.)
814526
def _visible_width(s):
    
    if isinstance(s, _text_type) or isinstance(s, _binary_type):
        return _max_line_width(_strip_invisible(s))
    else:
        return _max_line_width(_text_type(s))
1335591
def _parse_length(self, value, font_relative, callback, *args):
        ''''''
        if value.endswith('%'):
            frac = float(value[:-1])/100
            if font_relative:
                attrs = self._get_current_attributes()
                font_size = attrs.font.get_size() / pango.SCALE
                callback(frac*display_resolution*font_size, *args)
            else:
                ## CSS says "Percentage values: refer to width of the closest
                ##           block-level ancestor"
                ## This is difficult/impossible to implement, so we use
                ## textview width instead; a reasonable approximation..
                alloc = self.textview.get_allocation()
                self.__parse_length_frac_size_allocate(self.textview, alloc,
                                                       frac, callback, args)
                self.textview.connect("size-allocate",
                                      self.__parse_length_frac_size_allocate,
                                      frac, callback, args)

        elif value.endswith('pt'): # points
            callback(float(value[:-2])*display_resolution, *args)

        elif value.endswith('em'): # ems, the height of the element's font
            attrs = self._get_current_attributes()
            font_size = attrs.font.get_size() / pango.SCALE
            callback(float(value[:-2])*display_resolution*font_size, *args)

        elif value.endswith('ex'): # x-height, ~ the height of the letter 'x'
            ## FIXME: figure out how to calculate this correctly
            ##        for now 'em' size is used as approximation
            attrs = self._get_current_attributes()
            font_size = attrs.font.get_size() / pango.SCALE
            callback(float(value[:-2])*display_resolution*font_size, *args)

        elif value.endswith('px'): # pixels
            callback(int(value[:-2]), *args)

        else:
            warnings.warn("Unable to parse length value '%s'" % value)
29805
def _get_area(self):
        
        from fontTools.pens.areaPen import AreaPen
        pen = AreaPen(self.layer)
        self.draw(pen)
        return abs(pen.value)
271366
def line_width(line):
    
    if six.PY2:
        assert isinstance(line, unicode)
    _line = width_cal_preprocess(line)
    result = sum(map(get_char_width, _line))
    return result
1060158
def width(self, width=None):
        """"""

        if width is None:
            return self._width
        else:
            if not is_numeric(width):
                raise TypeError("width must be numeric, not '%s'" % str(width))
            self._width = width
814245
def bar(self, width, percent=0):
        
        width -= self._width_offset
        units = int(percent * 0.01 * width)
        if not units:
            return self.CHAR_LEFT_BORDER + self.CHAR_EMPTY * width + self.CHAR_RIGHT_BORDER

        final_bar = (
            self.CHAR_LEFT_BORDER +
            self.CHAR_FULL * (units - 1) +
            self.CHAR_LEADING +
            self.CHAR_EMPTY * (width - units) +
            self.CHAR_RIGHT_BORDER
        )
        return final_bar
337713
def calculate_width_content(width, border = False, margin = None, margin_left = None, margin_right = None, padding = None, padding_left = None, padding_right = None):
        
        if margin_left is None:
            margin_left = margin
        if margin_right is None:
            margin_right = margin
        if margin_left is not None:
            width -= int(margin_left)
        if margin_right is not None:
            width -= int(margin_right)
        if padding_left is None:
            padding_left = padding
        if padding_right is None:
            padding_right = padding
        if padding_left is not None:
            width -= int(padding_left)
        if padding_right is not None:
            width -= int(padding_right)
        if border:
            width -= 2
        return width if width > 0 else None
1353731
def calculate_width(font_size, text)
      return 0 if text.nil?
      @d.pointsize = font_size
      @d.font = @font if @font
      @d.get_type_metrics(@base_image, text.to_s).width
    end
1327436
def font_size
      return sz if sz
      font = styles.fonts[styles.cellXfs[style].fontId] || styles.fonts[0]
      (font.b || (defined?(@b) && @b)) ? (font.sz * 1.5) : font.sz
    end
408942
def string_width(string, font_size)
      font_scale = font_size / 10.0
      string.count(Worksheet::THIN_CHARS) * font_scale
    end
1206738
def _gate_width(self, gate):
        
        try:
            gates = self.settings['gates']
            gate_width = gates[gate.__class__.__name__]['width']
        except KeyError:
            gate_width = .5
        return gate_width
822406
def line_number_area_width(self):
        
        digits = 1
        count = max(1, self.editor.blockCount())
        while count >= 10:
            count /= 10
            digits += 1
        space = 5 + self.editor.fontMetrics().width("9") * digits
        return space