< prev index next >
src/java.desktop/share/native/libfreetype/src/type1/t1load.c
Print this page
*** 1505,1520 ****
return;
}
/* We need to `zero' out encoding_table.elements */
for ( n = 0; n < array_size; n++ )
! {
! char* notdef = (char *)".notdef";
!
!
! (void)T1_Add_Table( char_table, n, notdef, 8 );
! }
/* Now we need to read records of the form */
/* */
/* ... charcode /charname ... */
/* */
--- 1505,1515 ----
return;
}
/* We need to `zero' out encoding_table.elements */
for ( n = 0; n < array_size; n++ )
! (void)T1_Add_Table( char_table, n, ".notdef", 8 );
/* Now we need to read records of the form */
/* */
/* ... charcode /charname ... */
/* */
*** 2145,2155 ****
/* We take index 0 and add it to the end of the table(s) */
/* and add our own /.notdef glyph to index 0. */
/* 0 333 hsbw endchar */
FT_Byte notdef_glyph[] = { 0x8B, 0xF7, 0xE1, 0x0D, 0x0E };
- char* notdef_name = (char *)".notdef";
error = T1_Add_Table( swap_table, 0,
name_table->elements[0],
name_table->lengths [0] );
--- 2140,2149 ----
*** 2160,2170 ****
code_table->elements[0],
code_table->lengths [0] );
if ( error )
goto Fail;
! error = T1_Add_Table( name_table, 0, notdef_name, 8 );
if ( error )
goto Fail;
error = T1_Add_Table( code_table, 0, notdef_glyph, 5 );
--- 2154,2164 ----
code_table->elements[0],
code_table->lengths [0] );
if ( error )
goto Fail;
! error = T1_Add_Table( name_table, 0, ".notdef", 8 );
if ( error )
goto Fail;
error = T1_Add_Table( code_table, 0, notdef_glyph, 5 );
*** 2632,2642 ****
/* we must now build type1.encoding when we have a custom array */
if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
{
FT_Int charcode, idx, min_char, max_char;
- FT_Byte* glyph_name;
/* OK, we do the following: for each element in the encoding */
/* table, look up the index of the glyph having the same name */
/* the index is then stored in type1.encoding.char_index, and */
--- 2626,2635 ----
*** 2646,2676 ****
max_char = 0;
charcode = 0;
for ( ; charcode < loader.encoding_table.max_elems; charcode++ )
{
! FT_Byte* char_name;
type1->encoding.char_index[charcode] = 0;
! type1->encoding.char_name [charcode] = (char *)".notdef";
- char_name = loader.encoding_table.elements[charcode];
if ( char_name )
for ( idx = 0; idx < type1->num_glyphs; idx++ )
{
! glyph_name = (FT_Byte*)type1->glyph_names[idx];
! if ( ft_strcmp( (const char*)char_name,
! (const char*)glyph_name ) == 0 )
{
type1->encoding.char_index[charcode] = (FT_UShort)idx;
! type1->encoding.char_name [charcode] = (char*)glyph_name;
/* Change min/max encoded char only if glyph name is */
/* not /.notdef */
! if ( ft_strcmp( (const char*)".notdef",
! (const char*)glyph_name ) != 0 )
{
if ( charcode < min_char )
min_char = charcode;
if ( charcode >= max_char )
max_char = charcode + 1;
--- 2639,2669 ----
max_char = 0;
charcode = 0;
for ( ; charcode < loader.encoding_table.max_elems; charcode++ )
{
! const FT_String* char_name =
! (const FT_String*)loader.encoding_table.elements[charcode];
type1->encoding.char_index[charcode] = 0;
! type1->encoding.char_name [charcode] = ".notdef";
if ( char_name )
for ( idx = 0; idx < type1->num_glyphs; idx++ )
{
! const FT_String* glyph_name = type1->glyph_names[idx];
!
!
! if ( ft_strcmp( char_name, glyph_name ) == 0 )
{
type1->encoding.char_index[charcode] = (FT_UShort)idx;
! type1->encoding.char_name [charcode] = glyph_name;
/* Change min/max encoded char only if glyph name is */
/* not /.notdef */
! if ( ft_strcmp( ".notdef", glyph_name ) != 0 )
{
if ( charcode < min_char )
min_char = charcode;
if ( charcode >= max_char )
max_char = charcode + 1;
< prev index next >