| OLD | NEW |
| 1 /***************************************************************************/ | 1 /***************************************************************************/ |
| 2 /* */ | 2 /* */ |
| 3 /* psmodule.c */ | 3 /* psmodule.c */ |
| 4 /* */ | 4 /* */ |
| 5 /* PSNames module implementation (body). */ | 5 /* PSNames module implementation (body). */ |
| 6 /* */ | 6 /* */ |
| 7 /* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008 by */ | 7 /* Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007, 2008 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 ps_get_standard_strings( FT_UInt sid ) | 514 ps_get_standard_strings( FT_UInt sid ) |
| 515 { | 515 { |
| 516 if ( sid >= FT_NUM_SID_NAMES ) | 516 if ( sid >= FT_NUM_SID_NAMES ) |
| 517 return 0; | 517 return 0; |
| 518 | 518 |
| 519 return ft_standard_glyph_names + ft_sid_names[sid]; | 519 return ft_standard_glyph_names + ft_sid_names[sid]; |
| 520 } | 520 } |
| 521 | 521 |
| 522 | 522 |
| 523 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST | 523 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST |
| 524 FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, | 524 FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, |
| 525 (PS_Unicode_ValueFunc) ps_unicode_value, | 525 (PS_Unicode_ValueFunc) ps_unicode_value, |
| 526 (PS_Unicodes_InitFunc) ps_unicodes_init, | 526 (PS_Unicodes_InitFunc) ps_unicodes_init, |
| 527 (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, | 527 (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, |
| 528 (PS_Unicodes_CharNextFunc) ps_unicodes_char_next, | 528 (PS_Unicodes_CharNextFunc) ps_unicodes_char_next, |
| 529 | 529 |
| 530 (PS_Macintosh_NameFunc) ps_get_macintosh_name, | 530 (PS_Macintosh_NameFunc) ps_get_macintosh_name, |
| 531 (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, | 531 (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, |
| 532 | 532 |
| 533 t1_standard_encoding, | 533 t1_standard_encoding, |
| 534 t1_expert_encoding | 534 t1_expert_encoding |
| 535 ) | 535 ) |
| 536 | 536 |
| 537 #else | 537 #else |
| 538 | 538 |
| 539 FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, | 539 FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, |
| 540 0, | 540 0, |
| 541 0, | 541 0, |
| 542 0, | 542 0, |
| 543 0, | 543 0, |
| 544 | 544 |
| 545 (PS_Macintosh_NameFunc) ps_get_macintosh_name, | 545 (PS_Macintosh_NameFunc) ps_get_macintosh_name, |
| 546 (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, | 546 (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, |
| 547 | 547 |
| 548 t1_standard_encoding, | 548 t1_standard_encoding, |
| 549 t1_expert_encoding | 549 t1_expert_encoding |
| 550 ) | 550 ) |
| 551 | 551 |
| 552 #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ | 552 #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ |
| 553 | 553 |
| 554 | 554 |
| 555 FT_DEFINE_SERVICEDESCREC1(pscmaps_services, | 555 FT_DEFINE_SERVICEDESCREC1(pscmaps_services, |
| 556 FT_SERVICE_ID_POSTSCRIPT_CMAPS, &FT_PSCMAPS_INTERFACE_GET | 556 FT_SERVICE_ID_POSTSCRIPT_CMAPS, &FT_PSCMAPS_INTERFACE_GET |
| 557 ) | 557 ) |
| 558 | 558 |
| 559 | 559 |
| 560 | 560 |
| 561 | 561 |
| 562 static FT_Pointer | 562 static FT_Pointer |
| 563 psnames_get_service( FT_Module module, | 563 psnames_get_service( FT_Module module, |
| 564 const char* service_id ) | 564 const char* service_id ) |
| 565 { | 565 { |
| 566 /* FT_PSCMAPS_SERVICES_GET derefers `library' in PIC mode */ |
| 567 #ifdef FT_CONFIG_OPTION_PIC |
| 568 FT_Library library; |
| 569 |
| 570 |
| 571 if ( !module ) |
| 572 return NULL; |
| 573 library = module->library; |
| 574 if ( !library ) |
| 575 return NULL; |
| 576 #else |
| 566 FT_UNUSED( module ); | 577 FT_UNUSED( module ); |
| 578 #endif |
| 567 | 579 |
| 568 return ft_service_list_lookup( FT_PSCMAPS_SERVICES_GET, service_id ); | 580 return ft_service_list_lookup( FT_PSCMAPS_SERVICES_GET, service_id ); |
| 569 } | 581 } |
| 570 | 582 |
| 571 #endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */ | 583 #endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */ |
| 572 | 584 |
| 573 | 585 |
| 574 #ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES | 586 #ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES |
| 575 #define PUT_PS_NAMES_SERVICE(a) 0 | 587 #define PUT_PS_NAMES_SERVICE(a) 0 |
| 576 #else | 588 #else |
| 577 #define PUT_PS_NAMES_SERVICE(a) a | 589 #define PUT_PS_NAMES_SERVICE(a) a |
| 578 #endif | 590 #endif |
| 579 | 591 |
| 580 FT_DEFINE_MODULE(psnames_module_class, | 592 FT_DEFINE_MODULE(psnames_module_class, |
| 581 | 593 |
| 582 0, /* this is not a font driver, nor a renderer */ | 594 0, /* this is not a font driver, nor a renderer */ |
| 583 sizeof ( FT_ModuleRec ), | 595 sizeof ( FT_ModuleRec ), |
| 584 | 596 |
| 585 "psnames", /* driver name */ | 597 "psnames", /* driver name */ |
| 586 0x10000L, /* driver version */ | 598 0x10000L, /* driver version */ |
| 587 0x20000L, /* driver requires FreeType 2 or above */ | 599 0x20000L, /* driver requires FreeType 2 or above */ |
| 588 | 600 |
| 589 PUT_PS_NAMES_SERVICE((void*)&FT_PSCMAPS_INTERFACE_GET), /* module specific
interface */ | 601 PUT_PS_NAMES_SERVICE((void*)&FT_PSCMAPS_INTERFACE_GET), /* module specific
interface */ |
| 590 (FT_Module_Constructor)0, | 602 (FT_Module_Constructor)0, |
| 591 (FT_Module_Destructor) 0, | 603 (FT_Module_Destructor) 0, |
| 592 (FT_Module_Requester) PUT_PS_NAMES_SERVICE(psnames_get_service) | 604 (FT_Module_Requester) PUT_PS_NAMES_SERVICE(psnames_get_service) |
| 593 ) | 605 ) |
| 594 | 606 |
| 595 | 607 |
| 596 | 608 |
| 597 /* END */ | 609 /* END */ |
| OLD | NEW |