* docs/CHANGES: Mention gxvalid module. Formatting and other minor changes.
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 523 524 525 526 527 528 529 530
diff --git a/ChangeLog b/ChangeLog
index a35bb56..ce297ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-08-24 Werner Lemberg <wl@gnu.org>
+
+ * docs/CHANGES: Mention gxvalid module.
+
2005-08-23 Werner Lemberg <wl@gnu.org>
* src/autofit/aflatin.c (af_latin_metrics_scale): Initialize
@@ -14,19 +18,19 @@
* src/base/rule.mk: Register ftgxval.c.
* docs/INSTALL.ANY: Register gxvalid/gxvalid.c.
- * include/freetype/config/ftheader.h: Add macro to include gxvalid
- header file, FT_GX_VALIDATE_H.
+ * include/freetype/config/ftheader.h (FT_GX_VALIDATE_H): New macro
+ to include gxvalid header file.
* include/freetype/config/ftmodule.h: Register gxv_module_class.
* include/freetype/ftchapters.h: Add comment about gx_validation.
* include/freetype/ftotval.h: Change keyword FT_VALIDATE_XXX
- to FT_VALIDATE_OTXXX to co-exist gxvalid.
- * include/freetype/tttags.h: Add tag for TrueType GX/AAT tables.
+ to FT_VALIDATE_OTXXX to co-exist with gxvalid.
+ * include/freetype/tttags.h: Add tags for TrueType GX/AAT tables.
- * include/freetype/internal/ftserv.h: Add macro to use gxvalid
- service, FT_SERVICE_GX_VALIDATE_H
- * include/freetype/internal/fttrace.h: Add trace facilities
- for gxvalid.
+ * include/freetype/internal/ftserv.h (FT_SERVICE_GX_VALIDATE_H): New
+ macro for gxvalid service.
+ * include/freetype/internal/fttrace.h: Add trace facilities for
+ gxvalid.
New files on existing directories:
diff --git a/Jamfile b/Jamfile
index d22c839..40622a3 100644
--- a/Jamfile
+++ b/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 top Jamfile.
#
-# Copyright 2001, 2002, 2003, 2004 by
+# Copyright 2001, 2002, 2003, 2004, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/docs/CHANGES b/docs/CHANGES
index 8e6cb73..abd29cc 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -6,6 +6,13 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
II. IMPORTANT CHANGES
+ - A new API `FT_TrueTypeGX_Validate' (in FT_GX_VALIDATE_H) has
+ been added to validate TrueType GX/ATT tables (feat, mort, morx,
+ bsln, just, kern, opbd, trak, prop). After validation it is no
+ longer necessary to check for errors in those tables while
+ accessing them. This code has been contributed by Masatake
+ Yamato and Toshiya Suzuki.
+
- The following callback function types have changed slightly (by
adding the `const' keyword where appropriate):
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index bd6fde1..9b55f47 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -557,6 +557,7 @@
/* */
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
+
/*************************************************************************/
/* */
/* @macro: */
diff --git a/include/freetype/ftgxval.h b/include/freetype/ftgxval.h
index 093abc2..b78d7f3 100644
--- a/include/freetype/ftgxval.h
+++ b/include/freetype/ftgxval.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
-/* Copyright 2004 by */
+/* Copyright 2004, 2005 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -17,9 +17,11 @@
/***************************************************************************/
/***************************************************************************/
+/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout is support of Information-technology Promotion */
-/* Agency(IPA), Japan. */
+/* Development of gxlayout is supported by the Information-technology */
+/* Promotion Agency(IPA), Japan. */
+/* */
/***************************************************************************/
@@ -57,14 +59,16 @@ FT_BEGIN_HEADER
/* */
/*************************************************************************/
-/***************************************************************************/
-/* */
-/* */
-/* Warnings: Use FT_VALIDATE_XXX to validate a table. */
-/* Following definitions are for gxvalid developers. */
-/* */
-/* */
-/***************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* */
+ /* Warning: Use FT_VALIDATE_XXX to validate a table. */
+ /* Following definitions are for gxvalid developers. */
+ /* */
+ /* */
+ /*************************************************************************/
+
#define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1
#define FT_VALIDATE_morx_INDEX 2
@@ -78,11 +82,11 @@ FT_BEGIN_HEADER
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
- /* Up to 0x1000 is used by otvalid.
- Ox2000 is reserved for feature ot extension. */
+ /* Up to 0x1000 is used by otvalid.
+ Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000
-#define FT_VALIDATE_GX_BITFIELD(tag) \
- (FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX)
+#define FT_VALIDATE_GX_BITFIELD( tag ) \
+ ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/**********************************************************************
@@ -96,43 +100,43 @@ FT_BEGIN_HEADER
*
* @values:
* FT_VALIDATE_feat ::
- * Validate feat table.
+ * Validate `feat' table.
*
* @values:
* FT_VALIDATE_mort ::
- * Validate mort table.
+ * Validate `mort' table.
*
* @values:
* FT_VALIDATE_morx ::
- * Validate morx table.
+ * Validate `morx' table.
*
* @values:
* FT_VALIDATE_bsln ::
- * Validate bsln table.
+ * Validate `bsln' table.
*
* @values:
* FT_VALIDATE_just ::
- * Validate just table.
+ * Validate `just' table.
*
* @values:
* FT_VALIDATE_kern ::
- * Validate kern table.
+ * Validate `kern' table.
*
* @values:
* FT_VALIDATE_opbd ::
- * Validate opbd table.
+ * Validate `opbd' table.
*
* @values:
* FT_VALIDATE_trak ::
- * Validate trak table.
+ * Validate `trak' table.
*
* @values:
* FT_VALIDATE_prop ::
- * Validate prop table.
+ * Validate `prop' table.
*
* @values:
* FT_VALIDATE_lcar ::
- * Validate lcar table.
+ * Validate `lcar' table.
*
* @values:
* FT_VALIDATE_GX ::
@@ -141,26 +145,26 @@ FT_BEGIN_HEADER
*
*/
-#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD(feat)
-#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD(mort)
-#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD(morx)
-#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD(bsln)
-#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD(just)
-#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD(kern)
-#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD(opbd)
-#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD(trak)
-#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD(prop)
-#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD(lcar)
-
-#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
- FT_VALIDATE_mort | \
- FT_VALIDATE_morx | \
- FT_VALIDATE_bsln | \
- FT_VALIDATE_just | \
- FT_VALIDATE_kern | \
- FT_VALIDATE_opbd | \
- FT_VALIDATE_trak | \
- FT_VALIDATE_prop | \
+#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
+#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
+#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
+#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
+#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
+#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
+#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
+#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
+#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
+#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
+
+#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
+ FT_VALIDATE_mort | \
+ FT_VALIDATE_morx | \
+ FT_VALIDATE_bsln | \
+ FT_VALIDATE_just | \
+ FT_VALIDATE_kern | \
+ FT_VALIDATE_opbd | \
+ FT_VALIDATE_trak | \
+ FT_VALIDATE_prop | \
FT_VALIDATE_lcar )
@@ -186,12 +190,12 @@ FT_BEGIN_HEADER
* @FT_VALIDATE_GXXXX for possible values.
*
* table_length ::
- * The length of tables. Generally FT_VALIDATE_GX_LENGTH should
- * be passed.
+ * The size of the `tables' array. Normally, `FT_VALIDATE_GX_LENGTH'
+ * should be passed.
*
* @output
* tables ::
- * The array where each validated sfnt tables are stored to.
+ * The array where all validated sfnt tables are stored.
* The array itself must be allocated by a client.
*
* @return:
@@ -201,17 +205,17 @@ FT_BEGIN_HEADER
* This function only works with TrueTypeGX fonts, returning an error
* otherwise.
*
- * After use, the application should deallocate the buffers pointed by each
- * tables' element. A NULL value indicates that the table either
- * doesn't exist in the font, the application hasn't asked for validation, or
- * the validator doesn't have ability to validate the sfnt table.
+ * After use, the application should deallocate the buffers pointed to by
+ * each tables' element. A NULL value indicates that the table either
+ * doesn't exist in the font, the application hasn't asked for
+ * validation, or the validator doesn't have the ability to validate the
+ * sfnt table.
*/
FT_EXPORT( FT_Error )
- FT_TrueTypeGX_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
- FT_UInt table_length );
-
+ FT_TrueTypeGX_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
+ FT_UInt table_length );
/* */
@@ -223,27 +227,24 @@ FT_BEGIN_HEADER
*
* @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate
- * to indicate (a) classic kern dialect(s).
+ * to indicate the classic kern dialect or dialects. If the selected
+ * type doesn't fit, @FT_ClassicKern_Validate regards the table as
+ * invalid.
*
* @values:
* FT_VALIDATE_MS ::
- * Validate the kern table as it has classic Microsoft kern dialect.
- * If @FT_ClassicKern_Validate detects the table has the other
- * dialect, it regards the table invalid.
+ * Handle the `kern' table as a classic Microsoft kern table.
*
* @values:
* FT_VALIDATE_APPLE ::
- * Validate the kern table as it has classic Apple kern dialect.
- * If @FT_ClassicKern_Validate detects the table has the other
- * dialect, it regards the table invalid.
+ * Handle the `kern' table as a classic Apple kern table.
*
* @values:
* FT_VALIDATE_CKERN ::
- * Validate the kern table as it has classic Apple kern dialect or
- * Microsoft kern dialect.
+ * Handle the `kern' as either classic Apple or Microsoft kern table.
*/
-#define FT_VALIDATE_MS (FT_VALIDATE_GX_START << 0)
-#define FT_VALIDATE_APPLE (FT_VALIDATE_GX_START << 1)
+#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
+#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
@@ -256,14 +257,14 @@ FT_BEGIN_HEADER
* FT_ClassicKern_Validate
*
* @description:
- * Validate classic(16bit format) kern table to assure that the offsets
- * and indices are valid. The idea is that a higher-level library
- * which actually does the text layout can access those tables without
- * error checking (which can be quite time consuming).
+ * Validate classic (16bit format) kern table to assure that the offsets
+ * and indices are valid. The idea is that a higher-level library which
+ * actually does the text layout can access those tables without error
+ * checking (which can be quite time consuming).
*
- * Kern table validator in @FT_TrueTypeGX_Validate deals both
- * new 32 bit format and classic 16 bit format. In other hand
- * this function supports only the classic 16 bit format.
+ * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
+ * the new 32bit format and the classic 16bit format, while
+ * FT_ClassicKern_Validate only supports the classic 16bit format.
*
* @input:
* face ::
@@ -281,14 +282,14 @@ FT_BEGIN_HEADER
* FreeType error code. 0 means success.
*
* @note:
- * After use, the application should deallocate the buffers pointed by
- * ckern_table. A NULL value indicates that the table either
- * doesn't exist in the font.
+ * After use, the application should deallocate the buffers pointed to by
+ * ckern_table. A NULL value indicates that the table doesn't exist in
+ * the font.
*/
FT_EXPORT( FT_Error )
- FT_ClassicKern_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes *ckern_table );
+ FT_ClassicKern_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes *ckern_table );
/* */
diff --git a/include/freetype/internal/services/svgxval.h b/include/freetype/internal/services/svgxval.h
index 8be6e98..2cdab50 100644
--- a/include/freetype/internal/services/svgxval.h
+++ b/include/freetype/internal/services/svgxval.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
-/* Copyright 2004 by */
+/* Copyright 2004, 2005 by */
/* Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -17,11 +17,14 @@
/***************************************************************************/
/***************************************************************************/
+/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout was support of Information-technology Promotion */
-/* Agency(IPA), Japan. */
+/* Development of gxlayout is supported by the Information-technology */
+/* Promotion Agency(IPA), Japan. */
+/* */
/***************************************************************************/
+
#ifndef __SVGXVAL_H__
#define __SVGXVAL_H__
@@ -35,16 +38,16 @@ FT_BEGIN_HEADER
#define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate"
typedef FT_Error
- (*gxv_validate_func)( FT_Face face,
- FT_UInt gx_flags,
- FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
- FT_UInt table_length );
+ (*gxv_validate_func)( FT_Face face,
+ FT_UInt gx_flags,
+ FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
+ FT_UInt table_length );
typedef FT_Error
- (*ckern_validate_func) ( FT_Face face,
- FT_UInt ckern_flags,
- FT_Bytes *ckern_table );
+ (*ckern_validate_func)( FT_Face face,
+ FT_UInt ckern_flags,
+ FT_Bytes *ckern_table );
FT_DEFINE_SERVICE( GXvalidate )
diff --git a/include/freetype/tttags.h b/include/freetype/tttags.h
index a22cbd2..845454c 100644
--- a/include/freetype/tttags.h
+++ b/include/freetype/tttags.h
@@ -4,7 +4,7 @@
/* */
/* Tags for TrueType and OpenType tables (specification only). */
/* */
-/* Copyright 1996-2001, 2004 by */
+/* Copyright 1996-2001, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -79,8 +79,8 @@ FT_BEGIN_HEADER
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
-#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
+#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
diff --git a/src/base/Jamfile b/src/base/Jamfile
index b93b4a0..afbecc7 100644
--- a/src/base/Jamfile
+++ b/src/base/Jamfile
@@ -1,6 +1,6 @@
# FreeType 2 src/base Jamfile
#
-# Copyright 2001, 2002, 2003, 2004 by
+# Copyright 2001, 2002, 2003, 2004, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/base/ftgxval.c b/src/base/ftgxval.c
index 1b6261d..10ee969 100644
--- a/src/base/ftgxval.c
+++ b/src/base/ftgxval.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTyepGX/AAT tables (body). */
/* */
-/* Copyright 2004 by */
+/* Copyright 2004, 2005 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -17,22 +17,26 @@
/***************************************************************************/
/***************************************************************************/
+/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
-/* Development of gxlayout was support of Information-technology Promotion */
-/* Agency(IPA), Japan. */
+/* Development of gxlayout is supported by the Information-technology */
+/* Promotion Agency(IPA), Japan. */
+/* */
/***************************************************************************/
+
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_SERVICE_GX_VALIDATE_H
+
/* documentation is in ftgxval.h */
FT_EXPORT_DEF( FT_Error )
- FT_TrueTypeGX_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
- FT_UInt table_length )
+ FT_TrueTypeGX_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
+ FT_UInt table_length )
{
FT_Service_GXvalidate service;
FT_Error error;
@@ -66,9 +70,9 @@
FT_EXPORT_DEF( FT_Error )
- FT_ClassicKern_Validate( FT_Face face,
- FT_UInt validation_flags,
- FT_Bytes *ckern_table )
+ FT_ClassicKern_Validate( FT_Face face,
+ FT_UInt validation_flags,
+ FT_Bytes *ckern_table )
{
FT_Service_CKERNvalidate service;
FT_Error error;