From 15b60bb513984c5f0725d45b80e8798e21502dcf Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 3 Mar 2009 21:35:32 +0000 Subject: [PATCH] Formatting, copyright years. --- ChangeLog | 48 +++++++++++------- docs/CHANGES | 30 +++++------ include/freetype/internal/services/svpsinfo.h | 2 +- include/freetype/internal/t1types.h | 13 ++--- src/base/ftfstype.c | 5 +- src/cid/cidload.c | 2 +- src/cid/cidriver.c | 8 +-- src/cid/cidtoken.h | 2 +- src/type1/t1driver.c | 50 +++++++++++-------- src/type1/t1load.c | 2 +- src/type1/t1tokens.h | 2 +- src/type42/t42drivr.c | 48 ++++++++++-------- src/type42/t42parse.c | 3 +- 13 files changed, 124 insertions(+), 91 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5400cd07c..9f7fe9a25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,36 +1,50 @@ 2009-03-03 David Turner - Update documentation and bump version number to 2.3.9 + Update documentation and bump version number to 2.3.9. - * include/freetype/freetype.h: bump patch version to 9 - * docs/CHANGES: document the ABI break in 2.3.8 - * docs/VERSION.DLL: update version numbers table for 2.3.9 - * builds/unix/configure.ac: update AC_INIT and version_info + * include/freetype/freetype.h: Bump patch version to 9. + * docs/CHANGES: Document the ABI break in 2.3.8. + * docs/VERSION.DLL: Update version numbers table for 2.3.9. + * builds/unix/configure.ac: Update AC_INIT and version_info numbers. 2009-03-03 David Turner Remove ABI-breaking field in public PS_InfoFontRec definition. + Instead, we define a new internal PS_FontExtraRec structure to hold the additionnal field, then place it in various internal positions of the corresponding FT_Face derived objects. * include/freetype/t1tables.h (PS_FontInfoRec): Remove the `fs_type' field from the public structure. + * include/freetype/internal/psaux.h (T1_FieldLocation): New + enumeration `T1_FIELD_LOCATION_FONT_EXTRA'. + * include/freetype/internal/t1types.h (PS_FontExtraRec): New + structure. + (T1_FontRec, CID_FaceRec): Add it. - * include/freetype/internal/psaux.h (T1_FieldLocation), - include/freetype/internal/t1types.h (T1_FontRec, CID_FaceRec), - src/type1/t1load.c, src/type1/t1tokens.h, - src/cid/cidload.c, src/cid/cidtoken.h, - src/type42/t42parse.c: modify the various font parsers to store - the `fs_type' field in a different places, instead of the public - PS_FontInfoRec. + * src/cid/cidload.c (cid_load_keyword): Handle + T1_FIELD_LOCATION_FONT_EXTRA. + * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c: + Adjust FT_STRUCTURE and T1CODE properly to handle `FSType'. + * src/type1/t1load.c (t1_load_keyword): Handle + T1_FIELD_LOCATION_FONT_EXTRA. - * include/freetype/internal/services/svpsinfo.h (PsInfo service), - src/base/ftfstype.c (FT_Get_FSType_Flags), src/cff/cffdrivr.c, - src/cid/cidriver.c, src/type1/t1driver.c, src/type42/t42drivr.c: - Modify the PsInfo service to add a GetExtra function, use it in - FT_Get_FSType_Flags() and modify the drivers accordingly. + * include/freetype/internal/services/svpsinfo.h (PsInfo service): + Add `PS_GetFontExtraFunc' function typedef. + + * src/base/ftfstype.c: Include FT_INTERNAL_SERVICE_H and + FT_SERVICE_POSTSCRIPT_INFO_H. + (FT_Get_FSType_Flags): Use POSTSCRIPT_INFO service. + + * src/cff/cffdrivr.c (cff_service_ps_info): Updated. + * src/cid/cidriver.c (cid_ps_get_font_extra): New function. + (cid_service_ps_info): Updated. + * src/type1/t1driver.c (t1_ps_get_font_extra): New function. + (t1_service_ps_info): Updated. + * src/type42/t42drivr.c (t42_ps_get_font_extra): New function. + (t42_service_ps_info): Updated. 2009-03-02 Alexey Kryukov diff --git a/docs/CHANGES b/docs/CHANGES index cc9536368..e7eebf789 100644 --- a/docs/CHANGES +++ b/docs/CHANGES @@ -2,26 +2,26 @@ CHANGES BETWEEN 2.3.9 and 2.3.8 I. IMPORTANT BUG FIXES - - Very unfortunately, FreeType 2.3.8 contained a change that - broke its official ABI. The end result is that programs compiled + - Very unfortunately, FreeType 2.3.8 contained a change that broke + its official ABI. The end result is that programs compiled against previous versions of the library, but dynamically linked - to 2.3.8 can experience memory corruption if they call the - FT_Get_PS_Font_Info() function. + to 2.3.8 can experience memory corruption if they call the + `FT_Get_PS_Font_Info' function. - We recommend all users to upgrade to 2.3.9 as soon as possible, - or to downgrade to a previous release of the library if this is + We recommend all users to upgrade to 2.3.9 as soon as possible, + or to downgrade to a previous release of the library if this is not an option. - The origin of the bug is that a new field was added to the - publicly defined PS_FontInfoRec structure. Unfortunately objects - of this type can be stack or heap allocated by callers of - FT_Get_PS_Font_Info(), resulting in a memory buffer over-write - with its implementation in 2.3.8. + The origin of the bug is that a new field was added to the + publicly defined `PS_FontInfoRec' structure. Unfortunately, + objects of this type can be stack or heap allocated by callers + of `FT_Get_PS_Font_Info', resulting in a memory buffer + overwrite with its implementation in 2.3.8. - If you want to know if your code is vulnerable to this issue, - simply search for the substrings "PS_FontInfo" and - "PS_Font_Info" in your source code. If none is found, your code - is safe and will not be affected. + If you want to know whether your code is vulnerable to this + issue, simply search for the substrings `PS_FontInfo' and + `PS_Font_Info' in your source code. If none is found, your code + is safe and is not affected. The FreeType team apologizes for the problem. diff --git a/include/freetype/internal/services/svpsinfo.h b/include/freetype/internal/services/svpsinfo.h index 821776989..124c6f9f9 100644 --- a/include/freetype/internal/services/svpsinfo.h +++ b/include/freetype/internal/services/svpsinfo.h @@ -4,7 +4,7 @@ /* */ /* The FreeType PostScript info service (specification). */ /* */ -/* Copyright 2003, 2004 by */ +/* Copyright 2003, 2004, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/include/freetype/internal/t1types.h b/include/freetype/internal/t1types.h index fdf766dec..ff021b0fe 100644 --- a/include/freetype/internal/t1types.h +++ b/include/freetype/internal/t1types.h @@ -5,7 +5,7 @@ /* Basic Type1/Type2 type definitions and interface (specification */ /* only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -92,18 +92,19 @@ FT_BEGIN_HEADER * * Note these can't be blended with multiple-masters. */ - typedef struct PS_FontExtraRec_ + typedef struct PS_FontExtraRec_ { - FT_UShort fs_type; + FT_UShort fs_type; } PS_FontExtraRec; + typedef struct T1_FontRec_ { - PS_FontInfoRec font_info; /* font info dictionary */ + PS_FontInfoRec font_info; /* font info dictionary */ PS_FontExtraRec font_extra; /* font info extra fields */ - PS_PrivateRec private_dict; /* private dictionary */ - FT_String* font_name; /* top-level dictionary */ + PS_PrivateRec private_dict; /* private dictionary */ + FT_String* font_name; /* top-level dictionary */ T1_EncodingType encoding_type; T1_EncodingRec encoding; diff --git a/src/base/ftfstype.c b/src/base/ftfstype.c index 7060ac914..d0ef7b7c1 100644 --- a/src/base/ftfstype.c +++ b/src/base/ftfstype.c @@ -42,11 +42,10 @@ { PS_FontExtraRec extra; + if ( !service->ps_get_font_extra( face, &extra ) && - extra.fs_type != 0 ) - { + extra.fs_type != 0 ) return extra.fs_type; - } } } diff --git a/src/cid/cidload.c b/src/cid/cidload.c index 8541d06a6..a43a00e01 100644 --- a/src/cid/cidload.c +++ b/src/cid/cidload.c @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 font loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c index 42bd298db..f650ee1d9 100644 --- a/src/cid/cidriver.c +++ b/src/cid/cidriver.c @@ -4,7 +4,7 @@ /* */ /* CID driver interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -74,7 +74,8 @@ PS_FontInfoRec* afont_info ) { *afont_info = ((CID_Face)face)->cid.font_info; - return 0; + + return CID_Err_Ok; } static FT_Error @@ -82,7 +83,8 @@ PS_FontExtraRec* afont_extra ) { *afont_extra = ((CID_Face)face)->font_extra; - return 0; + + return CID_Err_Ok; } static const FT_Service_PsInfoRec cid_service_ps_info = diff --git a/src/cid/cidtoken.h b/src/cid/cidtoken.h index f73432252..94a3657b0 100644 --- a/src/cid/cidtoken.h +++ b/src/cid/cidtoken.h @@ -4,7 +4,7 @@ /* */ /* CID token definitions (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c index c22d8df84..8c398eee2 100644 --- a/src/type1/t1driver.c +++ b/src/type1/t1driver.c @@ -4,7 +4,7 @@ /* */ /* Type 1 driver interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -84,6 +84,7 @@ return 0; } + static const FT_Service_GlyphDictRec t1_service_glyph_dict = { (FT_GlyphDict_GetNameFunc) t1_get_glyph_name, @@ -91,10 +92,10 @@ }; - /* - * POSTSCRIPT NAME SERVICE - * - */ + /* + * POSTSCRIPT NAME SERVICE + * + */ static const char* t1_get_ps_name( T1_Face face ) @@ -102,16 +103,17 @@ return (const char*) face->type1.font_name; } + static const FT_Service_PsFontNameRec t1_service_ps_name = { (FT_PsName_GetFunc)t1_get_ps_name }; - /* - * MULTIPLE MASTERS SERVICE - * - */ + /* + * MULTIPLE MASTERS SERVICE + * + */ #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT static const FT_Service_MultiMastersRec t1_service_multi_masters = @@ -125,31 +127,36 @@ #endif - /* - * POSTSCRIPT INFO SERVICE - * - */ + /* + * POSTSCRIPT INFO SERVICE + * + */ static FT_Error t1_ps_get_font_info( FT_Face face, PS_FontInfoRec* afont_info ) { *afont_info = ((T1_Face)face)->type1.font_info; - return 0; + + return T1_Err_Ok; } + static FT_Error t1_ps_get_font_extra( FT_Face face, PS_FontExtraRec* afont_extra ) { *afont_extra = ((T1_Face)face)->type1.font_extra; - return 0; + + return T1_Err_Ok; } + static FT_Int t1_ps_has_glyph_names( FT_Face face ) { FT_UNUSED( face ); + return 1; } @@ -159,7 +166,8 @@ PS_PrivateRec* afont_private ) { *afont_private = ((T1_Face)face)->type1.private_dict; - return 0; + + return T1_Err_Ok; } @@ -171,6 +179,7 @@ (PS_GetFontPrivateFunc)t1_ps_get_font_private, }; + #ifndef T1_CONFIG_OPTION_NO_AFM static const FT_Service_KerningRec t1_service_kerning = { @@ -178,10 +187,11 @@ }; #endif - /* - * SERVICE LIST - * - */ + + /* + * SERVICE LIST + * + */ static const FT_ServiceDescRec t1_services[] = { diff --git a/src/type1/t1load.c b/src/type1/t1load.c index 50a0b2d6d..06e72cca6 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -4,7 +4,7 @@ /* */ /* Type 1 font loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/type1/t1tokens.h b/src/type1/t1tokens.h index bfbd0ef86..2d692f0e6 100644 --- a/src/type1/t1tokens.h +++ b/src/type1/t1tokens.h @@ -4,7 +4,7 @@ /* */ /* Type 1 tokenizer (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c index 92b40e1e6..820c67961 100644 --- a/src/type42/t42drivr.c +++ b/src/type42/t42drivr.c @@ -4,7 +4,7 @@ /* */ /* High-level Type 42 driver interface (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2006, 2007 by Roberto Alameda. */ +/* Copyright 2002, 2003, 2004, 2006, 2007, 2009 by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ @@ -49,11 +49,11 @@ #define FT_COMPONENT trace_t42 - /* - * - * GLYPH DICT SERVICE - * - */ + /* + * + * GLYPH DICT SERVICE + * + */ static FT_Error t42_get_glyph_name( T42_Face face, @@ -94,11 +94,11 @@ }; - /* - * - * POSTSCRIPT NAME SERVICE - * - */ + /* + * + * POSTSCRIPT NAME SERVICE + * + */ static const char* t42_get_ps_font_name( T42_Face face ) @@ -113,32 +113,37 @@ }; - /* - * - * POSTSCRIPT INFO SERVICE - * - */ + /* + * + * POSTSCRIPT INFO SERVICE + * + */ static FT_Error t42_ps_get_font_info( FT_Face face, PS_FontInfoRec* afont_info ) { *afont_info = ((T42_Face)face)->type1.font_info; + return T42_Err_Ok; } + static FT_Error t42_ps_get_font_extra( FT_Face face, PS_FontExtraRec* afont_extra ) { *afont_extra = ((T42_Face)face)->type1.font_extra; + return T42_Err_Ok; } + static FT_Int t42_ps_has_glyph_names( FT_Face face ) { FT_UNUSED( face ); + return 1; } @@ -148,6 +153,7 @@ PS_PrivateRec* afont_private ) { *afont_private = ((T42_Face)face)->type1.private_dict; + return T42_Err_Ok; } @@ -161,11 +167,11 @@ }; - /* - * - * SERVICE LIST - * - */ + /* + * + * SERVICE LIST + * + */ static const FT_ServiceDescRec t42_services[] = { diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c index 88d7a442a..b9e408c45 100644 --- a/src/type42/t42parse.c +++ b/src/type42/t42parse.c @@ -4,7 +4,8 @@ /* */ /* Type 42 font parser (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Roberto Alameda. */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */