Commit 916838ca68b0069212b2690c53e12d58c6679333

Werner Lemberg 2004-02-10T16:02:20

* src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_endchar>: Preserve glyph width before calling cff_operator_seac. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Handle special first argument for `hintmask' and `cntrmask' operators also.

diff --git a/ChangeLog b/ChangeLog
index 7380725..01d01ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-02-09  Werner Lemberg  <wl@gnu.org>
+
+	* src/cff/cffgload.c (cff_decoder_parse_charstrings)
+	<cff_op_endchar>: Preserve glyph width before calling
+	cff_operator_seac.
+
+2003-02-09  Martin Muskens  <mmuskens@aurelon.com>
+
+	* src/cff/cffgload.c (cff_decoder_parse_charstrings): Handle special
+	first argument for `hintmask' and `cntrmask' operators also.
+
 2003-02-08  Werner Lemberg  <wl@gnu.org>
 
 	* builds/unix/configure.in: Call AC_SUBST for `enable_shared',
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index af2b206..9aee312 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -1108,7 +1108,7 @@
             /* `glyph_width' to `nominal_width' plus number on the stack   */
             /* -- for either case.                                         */
 
-            FT_Int set_width_ok;
+            FT_Int  set_width_ok;
 
 
             switch ( op )
@@ -1123,6 +1123,8 @@
             case cff_op_hstemhm:
             case cff_op_vstemhm:
             case cff_op_rmoveto:
+            case cff_op_hintmask:
+            case cff_op_cntrmask:
               set_width_ok = num_args & 1;
               break;
 
@@ -1744,12 +1746,18 @@
           /* We are going to emulate the seac operator. */
           if ( num_args == 4 )
           {
+            /* Save glyph width so that the subglyphs don't overwrite it. */
+            FT_Pos  glyph_width = decoder->glyph_width;
+
+
             error = cff_operator_seac( decoder,
                                        args[0],
                                        args[1],
                                        (FT_Int)( args[2] >> 16 ),
                                        (FT_Int)( args[3] >> 16 ) );
             args += 4;
+
+            decoder->glyph_width = glyph_width;
           }
           else
           {