OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* sfobjs.c */ | 3 /* sfobjs.c */ |
4 /* */ | 4 /* */ |
5 /* SFNT object management (base). */ | 5 /* SFNT object management (base). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 1996-2008, 2010-2011 by */ | 7 /* Copyright 1996-2008, 2010-2011 by */ |
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 /* */ | 9 /* */ |
10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 if ( FT_READ_ULONG( tag ) ) | 370 if ( FT_READ_ULONG( tag ) ) |
371 return error; | 371 return error; |
372 | 372 |
373 if ( tag != 0x00010000UL && | 373 if ( tag != 0x00010000UL && |
374 tag != TTAG_ttcf && | 374 tag != TTAG_ttcf && |
375 tag != TTAG_OTTO && | 375 tag != TTAG_OTTO && |
376 tag != TTAG_true && | 376 tag != TTAG_true && |
377 tag != TTAG_typ1 && | 377 tag != TTAG_typ1 && |
378 tag != 0x00020000UL ) | 378 tag != 0x00020000UL ) |
| 379 { |
| 380 FT_TRACE2(( " not a font using the SFNT container format\n" )); |
379 return SFNT_Err_Unknown_File_Format; | 381 return SFNT_Err_Unknown_File_Format; |
| 382 } |
380 | 383 |
381 face->ttc_header.tag = TTAG_ttcf; | 384 face->ttc_header.tag = TTAG_ttcf; |
382 | 385 |
383 if ( tag == TTAG_ttcf ) | 386 if ( tag == TTAG_ttcf ) |
384 { | 387 { |
385 FT_Int n; | 388 FT_Int n; |
386 | 389 |
387 | 390 |
388 FT_TRACE3(( "sfnt_open_font: file is a collection\n" )); | 391 FT_TRACE3(( "sfnt_open_font: file is a collection\n" )); |
389 | 392 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 /* for now, parameters are unused */ | 448 /* for now, parameters are unused */ |
446 FT_UNUSED( num_params ); | 449 FT_UNUSED( num_params ); |
447 FT_UNUSED( params ); | 450 FT_UNUSED( params ); |
448 | 451 |
449 | 452 |
450 sfnt = (SFNT_Service)face->sfnt; | 453 sfnt = (SFNT_Service)face->sfnt; |
451 if ( !sfnt ) | 454 if ( !sfnt ) |
452 { | 455 { |
453 sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" ); | 456 sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" ); |
454 if ( !sfnt ) | 457 if ( !sfnt ) |
455 return SFNT_Err_Invalid_File_Format; | 458 { |
| 459 FT_ERROR(( "sfnt_init_face: cannot access `sfnt' module\n" )); |
| 460 return SFNT_Err_Missing_Module; |
| 461 } |
456 | 462 |
457 face->sfnt = sfnt; | 463 face->sfnt = sfnt; |
458 face->goto_table = sfnt->goto_table; | 464 face->goto_table = sfnt->goto_table; |
459 } | 465 } |
460 | 466 |
461 FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS ); | 467 FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS ); |
462 | 468 |
| 469 FT_TRACE2(( "SFNT driver\n" )); |
| 470 |
463 error = sfnt_open_font( stream, face ); | 471 error = sfnt_open_font( stream, face ); |
464 if ( error ) | 472 if ( error ) |
465 return error; | 473 return error; |
466 | 474 |
467 FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_index )); | 475 FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_index )); |
468 | 476 |
469 if ( face_index < 0 ) | 477 if ( face_index < 0 ) |
470 face_index = 0; | 478 face_index = 0; |
471 | 479 |
472 if ( face_index >= face->ttc_header.count ) | 480 if ( face_index >= face->ttc_header.count ) |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 FT_FREE( face->root.available_sizes ); | 1154 FT_FREE( face->root.available_sizes ); |
1147 face->root.num_fixed_sizes = 0; | 1155 face->root.num_fixed_sizes = 0; |
1148 | 1156 |
1149 FT_FREE( face->postscript_name ); | 1157 FT_FREE( face->postscript_name ); |
1150 | 1158 |
1151 face->sfnt = 0; | 1159 face->sfnt = 0; |
1152 } | 1160 } |
1153 | 1161 |
1154 | 1162 |
1155 /* END */ | 1163 /* END */ |
OLD | NEW |