diff options
author | marha <marha@users.sourceforge.net> | 2009-12-21 15:22:51 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-12-21 15:22:51 +0000 |
commit | 1ee02cd0419021c3d4950af2619da39c6e9c47f0 (patch) | |
tree | f5b61f7d9e151c7a64cff51399560ffb77800349 /freetype/src/psnames/psmodule.c | |
parent | d8432fdd4f13e9f9d1d44f5482faeb56562661a9 (diff) | |
download | vcxsrv-1ee02cd0419021c3d4950af2619da39c6e9c47f0.tar.gz vcxsrv-1ee02cd0419021c3d4950af2619da39c6e9c47f0.tar.bz2 vcxsrv-1ee02cd0419021c3d4950af2619da39c6e9c47f0.zip |
Updated to freetype-2.3.11
Diffstat (limited to 'freetype/src/psnames/psmodule.c')
-rw-r--r-- | freetype/src/psnames/psmodule.c | 76 |
1 files changed, 41 insertions, 35 deletions
diff --git a/freetype/src/psnames/psmodule.c b/freetype/src/psnames/psmodule.c index 41942a9b4..351885049 100644 --- a/freetype/src/psnames/psmodule.c +++ b/freetype/src/psnames/psmodule.c @@ -24,6 +24,7 @@ #include "pstables.h" #include "psnamerr.h" +#include "pspic.h" #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES @@ -33,7 +34,7 @@ #define VARIANT_BIT 0x80000000UL -#define BASE_GLYPH( code ) ( (code) & ~VARIANT_BIT ) +#define BASE_GLYPH( code ) ( (FT_UInt32)( (code) & ~VARIANT_BIT ) ) /* Return the Unicode value corresponding to a given glyph. Note that */ @@ -57,7 +58,7 @@ /* `uniXXXXYYYYZZZZ'... */ FT_Int count; - FT_ULong value = 0; + FT_UInt32 value = 0; const char* p = glyph_name + 3; @@ -92,7 +93,7 @@ if ( *p == '\0' ) return value; if ( *p == '.' ) - return value | VARIANT_BIT; + return (FT_UInt32)( value | VARIANT_BIT ); } } @@ -101,7 +102,7 @@ if ( glyph_name[0] == 'u' ) { FT_Int count; - FT_ULong value = 0; + FT_UInt32 value = 0; const char* p = glyph_name + 1; @@ -132,7 +133,7 @@ if ( *p == '\0' ) return value; if ( *p == '.' ) - return value | VARIANT_BIT; + return (FT_UInt32)( value | VARIANT_BIT ); } } @@ -154,9 +155,10 @@ /* now look up the glyph in the Adobe Glyph List */ if ( !dot ) - return ft_get_adobe_glyph_index( glyph_name, p ); + return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p ); else - return ft_get_adobe_glyph_index( glyph_name, dot ) | VARIANT_BIT; + return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) | + VARIANT_BIT ); } } @@ -435,7 +437,7 @@ } - static FT_ULong + static FT_UInt32 ps_unicodes_char_next( PS_Unicodes table, FT_UInt32 *unicode ) { @@ -516,56 +518,66 @@ } - static - const FT_Service_PsCMapsRec pscmaps_interface = - { #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST - + FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, (PS_Unicode_ValueFunc) ps_unicode_value, (PS_Unicodes_InitFunc) ps_unicodes_init, (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, (PS_Unicodes_CharNextFunc) ps_unicodes_char_next, + (PS_Macintosh_NameFunc) ps_get_macintosh_name, + (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, + + t1_standard_encoding, + t1_expert_encoding + ) + #else + FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface, 0, 0, 0, 0, -#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ - (PS_Macintosh_NameFunc) ps_get_macintosh_name, (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, t1_standard_encoding, t1_expert_encoding - }; + ) + +#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ + + + FT_DEFINE_SERVICEDESCREC1(pscmaps_services, + FT_SERVICE_ID_POSTSCRIPT_CMAPS, &FT_PSCMAPS_INTERFACE_GET + ) - static const FT_ServiceDescRec pscmaps_services[] = - { - { FT_SERVICE_ID_POSTSCRIPT_CMAPS, &pscmaps_interface }, - { NULL, NULL } - }; static FT_Pointer psnames_get_service( FT_Module module, const char* service_id ) { - FT_UNUSED( module ); + FT_Library library = module->library; + FT_UNUSED(library); - return ft_service_list_lookup( pscmaps_services, service_id ); + return ft_service_list_lookup( FT_PSCMAPS_SERVICES_GET, service_id ); } #endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */ +#ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES +#define PUT_PS_NAMES_SERVICE(a) 0 +#else +#define PUT_PS_NAMES_SERVICE(a) a +#endif - FT_CALLBACK_TABLE_DEF - const FT_Module_Class psnames_module_class = - { + FT_DEFINE_MODULE(psnames_module_class, + 0, /* this is not a font driver, nor a renderer */ sizeof ( FT_ModuleRec ), @@ -573,18 +585,12 @@ 0x10000L, /* driver version */ 0x20000L, /* driver requires FreeType 2 or above */ -#ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES - 0, - (FT_Module_Constructor)0, - (FT_Module_Destructor) 0, - (FT_Module_Requester) 0 -#else - (void*)&pscmaps_interface, /* module specific interface */ + PUT_PS_NAMES_SERVICE((void*)&FT_PSCMAPS_INTERFACE_GET), /* module specific interface */ (FT_Module_Constructor)0, (FT_Module_Destructor) 0, - (FT_Module_Requester) psnames_get_service -#endif - }; + (FT_Module_Requester) PUT_PS_NAMES_SERVICE(psnames_get_service) + ) + /* END */ |