Commit a2c7eb188892c6f02cd10cfa814672f3f2820ca8

Werner Lemberg 2013-02-07T19:49:12

* src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables. BTW, Greg agrees that the OpenType specification is missing the list of GS variables which will always be reset to the default values after the `prep' table has been executed.

diff --git a/ChangeLog b/ChangeLog
index f78667d..b42df16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-02-07  Werner Lemberg  <wl@gnu.org>
+
+	* src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables.
+
+	BTW, Greg agrees that the OpenType specification is missing the list
+	of GS variables which will always be reset to the default values
+	after the `prep' table has been executed.
+
 2013-02-06  Werner Lemberg  <wl@gnu.org>
 
 	* src/truetype/ttobjs.c (tt_size_run_prep): Reset reference points.
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 9b828c3..814badd 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -878,11 +878,26 @@
     else
       error = TT_Err_Ok;
 
-    /* UNDOCUMENTED!  Reference points are reset to zero. */
+    /* UNDOCUMENTED!  The MS rasterizer doesn't allow the following */
+    /* graphics state variables to be modified by the CVT program.  */
+
+    exec->GS.dualVector.x = 0x4000;
+    exec->GS.dualVector.y = 0;
+    exec->GS.projVector.x = 0x4000;
+    exec->GS.projVector.y = 0x0;
+    exec->GS.freeVector.x = 0x4000;
+    exec->GS.freeVector.y = 0x0;
+
     exec->GS.rp0 = 0;
     exec->GS.rp1 = 0;
     exec->GS.rp2 = 0;
 
+    exec->GS.gep0 = 1;
+    exec->GS.gep1 = 1;
+    exec->GS.gep2 = 1;
+
+    exec->GS.loop = 1;
+
     /* save as default graphics state */
     size->GS = exec->GS;