Commit e0bba322 authored by David Turner's avatar David Turner
Browse files

fixed the PSNames -> Unicode translation table

the Python script "glnames.py" was buggy and
lacked quite a few values in the "names_to_unicode"
table !!
parent 798e70e4
......@@ -1475,7 +1475,7 @@ def the_adobe_glyph_list():
def the_adobe_glyphs():
"""return the list of glyph names + unicode values"""
"""return the list of unicode values"""
lines = string.split( adobe_glyph_list, '\n' )
glyphs = []
......@@ -1531,11 +1531,14 @@ def dump_mac_indices( file ):
def dump_glyph_list( file, glyph_list, adobe_extra ):
write = file.write
name_list = []
write( " static const char* standard_glyph_names[] =\n" )
write( " {\n" )
for name in glyph_list:
write( ' "' + name + '",\n' )
name_list.append(name)
write( "\n" )
write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" )
......@@ -1543,6 +1546,7 @@ def dump_glyph_list( file, glyph_list, adobe_extra ):
for name in adobe_extra:
write( ' "' + name + '",\n' )
name_list.append(name)
write( "\n" )
write( "#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n" )
......@@ -1551,35 +1555,45 @@ def dump_glyph_list( file, glyph_list, adobe_extra ):
write( " };\n" )
write( "\n" )
write( "\n" )
return name_list
def dump_unicode_values( file, glyph_list ):
def dump_unicode_values( file, base_list, adobe_list ):
"""build the glyph names to unicode values table"""
write = file.write
adobe_list, uni_values = the_adobe_glyphs()
index_list = []
adobe_glyphs, uni_values = the_adobe_glyphs()
write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" )
write( "\n" )
write( " static const unsigned short names_to_unicode[" + \
repr( len( glyph_list ) + 1 ) + "] =\n" )
repr( len( base_list ) + len( adobe_list ) + 1 ) + "] =\n" )
write( " {\n" )
for name in glyph_list:
for name in base_list:
try:
index = adobe_list.index( name )
index_list.append( uni_values[index] )
index = adobe_glyphs.index( name )
write( " 0x" + uni_values[index] + ",\n" )
except:
index_list.append( 0 )
write( " 0,\n" )
write( "\n" )
write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" )
write( "\n" )
for name in adobe_list:
try:
index = adobe_glyphs.index( name )
write( " 0x" + uni_values[index] + ",\n" )
except:
write( " 0,\n" )
write( "\n" )
write( "#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n" )
write( " 0\n" )
write( " };\n" )
write( "\n" )
write( "#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n" )
write( "\n" )
write( "\n" )
......@@ -1617,11 +1631,11 @@ def main():
mac_list = count_extra_glyphs( mac_standard_names, t1_standard_strings )
count_mac = len( mac_list )
t1_bias = count_mac
glyph_list = mac_list + t1_standard_strings
base_list = mac_list + t1_standard_strings
# build adobe unicode index table & supplemental glyph names
adobe_list = the_adobe_glyph_list()
adobe_list = count_extra_glyphs( adobe_list, glyph_list )
adobe_list = count_extra_glyphs( adobe_list, base_list )
count_adobe = len( adobe_list )
write( "/***************************************************************************/\n" )
......@@ -1649,7 +1663,7 @@ def main():
write( "\n" )
# dump glyph list
dump_glyph_list( file, glyph_list, adobe_list )
name_list = dump_glyph_list( file, base_list, adobe_list )
# dump t1_standard_list
write( " static const char** t1_standard_glyphs = " \
......@@ -1661,19 +1675,22 @@ def main():
write( "\n" )
write( "#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n" )
write( "#define NUM_ADOBE_GLYPHS " + \
repr( len( glyph_list ) + len( adobe_list ) - t1_bias ) + "\n" )
repr( len( base_list ) + len( adobe_list ) - t1_bias ) + "\n" )
write( "#else\n" )
write( "#define NUM_ADOBE_GLYPHS " + \
repr( len( glyph_list ) - t1_bias ) + "\n" )
repr( len( base_list ) - t1_bias ) + "\n" )
write( "#endif\n" )
write( "\n" )
write( "\n" )
# dump mac indices table
dump_mac_indices( file )
# discard mac names from base list
base_list = base_list[t1_bias:]
# dump unicode values table
dump_unicode_values( file, glyph_list[t1_bias:] )
dump_unicode_values( file, base_list, adobe_list )
dump_encoding( file, "t1_standard_encoding", t1_standard_encoding )
dump_encoding( file, "t1_expert_encoding", t1_expert_encoding )
......
......@@ -830,9 +830,6 @@
/* a given size object. */
/* */
/* <Fields> */
/* pointSize :: The current point size in 26.6 points, where */
/* 1 point equals 1/72 inch. */
/* */
/* x_ppem :: The character width, expressed in integer pixels. */
/* This is the width of the EM square expressed in */
/* pixels, hence the term `ppem' (pixels per EM). */
......
......@@ -137,8 +137,7 @@
PS_UniMap* map2 = (PS_UniMap*)b;
return ( map1->unicode < map2->unicode ? -1 :
map1->unicode > map2->unicode ? 1 : 0 );
return ( map1->unicode - map2->unicode );
}
......
......@@ -1370,9 +1370,8 @@
};
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
static const unsigned short names_to_unicode[392] =
static const unsigned short names_to_unicode[1033] =
{
0,
0x0020,
......@@ -1765,10 +1764,655 @@
0,
0,
0,
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
0x01FC,
0x0102,
0xF6C9,
0x0391,
0x0386,
0x0100,
0x0104,
0x01FA,
0x0392,
0xF6CA,
0x0108,
0x010A,
0x03A7,
0x010E,
0x0110,
0xF6CB,
0xF6CC,
0xF6CD,
0x0114,
0x011A,
0x0116,
0x0112,
0x014A,
0x0118,
0x0395,
0x0388,
0x0397,
0x0389,
0x20AC,
0x0393,
0x01E6,
0x011C,
0x0122,
0x0120,
0xF6CE,
0x25CF,
0x25AA,
0x25AB,
0x25A1,
0x0126,
0x0124,
0xF6CF,
0x0132,
0x012C,
0x0130,
0x2111,
0x012A,
0x012E,
0x0399,
0x03AA,
0x038A,
0x0128,
0x0134,
0x039A,
0x0136,
0xF6BF,
0x0139,
0x039B,
0x013D,
0x013B,
0x013F,
0xF6D0,
0x039C,
0x0143,
0x0147,
0x0145,
0x039D,
0x014E,
0x01A0,
0x0150,
0x014C,
0x038F,
0x039F,
0x038C,
0x01FE,
0x03A6,
0x03A0,
0x03A8,
0x0154,
0x0158,
0x0156,
0x211C,
0x03A1,
0x250C,
0x2514,
0x2510,
0x2518,
0x253C,
0x252C,
0x2534,
0x251C,
0x2524,
0x2500,
0x2502,
0x2561,
0x2562,
0x2556,
0x2555,
0x2563,
0x2551,
0x2557,
0x255D,
0x255C,
0x255B,
0x255E,
0x255F,
0x255A,
0x2554,
0x2569,
0x2566,
0x2560,
0x2550,
0x256C,
0x2567,
0x2568,
0x2564,
0x2565,
0x2559,
0x2558,
0x2552,
0x2553,
0x256B,
0x256A,
0x015A,
0x015C,
0x0218,
0x03A3,
0x03A4,
0x0166,
0x0164,
0x0162,
0x0162,
0x0398,
0xF7FA,
0x016C,
0x01AF,
0x0170,
0x016A,
0x0172,
0x03A5,
0x03D2,
0x03AB,
0x038E,
0x016E,
0x0168,
0x1E82,
0x0174,
0x1E84,
0x1E80,
0x039E,
0x0176,
0x1EF2,
0x0179,
0x017B,
0x0396,
0x0103,
0x0301,
0x01FD,
0x2015,
0x0410,
0x0411,
0x0412,
0x0413,
0x0414,
0x0415,
0x0401,
0x0416,
0x0417,
0x0418,
0x0419,
0x041A,
0x041B,
0x041C,
0x041D,
0x041E,
0x041F,
0x0420,
0x0421,
0x0422,
0x0423,
0x0424,
0x0425,
0x0426,
0x0427,
0x0428,
0x0429,
0x042A,
0x042B,
0x042C,
0x042D,
0x042E,
0x042F,
0x0490,
0x0402,
0x0403,
0x0404,
0x0405,
0x0406,
0x0407,
0x0408,
0x0409,
0x040A,
0x040B,
0x040C,
0x040E,
0xF6C4,
0xF6C5,
0x0430,
0x0431,
0x0432,
0x0433,
0x0434,
0x0435,
0x0451,
0x0436,
0x0437,
0x0438,
0x0439,
0x043A,
0x043B,
0x043C,
0x043D,
0x043E,
0x043F,
0x0440,
0x0441,
0x0442,
0x0443,
0x0444,
0x0445,
0x0446,
0x0447,
0x0448,
0x0449,
0x044A,
0x044B,
0x044C,
0x044D,
0x044E,
0x044F,
0x0491,
0x0452,
0x0453,
0x0454,
0x0455,
0x0456,
0x0457,
0x0458,
0x0459,
0x045A,
0x045B,
0x045C,
0x045E,
0x040F,
0x0462,
0x0472,
0x0474,
0xF6C6,
0x045F,
0x0463,
0x0473,
0x0475,
0xF6C7,
0xF6C8,
0x04D9,
0x200E,
0x200F,
0x200D,
0x066A,
0x060C,
0x0660,
0x0661,
0x0662,
0x0663,
0x0664,
0x0665,
0x0666,
0x0667,
0x0668,
0x0669,
0x061B,
0x061F,
0x0621,
0x0622,
0x0623,
0x0624,
0x0625,
0x0626,
0x0627,
0x0628,
0x0629,
0x062A,
0x062B,
0x062C,
0x062D,
0x062E,
0x062F,
0x0630,
0x0631,
0x0632,
0x0633,
0x0634,
0x0635,
0x0636,
0x0637,
0x0638,
0x0639,
0x063A,
0x0640,
0x0641,
0x0642,
0x0643,
0x0644,
0x0645,
0x0646,
0x0648,
0x0649,
0x064A,
0x064B,
0x064C,
0x064D,
0x064E,
0x064F,
0x0650,
0x0651,
0x0652,
0x0647,
0x06A4,
0x067E,
0x0686,
0x0698,
0x06AF,
0x0679,
0x0688,
0x0691,
0x06BA,
0x06D2,
0x06D5,
0x20AA,
0x05BE,
0x05C3,
0x05D0,
0x05D1,
0x05D2,
0x05D3,
0x05D4,
0x05D5,
0x05D6,
0x05D7,
0x05D8,
0x05D9,
0x05DA,
0x05DB,
0x05DC,
0x05DD,
0x05DE,
0x05DF,
0x05E0,
0x05E1,
0x05E2,
0x05E3,
0x05E4,
0x05E5,
0x05E6,
0x05E7,
0x05E8,
0x05E9,
0x05EA,
0xFB2A,
0xFB2B,
0xFB4B,
0xFB1F,
0x05F0,
0x05F1,
0x05F2,
0xFB35,
0x05B4,
0x05B5,
0x05B6,
0x05BB,
0x05B8,
0x05B7,
0x05B0,
0x05B2,
0x05B1,
0x05B3,
0x05C2,
0x05C1,
0x05B9,
0x05BC,
0x05BD,
0x05BF,
0x05C0,
0x02BC,
0x2105,
0x2113,
0x2116,
0x202C,
0x202D,
0x202E,
0x200C,
0x066D,
0x02BD,
0x2135,
0x03B1,
0x03AC,
0x0101,
0x2220,
0x2329,
0x232A,
0x0387,
0x0105,
0x01FB,
0x2194,
0x21D4,
0x21D3,
0x21D0,
0x21D2,
0x21D1,
0x2193,
0xF8E7,
0x2190,
0x2192,
0x2191,
0x2195,
0x21A8,
0xF8E6,
0x2217,
0x03B2,
0x2588,
0xF8F4,
0xF8F3,
0xF8F2,
0xF8F1,
0xF8FE,
0xF8FD,
0xF8FC,
0xF8F0,
0xF8EF,
0xF8EE,
0xF8FB,
0xF8FA,
0xF8F9,
0x21B5,
0x0109,
0x010B,
0x03C7,
0x25CB,
0x2297,
0x2295,
0x2663,
0xF6C3,
0x2245,
0xF8E9,
0xF6D9,
0xF6D1,
0xF6D2,
0xF6D4,
0xF6D5,