* include/freetype/internal/ftdebug.h (FT_Trace): Remove comma in enum to avoid compiler warnings.
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 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522
diff --git a/ChangeLog b/ChangeLog
index e96f5ac..718aecd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,39 +1,56 @@
+2002-02-22 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/internal/ftdebug.h (FT_Trace): Remove comma in
+ enum to avoid compiler warnings.
+
2002-02-21 David Turner <david@freetype.org>
- * include/freetype/internal/ftdebug.h, src/base/ftdebug.c: modified
- the debug sub-system initialization. trace levels can now be specified
- within the "FT2_DEBUG" environment variable. See the comments within
- "ftdebug.c" for more details
+ Modified the debug sub-system initialization. Trace levels can now
+ be specified within the "FT2_DEBUG" environment variable. See the
+ comments within "ftdebug.c" for more details.
- * include/freetype/internal/fttrace.h: new file to define the trace
- levels used for debugging. it is used both to define enums and
- toggle names for FT2_DEBUG
+ * src/base/ftdebug.c: (FT_SetTraceLevel): Removed.
+ (ft_debug_init): New function.
+ (ft_debug_dummy): Removed.
+ Updated to changes in ftdebug.h
+
+ * include/freetype/internal/ftdebug.h: Always define
+ FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE is defined.
+ (FT_Assert): Renamed to ...
+ (FT_ASSERT): This.
+ Some stuff from ftdebug.h has been moved to ...
- * src/base/ftobjs.c, src/base/ftstream.c: FT_Assert renamed to
- FT_ASSERT
+ * include/freetype/internal/fttrace.h: This new file to define the
+ trace levels used for debugging. It is used both to define enums
+ and toggle names for FT2_DEBUG.
+ * include/freetype/internal/internal.h: Updated.
- * include/freetype/internal/ftextend.h, src/base/ftextend.c,
- src/base/Jamfile, src/base/rules.mk: removing "ftextend" from the
- library, since it is now completely obsolete..
+ * src/base/ftobjs.c, src/base/ftstream.c: Updated.
- * include/freetype/fterrors.h: adding "#undef FT_ERR_CAT" to avoid
- warnings with certain compilers (like LCC)
+ * include/freetype/internal/ftextend.h, src/base/ftextend.c:
+ Removed. Both files are now completely obsolete.
+ * src/base/Jamfile, src/base/rules.mk: Updated.
- * src/pshinter/pshalgo2.c: renaming 'print_zone' to 'psh2_print_zone'
- to avoid errors during compilation of debug library
+ * include/freetype/fterrors.h: Adding "#undef FT_ERR_CAT" and
+ `#undef FT_ERR_XCAT" to avoid warnings with certain compilers (like
+ LCC).
+ * src/pshinter/pshalgo2.c (print_zone): Renamed to ...
+ (psh2_print_zone): This to avoid errors during compilation of debug
+ library.
-2002-02-20 David Turner <david@freetype.org>
+ * src/smooth/ftgrays.c (FT_COMPONENT): Change definition to as
+ `trace_smooth'.
- * README: adding "devel@freetype.org" address for bug reports..
+2002-02-20 David Turner <david@freetype.org>
+ * README: Adding "devel@freetype.org" address for bug reports.
2002-02-20 Werner Lemberg <wl@gnu.org>
* builds/unix/install.mk (check): New dummy target.
(.PHONY): Add it.
-
2002-02-19 Werner Lemberg <wl@gnu.org>
* builds/freetype.mk (FT_CFLAGS): Use $(INCLUDE_FLAGS) first.
@@ -154,7 +171,7 @@
2002-02-06 Detlef Würkner <TetiSoft@apg.lahn.de>
* src/pcf/pcfdriver.c (FT_Done_Face): Fixed small memory leak.
-
+
* src/pcf/pcfread.c (pcf_load_font): Now handles the "AVERAGE_WIDTH"
property to return correct character pixel (width/height) pairs for
embedded bitmaps.
@@ -454,7 +471,7 @@
* src/cff/cffgload.c (CFF_Parse_CharStrings), src/psaux/t1decode.c
(T1_Decoder_Parse_Charstrings), src/pshinter/pshalgo2.c (*), Fixed a
- bug where the X and Y axis where inversed in the postscript hinter.
+ bug where the X and Y axis where inversed in the postscript hinter.
This caused problem when displaying on non-square surfaces.
* src/pshinter/pshalgo2.c: s/vertical/dimension/.
diff --git a/README b/README
index 371afab..dc7fb12 100644
--- a/README
+++ b/README
@@ -24,14 +24,13 @@
ftp://ftp.freetype.org/pub/freetype2/ftdoc208.zip
-
Reports
=======
- Please report bugs by e-mail to 'devel@freetype.org'. Don't forget
- to join a detailed explanation of what's wrong, there is nothing
- worse than receiving a terse message that says "it doesn't work"
- for us :o)
+ Please report bugs by e-mail to `devel@freetype.org'. Don't
+ forget to send a detailed explanation of the problem -- there is
+ nothing worse than receiving a terse message that only says "it
+ doesn't work".
diff --git a/include/freetype/fterrors.h b/include/freetype/fterrors.h
index 85dd658..9c8ad41 100644
--- a/include/freetype/fterrors.h
+++ b/include/freetype/fterrors.h
@@ -196,11 +196,6 @@
"invalid argument" )
FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
"unimplemented feature" )
- FT_ERRORDEF_( Invalid_Table, 0x08, \
- "broken table" )
- FT_ERRORDEF_( Invalid_Offset, 0x09, \
- "broken offset within table" )
-
/* glyph/character errors */
diff --git a/include/freetype/internal/ftdebug.h b/include/freetype/internal/ftdebug.h
index b13aa78..3d1100a 100644
--- a/include/freetype/internal/ftdebug.h
+++ b/include/freetype/internal/ftdebug.h
@@ -28,11 +28,11 @@ FT_BEGIN_HEADER
/* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
-/* is already defined.. this simplifies the following #ifdefs.. */
+/* is already defined; this simplifies the following #ifdefs */
/* */
#ifdef FT_DEBUG_LEVEL_TRACE
-# undef FT_DEBUG_LEVEL_ERROR
-# define FT_DEBUG_LEVEL_ERROR
+#undef FT_DEBUG_LEVEL_ERROR
+#define FT_DEBUG_LEVEL_ERROR
#endif
@@ -45,26 +45,25 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_LEVEL_TRACE
-# define FT_TRACE_DEF(x) trace_ ## x ,
+#define FT_TRACE_DEF( x ) trace_ ## x ,
- /* defining the enums */
+ /* defining the enums */
typedef enum
{
-# include FT_INTERNAL_TRACE_H
- trace_count,
+#include FT_INTERNAL_TRACE_H
+ trace_count
} FT_Trace;
- /* defining the array of trace levels, provided by 'src/base/ftdebug.c' */
- extern int ft_trace_levels [ trace_count ];
+ /* defining the array of trace levels, provided by `src/base/ftdebug.c' */
+ extern int ft_trace_levels[trace_count];
-# undef FT_TRACE_DEF
+#undef FT_TRACE_DEF
#endif /* FT_DEBUG_LEVEL_TRACE */
-
/*************************************************************************/
/* */
/* Define the FT_TRACE macro */
@@ -78,7 +77,7 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_LEVEL_TRACE
-# define FT_TRACE( level, varformat ) \
+#define FT_TRACE( level, varformat ) \
do \
{ \
if ( ft_trace_levels[FT_COMPONENT] >= level ) \
@@ -87,10 +86,11 @@ FT_BEGIN_HEADER
#else /* !FT_DEBUG_LEVEL_TRACE */
-# define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */
+#define FT_TRACE( level, varformat ) do ; while ( 0 ) /* nothing */
#endif /* !FT_DEBUG_LEVEL_TRACE */
+
/*************************************************************************/
/* */
/* You need two opening resp. closing parentheses! */
@@ -109,7 +109,6 @@ FT_BEGIN_HEADER
#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
-
/*************************************************************************/
/* */
/* Define the FT_ERROR macro */
@@ -118,11 +117,11 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_LEVEL_ERROR
-# define FT_ERROR( varformat ) FT_Message varformat
+#define FT_ERROR( varformat ) FT_Message varformat
#else /* !FT_DEBUG_LEVEL_ERROR */
-# define FT_ERROR( varformat ) do ; while ( 0 ) /* nothing */
+#define FT_ERROR( varformat ) do ; while ( 0 ) /* nothing */
#endif /* !FT_DEBUG_LEVEL_ERROR */
@@ -145,7 +144,7 @@ FT_BEGIN_HEADER
#else /* !FT_DEBUG_LEVEL_ERROR */
-# define FT_ASSERT( condition ) do ; while ( 0 )
+#define FT_ASSERT( condition ) do ; while ( 0 )
#endif /* !FT_DEBUG_LEVEL_ERROR */
@@ -171,7 +170,6 @@ FT_BEGIN_HEADER
#endif /* FT_DEBUG_LEVEL_ERROR */
-
FT_BASE( void ) ft_debug_init( void );
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index 43a44d0..60eb598 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -450,171 +450,6 @@ FT_BEGIN_HEADER
/*************************************************************************/
/**** ****/
/**** ****/
- /**** V A L I D A T O R ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- typedef struct FT_ValidatorRec_* FT_Validator;
-
-/*********************************************************************
- *
- * there are three distinct validation levels here:
- *
- * DEFAULT ::
- * used to perform normal checks. A table validated with this setting
- * is sufficiently correct to be used reliably by FreeType
- *
- * TIGHT ::
- * this is more strict than default. A table validated with this setting
- * is sufficiently correct to be used reliablity by FreeType and to not
- * contain invalid data (that will not crash FreeType or produce bogus
- * warnings). This is used to spot font converter/generation tool
- * bugs..
- *
- * for example, a CharMap table could map a given character code to
- * a glyph index that is larger than the number of available glyphs
- * in the font. Such a table would not pass the "TIGHT" validation
- * even though it can be used safely with FreeType (which will later
- * report errors when trying to load the glyph, for example..)
- *
- *
- * PARANOID ::
- * in this mode, everything is checked to the maximum, and according
- * to the specification(s) defining the tables being checked. Really
- * useful for font fascists and to spot really weird font artefacts.
- *
- * Beware that most fonts will simply not pass this validation level
- * though !!
- */
- typedef enum
- {
- FT_VALIDATE_DEFAULT = 0,
- FT_VALIDATE_TIGHT,
- FT_VALIDATE_PARANOID
-
- } FT_ValidationLevel;
-
-
-/**********************************************************************
- *
- * to use it, you need something like:
- *
- * valid->error = 0;
- *
- * if ( setjmp( valid->jump_buffer ) == 0 )
- * validate_table( table_data, .... );
- *
- * return valid->error;
- *
- */
- typedef struct FT_ValidatorRec_
- {
- FT_Byte* base; /* address of table in memory */
- FT_Byte* limit; /* base + size of table in bytes */
-
- FT_Error error; /* error code. 0 in case of success */
- FT_ValidationLevel level; /* validation level.. */
- FT_UInt num_glyphs; /* if level >= FT_VALIDATE_TIGHT only */
-
- jmp_buf jump_buffer;
-
- } FT_ValidatorRec;
-
-
- /* call this function when an error is detected during validation. this */
- /* will set the error and call 'longjmp' to return to the top-level */
- /* caller of the validation routine.. */
- /* */
- FT_BASE( void )
- ft_validator_error( FT_Validator valid,
- FT_Error error );
-
- /* this macro assumes that the local variable 'valid' points to the */
- /* current validator structure.. */
-#define FT_INVALID(e) ft_validator_error( valid, e )
-
- /* a few "common" errors in font tables */
-#define FT_INVALID_TOO_SHORT FT_INVALID( FT_Err_Invalid_Table )
-#define FT_INVALID_OFFSET FT_INVALID( FT_Err_Invalid_Offset )
-#define FT_INVALID_GLYPH_ID FT_INVALID( FT_Err_Invalid_Table )
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** C H A R M A P S ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /* handle to internal charmap object */
- typedef struct FT_CMapRec_* FT_CMap;
-
- /* handle to charmap class structure */
- typedef const struct FT_CMap_ClassRec_* FT_CMap_Class;
-
-
- /* internal charmap object structure, sub-class of 'FT_CharMapRec' */
- typedef struct FT_CMapRec_
- {
- FT_CharMapRec charmap;
- FT_CMap_Class clazz;
- FT_Pointer data; /* passed to validate/index/next methods */
-
- } FT_CMapRec;
-
- /* useful macros */
-#define FT_CMAP(x) ((FT_CMap)(x))
-#define FT_CMAP_FACE(x) (FT_CMAP(x)->charmap.face)
-#define FT_CMAP_PLATFORM_ID(x) (FT_CMAP(x)->charmap.platform_id)
-#define FT_CMAP_ENCODING_ID(x) (FT_CMAP(x)->charmap.encoding_id)
-#define FT_CMAP_ENCODING(x) (FT_CMAP(x)->charmap.encoding)
-
-
- /* charmap initializer */
- typedef FT_Error (*FT_CMap_InitFunc)( FT_CMap cmap );
-
- /* charmap finalizer */
- typedef void (*FT_CMap_DoneFunc)( FT_CMap cmap );
-
- /* charmap validation routine */
- typedef FT_Error (*FT_CMap_ValidateFunc)( FT_Pointer cmap_data,
- FT_Validator valid );
-
- /* charmap charcode to glyph index mapping function */
- typedef FT_UInt (*FT_CMap_CharIndexFunc)( FT_Pointer cmap_data,
- FT_ULong char_code );
-
- /* charmap charcode increment function */
- typedef FT_ULong (*FT_CMap_CharNextFunc)( FT_Pointer cmap_data,
- FT_ULong char_code,
- FT_UInt *agindex );
-
- /* charmap class */
- typedef struct FT_CMap_ClassRec_
- {
- FT_ULong size; /* size in bytes */
- FT_CMap_InitFunc init;
- FT_CMap_DoneFunc done;
- FT_CMap_ValidateFunc validate;
- FT_CMap_CharIndexFunc char_index;
- FT_CMap_CharNextFunc char_next;
-
- } FT_CMap_ClassRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
/**** R E N D E R E R S ****/
/**** ****/
/**** ****/
diff --git a/src/base/ftdebug.c b/src/base/ftdebug.c
index ea4033a..4263c67 100644
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -85,12 +85,12 @@
#ifdef FT_DEBUG_LEVEL_TRACE
/* array of trace levels, initialized to 0 */
- int ft_trace_levels[ trace_count ];
+ int ft_trace_levels[trace_count];
- /* define array of trace toggle names */
-#define FT_TRACE_DEF(x) #x ,
+ /* define array of trace toggle names */
+#define FT_TRACE_DEF(x) #x ,
- static const char* ft_trace_toggles[ trace_count+1 ] =
+ static const char* ft_trace_toggles[trace_count + 1] =
{
#include FT_INTERNAL_TRACE_H
NULL
@@ -99,25 +99,24 @@
#undef FT_TRACE_DEF
-
- /************************************************************************
- *
- * initialize the tracing sub-system, this is done by retrieving the
- * value of the "FT2_DEBUG" environment variable. It must be a list of
- * toggles, separated by spaces, ';' or ':' for example:
- *
- * "any=3 memory=6 stream=5"
- *
- * will request that all levels be set to 3, except the trace level for
- * the memory and stream components which are respectively set to 6 and 5
- *
- * see the file <freetype/internal/fttrace.h> for details of the available
- * toggle names.
- *
- * the level is between 0 and 6, where 0 is quiet (except in important
- * runtime errors), and 6 is _very_ verbose
- */
-
+ /*************************************************************************/
+ /* */
+ /* Initialize the tracing sub-system. This is done by retrieving the */
+ /* value of the "FT2_DEBUG" environment variable. It must be a list of */
+ /* toggles, separated by spaces, `;' or `:'. Example: */
+ /* */
+ /* "any=3 memory=6 stream=5" */
+ /* */
+ /* This will request that all levels be set to 3, except the trace level */
+ /* for the memory and stream components which are set to 6 and 5, */
+ /* respectively. */
+ /* */
+ /* See the file <freetype/internal/fttrace.h> for details of the */
+ /* available toggle names. */
+ /* */
+ /* The level must be between 0 and 6; 0 means quiet (except for serious */
+ /* runtime errors), and 6 means _very_ verbose. */
+ /* */
FT_BASE_DEF( void )
ft_debug_init( void )
{
@@ -128,6 +127,7 @@
const char* p = ft2_debug;
const char* q;
+
for ( ; *p; p++ )
{
/* skip leading whitespace and separators */
@@ -144,10 +144,12 @@
int n, i, len = p - q;
int level = -1, found = -1;
+
for ( n = 0; n < trace_count; n++ )
{
const char* toggle = ft_trace_toggles[n];
+
for ( i = 0; i < len; i++ )
{
if ( toggle[i] != q[i] )
@@ -179,7 +181,7 @@
ft_trace_levels[n] = level;
}
else
- ft_trace_levels[ found ] = level;
+ ft_trace_levels[found] = level;
}
}
}