Commit a374c9cfe7bb26045a82a8229bf419565fb004f9

Werner Lemberg 2015-03-03T11:23:45

[autofit] Fix Savannah bug #44241. * src/autofit/aflatin.c (af_latin_metrics_init_blues): Reject glyphs with less than 3 points.

diff --git a/ChangeLog b/ChangeLog
index e84215e..dc432ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-03-03  Werner Lemberg  <wl@gnu.org>
+
+	[autofit] Fix Savannah bug #44241.
+
+	* src/autofit/aflatin.c (af_latin_metrics_init_blues): Reject glyphs
+	with less than 3 points.
+
 2015-03-02  Werner Lemberg  <wl@gnu.org>
 
 	Simplify `TYPEOF' macro.
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index a46321f..e228548 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -362,9 +362,10 @@
 
         error   = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
         outline = face->glyph->outline;
-        if ( error || outline.n_points <= 0 )
+        /* reject glyphs that don't produce any rendering */
+        if ( error || outline.n_points <= 2 )
         {
-          FT_TRACE5(( "  U+%04lX contains no outlines\n", ch ));
+          FT_TRACE5(( "  U+%04lX contains no (usable) outlines\n", ch ));
           continue;
         }