*** freetype-2.1.7/src/cff/cffload.c Wed Oct 29 13:43:51 2003 --- freetype-2.1.7a/src/cff/cffload.c Tue Mar 16 13:25:43 2004 *************** *** 2117,2122 **** --- 2117,2147 ---- if ( error ) goto Exit; + /* read the charstrings index now */ + if ( dict->charstrings_offset == 0 ) + { + FT_ERROR(( "cff_font_load: no charstrings offset!\n" )); + error = CFF_Err_Unknown_File_Format; + goto Exit; + } + + if ( FT_STREAM_SEEK( base_offset + dict->charstrings_offset ) ) + goto Exit; + + error = cff_new_index( &font->charstrings_index, stream, 0 ); + if ( error ) + goto Exit; + + /* explicit the global subrs */ + font->num_global_subrs = font->global_subrs_index.count; + font->num_glyphs = font->charstrings_index.count; + + error = cff_index_get_pointers( &font->global_subrs_index, + &font->global_subrs ) ; + + if ( error ) + goto Exit; + /* now, check for a CID font */ if ( dict->cid_registry ) { *************** *** 2161,2167 **** /* now load the FD Select array */ error = CFF_Load_FD_Select( &font->fd_select, ! (FT_UInt)dict->cid_count, stream, base_offset + dict->cid_fd_select_offset ); --- 2186,2192 ---- /* now load the FD Select array */ error = CFF_Load_FD_Select( &font->fd_select, ! font->num_glyphs, stream, base_offset + dict->cid_fd_select_offset ); *************** *** 2174,2204 **** else font->num_subfonts = 0; - /* read the charstrings index now */ - if ( dict->charstrings_offset == 0 ) - { - FT_ERROR(( "cff_font_load: no charstrings offset!\n" )); - error = CFF_Err_Unknown_File_Format; - goto Exit; - } - - if ( FT_STREAM_SEEK( base_offset + dict->charstrings_offset ) ) - goto Exit; - - error = cff_new_index( &font->charstrings_index, stream, 0 ); - if ( error ) - goto Exit; - - /* explicit the global subrs */ - font->num_global_subrs = font->global_subrs_index.count; - font->num_glyphs = font->charstrings_index.count; - - error = cff_index_get_pointers( &font->global_subrs_index, - &font->global_subrs ) ; - - if ( error ) - goto Exit; - /* read the Charset and Encoding tables when available */ if ( font->num_glyphs > 0 ) { --- 2199,2204 ----