Formatting, copyright years.

This commit is contained in:
Werner Lemberg 2009-03-03 21:35:32 +00:00
parent cda6f49332
commit 15b60bb513
13 changed files with 124 additions and 91 deletions

View File

@ -1,36 +1,50 @@
2009-03-03 David Turner <david@freetype.org> 2009-03-03 David Turner <david@freetype.org>
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 * include/freetype/freetype.h: Bump patch version to 9.
* docs/CHANGES: document the ABI break in 2.3.8 * docs/CHANGES: Document the ABI break in 2.3.8.
* docs/VERSION.DLL: update version numbers table for 2.3.9 * docs/VERSION.DLL: Update version numbers table for 2.3.9.
* builds/unix/configure.ac: update AC_INIT and version_info * builds/unix/configure.ac: Update AC_INIT and version_info
numbers. numbers.
2009-03-03 David Turner <david@freetype.org> 2009-03-03 David Turner <david@freetype.org>
Remove ABI-breaking field in public PS_InfoFontRec definition. Remove ABI-breaking field in public PS_InfoFontRec definition.
Instead, we define a new internal PS_FontExtraRec structure to Instead, we define a new internal PS_FontExtraRec structure to
hold the additionnal field, then place it in various internal hold the additionnal field, then place it in various internal
positions of the corresponding FT_Face derived objects. positions of the corresponding FT_Face derived objects.
* include/freetype/t1tables.h (PS_FontInfoRec): Remove the * include/freetype/t1tables.h (PS_FontInfoRec): Remove the
`fs_type' field from the public structure. `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), * src/cid/cidload.c (cid_load_keyword): Handle
include/freetype/internal/t1types.h (T1_FontRec, CID_FaceRec), T1_FIELD_LOCATION_FONT_EXTRA.
src/type1/t1load.c, src/type1/t1tokens.h, * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c:
src/cid/cidload.c, src/cid/cidtoken.h, Adjust FT_STRUCTURE and T1CODE properly to handle `FSType'.
src/type42/t42parse.c: modify the various font parsers to store * src/type1/t1load.c (t1_load_keyword): Handle
the `fs_type' field in a different places, instead of the public T1_FIELD_LOCATION_FONT_EXTRA.
PS_FontInfoRec.
* include/freetype/internal/services/svpsinfo.h (PsInfo service), * include/freetype/internal/services/svpsinfo.h (PsInfo service):
src/base/ftfstype.c (FT_Get_FSType_Flags), src/cff/cffdrivr.c, Add `PS_GetFontExtraFunc' function typedef.
src/cid/cidriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
Modify the PsInfo service to add a GetExtra function, use it in * src/base/ftfstype.c: Include FT_INTERNAL_SERVICE_H and
FT_Get_FSType_Flags() and modify the drivers accordingly. 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 <anagnost@yandex.ru> 2009-03-02 Alexey Kryukov <anagnost@yandex.ru>

View File

@ -2,26 +2,26 @@ CHANGES BETWEEN 2.3.9 and 2.3.8
I. IMPORTANT BUG FIXES I. IMPORTANT BUG FIXES
- Very unfortunately, FreeType 2.3.8 contained a change that - Very unfortunately, FreeType 2.3.8 contained a change that broke
broke its official ABI. The end result is that programs compiled its official ABI. The end result is that programs compiled
against previous versions of the library, but dynamically linked against previous versions of the library, but dynamically linked
to 2.3.8 can experience memory corruption if they call the to 2.3.8 can experience memory corruption if they call the
FT_Get_PS_Font_Info() function. `FT_Get_PS_Font_Info' function.
We recommend all users to upgrade to 2.3.9 as soon as possible, 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 or to downgrade to a previous release of the library if this is
not an option. not an option.
The origin of the bug is that a new field was added to the The origin of the bug is that a new field was added to the
publicly defined PS_FontInfoRec structure. Unfortunately objects publicly defined `PS_FontInfoRec' structure. Unfortunately,
of this type can be stack or heap allocated by callers of objects of this type can be stack or heap allocated by callers
FT_Get_PS_Font_Info(), resulting in a memory buffer over-write of `FT_Get_PS_Font_Info', resulting in a memory buffer
with its implementation in 2.3.8. overwrite with its implementation in 2.3.8.
If you want to know if your code is vulnerable to this issue, If you want to know whether your code is vulnerable to this
simply search for the substrings "PS_FontInfo" and issue, simply search for the substrings `PS_FontInfo' and
"PS_Font_Info" in your source code. If none is found, your code `PS_Font_Info' in your source code. If none is found, your code
is safe and will not be affected. is safe and is not affected.
The FreeType team apologizes for the problem. The FreeType team apologizes for the problem.

View File

@ -4,7 +4,7 @@
/* */ /* */
/* The FreeType PostScript info service (specification). */ /* The FreeType PostScript info service (specification). */
/* */ /* */
/* Copyright 2003, 2004 by */ /* Copyright 2003, 2004, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */

View File

@ -5,7 +5,7 @@
/* Basic Type1/Type2 type definitions and interface (specification */ /* Basic Type1/Type2 type definitions and interface (specification */
/* only). */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* 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. * 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; } PS_FontExtraRec;
typedef struct T1_FontRec_ 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_FontExtraRec font_extra; /* font info extra fields */
PS_PrivateRec private_dict; /* private dictionary */ PS_PrivateRec private_dict; /* private dictionary */
FT_String* font_name; /* top-level dictionary */ FT_String* font_name; /* top-level dictionary */
T1_EncodingType encoding_type; T1_EncodingType encoding_type;
T1_EncodingRec encoding; T1_EncodingRec encoding;

View File

@ -42,11 +42,10 @@
{ {
PS_FontExtraRec extra; PS_FontExtraRec extra;
if ( !service->ps_get_font_extra( face, &extra ) && if ( !service->ps_get_font_extra( face, &extra ) &&
extra.fs_type != 0 ) extra.fs_type != 0 )
{
return extra.fs_type; return extra.fs_type;
}
} }
} }

View File

@ -4,7 +4,7 @@
/* */ /* */
/* CID-keyed Type1 font loader (body). */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* CID driver interface (body). */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -74,7 +74,8 @@
PS_FontInfoRec* afont_info ) PS_FontInfoRec* afont_info )
{ {
*afont_info = ((CID_Face)face)->cid.font_info; *afont_info = ((CID_Face)face)->cid.font_info;
return 0;
return CID_Err_Ok;
} }
static FT_Error static FT_Error
@ -82,7 +83,8 @@
PS_FontExtraRec* afont_extra ) PS_FontExtraRec* afont_extra )
{ {
*afont_extra = ((CID_Face)face)->font_extra; *afont_extra = ((CID_Face)face)->font_extra;
return 0;
return CID_Err_Ok;
} }
static const FT_Service_PsInfoRec cid_service_ps_info = static const FT_Service_PsInfoRec cid_service_ps_info =

View File

@ -4,7 +4,7 @@
/* */ /* */
/* CID token definitions (specification only). */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Type 1 driver interface (body). */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -84,6 +84,7 @@
return 0; return 0;
} }
static const FT_Service_GlyphDictRec t1_service_glyph_dict = static const FT_Service_GlyphDictRec t1_service_glyph_dict =
{ {
(FT_GlyphDict_GetNameFunc) t1_get_glyph_name, (FT_GlyphDict_GetNameFunc) t1_get_glyph_name,
@ -91,10 +92,10 @@
}; };
/* /*
* POSTSCRIPT NAME SERVICE * POSTSCRIPT NAME SERVICE
* *
*/ */
static const char* static const char*
t1_get_ps_name( T1_Face face ) t1_get_ps_name( T1_Face face )
@ -102,16 +103,17 @@
return (const char*) face->type1.font_name; return (const char*) face->type1.font_name;
} }
static const FT_Service_PsFontNameRec t1_service_ps_name = static const FT_Service_PsFontNameRec t1_service_ps_name =
{ {
(FT_PsName_GetFunc)t1_get_ps_name (FT_PsName_GetFunc)t1_get_ps_name
}; };
/* /*
* MULTIPLE MASTERS SERVICE * MULTIPLE MASTERS SERVICE
* *
*/ */
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
static const FT_Service_MultiMastersRec t1_service_multi_masters = static const FT_Service_MultiMastersRec t1_service_multi_masters =
@ -125,31 +127,36 @@
#endif #endif
/* /*
* POSTSCRIPT INFO SERVICE * POSTSCRIPT INFO SERVICE
* *
*/ */
static FT_Error static FT_Error
t1_ps_get_font_info( FT_Face face, t1_ps_get_font_info( FT_Face face,
PS_FontInfoRec* afont_info ) PS_FontInfoRec* afont_info )
{ {
*afont_info = ((T1_Face)face)->type1.font_info; *afont_info = ((T1_Face)face)->type1.font_info;
return 0;
return T1_Err_Ok;
} }
static FT_Error static FT_Error
t1_ps_get_font_extra( FT_Face face, t1_ps_get_font_extra( FT_Face face,
PS_FontExtraRec* afont_extra ) PS_FontExtraRec* afont_extra )
{ {
*afont_extra = ((T1_Face)face)->type1.font_extra; *afont_extra = ((T1_Face)face)->type1.font_extra;
return 0;
return T1_Err_Ok;
} }
static FT_Int static FT_Int
t1_ps_has_glyph_names( FT_Face face ) t1_ps_has_glyph_names( FT_Face face )
{ {
FT_UNUSED( face ); FT_UNUSED( face );
return 1; return 1;
} }
@ -159,7 +166,8 @@
PS_PrivateRec* afont_private ) PS_PrivateRec* afont_private )
{ {
*afont_private = ((T1_Face)face)->type1.private_dict; *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, (PS_GetFontPrivateFunc)t1_ps_get_font_private,
}; };
#ifndef T1_CONFIG_OPTION_NO_AFM #ifndef T1_CONFIG_OPTION_NO_AFM
static const FT_Service_KerningRec t1_service_kerning = static const FT_Service_KerningRec t1_service_kerning =
{ {
@ -178,10 +187,11 @@
}; };
#endif #endif
/*
* SERVICE LIST /*
* * SERVICE LIST
*/ *
*/
static const FT_ServiceDescRec t1_services[] = static const FT_ServiceDescRec t1_services[] =
{ {

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Type 1 font loader (body). */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Type 1 tokenizer (specification). */ /* 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. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* High-level Type 42 driver interface (body). */ /* 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, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
@ -49,11 +49,11 @@
#define FT_COMPONENT trace_t42 #define FT_COMPONENT trace_t42
/* /*
* *
* GLYPH DICT SERVICE * GLYPH DICT SERVICE
* *
*/ */
static FT_Error static FT_Error
t42_get_glyph_name( T42_Face face, t42_get_glyph_name( T42_Face face,
@ -94,11 +94,11 @@
}; };
/* /*
* *
* POSTSCRIPT NAME SERVICE * POSTSCRIPT NAME SERVICE
* *
*/ */
static const char* static const char*
t42_get_ps_font_name( T42_Face face ) t42_get_ps_font_name( T42_Face face )
@ -113,32 +113,37 @@
}; };
/* /*
* *
* POSTSCRIPT INFO SERVICE * POSTSCRIPT INFO SERVICE
* *
*/ */
static FT_Error static FT_Error
t42_ps_get_font_info( FT_Face face, t42_ps_get_font_info( FT_Face face,
PS_FontInfoRec* afont_info ) PS_FontInfoRec* afont_info )
{ {
*afont_info = ((T42_Face)face)->type1.font_info; *afont_info = ((T42_Face)face)->type1.font_info;
return T42_Err_Ok; return T42_Err_Ok;
} }
static FT_Error static FT_Error
t42_ps_get_font_extra( FT_Face face, t42_ps_get_font_extra( FT_Face face,
PS_FontExtraRec* afont_extra ) PS_FontExtraRec* afont_extra )
{ {
*afont_extra = ((T42_Face)face)->type1.font_extra; *afont_extra = ((T42_Face)face)->type1.font_extra;
return T42_Err_Ok; return T42_Err_Ok;
} }
static FT_Int static FT_Int
t42_ps_has_glyph_names( FT_Face face ) t42_ps_has_glyph_names( FT_Face face )
{ {
FT_UNUSED( face ); FT_UNUSED( face );
return 1; return 1;
} }
@ -148,6 +153,7 @@
PS_PrivateRec* afont_private ) PS_PrivateRec* afont_private )
{ {
*afont_private = ((T42_Face)face)->type1.private_dict; *afont_private = ((T42_Face)face)->type1.private_dict;
return T42_Err_Ok; return T42_Err_Ok;
} }
@ -161,11 +167,11 @@
}; };
/* /*
* *
* SERVICE LIST * SERVICE LIST
* *
*/ */
static const FT_ServiceDescRec t42_services[] = static const FT_ServiceDescRec t42_services[] =
{ {

View File

@ -4,7 +4,8 @@
/* */ /* */
/* Type 42 font parser (body). */ /* 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, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */