Commit 105721a5a61718ab43de8f7e7e277077668b0eae

Werner Lemberg 2008-11-15T10:35:51

* src/truetype/ttinterp.c (tt_default_graphics_state): The default value for `scan_type' is zero, as confirmed by Greg Hitchcock from Microsoft. Problem reported by Michal Nowakowski <miszka@limes.com.pl>.

diff --git a/ChangeLog b/ChangeLog
index 31b5846..f2214e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-11-15  Werner Lemberg  <wl@gnu.org>
+
+	* src/truetype/ttinterp.c (tt_default_graphics_state): The default
+	value for `scan_type' is zero, as confirmed by Greg Hitchcock from
+	Microsoft.  Problem reported by Michal Nowakowski
+	<miszka@limes.com.pl>.
+
 2008-11-12  Tor Andersson  <tor.andersson@gmail.com>
 
 	* src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field.
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 2ab0c09..74c8f17 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -748,6 +748,13 @@
   }
 
 
+  /* The default value for `scan_control' is documented as FALSE in the */
+  /* TrueType specification.  This is confusing since it implies a      */
+  /* Boolean value.  However, this is not the case, thus both the       */
+  /* default values of our `scan_type' and `scan_control' fields (which */
+  /* the documentation's `scan_control' variable is split into) are     */
+  /* zero.                                                              */
+
   const TT_GraphicsState  tt_default_graphics_state =
   {
     0, 0, 0,
@@ -761,7 +768,7 @@
 
     1, 64, 1,
     TRUE, 68, 0, 0, 9, 3,
-    0, FALSE, 2, 1, 1, 1
+    0, FALSE, 0, 1, 1, 1
   };
 
 
diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h
index 6971013..d4b8228 100644
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Objects manager (specification).                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by       */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -99,6 +99,10 @@ FT_BEGIN_HEADER
     FT_Short       delta_shift;
 
     FT_Byte        instruct_control;
+    /* According to Greg Hitchcock from Microsoft, the `scan_control'     */
+    /* variable as documented in the TrueType specification is a 32-bit   */
+    /* integer; the high-word part holds the SCANTYPE value, the low-word */
+    /* part the SCANCTRL value.  We separate it into two fields.          */
     FT_Bool        scan_control;
     FT_Int         scan_type;