Commit 3d92f08bc5d1eb187a35d4619a14f5d2feb8b956

Werner Lemberg 2007-03-06T11:59:24

* 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.

diff --git a/ChangeLog b/ChangeLog
index 017c412..2cd3b2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-03-05  Werner Lemberg  <wl@gnu.org>
+
+	* 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  <david@freetype.org>
 
 	* 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 970a50f..82702d3 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 e466e93..4fce36f 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 a22b80f..505d95c 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 8f849dd..a1a1cbb 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;