예제 #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
예제 #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
예제 #3
0
파일: encdiff2.py 프로젝트: mkawserm/jagpdf
def get_glyph_name(codept):
    try:
        return glyphlist.unicode_to_glyph(codept)
    except KeyError:
        return ".notdef"
예제 #4
0
파일: encdiff2.py 프로젝트: watmough/jagpdf
def get_glyph_name(codept):
    try:
        return glyphlist.unicode_to_glyph(codept)
    except KeyError:
        return '.notdef'