freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 21bd9c2: [psaux] Fix Type 1 glyphs with too many stem


From: Hew Yih Shiuan Ewald
Subject: [freetype2] master 21bd9c2: [psaux] Fix Type 1 glyphs with too many stem hints.
Date: Sun, 7 Jan 2018 03:40:35 -0500 (EST)

branch: master
commit 21bd9c2f8ce57b20204ef505e9a64f55350edec0
Author: Ewald Hew <address@hidden>
Commit: Ewald Hew <address@hidden>

    [psaux] Fix Type 1 glyphs with too many stem hints.
    
    According to the CFF specification, charstrings can have up to 96 stem
    hints. Due to hint replacement routines in Type 1 charstrings, some
    glyphs are rejected by the Adobe engine, which implements the above
    limit. This fix turns off hinting for such glyphs.
    
    * src/psaux/pshints.c (cf2_hintmap_build): Reset the error from calling
    `cf2_hintmask_setAll' on a problematic Type 1 charstring and turn off
    hinting.
---
 ChangeLog           | 13 +++++++++++++
 src/psaux/pshints.c |  8 ++++++++
 2 files changed, 21 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 0ead1e5..5edd30b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2018-01-07  Ewald Hew  <address@hidden>
+
+       [psaux] Fix Type 1 glyphs with too many stem hints.
+
+       According to the CFF specification, charstrings can have up to 96 stem
+       hints. Due to hint replacement routines in Type 1 charstrings, some
+       glyphs are rejected by the Adobe engine, which implements the above
+       limit. This fix turns off hinting for such glyphs.
+
+       * src/psaux/pshints.c (cf2_hintmap_build): Reset the error from calling
+       `cf2_hintmask_setAll' on a problematic Type 1 charstring and turn off
+       hinting.
+
 2018-01-06  Werner Lemberg  <address@hidden>
 
        Add `FT_Done_MM_Var'.
diff --git a/src/psaux/pshints.c b/src/psaux/pshints.c
index 94f18c7..3615196 100644
--- a/src/psaux/pshints.c
+++ b/src/psaux/pshints.c
@@ -842,7 +842,15 @@
                            cf2_arrstack_size( hStemHintArray ) +
                              cf2_arrstack_size( vStemHintArray ) );
       if ( !cf2_hintmask_isValid( hintMask ) )
+      {
+        if ( font->isT1 )
+        {
+          /* no error, just continue unhinted */
+          *hintMask->error = FT_Err_Ok;
+          hintmap->hinted  = FALSE;
+        }
         return;                   /* too many stem hints */
+      }
     }
 
     /* begin by clearing the map */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]