'Return map of glyph_id -> coverage index. Map contains only those
glyph_ids that are covered by this table and that are present in
glyph_ids.'

def coverage_indices(self, glyph_ids):

    ans = OrderedDict()
    for gid in glyph_ids:
        if (self.format == 1):
            idx = self.glyph_ids_map.get(gid, None)
            if (idx is not None):
                ans[gid] = idx
        else:
            for (start, end, start_coverage_index) in self.ranges:
                if (start <= gid <= end):
                    ans[gid] = (start_coverage_index + (gid - start))
    return ans
