'Return a unique id for the given font and character-code set.'

def _get_char_id(self, font, ccode):

    sfnt = font.get_sfnt()
    try:
        ps_name = sfnt[(1, 0, 0, 6)].decode(u'macroman')
    except KeyError:
        ps_name = sfnt[(3, 1, 1033, 6)].decode(u'utf-16be')
    char_id = urllib_quote((u'%s-%x' % (ps_name, ccode)))
    return char_id
