diff --git a/ChangeLog b/ChangeLog index f14267655..5c8f45146 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,27 +1,82 @@ +2003-10-31 Detlef Würkner + + * src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names): + Fix parameter order in calls to FT_FACE_FIND_SERVICE. + +2003-10-31 Werner Lemberg + + * include/freetype/internal/ftserv.h + (FT_SERVICE_POSTSCRIPT_NAMES_H): Removed. Unused. + + * src/type42/t42drivr.c (t42_services): Updated. + 2003-10-29 David Turner - * include/freetype/internal/bdftypes.h: removed obsolete header + * include/freetype/internal/bdftypes.h: Removed. Obsolete. + * src/base/ftbdf.c: Updated. - * include/freetype/internal/cfftypes.h, src/cff/cfftypes.h, - src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h, - include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from - 'include/freetype/internal' to 'src/cff' since no other modules needs - to known about these types + * include/freetype/internal/cfftypes.h: Moved to... + * src/cff/cfftypes.h: This place since no other module needs to + know about those types. - * include/freetype/internal/t42types.h, - include/freetype/internal/internal.h, src/type42/t42objs.h, - src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from - 'include/freetype/internal' to 'src/type42' since no other modules needs - to known about these types + * include/freetype/internal/t42types.h: Moved to... + * src/type42/t42types.h: This place since no other module needs to + know about those types. - * src/gzip/infblock.c: removing compiler warning + * include/freetype/internal/services/svbdf.h: Include FT_BDF_H. - * include/freetype/internal/services/svpsinfo.h, - include/freetype/internal/ftserv.h, src/cff/cffdrivr.c, - src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c, - src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined - in "svpsinfo.h", removing some sad hacks. + * include/freetype/internal/services/svpsname.h: Renamed to... + * include/freetype/internal/services/svpscmap.h: This. + Updated `FT_Service_PsNames' -> `FT_Service_PsCMaps' and + `POSTSCRIPT_NAMES' -> `POSTSCRIPT_CMAPS' everywhere. + * include/freetype/internal/services/svpsinfo.h: New file, providing + PostScript info service. + + * include/freetype/internal/ftserv.h (FT_SERVICE_POSTSCRIPT_CMAPS_H, + FT_SERVICE_POSTSCRIPT_INFO_H): New macros for svpscmap.h and + svpsinfo.h. + * include/freetype/internal/internal.h (FT_INTERNAL_TYPE42_TYPES_H, + FT_INTERNAL_CFF_TYPES_H, FT_INTERNAL_BDF_TYPES_H): Removed. + + * src/base/fttype1.c: Don't include FT_INTERNAL_TYPE1_TYPES_H and + FT_INTERNAL_TYPE42_TYPES_H but FT_INTERNAL_SERVICE_H and + FT_SERVICE_POSTSCRIPT_INFO_H. + (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names): Use new + POSTSCRIPT_INFO service. + + * src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H. + (cff_ps_has_glyph_names): New function. + (cff_service_ps_info): New service. + (cff_services): Updated. + + * src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h: Don't + include FT_INTERNAL_CFF_TYPES_H but cfftypes.h directly. + + * src/cif/cidriver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H. + (cid_ps_get_font_info): New function. + (cid_service_ps_info): New service. + (cid_services): Updated. + + * src/type1/t1driver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H. + (t1_ps_get_font_info, t1_ps_has_glyph_names): New functions. + (t1_service_ps_info): New service. + (t1_services): Updated. + + * src/type42/t42drivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H. + (t42_ps_get_font_info, t42_ps_has_glyph_names): New functions. + (t42_service_ps_info): New service. + + * src/type42/t42objs.h: Don't include FT_INTERNAL_TYPE42_TYPES_H + but t42types.h directly. + + * src/psnames/psmodule.c (psnames_interface, psnames_services): + Renamed to... + (pscmaps_interface, pscmaps_services): This. + Updated all users. + + + * src/gzip/infblock.c (inflate_blocks): Remove compiler warning. 2003-10-22 Werner Lemberg diff --git a/include/freetype/internal/ftserv.h b/include/freetype/internal/ftserv.h index e0596ad48..d77e1d5fa 100644 --- a/include/freetype/internal/ftserv.h +++ b/include/freetype/internal/ftserv.h @@ -240,7 +240,6 @@ FT_BEGIN_HEADER #define FT_SERVICE_MULTIPLE_MASTERS_H #define FT_SERVICE_POSTSCRIPT_NAME_H -#define FT_SERVICE_POSTSCRIPT_NAMES_H #define FT_SERVICE_POSTSCRIPT_CMAPS_H #define FT_SERVICE_POSTSCRIPT_INFO_H #define FT_SERVICE_GLYPH_DICT_H diff --git a/include/freetype/internal/services/svpscmap.h b/include/freetype/internal/services/svpscmap.h index 374503ba6..ade96ef8f 100644 --- a/include/freetype/internal/services/svpscmap.h +++ b/include/freetype/internal/services/svpscmap.h @@ -2,7 +2,7 @@ /* */ /* svpscmap.h */ /* */ -/* The FreeType PostScript charmap service (specification) */ +/* The FreeType PostScript charmap service (specification). */ /* */ /* Copyright 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ @@ -33,7 +33,7 @@ FT_BEGIN_HEADER (*PS_Unicode_ValueFunc)( const char* glyph_name ); /* - * Unicode value to Adobe glyph name index. 0xFFFF if not found + * Unicode value to Adobe glyph name index. 0xFFFF if not found. */ typedef FT_UInt (*PS_Unicode_Index_Func)( FT_UInt num_glyphs, @@ -41,13 +41,13 @@ FT_BEGIN_HEADER FT_ULong unicode ); /* - * Macintosh name id to glyph name, NULL if invalid index + * Macintosh name id to glyph name. NULL if invalid index. */ typedef const char* (*PS_Macintosh_Name_Func)( FT_UInt name_index ); /* - * Adobe standard string id to glyph name, NULL if invalid index + * Adobe standard string ID to glyph name. NULL if invalid index. */ typedef const char* (*PS_Adobe_Std_Strings_Func)( FT_UInt string_index ); @@ -101,10 +101,13 @@ FT_BEGIN_HEADER const unsigned short* adobe_expert_encoding; }; - /* */ + /* */ FT_END_HEADER -#endif /* __SVPSNAME_H__ */ +#endif /* __SVPSCMAP_H__ */ + + +/* END */ diff --git a/include/freetype/internal/services/svpsinfo.h b/include/freetype/internal/services/svpsinfo.h index 5bf7c49f6..73c02cdb7 100644 --- a/include/freetype/internal/services/svpsinfo.h +++ b/include/freetype/internal/services/svpsinfo.h @@ -1,30 +1,55 @@ -#ifndef __SVPSINFO_H__ -#define __SVPSINFO_H__ - -#include FT_INTERNAL_SERVICE_H -#include FT_INTERNAL_TYPE1_TYPES_H - -FT_BEGIN_HEADER - - -#define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info" - - typedef FT_Error (*PS_GetFontInfoFunc)( FT_Face face, - PS_FontInfoRec* afont_info ); - - typedef FT_Int (*PS_HasGlyphNamesFunc)( FT_Face face ); - - FT_DEFINE_SERVICE( PsInfo ) - { - PS_GetFontInfoFunc ps_get_font_info; - PS_HasGlyphNamesFunc ps_has_glyph_names; - }; - - /* */ - - -FT_END_HEADER - - - -#endif /* __SVPSINFO_H__ */ +/***************************************************************************/ +/* */ +/* svpsinfo.h */ +/* */ +/* The FreeType PostScript info service (specification). */ +/* */ +/* Copyright 2003 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __SVPSINFO_H__ +#define __SVPSINFO_H__ + +#include FT_INTERNAL_SERVICE_H +#include FT_INTERNAL_TYPE1_TYPES_H + + +FT_BEGIN_HEADER + + +#define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info" + + + typedef FT_Error + (*PS_GetFontInfoFunc)( FT_Face face, + PS_FontInfoRec* afont_info ); + + typedef FT_Int + (*PS_HasGlyphNamesFunc)( FT_Face face ); + + + FT_DEFINE_SERVICE( PsInfo ) + { + PS_GetFontInfoFunc ps_get_font_info; + PS_HasGlyphNamesFunc ps_has_glyph_names; + }; + + /* */ + + +FT_END_HEADER + + +#endif /* __SVPSINFO_H__ */ + + +/* END */ diff --git a/include/freetype/internal/services/svsfnt.h b/include/freetype/internal/services/svsfnt.h index 2bfd14c03..e24de785b 100644 --- a/include/freetype/internal/services/svsfnt.h +++ b/include/freetype/internal/services/svsfnt.h @@ -53,8 +53,8 @@ FT_BEGIN_HEADER FT_DEFINE_SERVICE( SFNT_Table ) { - FT_SFNT_TableLoadFunc load_table; - FT_SFNT_TableGetFunc get_table; + FT_SFNT_TableLoadFunc load_table; + FT_SFNT_TableGetFunc get_table; }; /* */ diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 0e12c9b28..67e491b1b 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -2480,8 +2480,8 @@ FT_Get_Sfnt_Table( FT_Face face, FT_Sfnt_Tag tag ) { - void* table = 0; - FT_Service_SFNT_Table service; + void* table = 0; + FT_Service_SFNT_Table service; if ( face && FT_IS_SFNT( face ) ) diff --git a/src/base/fttype1.c b/src/base/fttype1.c index 7b4513911..313f6279b 100644 --- a/src/base/fttype1.c +++ b/src/base/fttype1.c @@ -4,7 +4,7 @@ /* */ /* FreeType utility file for PS names support (body). */ /* */ -/* Copyright 2002 by */ +/* Copyright 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -30,15 +30,18 @@ { FT_Error error = FT_Err_Invalid_Argument; + if ( face ) { - FT_Service_PsInfo service = NULL; + FT_Service_PsInfo service = NULL; - FT_FACE_FIND_SERVICE( service, face, POSTSCRIPT_INFO ); + + FT_FACE_FIND_SERVICE( face, face, POSTSCRIPT_INFO ); if ( service && service->ps_get_font_info ) error = service->ps_get_font_info( face, afont_info ); } + return error; } @@ -51,13 +54,15 @@ FT_Int result = 0; FT_Service_PsInfo service = NULL; + if ( face ) { - FT_FACE_FIND_SERVICE( service, face, POSTSCRIPT_INFO ); + FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO ); if ( service && service->ps_has_glyph_names ) result = service->ps_has_glyph_names( face ); } + return result; } diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c index 6099fdff2..9916485de 100644 --- a/src/cff/cffdrivr.c +++ b/src/cff/cffdrivr.c @@ -315,6 +315,7 @@ (FT_GlyphDict_NameIndexFunc)cff_get_name_index, }; + /* * POSTSCRIPT INFO SERVICE * @@ -327,14 +328,14 @@ return 1; } + static const FT_Service_PsInfoRec cff_service_ps_info = { - (PS_GetFontInfoFunc) NULL, /* unsupported with CFF fonts */ - (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names + (PS_GetFontInfoFunc) NULL, /* unsupported with CFF fonts */ + (PS_HasGlyphNamesFunc)cff_ps_has_glyph_names }; - /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ @@ -362,14 +363,15 @@ cff_get_interface( CFF_Driver driver, const char* module_interface ) { - FT_Module sfnt; + FT_Module sfnt; FT_Module_Interface result; + result = ft_service_list_lookup( cff_services, module_interface ); if ( result != NULL ) return result; - /* we simply pass our request to the `sfnt' module */ + /* we pass our request to the `sfnt' module */ sfnt = FT_Get_Module( driver->root.root.library, "sfnt" ); return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0; diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c index 7da95821a..90c34dbcb 100644 --- a/src/cff/cffobjs.c +++ b/src/cff/cffobjs.c @@ -324,7 +324,7 @@ /* FreeType 2 */ } - /* now, load the CFF part of the file */ + /* now, load the CFF part of the file */ error = face->goto_table( face, TTAG_CFF, stream, 0 ); if ( error ) goto Exit; diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c index 2f3908aa5..f5639b9f7 100644 --- a/src/cid/cidriver.c +++ b/src/cid/cidriver.c @@ -75,10 +75,11 @@ return 0; } + static const FT_Service_PsInfoRec cid_service_ps_info = { - (PS_GetFontInfoFunc) cid_ps_get_font_info, - (PS_HasGlyphNamesFunc) NULL /* unsupported with CID fonts */ + (PS_GetFontInfoFunc) cid_ps_get_font_info, + (PS_HasGlyphNamesFunc)NULL /* unsupported with CID fonts */ }; diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index df092a34c..784da9992 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -241,7 +241,7 @@ return result; } - static const FT_Service_PsFontNameRec sfnt_service_ps_name = + static const FT_Service_PsFontNameRec sfnt_service_ps_name = { (FT_PsName_GetFunc)sfnt_get_ps_name }; @@ -255,9 +255,9 @@ static const FT_ServiceDescRec sfnt_services[] = { - { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, & sfnt_service_ps_name }, + { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &sfnt_service_ps_name }, #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES - { FT_SERVICE_ID_GLYPH_DICT, & sfnt_service_glyph_dict }, + { FT_SERVICE_ID_GLYPH_DICT, &sfnt_service_glyph_dict }, #endif { NULL, NULL } diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c index 5aafca33e..49b5d9826 100644 --- a/src/type1/t1driver.c +++ b/src/type1/t1driver.c @@ -149,6 +149,7 @@ return 0; } + static FT_Int t1_ps_has_glyph_names( FT_Face face ) { @@ -156,12 +157,14 @@ return 1; } + static const FT_Service_PsInfoRec t1_service_ps_info = { - (PS_GetFontInfoFunc) t1_ps_get_font_info, - (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names + (PS_GetFontInfoFunc) t1_ps_get_font_info, + (PS_HasGlyphNamesFunc)t1_ps_has_glyph_names }; + /* * SERVICE LIST * diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c index 6a4f98862..d7942e2c5 100644 --- a/src/type1/t1objs.c +++ b/src/type1/t1objs.c @@ -275,11 +275,11 @@ FT_Int num_params, FT_Parameter* params ) { - FT_Error error; + FT_Error error; FT_Service_PsCMaps psnames; - PSAux_Service psaux; - T1_Font type1 = &face->type1; - PS_FontInfo info = &type1->font_info; + PSAux_Service psaux; + T1_Font type1 = &face->type1; + PS_FontInfo info = &type1->font_info; FT_UNUSED( num_params ); FT_UNUSED( params ); diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c index deb7f2898..8af1621df 100644 --- a/src/type42/t42drivr.c +++ b/src/type42/t42drivr.c @@ -129,6 +129,7 @@ /* + * * POSTSCRIPT INFO SERVICE * */ @@ -141,6 +142,7 @@ return 0; } + static FT_Int t42_ps_has_glyph_names( FT_Face face ) { @@ -148,10 +150,11 @@ return 1; } + static const FT_Service_PsInfoRec t42_service_ps_info = { - (PS_GetFontInfoFunc) t42_ps_get_font_info, - (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names + (PS_GetFontInfoFunc) t42_ps_get_font_info, + (PS_HasGlyphNamesFunc)t42_ps_has_glyph_names }; @@ -165,6 +168,7 @@ { { FT_SERVICE_ID_GLYPH_DICT, &t42_service_glyph_dict }, { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t42_service_ps_font_name }, + { FT_SERVICE_ID_POSTSCRIPT_INFO, &t42_service_ps_info }, { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_42 }, { NULL, NULL } };