[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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
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;