Ejemplo n.º 1
0
def encoding_status():
    content = open(AFM_DIR + 'Courier-Bold.afm').read()
    names = re.compile('; N ([a-zA-Z]+) ;')
    core_names = set(names.findall(content))
    encodings = ['windows-1250', 'windows-1251', 'windows-1252', 'windows-1253']
    for enc in encodings:
        for i in xrange(128,256):
            try:
                c = unicode(chr(i), enc)
                assert len(c) == 1
                codepoint = ord(c[0])
                name = glyphlist.unicode_to_glyph(codepoint)
                if name not in core_names:
                    print enc, name, "0x%x" % codepoint
            except UnicodeDecodeError, err:
                print enc, err
Ejemplo n.º 2
0
def encoding_status():
    content = open(AFM_DIR + 'Courier-Bold.afm').read()
    names = re.compile('; N ([a-zA-Z]+) ;')
    core_names = set(names.findall(content))
    encodings = [
        'windows-1250', 'windows-1251', 'windows-1252', 'windows-1253'
    ]
    for enc in encodings:
        for i in xrange(128, 256):
            try:
                c = unicode(chr(i), enc)
                assert len(c) == 1
                codepoint = ord(c[0])
                name = glyphlist.unicode_to_glyph(codepoint)
                if name not in core_names:
                    print enc, name, "0x%x" % codepoint
            except UnicodeDecodeError, err:
                print enc, err
Ejemplo n.º 3
0
def get_glyph_name(codept):
    try:
        return glyphlist.unicode_to_glyph(codept)
    except KeyError:
        return ".notdef"
Ejemplo n.º 4
0
def get_glyph_name(codept):
    try:
        return glyphlist.unicode_to_glyph(codept)
    except KeyError:
        return '.notdef'