Commit 971517ac8e9fb75b0b2ef944a62199fc4fcb0ffe

David Turner 2002-07-08T23:13:25

* src/pshinter/pshglob.h, src/pshinter/pshglob.c: adding support for blue fuzz

diff --git a/ChangeLog b/ChangeLog
index 68360ec..4239c37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@
 
 2002-07-07  Owen Taylor  <owen@redhat.com>
 
+    * src/pshinter/pshglob.h, src/pshinter/pshglob.c: adding support for
+    blue fuzz
+
     * include/freetype/freetype.h, src/base/ftobjs.h,
     freetype/internal/ftobjs.h, freetype/internal/psaux.h,
     freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
diff --git a/src/pshinter/pshglob.c b/src/pshinter/pshglob.c
index 58c77b5..ef71396 100644
--- a/src/pshinter/pshglob.c
+++ b/src/pshinter/pshglob.c
@@ -534,10 +534,10 @@
     for ( ; count > 0; count--, zone++ )
     {
       delta = stem_top - zone->org_bottom;
-      if ( delta < 0 )
+      if ( delta < -blues->blue_fuzz )
         break;
 
-      if ( stem_top <= zone->org_top )
+      if ( stem_top <= zone->org_top + blues->blue_fuzz)
       {
         if ( no_shoots || delta <= blues->blue_threshold )
         {
@@ -556,10 +556,10 @@
     for ( ; count > 0; count--, zone-- )
     {
       delta = zone->org_top - stem_bot;
-      if ( delta < 0 )
+      if ( delta < -blues->blue_fuzz )
         break;
 
-      if ( stem_bot >= zone->org_bottom )
+      if ( stem_bot >= zone->org_bottom - blues->blue_fuzz )
       {
         if ( no_shoots || delta < blues->blue_shift )
         {
@@ -680,6 +680,8 @@
                                   ? priv->blue_shift
                                   : 7;
 
+      globals->blues.blue_fuzz = priv->blue_fuzz;
+
       globals->dimension[0].scale_mult  = 0;
       globals->dimension[0].scale_delta = 0;
       globals->dimension[1].scale_mult  = 0;
diff --git a/src/pshinter/pshglob.h b/src/pshinter/pshglob.h
index fcda9da..0a3a96a 100644
--- a/src/pshinter/pshglob.h
+++ b/src/pshinter/pshglob.h
@@ -123,6 +123,7 @@ FT_BEGIN_HEADER
     FT_Fixed           blue_scale;
     FT_Int             blue_shift;
     FT_Int             blue_threshold;
+    FT_Int             blue_fuzz;
     FT_Bool            no_overshoots;
 
   } PSH_BluesRec, *PSH_Blues;
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index d2f810d..4868a98 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1653,6 +1653,9 @@
     /* default lenIV */
     type1->private_dict.lenIV = 4;
 
+    /* default blue fuzz, we put it there since 0 is a valid value */
+    type1->private_dict.blue_fuzz = 1;
+
     parser = &loader.parser;
     error  = T1_New_Parser( parser,
                             face->root.stream,