shithub: freetype+ttf2subf

Download patch

ref: 3d92f08bc5d1eb187a35d4619a14f5d2feb8b956
parent: dddd068e5dc398c290ca5b559c1ce5622b5d667f
author: Werner Lemberg <[email protected]>
date: Tue Mar 6 06:59:24 EST 2007

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

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-03-05  Werner Lemberg  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* src/base/ftinit.c (FT_Init_FreeType): fixed a small memory leak
--- 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
 
 
   /**********************************************************************/
--- 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
           {
--- 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 );
--- 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;