From ed6c0e063c05f474de620bdc3a22fb96f35379e5 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 15 Sep 2008 07:49:40 +0000 Subject: [PATCH] Fix Savannah bug #24179, reported by Bram Tassyns. * src/type1/t1load.c (mm_axis_unmap, T1_Get_MM_Var): Fix computation of default values. * src/tools/glnames.py (main): Surround `ft_get_adobe_glyph_index' and `ft_adobe_glyph_list' with FT_CONFIG_OPTION_ADOBE_GLYPH_LIST to prevent unconditional definition. This fixes Savannah bug #24241. * src/psnames/pstables.h: Regenerated. --- ChangeLog | 15 +++++++++++++++ include/freetype/config/ftoption.h | 6 +++--- src/psnames/pstables.h | 7 ++++++- src/tools/glnames.py | 11 ++++++++--- src/type1/t1load.c | 8 +++----- 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47ea642de..aa303813d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-09-15 George Williams + + Fix Savannah bug #24179, reported by Bram Tassyns. + + * src/type1/t1load.c (mm_axis_unmap, T1_Get_MM_Var): Fix computation + of default values. + +2008-09-15 Werner Lemberg + + * src/tools/glnames.py (main): Surround `ft_get_adobe_glyph_index' + and `ft_adobe_glyph_list' with FT_CONFIG_OPTION_ADOBE_GLYPH_LIST to + prevent unconditional definition. This fixes Savannah bug #24241. + + * src/psnames/pstables.h: Regenerated. + 2008-09-13 Werner Lemberg * autogen.sh, builds/unix/configure.raw, diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h index 22f06edca..cd57a9461 100644 --- a/include/freetype/config/ftoption.h +++ b/include/freetype/config/ftoption.h @@ -233,19 +233,19 @@ FT_BEGIN_HEADER /* */ /* Glyph Postscript Names handling */ /* */ - /* By default, FreeType 2 is compiled with the `PSNames' module. This */ + /* By default, FreeType 2 is compiled with the `psnames' module. This */ /* module is in charge of converting a glyph name string into a */ /* Unicode value, or return a Macintosh standard glyph name for the */ /* use with the TrueType `post' table. */ /* */ - /* Undefine this macro if you do not want `PSNames' compiled in your */ + /* Undefine this macro if you do not want `psnames' compiled in your */ /* build of FreeType. This has the following effects: */ /* */ /* - The TrueType driver will provide its own set of glyph names, */ /* if you build it to support postscript names in the TrueType */ /* `post' table. */ /* */ - /* - The Type 1 driver will not be able to synthetize a Unicode */ + /* - The Type 1 driver will not be able to synthesize a Unicode */ /* charmap out of the glyphs found in the fonts. */ /* */ /* You would normally undefine this configuration macro when building */ diff --git a/src/psnames/pstables.h b/src/psnames/pstables.h index cc40ef735..ed05c4ca7 100644 --- a/src/psnames/pstables.h +++ b/src/psnames/pstables.h @@ -4,7 +4,7 @@ /* */ /* PostScript glyph names. */ /* */ -/* Copyright 2005 by */ +/* Copyright 2005, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -561,6 +561,9 @@ * The lookup function to get the Unicode value for a given string * is defined below the table. */ + +#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + static const unsigned char ft_adobe_glyph_list[54791] = { 0, 52, 0,106, 2,167, 3, 63, 4,220, 6,125, 9,143, 10, 23, @@ -4086,5 +4089,7 @@ return 0; } +#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ + /* END */ diff --git a/src/tools/glnames.py b/src/tools/glnames.py index 9a6da3831..e8a3a59f1 100644 --- a/src/tools/glnames.py +++ b/src/tools/glnames.py @@ -6,7 +6,7 @@ # -# Copyright 1996-2000, 2003, 2005, 2007 by +# Copyright 1996-2000, 2003, 2005, 2007, 2008 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -21,7 +21,7 @@ usage: %s This python script generates the glyph names tables defined in the - PSNames module. + `psnames' module. Its single argument is the name of the header file to be created. """ @@ -5067,7 +5067,7 @@ def main(): write( "/* */\n" ) write( "/* PostScript glyph names. */\n" ) write( "/* */\n" ) - write( "/* Copyright 2005 by */\n" ) + write( "/* Copyright 2005, 2008 by */\n" ) write( "/* David Turner, Robert Wilhelm, and Werner Lemberg. */\n" ) write( "/* */\n" ) write( "/* This file is part of the FreeType project, and may only be used, */\n" ) @@ -5117,6 +5117,9 @@ def main(): * The lookup function to get the Unicode value for a given string * is defined below the table. */ + +#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + """ ) dump_array( dict_array, write, "ft_adobe_glyph_list" ) @@ -5219,6 +5222,8 @@ def main(): return 0; } +#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ + """ ) if 0: # generate unit test, or don't diff --git a/src/type1/t1load.c b/src/type1/t1load.c index 624df4d94..36aa5de63 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -241,8 +241,7 @@ axismap->blend_points[j] - axismap->blend_points[j - 1] ); - - return axismap->design_points[j - 1] + + return FT_INT_TO_FIXED( axismap->design_points[j - 1] ) + FT_MulDiv( t, axismap->design_points[j] - axismap->design_points[j - 1], @@ -355,9 +354,8 @@ blend->num_axis ); for ( i = 0; i < mmaster.num_axis; ++i ) - mmvar->axis[i].def = - FT_INT_TO_FIXED( mm_axis_unmap( &blend->design_map[i], - axiscoords[i] ) ); + mmvar->axis[i].def = mm_axis_unmap( &blend->design_map[i], + axiscoords[i] ); } *master = mmvar;