Commit 5c8a8cb54c0af0e53a01b8db3a5d5175fe4e57c3

Werner Lemberg 2016-02-06T08:03:03

[cff] Fix some Type 2 operators in old CFF engine. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Fix `eq' operator, add `not' and (unsupported) `blend' operators.

diff --git a/ChangeLog b/ChangeLog
index fa6ac11..63403ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-06  Werner Lemberg  <wl@gnu.org>
+
+	[cff] Fix some Type 2 operators in old CFF engine.
+
+	* src/cff/cffgload.c (cff_decoder_parse_charstrings): Fix `eq'
+	operator, add `not' and (unsupported) `blend' operators.
+
 2016-02-05  Sebastian Rasmussen  <sebras@gmail.com>
 
 	Make direct call of `make install' work (#47072).
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 0ef48f1..36a353d 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2221,15 +2221,26 @@
           break;
 
         case cff_op_store:
+          /* this operator was removed from the Type2 specification */
+          /* in version 16-March-2000                               */
           FT_TRACE4(( " store\n"));
 
           goto Unimplemented;
 
         case cff_op_load:
+          /* this operator was removed from the Type2 specification */
+          /* in version 16-March-2000                               */
           FT_TRACE4(( " load\n" ));
 
           goto Unimplemented;
 
+        case cff_op_blend:
+          /* this operator was removed from the Type2 specification */
+          /* in version 16-March-2000                               */
+          FT_TRACE4(( " blend\n" ));
+
+          goto Unimplemented;
+
         case cff_op_dotsection:
           /* this operator is deprecated and ignored by the parser */
           FT_TRACE4(( " dotsection\n" ));
@@ -2358,11 +2369,23 @@
           }
           break;
 
-        case cff_op_eq:
+        case cff_op_not:
           {
             FT_Fixed  cond = !args[0];
 
 
+            FT_TRACE4(( " not\n" ));
+
+            args[0] = cond ? 0x10000L : 0;
+            args++;
+          }
+          break;
+
+        case cff_op_eq:
+          {
+            FT_Fixed  cond = args[0] == args[1];
+
+
             FT_TRACE4(( " eq\n" ));
 
             args[0] = cond ? 0x10000L : 0;