formatting
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 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399
diff --git a/ChangeLog b/ChangeLog
index 0c285d6..f93d7f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,21 +1,28 @@
2006-09-26 David Turner <david@freetype.org>
- * src/autofit/aftypes.h, src/autofit/afhints.h,
- src/autofit/afmodule.c: adding support for disabling
- horizontal and vertical hinting for the purpose of debugging
- the auto-fitter
-
- * include/freetype/config/ftoption.h, devel/ftoption.h:
- introducing the new FT_CONFIG_OPTION_SUBPIXEL_RENDERING to
- control wether we want to compile LCD-optimized rendering code
- (à la ClearType) or not. The macro *must* be disabled in default
- builds of the library for patent reasons.
-
- * src/smooth/ftsmooth.c: disabling LCD-specific rendering when
- FT_CONFIG_OPTION_SUBPIXEL_RENDERING isn't defined at compile
- time. This only changes the content of the rendered glyph to
- match the one of normal gray-level rendering, hence clients
- should not need to be modified.
+ * src/autofit/afhints.h (AF_HINTS_DO_HORIZONTAL,
+ AF_HINTS_DO_VERTICAL, AF_HINTS_DO_ADVANCE): New macros to disable
+ horizontal and vertical hinting for the purpose of debugging the
+ auto-fitter.
+
+ * src/autofit/afmodule.c (_af_debug_disable_horz_hints,
+ _af_debug_disable_vert_hints) [AF_DEBUG]: New global variables.
+
+ * src/autofit/aftypes.h [AF_DEBUG]: Declare above variables.
+
+ * include/freetype/config/ftoption.h, devel/ftoption.h
+ (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): New macro to control whether
+ we want to compile LCD-optimized rendering code (à la ClearType) or
+ not. The macro *must* be disabled in default builds of the library
+ for patent reasons.
+
+ * src/smooth/ftsmooth.c (ft_smooth_render_generic): Disable
+ LCD-specific rendering when FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ isn't defined at compile time. This only changes the content of the
+ rendered glyph to match the one of normal gray-level rendering,
+ hence clients should not need to be modified.
+
+ * docs/CHANGES: Updated.
2006-09-18 Garrick Meeker <garrick@digitalanarchy.com>
diff --git a/devel/ftoption.h b/devel/ftoption.h
index 1bc2758..cea6dea 100644
--- a/devel/ftoption.h
+++ b/devel/ftoption.h
@@ -77,19 +77,19 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
- /* uncomment the line below if you want to active sub-pixel rendering */
+ /* Uncomment the line below if you want to active sub-pixel rendering */
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
/* */
/* Note that this feature is covered by several Microsoft patents */
/* and should not be activated in any default build of the library. */
/* */
/* This macro has no impact on the FreeType API, only on its */
- /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
- /* FT_Render_Glyph will still generate a bitmap that is 3 times */
- /* larger than the original size, The difference will be that each */
- /* triplet of subpixels will have R=G=B. */
+ /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
+ /* FT_Render_Glyph still generates a bitmap that is 3 times larger than */
+ /* the original size; the difference will be that each triplet of */
+ /* subpixels has R=G=B. */
/* */
- /* This is done to allow FreeType clients to run unmodified, forcing */
+ /* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
diff --git a/docs/CHANGES b/docs/CHANGES
index 4e1008e..c5fbebf 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -2,65 +2,71 @@ CHANGES BETWEEN 2.2.2 and 2.2.1
I. IMPORTANT BUG FIXES
- - The PCF font loarder has been seriously hardened against malformed
- font files.
+ - The PCF font loader is now much more robust while loading
+ malformed font files.
+
+ - Various memory leaks have been found and fixed.
- - various memory leaks have been found and squashed
II. IMPORTANT CHANGES
- - the unpatented hinter is now part of the default build of the
- library, and we added code to automatically support "tricky"
+ - The unpatented hinter is now part of the default build of the
+ library; we have added code to automatically support `tricky'
fonts that need it.
- what this means is that FreeType should "just work" with certain
- Asian fonts, like MingLiU, which cannot properly load without a
- bytecode interpreter, but fortunately do not use any of the
- patented bytecode opcodes. We detect these fonts by name, so
- report any font file that doesn't seem to work with this,
- and we'll do what we can to support it in a next release.
-
- Note that the API didn't change, so you can still force
- unpatented hinting with a special parameter to FT_Open_Face
- as well. This might be useful, for example, a PDF reader
- might present a user option to activate it to deal with certain
- "tricky" embedded fonts which cannot be clearly identified.
-
- if you're an embedded systems developer, you might want to
- *disable* the feature to save code space by undefining
+ This means that FreeType should `just work' with certain Asian
+ fonts, like MingLiU, which cannot properly be loaded without a
+ bytecode interpreter, but which fortunately do not use any of
+ the patented bytecode opcodes. We detect these fonts by name,
+ so please report any font file that doesn't seem to work with
+ FreeType, and we shall do what we can to support it in a next
+ release.
+
+ Note that the API hasn't changed, so you can still force
+ unpatented hinting with a special parameter to FT_Open_Face as
+ well. This might be useful in same cases; for example, a PDF
+ reader might present a user option to activate it to deal with
+ certain `tricky' embedded fonts which cannot be clearly
+ identified.
+
+ If you are a developer for embedded systems, you might want to
+ *disable* the feature to save code space by undefining
TT_CONFIG_OPTION_UNPATENTED_HINTING in ftoption.h.
- - LCD-optimized rendering is now DISABLED in all default builds
- of the library, mainly due to PATENTS. For more information
+ - LCD-optimized rendering is now DISABLED in all default builds of
+ the library, mainly due to PATENT issues. For more information
see:
http://lists.gnu.org/archive/html/freetype/2006-09/msg00064.html
- a new configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING has
- been introduced in ftoption.h; manually define it in this file
- if you want to re-enable the feature.
+ A new configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ has been introduced in ftoption.h; manually define it in this
+ file if you want to re-enable the feature.
- the change only affects the implementation, not the FreeType API.
- This means that clients don't need to be modified, because the
- library still generates LCD decimated bitmaps, but with the added
- constraint that R=G=B on each triplet.
+ The change only affects the implementation, not the FreeType
+ API. This means that clients don't need to be modified, because
+ the library still generates LCD decimated bitmaps, but with the
+ added constraint that R=G=B on each triplet.
- the displayed result should be equal to normal anti-aliased
+ The displayed result should be equal to normal anti-aliased
rendering.
- - Some computation bugs in the TrueType bytecode interpreter were found,
- which allow us to get rid of very subtle and rare differences we had
- with the Windows renderer.
+ - Some computation bugs in the TrueType bytecode interpreter were
+ found, which allow us to get rid of very subtle and rare
+ differences we had experienced with the Windows renderer.
+
III. MISCELLANEOUS
- TrueType glyph loading is now about 25% faster.
- - the anti-aliased rasterizer has been optimized and is now 15% to 25%
- percent faster than the previous one, depending on content
+ - The anti-aliased rasterizer has been optimized and is now 15% to
+ 25% percent faster than in previous versions, depending on
+ content.
+
+ - The Type 1 loader has been improved; as an example, it now skips
+ top-level dictionaries properly.
- - the Type 1 loader has been improved; as an example, it now skips
- over top-level dictionaries properly
======================================================================
@@ -557,7 +563,7 @@ CHANGES BETWEEN 2.1.8 and 2.1.7
III. MISCELLANEOUS
- - Wolfgang Domr�e contributed support files for building FreeType
+ - Wolfgang Domröse contributed support files for building FreeType
on the Atari using the PureC compiler. Note that the Atari is a
16bit platform.
@@ -1141,7 +1147,7 @@ CHANGES BETWEEN 2.1.0 and 2.0.9
to use the following text in your documentation:
"""
- Portions of this software are copyright 1996-2002 The
+ Portions of this software are copyright © 1996-2002 The
FreeType Project (www.freetype.org). All rights reserved.
"""
@@ -2844,4 +2850,9 @@ file you indicate that you have read the license and understand and
accept it fully.
+Local Variables:
+version-control: never
+coding: utf-8
+End:
+
--- end of CHANGES ---
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 8e76295..c6caa1b 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -77,23 +77,24 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
- /* uncomment the line below if you want to active sub-pixel rendering */
+ /* Uncomment the line below if you want to active sub-pixel rendering */
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
/* */
/* Note that this feature is covered by several Microsoft patents */
/* and should not be activated in any default build of the library. */
/* */
/* This macro has no impact on the FreeType API, only on its */
- /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
- /* FT_Render_Glyph will still generate a bitmap that is 3 times */
- /* larger than the original size, The difference will be that each */
- /* triplet of subpixels will have R=G=B. */
+ /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
+ /* FT_Render_Glyph still generates a bitmap that is 3 times larger than */
+ /* the original size; the difference will be that each triplet of */
+ /* subpixels has R=G=B. */
/* */
- /* This is done to allow FreeType clients to run unmodified, forcing */
+ /* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+
/*************************************************************************/
/* */
/* Many compilers provide a non-ANSI 64-bit data type that can be used */
diff --git a/src/autofit/afhints.h b/src/autofit/afhints.h
index 45cf513..66078fd 100644
--- a/src/autofit/afhints.h
+++ b/src/autofit/afhints.h
@@ -213,17 +213,22 @@ FT_BEGIN_HEADER
#define AF_HINTS_TEST_SCALER( h, f ) ( (h)->scaler_flags & (f) )
#define AF_HINTS_TEST_OTHER( h, f ) ( (h)->other_flags & (f) )
+
#ifdef AF_DEBUG
-#define AF_HINTS_DO_HORIZONTAL( h ) \
- ( !_af_debug_disable_horz_hints && !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL ) )
-#define AF_HINTS_DO_VERTICAL( h ) \
- ( !_af_debug_disable_vert_hints && !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL ) )
+#define AF_HINTS_DO_HORIZONTAL( h ) \
+ ( !_af_debug_disable_horz_hints && \
+ !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL ) )
+
+#define AF_HINTS_DO_VERTICAL( h ) \
+ ( !_af_debug_disable_vert_hints && \
+ !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL ) )
#define AF_HINTS_DO_ADVANCE( h ) \
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )
#else /* !AF_DEBUG */
+
#define AF_HINTS_DO_HORIZONTAL( h ) \
!AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL )
@@ -235,6 +240,7 @@ FT_BEGIN_HEADER
#endif /* !AF_DEBUG */
+
FT_LOCAL( AF_Direction )
af_direction_compute( FT_Pos dx,
FT_Pos dy );
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 16f3a4b..3045a75 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (body). */
/* */
-/* Copyright 2000-2001, 2002, 2003, 2004, 2005 by */
+/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -183,6 +183,7 @@
params.flags = FT_RASTER_FLAG_AA;
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+
/* implode outline if needed */
{
FT_Int n;
@@ -190,11 +191,15 @@
if ( hmul )
- for ( vec = outline->points, n = 0; n < outline->n_points; n++, vec++ )
+ for ( vec = outline->points, n = 0;
+ n < outline->n_points;
+ n++, vec++ )
vec->x *= hmul;
if ( vmul )
- for ( vec = outline->points, n = 0; n < outline->n_points; n++, vec++ )
+ for ( vec = outline->points, n = 0;
+ n < outline->n_points;
+ n++, vec++ )
vec->y *= vmul;
}
@@ -208,33 +213,42 @@
if ( hmul )
- for ( vec = outline->points, n = 0; n < outline->n_points; n++, vec++ )
+ for ( vec = outline->points, n = 0;
+ n < outline->n_points;
+ n++, vec++ )
vec->x /= hmul;
if ( vmul )
- for ( vec = outline->points, n = 0; n < outline->n_points; n++, vec++ )
+ for ( vec = outline->points, n = 0;
+ n < outline->n_points;
+ n++, vec++ )
vec->y /= vmul;
}
+
#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+
/* render outline into bitmap */
error = render->raster_render( render->raster, ¶ms );
/* expand it horizontally */
if ( hmul > 1 )
{
- FT_Byte* line = bitmap->buffer + (height - height_org)*pitch;
+ FT_Byte* line = bitmap->buffer + ( height - height_org ) * pitch;
FT_UInt hh;
+
for ( hh = height_org; hh > 0; hh--, line += pitch )
{
FT_UInt xx;
FT_Byte* end = line + width;
+
for ( xx = width_org; xx > 0; xx-- )
{
FT_UInt pixel = line[xx-1];
FT_UInt count = hmul;
+
for ( count = hmul; count > 0; count-- )
end[-count] = (FT_Byte)pixel;
@@ -246,14 +260,16 @@
/* expand it vertically */
if ( vmul > 1 )
{
- FT_Byte* read = bitmap->buffer + (height-height_org)*pitch;
- FT_Byte* write = bitmap->buffer;
- FT_UInt hh;
+ FT_Byte* read = bitmap->buffer + ( height - height_org ) * pitch;
+ FT_Byte* write = bitmap->buffer;
+ FT_UInt hh;
+
for ( hh = height_org; hh > 0; hh-- )
{
FT_UInt count = vmul;
+
for ( count = vmul; count > 0; count-- )
{
memcpy( write, read, pitch );