From 3d92f08bc5d1eb187a35d4619a14f5d2feb8b956 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 6 Mar 2007 11:59:24 +0000 Subject: [PATCH] * include/freetype/config/ftstdlib.h (ft_strstr): New wrapper macro for `strstr'. * src/truetype/ttobjs.c (tt_face_init): Use ft_strstr for scanning `trick_names', as suggested by Ivan Nincic. --- ChangeLog | 8 ++++++++ include/freetype/config/ftstdlib.h | 3 ++- src/autofit/aflatin.c | 2 +- src/pshinter/pshalgo.c | 8 ++++---- src/truetype/ttobjs.c | 4 ++-- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 017c412af..2cd3b2da1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-03-05 Werner Lemberg + + * include/freetype/config/ftstdlib.h (ft_strstr): New wrapper + macro for `strstr'. + + * src/truetype/ttobjs.c (tt_face_init): Use ft_strstr for scanning + `trick_names', as suggested by Ivan Nincic. + 2007-03-05 David Turner * src/base/ftinit.c (FT_Init_FreeType): fixed a small memory leak diff --git a/include/freetype/config/ftstdlib.h b/include/freetype/config/ftstdlib.h index 970a50f7b..82702d3cd 100644 --- a/include/freetype/config/ftstdlib.h +++ b/include/freetype/config/ftstdlib.h @@ -5,7 +5,7 @@ /* ANSI-specific library and header configuration file (specification */ /* only). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -101,6 +101,7 @@ #define ft_strncmp strncmp #define ft_strncpy strncpy #define ft_strrchr strrchr +#define ft_strstr strstr /**********************************************************************/ diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c index e466e93ed..4fce36fa7 100644 --- a/src/autofit/aflatin.c +++ b/src/autofit/aflatin.c @@ -479,7 +479,7 @@ if ( dim == AF_DIMENSION_HORZ ) { if ( fitted < scaled ) - scale -= scale/50; /* x_scale = x_scale*0.98 */ + scale -= scale / 50; /* scale *= 0.98 */ } else { diff --git a/src/pshinter/pshalgo.c b/src/pshinter/pshalgo.c index a22b80fa6..505d95c57 100644 --- a/src/pshinter/pshalgo.c +++ b/src/pshinter/pshalgo.c @@ -2220,11 +2220,11 @@ PSH_Dimension dim_x = &glyph->globals->dimension[0]; PSH_Dimension dim_y = &glyph->globals->dimension[1]; - FT_Fixed x_scale = dim_x->scale_mult; - FT_Fixed y_scale = dim_y->scale_mult; + FT_Fixed x_scale = dim_x->scale_mult; + FT_Fixed y_scale = dim_y->scale_mult; - FT_Fixed scaled; - FT_Fixed fitted; + FT_Fixed scaled; + FT_Fixed fitted; scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale ); diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index 8f849dd87..a1a1cbb7d 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -283,8 +283,8 @@ /* be worth to do more checks for a few special cases. */ for ( nn = 0; trick_names[nn] != NULL; nn++ ) { - if ( ttface->family_name && - ft_strcmp( ttface->family_name, trick_names[nn] ) == 0 ) + if ( ttface->family_name && + ft_strstr( ttface->family_name, trick_names[nn] ) ) { unpatented_hinting = 1; break;