OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* sfdriver.c */ | 3 /* sfdriver.c */ |
4 /* */ | 4 /* */ |
5 /* High-level SFNT driver interface (body). */ | 5 /* High-level SFNT driver interface (body). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 1996-2007, 2009-2011 by */ | 7 /* Copyright 1996-2007, 2009-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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET, | 415 FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &FT_SFNT_SERVICE_PS_NAME_GET, |
416 FT_SERVICE_ID_TT_CMAP, &FT_TT_SERVICE_GET_CMAP_INFO_GET | 416 FT_SERVICE_ID_TT_CMAP, &FT_TT_SERVICE_GET_CMAP_INFO_GET |
417 ) | 417 ) |
418 #endif | 418 #endif |
419 | 419 |
420 | 420 |
421 FT_CALLBACK_DEF( FT_Module_Interface ) | 421 FT_CALLBACK_DEF( FT_Module_Interface ) |
422 sfnt_get_interface( FT_Module module, | 422 sfnt_get_interface( FT_Module module, |
423 const char* module_interface ) | 423 const char* module_interface ) |
424 { | 424 { |
| 425 /* FT_SFNT_SERVICES_GET derefers `library' in PIC mode */ |
| 426 #ifdef FT_CONFIG_OPTION_PIC |
| 427 FT_Library library; |
| 428 |
| 429 |
| 430 if ( !module ) |
| 431 return NULL; |
| 432 library = module->library; |
| 433 if ( !library ) |
| 434 return NULL; |
| 435 #else |
425 FT_UNUSED( module ); | 436 FT_UNUSED( module ); |
426 | 437 #endif |
427 return ft_service_list_lookup( FT_SFNT_SERVICES_GET, module_interface ); | 438 return ft_service_list_lookup( FT_SFNT_SERVICES_GET, module_interface ); |
428 } | 439 } |
429 | 440 |
430 | 441 |
431 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS | 442 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS |
432 | 443 |
433 FT_CALLBACK_DEF( FT_Error ) | 444 FT_CALLBACK_DEF( FT_Error ) |
434 tt_face_load_sfnt_header_stub( TT_Face face, | 445 tt_face_load_sfnt_header_stub( TT_Face face, |
435 FT_Stream stream, | 446 FT_Stream stream, |
436 FT_Long face_index, | 447 FT_Long face_index, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 { | 560 { |
550 FT_UNUSED( face ); | 561 FT_UNUSED( face ); |
551 FT_UNUSED( cmap ); | 562 FT_UNUSED( cmap ); |
552 | 563 |
553 return SFNT_Err_Ok; | 564 return SFNT_Err_Ok; |
554 } | 565 } |
555 | 566 |
556 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ | 567 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ |
557 | 568 |
558 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS | 569 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS |
559 #define PUT_EMBEDDED_BITMAPS(a) a | 570 #define PUT_EMBEDDED_BITMAPS(a) a |
560 #else | 571 #else |
561 #define PUT_EMBEDDED_BITMAPS(a) 0 | 572 #define PUT_EMBEDDED_BITMAPS(a) 0 |
562 #endif | 573 #endif |
563 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES | 574 #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES |
564 #define PUT_PS_NAMES(a) a | 575 #define PUT_PS_NAMES(a) a |
565 #else | 576 #else |
566 #define PUT_PS_NAMES(a) 0 | 577 #define PUT_PS_NAMES(a) 0 |
567 #endif | 578 #endif |
568 | 579 |
569 FT_DEFINE_SFNT_INTERFACE(sfnt_interface, | 580 FT_DEFINE_SFNT_INTERFACE(sfnt_interface, |
570 tt_face_goto_table, | 581 tt_face_goto_table, |
571 | 582 |
572 sfnt_init_face, | 583 sfnt_init_face, |
573 sfnt_load_face, | 584 sfnt_load_face, |
574 sfnt_done_face, | 585 sfnt_done_face, |
575 sfnt_get_interface, | 586 sfnt_get_interface, |
576 | 587 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 PUT_EMBEDDED_BITMAPS(tt_face_free_eblc), | 641 PUT_EMBEDDED_BITMAPS(tt_face_free_eblc), |
631 | 642 |
632 PUT_EMBEDDED_BITMAPS(tt_face_set_sbit_strike), | 643 PUT_EMBEDDED_BITMAPS(tt_face_set_sbit_strike), |
633 PUT_EMBEDDED_BITMAPS(tt_face_load_strike_metrics), | 644 PUT_EMBEDDED_BITMAPS(tt_face_load_strike_metrics), |
634 | 645 |
635 tt_face_get_metrics | 646 tt_face_get_metrics |
636 ) | 647 ) |
637 | 648 |
638 | 649 |
639 FT_DEFINE_MODULE(sfnt_module_class, | 650 FT_DEFINE_MODULE(sfnt_module_class, |
640 | 651 |
641 0, /* not a font driver or renderer */ | 652 0, /* not a font driver or renderer */ |
642 sizeof( FT_ModuleRec ), | 653 sizeof ( FT_ModuleRec ), |
643 | 654 |
644 "sfnt", /* driver name */ | 655 "sfnt", /* driver name */ |
645 0x10000L, /* driver version 1.0 */ | 656 0x10000L, /* driver version 1.0 */ |
646 0x20000L, /* driver requires FreeType 2.0 or higher */ | 657 0x20000L, /* driver requires FreeType 2.0 or higher */ |
647 | 658 |
648 (const void*)&FT_SFNT_INTERFACE_GET, /* module specific interface */ | 659 (const void*)&FT_SFNT_INTERFACE_GET, /* module specific interface */ |
649 | 660 |
650 (FT_Module_Constructor)0, | 661 (FT_Module_Constructor)0, |
651 (FT_Module_Destructor) 0, | 662 (FT_Module_Destructor) 0, |
652 (FT_Module_Requester) sfnt_get_interface | 663 (FT_Module_Requester) sfnt_get_interface |
653 ) | 664 ) |
654 | 665 |
655 | 666 |
656 /* END */ | 667 /* END */ |
OLD | NEW |