'Return the advance widths (in pixels) for all glyphs corresponding to
the characters in string at the specified pixel_size and stretch factor.'

def advance_widths(self, string, pixel_size=12.0, stretch=1.0):

    if (not isinstance(string, type(u''))):
        raise ValueError(u'Must    supply    a    unicode    object')
    chars = tuple(map(ord, string))
    cmap = self.cmap.get_character_map(chars)
    glyph_ids = (cmap[c] for c in chars)
    pixel_size_x = (stretch * pixel_size)
    xscale = (pixel_size_x / self.units_per_em)
    return tuple(((i * xscale) for i in self.glyph_widths(glyph_ids)))
