From aaf21968deb85b635cb6aa6544df233ea5981346 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 13 Feb 2013 09:48:21 +0100 Subject: Update to following packages: openssl-1.0.1e freetype-2.4.11 --- freetype/src/pshinter/pshglob.c | 51 +++++++++++++++++++++++++++++++++++++++-- freetype/src/pshinter/pshmod.c | 17 +++++++------- freetype/src/pshinter/pshpic.c | 10 ++++---- freetype/src/pshinter/pshpic.h | 16 ++++++++----- 4 files changed, 73 insertions(+), 21 deletions(-) (limited to 'freetype/src/pshinter') diff --git a/freetype/src/pshinter/pshglob.c b/freetype/src/pshinter/pshglob.c index 31231ad00..9285efc9e 100644 --- a/freetype/src/pshinter/pshglob.c +++ b/freetype/src/pshinter/pshglob.c @@ -5,7 +5,7 @@ /* PostScript hinter global hinting management (body). */ /* Inspired by the new auto-hinter module. */ /* */ -/* Copyright 2001, 2002, 2003, 2004, 2006, 2010 by */ +/* Copyright 2001-2004, 2006, 2010, 2012 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -522,6 +522,28 @@ } + /* calculate the maximum height of given blue zones */ + static FT_Short + psh_calc_max_height( FT_UInt num, + const FT_Short* values, + FT_Short cur_max ) + { + FT_UInt count; + + + for ( count = 0; count < num; count += 2 ) + { + FT_Short cur_height = values[count + 1] - values[count]; + + + if ( cur_height > cur_max ) + cur_max = cur_height; + } + + return cur_max; + } + + FT_LOCAL_DEF( void ) psh_blues_snap_stem( PSH_Blues blues, FT_Int stem_top, @@ -684,7 +706,32 @@ priv->family_blues, priv->num_family_other_blues, priv->family_other_blues, priv->blue_fuzz, 1 ); - globals->blues.blue_scale = priv->blue_scale; + /* limit the BlueScale value to `1 / max_of_blue_zone_heights' */ + { + FT_Fixed max_scale; + FT_Short max_height = 1; + + + max_height = psh_calc_max_height( priv->num_blue_values, + priv->blue_values, + max_height ); + max_height = psh_calc_max_height( priv->num_other_blues, + priv->other_blues, + max_height ); + max_height = psh_calc_max_height( priv->num_family_blues, + priv->family_blues, + max_height ); + max_height = psh_calc_max_height( priv->num_family_other_blues, + priv->family_other_blues, + max_height ); + + /* BlueScale is scaled 1000 times */ + max_scale = FT_DivFix( 1000, max_height ); + globals->blues.blue_scale = priv->blue_scale < max_scale + ? priv->blue_scale + : max_scale; + } + globals->blues.blue_shift = priv->blue_shift; globals->blues.blue_fuzz = priv->blue_fuzz; diff --git a/freetype/src/pshinter/pshmod.c b/freetype/src/pshinter/pshmod.c index 91da5d7e6..cdeaca18c 100644 --- a/freetype/src/pshinter/pshmod.c +++ b/freetype/src/pshinter/pshmod.c @@ -4,7 +4,7 @@ /* */ /* FreeType PostScript hinter module implementation (body). */ /* */ -/* Copyright 2001, 2002, 2007 by */ +/* Copyright 2001, 2002, 2007, 2009, 2012 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -93,14 +93,15 @@ } - FT_DEFINE_PSHINTER_INTERFACE(pshinter_interface, + FT_DEFINE_PSHINTER_INTERFACE( + pshinter_interface, pshinter_get_globals_funcs, pshinter_get_t1_funcs, - pshinter_get_t2_funcs - ) + pshinter_get_t2_funcs ) - FT_DEFINE_MODULE(pshinter_module_class, + FT_DEFINE_MODULE( + pshinter_module_class, 0, sizeof ( PS_Hinter_ModuleRec ), @@ -108,11 +109,11 @@ 0x10000L, 0x20000L, - &FTPSHINTER_INTERFACE_GET, /* module-specific interface */ + &PSHINTER_INTERFACE_GET, /* module-specific interface */ (FT_Module_Constructor)ps_hinter_init, (FT_Module_Destructor) ps_hinter_done, - (FT_Module_Requester) 0 /* no additional interface for now */ - ) + (FT_Module_Requester) NULL ) /* no additional interface for now */ + /* END */ diff --git a/freetype/src/pshinter/pshpic.c b/freetype/src/pshinter/pshpic.c index 1e0f9a9dc..bf7f2009d 100644 --- a/freetype/src/pshinter/pshpic.c +++ b/freetype/src/pshinter/pshpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for pshinter module. */ /* */ -/* Copyright 2009, 2010 by */ +/* Copyright 2009, 2010, 2012 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -22,6 +22,7 @@ #include "pshpic.h" #include "pshnterr.h" + #ifdef FT_CONFIG_OPTION_PIC /* forward declaration of PIC init functions from pshmod.c */ @@ -33,7 +34,7 @@ pshinter_module_class_pic_free( FT_Library library ) { FT_PIC_Container* pic_container = &library->pic_container; - FT_Memory memory = library->memory; + FT_Memory memory = library->memory; if ( pic_container->pshinter ) @@ -49,7 +50,7 @@ { FT_PIC_Container* pic_container = &library->pic_container; FT_Error error = PSH_Err_Ok; - PSHinterPIC* container; + PSHinterPIC* container = NULL; FT_Memory memory = library->memory; @@ -63,13 +64,12 @@ FT_Init_Class_pshinter_interface( library, &container->pshinter_interface ); -/*Exit:*/ if( error ) pshinter_module_class_pic_free( library ); return error; } - #endif /* FT_CONFIG_OPTION_PIC */ + /* END */ diff --git a/freetype/src/pshinter/pshpic.h b/freetype/src/pshinter/pshpic.h index c10bdd999..62abf322c 100644 --- a/freetype/src/pshinter/pshpic.h +++ b/freetype/src/pshinter/pshpic.h @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for pshinter module. */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2012 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -24,21 +24,25 @@ FT_BEGIN_HEADER #include FT_INTERNAL_PIC_H + #ifndef FT_CONFIG_OPTION_PIC -#define FTPSHINTER_INTERFACE_GET pshinter_interface +#define PSHINTER_INTERFACE_GET pshinter_interface #else /* FT_CONFIG_OPTION_PIC */ #include FT_INTERNAL_POSTSCRIPT_HINTS_H - typedef struct PSHinterPIC_ + typedef struct PSHinterPIC_ { - PSHinter_Interface pshinter_interface; + PSHinter_Interface pshinter_interface; + } PSHinterPIC; -#define GET_PIC(lib) ((PSHinterPIC*)((lib)->pic_container.autofit)) -#define FTPSHINTER_INTERFACE_GET (GET_PIC(library)->pshinter_interface) + +#define GET_PIC( lib ) ( (PSHinterPIC*)((lib)->pic_container.autofit) ) + +#define PSHINTER_INTERFACE_GET ( GET_PIC( library )->pshinter_interface ) /* see pshpic.c for the implementation */ void -- cgit v1.2.3