Cleanups.
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 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362
diff --git a/ChangeLog b/ChangeLog
index 3fa873f..dc11e3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -103,8 +103,15 @@
* src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Use
`ft_glyphslot_alloc_bitmap'.
- * src/sfnt/ttsbit.c, src/type42/t42objs.c,
- src/winfonts/winfnt.c:
+ * src/sfnt/ttsbit.c (Load_SBit_Image): Change 5th argument to type
+ `FT_GlyphSlot'.
+ Adding argument `depth' to handle recursive calls.
+ Use `ft_glyphslot_alloc_bitmap'.
+ (tt_face_load_sbit_image): Remove unused variable `memory'.
+ Don't handle `FT_GLYPH_OWN_BITMAP'.
+ Update call to Load_SBit_Image.
+
+ * src/type42/t42objs.c, src/winfonts/winfnt.c:
* src/cache/ftlru.c (FT_LruList_Lookup): Fixed an invalid assertion
check.
@@ -126,8 +133,9 @@
2003-03-14 David Turner <david@freetype.org>
- * src/truetype/ttdriver.c: Fixing the small TrueType native
- rendering glitches, they came from a small rounding error.
+ * src/truetype/ttdriver.c (Set_Char_Sizes): Fixing the small
+ TrueType native rendering glitches, they came from a small rounding
+ error.
2003-03-13 David Turner <david@freetype.org>
@@ -161,10 +169,11 @@
leak) that only happened when a try to resize an array would end in
an out-of-memory condition.
- * src/smooth/ftgrays.c: Removed compiler warnings / volatile bug.
+ * src/smooth/ftgrays.c (gray_convert_glyph): Removed compiler
+ warnings / volatile bug.
- * src/truetype/ttobjs.c: Removed segmentation fault that happened in
- tight memory environments.
+ * src/truetype/ttobjs.c (tt_glyphzone_done): Removed segmentation
+ fault that happened in tight memory environments.
2003-02-28 Pixel <pixel@mandrakesoft.com>
@@ -232,8 +241,17 @@
* src/base/ftobjs.c (ft_recompute_scaled_metrics): Fix rounding.
- * src/truetype/ttdriver.c, src/truetype/ttobjs.h,
- src/truetype/ttobjs.c, src/truetype/ttinterp.c:
+ * src/truetype/ttdriver.c (Set_Char_Sizes): New variable `metrics2'.
+ [!TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Removed.
+
+ * src/truetype/ttobjs.h (TT_SizeRec): New field `metrics'.
+ * src/truetype/ttobjs.c (Reset_Outline_Size): Fix initialization of
+ `metrics'.
+ [FT_CONFIG_CHESTER_ASCENDER]: Code removed.
+ (Reset_SBit_Size): Fix initialization of `metrics'.
+
+ * src/truetype/ttinterp.c (TT_Load_Context): Fix initialization of
+ `exec->metrics'.
* src/autohint/ahhint.c (ah_hinter_load): Disabled the advance width
"correction" which seemed to provide more trouble than benefits.
@@ -249,8 +267,14 @@
Allow metrics to be overridden.
* src/cid/cidgload.c (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL]:
Ditto.
- * src/truetype/ttgload.c, src/type1/t1gload.c
- [FT_CONFIG_OPTION_INCREMENTAL]:
+
+ * src/truetype/ttgload.c (load_truetype_glyph)
+ [FT_CONFIG_OPTION_INCREMENTAL]: Simplify.
+ (compute_glyph_metrics) [FT_CONFIG_OPTION_INCREMENTAL]: Code block
+ moved down.
+
+ * src/type1/t1gload.c [FT_CONFIG_OPTION_INCREMENTAL]:
+
* include/freetype/ftincrem.h: Updated.
2003-01-31 David Turner <david@freetype.org>
@@ -285,7 +309,12 @@
* src/base/ftobjs.c (FT_Set_Char_Size)
[FT_CONFIG_CHESTER_BLUE_SCALE]: Round differently.
- * src/truetype/ttobjs.c:
+ * src/truetype/ttdriver.c (Set_Char_Sizes)
+ [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Do some rounding only
+ if this macro is defined.
+
+ * src/truetype/ttobjs.c (Reset_Outline_Size)
+ [FT_CONFIG_CHESTER_ASCENDER]: Round differently.
* src/pshinter/pshalgo3.c: Improved the Postscript hinter. Getting
rid of stem snapping seems to work well here (though the stems are
@@ -464,6 +493,11 @@
* src/truetype/ttgload.c: Fixing the TrueType loader to handle
invalid composites correctly by limiting the recursion depth.
+ (TT_MAX_COMPOSITE_RECURSE): New macro.
+ (load_truetype_glyph): Add argument `recurse_count'.
+ Load a composite only if the numbers of contours is -1, emit error
+ otherwise.
+ (TT_Load_Glyph): Updated.
2003-01-08 David Turner <david@freetype.org>
@@ -517,6 +551,9 @@
* include/freetype/tttables.h (FT_Load_Sfnt_Table): New function.
* src/base/ftobjs.c: Implement it.
+ * src/sfnt/sfdriver.c (sfnt_get_interface): Handle `load_sfnt'
+ module request.
+
2002-12-17 David Turner <david@freetype.org>
* src/base/ftobjs.c (find_unicode_charmap): Added some comments to
@@ -4244,7 +4281,7 @@
* include/freetype/internal/ftmemory.h, src/base/ftdbgmem.c:
Improvements to the memory debugger to report more information in
- case of errors. Also, some allocations that occured through REALLOC
+ case of errors. Also, some allocations that occurred through REALLOC
couldn't be previously catched correctly.
* src/autohint/ahglyph.c (ah_outline_compute_segments,
@@ -4318,7 +4355,7 @@
* src/type1/t1load.c (parse_font_name, parse_subrs): Added a test
for when loading synthetic fonts to make sure that the font name
and subrotuines are not loaded twice. This is to remove a memory
- leak that occured because the original memory blocks for these
+ leak that occurred because the original memory blocks for these
objects were not deallocated when the objects were parsed the
second time.
@@ -5569,7 +5606,7 @@
* src/cff/cffobjs.c, src/cff/cffobjs.h, src/cff/cffparse.c,
src/cff/cffdrivr.c, src/cff/cff.c, src/cff/cffload.c,
src/cff/cffgload.c, src/cff/cffgload.h: Changed to use
- cffgload.{c,h} instead of t2gload.{c,h}. All occurences of t2_
+ cffgload.{c,h} instead of t2gload.{c,h}. All occurrences of t2_
(T2_) were replaced with cff_ (CFF_, respectively).
* src/cff/t2gload.h: Renamed cffgload.h.
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index e930b71..8deba51 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (body). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -178,8 +178,9 @@
while ( new_size < table->cursor + length )
{
- /* increase size by 25% and round up to the nearest multiple of 1024 */
- new_size += (new_size >> 2) + 1;
+ /* increase size by 25% and round up to the nearest multiple
+ of 1024 */
+ new_size += ( new_size >> 2 ) + 1;
new_size = ( new_size + 1023 ) & -1024;
}
diff --git a/src/pshinter/pshalgo3.c b/src/pshinter/pshalgo3.c
index 77f39bd..03f6ce6 100644
--- a/src/pshinter/pshalgo3.c
+++ b/src/pshinter/pshalgo3.c
@@ -4,7 +4,7 @@
/* */
/* PostScript hinting algorithm 3 (body). */
/* */
-/* Copyright 2001, 2002 by */
+/* Copyright 2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -458,9 +458,9 @@
return;
}
- /* perform stem snapping when requested - this is necessary
- * for monochrome and LCD hinting modes only
- */
+ /* perform stem snapping when requested - this is necessary
+ * for monochrome and LCD hinting modes only
+ */
do_snapping = ( dimension == 0 && glyph->do_horz_snapping ) ||
( dimension == 1 && glyph->do_vert_snapping );
@@ -520,22 +520,22 @@
hint->cur_pos = pos;
hint->cur_len = fit_len;
- /* stem adjustment tries to snap stem widths to standard
- * ones. this is important to prevent unpleasant rounding
- * artefacts...
- */
+ /* Stem adjustment tries to snap stem widths to standard
+ * ones. This is important to prevent unpleasant rounding
+ * artefacts.
+ */
if ( glyph->do_stem_adjust )
{
if ( len <= 64 )
{
- /* the stem is less than one pixel, we will center it
- * around the nearest pixel center
- */
+ /* the stem is less than one pixel; we will center it
+ * around the nearest pixel center
+ */
#if 1
- pos = ( pos + (len >> 1) ) & -64;
+ pos = ( pos + ( len >> 1 ) ) & -64;
#else
- /* this seems to be a bug !! */
- pos = ( pos + ( (len >> 1) & -64 ) );
+ /* this seems to be a bug! */
+ pos = ( pos + ( ( len >> 1 ) & -64 ) );
#endif
len = 64;
}
@@ -626,6 +626,7 @@
PSH_AlignmentRec align;
+
/* ignore stem alignments when requested through the hint flags */
if ( ( dimension == 0 && !glyph->do_horz_hints ) ||
( dimension == 1 && !glyph->do_vert_hints ) )
@@ -684,53 +685,55 @@
if ( !psh3_hint_is_fitted( parent ) )
psh3_hint_align_light( parent, globals, dimension, glyph );
- par_org_center = parent->org_pos + ( parent->org_len / 2);
- par_cur_center = parent->cur_pos + ( parent->cur_len / 2);
- cur_org_center = hint->org_pos + ( hint->org_len / 2);
+ par_org_center = parent->org_pos + ( parent->org_len / 2 );
+ par_cur_center = parent->cur_pos + ( parent->cur_len / 2 );
+ cur_org_center = hint->org_pos + ( hint->org_len / 2 );
cur_delta = FT_MulFix( cur_org_center - par_org_center, scale );
pos = par_cur_center + cur_delta - ( len >> 1 );
}
- /* Stems less than one pixel wide are easy - we want to
- * make them as dark as possible, so they must fall within
- * one pixel. If the stem is split between two pixels
- * then snap the edge that is nearer to the pixel boundary
- * to the pixel boundary
- */
- if (len <= 64)
+ /* Stems less than one pixel wide are easy -- we want to
+ * make them as dark as possible, so they must fall within
+ * one pixel. If the stem is split between two pixels
+ * then snap the edge that is nearer to the pixel boundary
+ * to the pixel boundary.
+ */
+ if ( len <= 64 )
{
if ( ( pos + len + 63 ) / 64 != pos / 64 + 1 )
pos += psh3_hint_snap_stem_side_delta ( pos, len );
}
- /* Position stems other to minimize the amount of mid-grays.
- * There are, in general, two positions that do this,
- * illustrated as A) and B) below.
- *
- * + + + +
- *
- * A) |--------------------------------|
- * B) |--------------------------------|
- * C) |--------------------------------|
- *
- * Position A) (split the excess stem equally) should be better
- * for stems of width N + f where f < 0.5
- *
- * Position B) (split the deficiency equally) should be better
- * for stems of width N + f where f > 0.5
- *
- * It turns out though that minimizing the total number of lit
- * pixels is also important, so position C), with one edge
- * aligned with a pixel boundary is actually preferable
- * to A). There are also more possibile positions for C) than
- * for A) or B), so it involves less distortion of the overall
- * character shape.
- */
+
+ /* Position stems other to minimize the amount of mid-grays.
+ * There are, in general, two positions that do this,
+ * illustrated as A) and B) below.
+ *
+ * + + + +
+ *
+ * A) |--------------------------------|
+ * B) |--------------------------------|
+ * C) |--------------------------------|
+ *
+ * Position A) (split the excess stem equally) should be better
+ * for stems of width N + f where f < 0.5.
+ *
+ * Position B) (split the deficiency equally) should be better
+ * for stems of width N + f where f > 0.5.
+ *
+ * It turns out though that minimizing the total number of lit
+ * pixels is also important, so position C), with one edge
+ * aligned with a pixel boundary is actually preferable
+ * to A). There are also more possibile positions for C) than
+ * for A) or B), so it involves less distortion of the overall
+ * character shape.
+ */
else /* len > 64 */
{
- FT_Fixed frac_len = len & 63;
- FT_Fixed center = pos + ( len >> 1 );
- FT_Fixed delta_a, delta_b;
+ FT_Fixed frac_len = len & 63;
+ FT_Fixed center = pos + ( len >> 1 );
+ FT_Fixed delta_a, delta_b;
+
if ( ( len / 64 ) & 1 )
{
@@ -743,18 +746,20 @@
delta_b = ( center & -64 ) + 32 - center;
}
- /* We choose between B) and C) above based on the amount
- * of fractinal stem width; for small amounts, choose
- * C) always, for large amounts, B) always, and inbetween,
- * pick whichever one involves less stem movement.
- */
- if (frac_len < 32)
+ /* We choose between B) and C) above based on the amount
+ * of fractinal stem width; for small amounts, choose
+ * C) always, for large amounts, B) always, and inbetween,
+ * pick whichever one involves less stem movement.
+ */
+ if ( frac_len < 32 )
{
pos += psh3_hint_snap_stem_side_delta ( pos, len );
}
- else if (frac_len < 48)
+ else if ( frac_len < 48 )
{
- FT_Fixed side_delta = psh3_hint_snap_stem_side_delta ( pos, len );
+ FT_Fixed side_delta = psh3_hint_snap_stem_side_delta ( pos,
+ len );
+
if ( ABS( side_delta ) < ABS( delta_b ) )
pos += side_delta;