Index: z1load.c =================================================================== RCS file: /cvsroot/freetype2/src/type1z/z1load.c,v retrieving revision 1.23 diff -u -r1.23 z1load.c --- z1load.c 2000/10/15 08:53:27 1.23 +++ z1load.c 2000/10/16 02:36:09 @@ -969,6 +969,13 @@ return; } + /* We need to `zero' out encoding_table.elements */ + for ( n = 0 ; n < count ; n++ ) + { + char *notdef = ".notdef"; + Z1_Add_Table( char_table, n, notdef, 8 ); + } + /* Now, we will need to read a record of the form */ /* ... charcode /charname ... for each entry in our table */ /* */ @@ -1539,7 +1546,7 @@ /* array.. */ if ( type1->encoding_type == t1_encoding_array ) { - FT_Int charcode, index, min_char, max_char; + FT_Int charcode, index, notdef_index, min_char, max_char; FT_Byte* char_name; FT_Byte* glyph_name; @@ -1552,10 +1559,23 @@ min_char = +32000; max_char = -32000; + /* Find the index of the /.notdef glyph */ + notdef_index = 0; + for ( index = 0; index < type1->num_glyphs; index++ ) + { + glyph_name = (FT_Byte*)type1->glyph_names[index]; + if ( strcmp( (const char*)".notdef", + (const char*)glyph_name ) == 0 ) + { + notdef_index = index; + break; + } + } + charcode = 0; for ( ; charcode < loader.encoding_table.max_elems; charcode++ ) { - type1->encoding.char_index[charcode] = 0; + type1->encoding.char_index[charcode] = notdef_index; type1->encoding.char_name [charcode] = (char *)".notdef"; char_name = loader.encoding_table.elements[charcode]; @@ -1569,8 +1589,14 @@ type1->encoding.char_index[charcode] = index; type1->encoding.char_name [charcode] = (char*)glyph_name; - if (charcode < min_char) min_char = charcode; - if (charcode > max_char) max_char = charcode; + /* Change min/max encoded char only if glyph name is */ + /* not /.notdef */ + if ( strcmp( (const char*)".notdef", + (const char*)glyph_name ) != 0 ) + { + if (charcode < min_char) min_char = charcode; + if (charcode > max_char) max_char = charcode; + } break; } }