From 105721a5a61718ab43de8f7e7e277077668b0eae Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 15 Nov 2008 10:35:51 +0000 Subject: [PATCH] * 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 . --- ChangeLog | 7 +++++++ src/truetype/ttinterp.c | 9 ++++++++- src/truetype/ttobjs.h | 6 +++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31b584628..f2214e75b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-11-15 Werner Lemberg + + * 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 + . + 2008-11-12 Tor Andersson * src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field. diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c index 2ab0c0940..74c8f17a8 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 6971013af..d4b82285e 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;