'Update this table to contain pointers only to the glyphs in
resolved_glyph_map which must be a map of glyph_ids to (offset, sz)'

def subset(self, resolved_glyph_map):

    self.offset_map = [0 for i in self.offset_map]
    glyphs = [(glyph_id, x[0], x[1]) for (glyph_id, x) in resolved_glyph_map.iteritems()]
    glyphs.sort(key=itemgetter(1))
    for (glyph_id, offset, sz) in glyphs:
        self.offset_map[glyph_id] = offset
        self.offset_map[(glyph_id + 1)] = (offset + sz)
    for i in xrange(1, len(self.offset_map)):
        if (self.offset_map[i] == 0):
            self.offset_map[i] = self.offset_map[(i - 1)]
    vals = self.offset_map
    if (self.fmt == u'H'):
        vals = [(i // 2) for i in self.offset_map]
    self.raw = pack((u'>%d%s' % (len(vals), self.fmt)).encode(u'ascii'), *vals)
