shithub: freetype+ttf2subf

Download patch

ref: 5c8a8cb54c0af0e53a01b8db3a5d5175fe4e57c3
parent: ae7c55d98ef18e08eba991acd3cb2cc96ace61f8
author: Werner Lemberg <[email protected]>
date: Sat Feb 6 03:03:03 EST 2016

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

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-06  Werner Lemberg  <[email protected]>
+
+	[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  <[email protected]>
 
 	Make direct call of `make install' work (#47072).
--- 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,9 +2369,21 @@
           }
           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" ));