* src/cache/ftccache.i: fixed a bug that prevented compilation in debug mode of template instantiation * src/cff/cffparse.c: fixed the CFF table loader. It didn't accept empty arrays, and this prevented the loading of certain fonts. * src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.c: adding fix to prevent seg fault when hints are provided in an empty glyph !! * include/freetype/ftimage.h: removed incorrect "zft_" definitions and updated constants documentation comments * include/freetype/freetype.h (FT_FaceRec): updating documentation comment. The "descender" value is always *negative*, not positive !
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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
diff --git a/ChangeLog b/ChangeLog
index 7e5821f..55b67b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2002-09-09 David Turner <david@freetype.org>
+
+ * src/cache/ftccache.i: fixed a bug that prevented compilation in
+ debug mode of template instantiation
+
+ * src/cff/cffparse.c: fixed the CFF table loader. It didn't accept
+ empty arrays, and this prevented the loading of certain fonts.
+
+ * src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.c: adding fix to
+ prevent seg fault when hints are provided in an empty glyph !!
+
+2002-09-09 Owen Taylor <owen@redhat.com>
+
+ * src/pcf/pcfdriver.c (PCF_Glyph_Load): fixing incorrect computation
+ of bitmap metrics.
+
2002-09-08 David Turner <david@freetype.org>
* src/smooth/ftsmooth.c, src/base/ftobjs.c,
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 32f03c0..57581f8 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -746,9 +746,9 @@ FT_BEGIN_HEADER
/* descender :: The face's descender is the vertical */
/* distance from the baseline to the */
/* bottommost point of any glyph in the face. */
- /* This field's value is positive, expressed */
+ /* This field's value is *negative*, expressed */
/* in font units. Some font designs use a */
- /* value different from `-bbox.yMin'. Only */
+ /* value different from `bbox.yMin'. Only */
/* relevant for scalable formats. */
/* */
/* height :: The face's height is the vertical distance */
diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h
index 099fcd3..b150e3c 100644
--- a/include/freetype/ftimage.h
+++ b/include/freetype/ftimage.h
@@ -422,25 +422,25 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Const> */
- /* FT_OUTLINE_NONE */
+ /* ft_outline_none */
/* */
/* <Description> */
/* This constant is deprecated. Please use @FT_OUTLINE_NONE */
/* instead. */
/* */
-#define zft_outline_none FT_OUTLINE_NONE
+#define ft_outline_none FT_OUTLINE_NONE
/*************************************************************************/
/* */
/* <Const> */
- /* FT_OUTLINE_OWNER */
+ /* ft_outline_owner */
/* */
/* <Description> */
/* This constant is deprecated. Please use @FT_OUTLINE_OWNER */
/* instead. */
/* */
-#define zft_outline_owner FT_OUTLINE_OWNER
+#define ft_outline_owner FT_OUTLINE_OWNER
/*************************************************************************/
@@ -452,55 +452,55 @@ FT_BEGIN_HEADER
/* This constant is deprecated. Please use @FT_OUTLINE_EVEN_ODD_FILL */
/* instead. */
/* */
-#define zft_outline_even_off_fill FT_OUTLINE_EVEN_ODD_FILL
+#define ft_outline_even_off_fill FT_OUTLINE_EVEN_ODD_FILL
/*************************************************************************/
/* */
/* <Const> */
- /* FT_OUTLINE_REVERSE_FILL */
+ /* ft_outline_reverse_fill */
/* */
/* <Description> */
/* This constant is deprecated. Please use @FT_OUTLINE_REVERSE_FILL */
/* instead. */
/* */
-#define zft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL
+#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL
/*************************************************************************/
/* */
/* <Const> */
- /* FT_OUTLINE_IGNORE_DROPOUTS */
+ /* ft_outline_ignore_dropouts */
/* */
/* <Description> */
/* This constant is deprecated. Please use */
/* @FT_OUTLINE_IGNORE_DROPOUTS instead. */
/* */
-#define zft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS
+#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS
/*************************************************************************/
/* */
/* <Const> */
- /* FT_OUTLINE_HIGH_PRECISION */
+ /* ft_outline_high_precision */
/* */
/* <Description> */
/* This constant is deprecated. Please use */
/* @FT_OUTLINE_HIGH_PRECISION instead. */
/* */
-#define zft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
+#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
/*************************************************************************/
/* */
/* <Const> */
- /* FT_OUTLINE_SINGLE_PASS */
+ /* ft_outline_single_pass */
/* */
/* <Description> */
/* This constant is deprecated. Please use @FT_OUTLINE_SINGLE_PASS */
/* instead. */
/* */
-#define zft_outline_single_pass FT_OUTLINE_SINGLE_PASS
+#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS
/* */
diff --git a/src/cache/ftccache.i b/src/cache/ftccache.i
index 8ecf395..bb6e631 100644
--- a/src/cache/ftccache.i
+++ b/src/cache/ftccache.i
@@ -89,16 +89,6 @@
bucket = cache->buckets + idx;
}
-#ifdef FT_DEBUG_LEVEL_ERROR
- if ( query->family != family ||
- family->fam_index >= cache->manager->families.size )
- {
- FT_ERROR((
- "ftc_cache_lookup: invalid query (bad 'family' field)\n" ));
- return FTC_Err_Invalid_Argument;
- }
-#endif
-
pnode = bucket;
for ( ;; )
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index b2c089b..43cc559 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -542,16 +542,15 @@
const CFF_Field_Handler* field;
- /* first of all, a trivial check */
- if ( num_args < 1 )
- goto Stack_Underflow;
-
*parser->top = p;
code = v;
if ( v == 12 )
{
/* two byte operator */
p++;
+ if ( p >= limit )
+ goto Syntax_Error;
+
code = 0x100 | p[0];
}
code = code | parser->object_code;
@@ -565,6 +564,11 @@
FT_Byte* q = (FT_Byte*)parser->object + field->offset;
+ /* check that we have enough arguments -- except for */
+ /* delta encoded arrays, which can be empty */
+ if ( field->kind != cff_kind_delta && num_args < 1 )
+ goto Stack_Underflow;
+
switch ( field->kind )
{
case cff_kind_bool:
diff --git a/src/pcf/pcfdriver.c b/src/pcf/pcfdriver.c
index cdaadb5..74e96ba 100644
--- a/src/pcf/pcfdriver.c
+++ b/src/pcf/pcfdriver.c
@@ -414,7 +414,8 @@ THE SOFTWARE.
slot->metrics.horiAdvance = metric->characterWidth << 6 ;
slot->metrics.horiBearingX = metric->leftSideBearing << 6 ;
slot->metrics.horiBearingY = metric->ascent << 6 ;
- slot->metrics.width = metric->characterWidth << 6 ;
+ slot->metrics.width = ( metric->rightSideBearing -
+ metric->leftSideBearing ) << 6;
slot->metrics.height = bitmap->rows << 6;
slot->linearHoriAdvance = (FT_Fixed)bitmap->width << 16;
diff --git a/src/pshinter/pshalgo2.c b/src/pshinter/pshalgo2.c
index 372ff28..c0a9265 100644
--- a/src/pshinter/pshalgo2.c
+++ b/src/pshinter/pshalgo2.c
@@ -1128,7 +1128,7 @@
/* process secondary hints to "selected" points */
- if ( num_masks > 1 )
+ if ( num_masks > 1 && glyph->num_points > 0 )
{
first = mask->end_point;
mask++;
diff --git a/src/pshinter/pshalgo3.c b/src/pshinter/pshalgo3.c
index bd65068..6174553 100644
--- a/src/pshinter/pshalgo3.c
+++ b/src/pshinter/pshalgo3.c
@@ -1297,7 +1297,7 @@
/* process secondary hints to "selected" points */
- if ( num_masks > 1 )
+ if ( num_masks > 1 && glyph->num_points > 0 )
{
first = mask->end_point;
mask++;
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index e982c53..636d32f 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -720,7 +720,7 @@
sbit_metrics->y_scale = 1 << 16;
#endif
- sbit_metrics->ascender = strike->hori.ascender << 6;
+ sbit_metrics->ascender = strike->hori.ascender << 6;
sbit_metrics->descender = strike->hori.descender << 6;
/* XXX: Is this correct? */