modules/freetype2/devel/ftoption.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /***************************************************************************/
michael@0 2 /* */
michael@0 3 /* ftoption.h (for development) */
michael@0 4 /* */
michael@0 5 /* User-selectable configuration macros (specification only). */
michael@0 6 /* */
michael@0 7 /* Copyright 1996-2013 by */
michael@0 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
michael@0 9 /* */
michael@0 10 /* This file is part of the FreeType project, and may only be used, */
michael@0 11 /* modified, and distributed under the terms of the FreeType project */
michael@0 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
michael@0 13 /* this file you indicate that you have read the license and */
michael@0 14 /* understand and accept it fully. */
michael@0 15 /* */
michael@0 16 /***************************************************************************/
michael@0 17
michael@0 18
michael@0 19 #ifndef __FTOPTION_H__
michael@0 20 #define __FTOPTION_H__
michael@0 21
michael@0 22
michael@0 23 #include <ft2build.h>
michael@0 24
michael@0 25
michael@0 26 FT_BEGIN_HEADER
michael@0 27
michael@0 28 /*************************************************************************/
michael@0 29 /* */
michael@0 30 /* USER-SELECTABLE CONFIGURATION MACROS */
michael@0 31 /* */
michael@0 32 /* This file contains the default configuration macro definitions for */
michael@0 33 /* a standard build of the FreeType library. There are three ways to */
michael@0 34 /* use this file to build project-specific versions of the library: */
michael@0 35 /* */
michael@0 36 /* - You can modify this file by hand, but this is not recommended in */
michael@0 37 /* cases where you would like to build several versions of the */
michael@0 38 /* library from a single source directory. */
michael@0 39 /* */
michael@0 40 /* - You can put a copy of this file in your build directory, more */
michael@0 41 /* precisely in `$BUILD/config/ftoption.h', where `$BUILD' is the */
michael@0 42 /* name of a directory that is included _before_ the FreeType include */
michael@0 43 /* path during compilation. */
michael@0 44 /* */
michael@0 45 /* The default FreeType Makefiles and Jamfiles use the build */
michael@0 46 /* directory `builds/<system>' by default, but you can easily change */
michael@0 47 /* that for your own projects. */
michael@0 48 /* */
michael@0 49 /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
michael@0 50 /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
michael@0 51 /* locate this file during the build. For example, */
michael@0 52 /* */
michael@0 53 /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
michael@0 54 /* #include <config/ftheader.h> */
michael@0 55 /* */
michael@0 56 /* will use `$BUILD/myftoptions.h' instead of this file for macro */
michael@0 57 /* definitions. */
michael@0 58 /* */
michael@0 59 /* Note also that you can similarly pre-define the macro */
michael@0 60 /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
michael@0 61 /* that are statically linked to the library at compile time. By */
michael@0 62 /* default, this file is <config/ftmodule.h>. */
michael@0 63 /* */
michael@0 64 /* We highly recommend using the third method whenever possible. */
michael@0 65 /* */
michael@0 66 /*************************************************************************/
michael@0 67
michael@0 68
michael@0 69 /*************************************************************************/
michael@0 70 /*************************************************************************/
michael@0 71 /**** ****/
michael@0 72 /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
michael@0 73 /**** ****/
michael@0 74 /*************************************************************************/
michael@0 75 /*************************************************************************/
michael@0 76
michael@0 77
michael@0 78 /*************************************************************************/
michael@0 79 /* */
michael@0 80 /* Uncomment the line below if you want to activate sub-pixel rendering */
michael@0 81 /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
michael@0 82 /* */
michael@0 83 /* Note that this feature is covered by several Microsoft patents */
michael@0 84 /* and should not be activated in any default build of the library. */
michael@0 85 /* */
michael@0 86 /* This macro has no impact on the FreeType API, only on its */
michael@0 87 /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
michael@0 88 /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
michael@0 89 /* the original size in case this macro isn't defined; however, each */
michael@0 90 /* triplet of subpixels has R=G=B. */
michael@0 91 /* */
michael@0 92 /* This is done to allow FreeType clients to run unmodified, forcing */
michael@0 93 /* them to display normal gray-level anti-aliased glyphs. */
michael@0 94 /* */
michael@0 95 #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
michael@0 96
michael@0 97
michael@0 98 /*************************************************************************/
michael@0 99 /* */
michael@0 100 /* Many compilers provide a non-ANSI 64-bit data type that can be used */
michael@0 101 /* by FreeType to speed up some computations. However, this will create */
michael@0 102 /* some problems when compiling the library in strict ANSI mode. */
michael@0 103 /* */
michael@0 104 /* For this reason, the use of 64-bit integers is normally disabled when */
michael@0 105 /* the __STDC__ macro is defined. You can however disable this by */
michael@0 106 /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
michael@0 107 /* */
michael@0 108 /* For most compilers, this will only create compilation warnings when */
michael@0 109 /* building the library. */
michael@0 110 /* */
michael@0 111 /* ObNote: The compiler-specific 64-bit integers are detected in the */
michael@0 112 /* file `ftconfig.h' either statically or through the */
michael@0 113 /* `configure' script on supported platforms. */
michael@0 114 /* */
michael@0 115 #undef FT_CONFIG_OPTION_FORCE_INT64
michael@0 116
michael@0 117
michael@0 118 /*************************************************************************/
michael@0 119 /* */
michael@0 120 /* If this macro is defined, do not try to use an assembler version of */
michael@0 121 /* performance-critical functions (e.g. FT_MulFix). You should only do */
michael@0 122 /* that to verify that the assembler function works properly, or to */
michael@0 123 /* execute benchmark tests of the various implementations. */
michael@0 124 /* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
michael@0 125
michael@0 126
michael@0 127 /*************************************************************************/
michael@0 128 /* */
michael@0 129 /* If this macro is defined, try to use an inlined assembler version of */
michael@0 130 /* the `FT_MulFix' function, which is a `hotspot' when loading and */
michael@0 131 /* hinting glyphs, and which should be executed as fast as possible. */
michael@0 132 /* */
michael@0 133 /* Note that if your compiler or CPU is not supported, this will default */
michael@0 134 /* to the standard and portable implementation found in `ftcalc.c'. */
michael@0 135 /* */
michael@0 136 #define FT_CONFIG_OPTION_INLINE_MULFIX
michael@0 137
michael@0 138
michael@0 139 /*************************************************************************/
michael@0 140 /* */
michael@0 141 /* LZW-compressed file support. */
michael@0 142 /* */
michael@0 143 /* FreeType now handles font files that have been compressed with the */
michael@0 144 /* `compress' program. This is mostly used to parse many of the PCF */
michael@0 145 /* files that come with various X11 distributions. The implementation */
michael@0 146 /* uses NetBSD's `zopen' to partially uncompress the file on the fly */
michael@0 147 /* (see src/lzw/ftgzip.c). */
michael@0 148 /* */
michael@0 149 /* Define this macro if you want to enable this `feature'. */
michael@0 150 /* */
michael@0 151 #define FT_CONFIG_OPTION_USE_LZW
michael@0 152
michael@0 153
michael@0 154 /*************************************************************************/
michael@0 155 /* */
michael@0 156 /* Gzip-compressed file support. */
michael@0 157 /* */
michael@0 158 /* FreeType now handles font files that have been compressed with the */
michael@0 159 /* `gzip' program. This is mostly used to parse many of the PCF files */
michael@0 160 /* that come with XFree86. The implementation uses `zlib' to */
michael@0 161 /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
michael@0 162 /* */
michael@0 163 /* Define this macro if you want to enable this `feature'. See also */
michael@0 164 /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
michael@0 165 /* */
michael@0 166 #define FT_CONFIG_OPTION_USE_ZLIB
michael@0 167
michael@0 168
michael@0 169 /*************************************************************************/
michael@0 170 /* */
michael@0 171 /* ZLib library selection */
michael@0 172 /* */
michael@0 173 /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
michael@0 174 /* It allows FreeType's `ftgzip' component to link to the system's */
michael@0 175 /* installation of the ZLib library. This is useful on systems like */
michael@0 176 /* Unix or VMS where it generally is already available. */
michael@0 177 /* */
michael@0 178 /* If you let it undefined, the component will use its own copy */
michael@0 179 /* of the zlib sources instead. These have been modified to be */
michael@0 180 /* included directly within the component and *not* export external */
michael@0 181 /* function names. This allows you to link any program with FreeType */
michael@0 182 /* _and_ ZLib without linking conflicts. */
michael@0 183 /* */
michael@0 184 /* Do not #undef this macro here since the build system might define */
michael@0 185 /* it for certain configurations only. */
michael@0 186 /* */
michael@0 187 /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
michael@0 188
michael@0 189
michael@0 190 /*************************************************************************/
michael@0 191 /* */
michael@0 192 /* Bzip2-compressed file support. */
michael@0 193 /* */
michael@0 194 /* FreeType now handles font files that have been compressed with the */
michael@0 195 /* `bzip2' program. This is mostly used to parse many of the PCF */
michael@0 196 /* files that come with XFree86. The implementation uses `libbz2' to */
michael@0 197 /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
michael@0 198 /* Contrary to gzip, bzip2 currently is not included and need to use */
michael@0 199 /* the system available bzip2 implementation. */
michael@0 200 /* */
michael@0 201 /* Define this macro if you want to enable this `feature'. */
michael@0 202 /* */
michael@0 203 #define FT_CONFIG_OPTION_USE_BZIP2
michael@0 204
michael@0 205
michael@0 206 /*************************************************************************/
michael@0 207 /* */
michael@0 208 /* PNG bitmap support. */
michael@0 209 /* */
michael@0 210 /* FreeType now handles loading color bitmap glyphs in the PNG format. */
michael@0 211 /* This requires help from the external libpng library. Uncompressed */
michael@0 212 /* color bitmaps do not need any external libraries and will be */
michael@0 213 /* supported regardless of this configuration. */
michael@0 214 /* */
michael@0 215 /* Define this macro if you want to enable this `feature'. */
michael@0 216 /* */
michael@0 217 #define FT_CONFIG_OPTION_USE_PNG
michael@0 218
michael@0 219
michael@0 220 /*************************************************************************/
michael@0 221 /* */
michael@0 222 /* HarfBuzz support. */
michael@0 223 /* */
michael@0 224 /* FreeType uses the HarfBuzz library to improve auto-hinting of */
michael@0 225 /* OpenType fonts. If available, many glyphs not directly addressable */
michael@0 226 /* by a font's character map will be hinted also. */
michael@0 227 /* */
michael@0 228 /* Define this macro if you want to enable this `feature'. */
michael@0 229 /* */
michael@0 230 #define FT_CONFIG_OPTION_USE_HARFBUZZ
michael@0 231
michael@0 232
michael@0 233 /*************************************************************************/
michael@0 234 /* */
michael@0 235 /* Define to disable the use of file stream functions and types, FILE, */
michael@0 236 /* fopen() etc. Enables the use of smaller system libraries on embedded */
michael@0 237 /* systems that have multiple system libraries, some with or without */
michael@0 238 /* file stream support, in the cases where file stream support is not */
michael@0 239 /* necessary such as memory loading of font files. */
michael@0 240 /* */
michael@0 241 /* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
michael@0 242
michael@0 243
michael@0 244 /*************************************************************************/
michael@0 245 /* */
michael@0 246 /* DLL export compilation */
michael@0 247 /* */
michael@0 248 /* When compiling FreeType as a DLL, some systems/compilers need a */
michael@0 249 /* special keyword in front OR after the return type of function */
michael@0 250 /* declarations. */
michael@0 251 /* */
michael@0 252 /* Two macros are used within the FreeType source code to define */
michael@0 253 /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
michael@0 254 /* */
michael@0 255 /* FT_EXPORT( return_type ) */
michael@0 256 /* */
michael@0 257 /* is used in a function declaration, as in */
michael@0 258 /* */
michael@0 259 /* FT_EXPORT( FT_Error ) */
michael@0 260 /* FT_Init_FreeType( FT_Library* alibrary ); */
michael@0 261 /* */
michael@0 262 /* */
michael@0 263 /* FT_EXPORT_DEF( return_type ) */
michael@0 264 /* */
michael@0 265 /* is used in a function definition, as in */
michael@0 266 /* */
michael@0 267 /* FT_EXPORT_DEF( FT_Error ) */
michael@0 268 /* FT_Init_FreeType( FT_Library* alibrary ) */
michael@0 269 /* { */
michael@0 270 /* ... some code ... */
michael@0 271 /* return FT_Err_Ok; */
michael@0 272 /* } */
michael@0 273 /* */
michael@0 274 /* You can provide your own implementation of FT_EXPORT and */
michael@0 275 /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
michael@0 276 /* will be later automatically defined as `extern return_type' to */
michael@0 277 /* allow normal compilation. */
michael@0 278 /* */
michael@0 279 /* Do not #undef these macros here since the build system might define */
michael@0 280 /* them for certain configurations only. */
michael@0 281 /* */
michael@0 282 /* #define FT_EXPORT(x) extern x */
michael@0 283 /* #define FT_EXPORT_DEF(x) x */
michael@0 284
michael@0 285
michael@0 286 /*************************************************************************/
michael@0 287 /* */
michael@0 288 /* Glyph Postscript Names handling */
michael@0 289 /* */
michael@0 290 /* By default, FreeType 2 is compiled with the `psnames' module. This */
michael@0 291 /* module is in charge of converting a glyph name string into a */
michael@0 292 /* Unicode value, or return a Macintosh standard glyph name for the */
michael@0 293 /* use with the TrueType `post' table. */
michael@0 294 /* */
michael@0 295 /* Undefine this macro if you do not want `psnames' compiled in your */
michael@0 296 /* build of FreeType. This has the following effects: */
michael@0 297 /* */
michael@0 298 /* - The TrueType driver will provide its own set of glyph names, */
michael@0 299 /* if you build it to support postscript names in the TrueType */
michael@0 300 /* `post' table. */
michael@0 301 /* */
michael@0 302 /* - The Type 1 driver will not be able to synthesize a Unicode */
michael@0 303 /* charmap out of the glyphs found in the fonts. */
michael@0 304 /* */
michael@0 305 /* You would normally undefine this configuration macro when building */
michael@0 306 /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
michael@0 307 /* */
michael@0 308 #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
michael@0 309
michael@0 310
michael@0 311 /*************************************************************************/
michael@0 312 /* */
michael@0 313 /* Postscript Names to Unicode Values support */
michael@0 314 /* */
michael@0 315 /* By default, FreeType 2 is built with the `PSNames' module compiled */
michael@0 316 /* in. Among other things, the module is used to convert a glyph name */
michael@0 317 /* into a Unicode value. This is especially useful in order to */
michael@0 318 /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
michael@0 319 /* through a big table named the `Adobe Glyph List' (AGL). */
michael@0 320 /* */
michael@0 321 /* Undefine this macro if you do not want the Adobe Glyph List */
michael@0 322 /* compiled in your `PSNames' module. The Type 1 driver will not be */
michael@0 323 /* able to synthesize a Unicode charmap out of the glyphs found in the */
michael@0 324 /* fonts. */
michael@0 325 /* */
michael@0 326 #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
michael@0 327
michael@0 328
michael@0 329 /*************************************************************************/
michael@0 330 /* */
michael@0 331 /* Support for Mac fonts */
michael@0 332 /* */
michael@0 333 /* Define this macro if you want support for outline fonts in Mac */
michael@0 334 /* format (mac dfont, mac resource, macbinary containing a mac */
michael@0 335 /* resource) on non-Mac platforms. */
michael@0 336 /* */
michael@0 337 /* Note that the `FOND' resource isn't checked. */
michael@0 338 /* */
michael@0 339 #define FT_CONFIG_OPTION_MAC_FONTS
michael@0 340
michael@0 341
michael@0 342 /*************************************************************************/
michael@0 343 /* */
michael@0 344 /* Guessing methods to access embedded resource forks */
michael@0 345 /* */
michael@0 346 /* Enable extra Mac fonts support on non-Mac platforms (e.g. */
michael@0 347 /* GNU/Linux). */
michael@0 348 /* */
michael@0 349 /* Resource forks which include fonts data are stored sometimes in */
michael@0 350 /* locations which users or developers don't expected. In some cases, */
michael@0 351 /* resource forks start with some offset from the head of a file. In */
michael@0 352 /* other cases, the actual resource fork is stored in file different */
michael@0 353 /* from what the user specifies. If this option is activated, */
michael@0 354 /* FreeType tries to guess whether such offsets or different file */
michael@0 355 /* names must be used. */
michael@0 356 /* */
michael@0 357 /* Note that normal, direct access of resource forks is controlled via */
michael@0 358 /* the FT_CONFIG_OPTION_MAC_FONTS option. */
michael@0 359 /* */
michael@0 360 #ifdef FT_CONFIG_OPTION_MAC_FONTS
michael@0 361 #define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
michael@0 362 #endif
michael@0 363
michael@0 364
michael@0 365 /*************************************************************************/
michael@0 366 /* */
michael@0 367 /* Allow the use of FT_Incremental_Interface to load typefaces that */
michael@0 368 /* contain no glyph data, but supply it via a callback function. */
michael@0 369 /* This is required by clients supporting document formats which */
michael@0 370 /* supply font data incrementally as the document is parsed, such */
michael@0 371 /* as the Ghostscript interpreter for the PostScript language. */
michael@0 372 /* */
michael@0 373 #define FT_CONFIG_OPTION_INCREMENTAL
michael@0 374
michael@0 375
michael@0 376 /*************************************************************************/
michael@0 377 /* */
michael@0 378 /* The size in bytes of the render pool used by the scan-line converter */
michael@0 379 /* to do all of its work. */
michael@0 380 /* */
michael@0 381 /* This must be greater than 4KByte if you use FreeType to rasterize */
michael@0 382 /* glyphs; otherwise, you may set it to zero to avoid unnecessary */
michael@0 383 /* allocation of the render pool. */
michael@0 384 /* */
michael@0 385 #define FT_RENDER_POOL_SIZE 16384L
michael@0 386
michael@0 387
michael@0 388 /*************************************************************************/
michael@0 389 /* */
michael@0 390 /* FT_MAX_MODULES */
michael@0 391 /* */
michael@0 392 /* The maximum number of modules that can be registered in a single */
michael@0 393 /* FreeType library object. 32 is the default. */
michael@0 394 /* */
michael@0 395 #define FT_MAX_MODULES 32
michael@0 396
michael@0 397
michael@0 398 /*************************************************************************/
michael@0 399 /* */
michael@0 400 /* Debug level */
michael@0 401 /* */
michael@0 402 /* FreeType can be compiled in debug or trace mode. In debug mode, */
michael@0 403 /* errors are reported through the `ftdebug' component. In trace */
michael@0 404 /* mode, additional messages are sent to the standard output during */
michael@0 405 /* execution. */
michael@0 406 /* */
michael@0 407 /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
michael@0 408 /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
michael@0 409 /* */
michael@0 410 /* Don't define any of these macros to compile in `release' mode! */
michael@0 411 /* */
michael@0 412 /* Do not #undef these macros here since the build system might define */
michael@0 413 /* them for certain configurations only. */
michael@0 414 /* */
michael@0 415 #define FT_DEBUG_LEVEL_ERROR
michael@0 416 #define FT_DEBUG_LEVEL_TRACE
michael@0 417
michael@0 418
michael@0 419 /*************************************************************************/
michael@0 420 /* */
michael@0 421 /* Autofitter debugging */
michael@0 422 /* */
michael@0 423 /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */
michael@0 424 /* control the autofitter behaviour for debugging purposes with global */
michael@0 425 /* boolean variables (consequently, you should *never* enable this */
michael@0 426 /* while compiling in `release' mode): */
michael@0 427 /* */
michael@0 428 /* _af_debug_disable_horz_hints */
michael@0 429 /* _af_debug_disable_vert_hints */
michael@0 430 /* _af_debug_disable_blue_hints */
michael@0 431 /* */
michael@0 432 /* Additionally, the following functions provide dumps of various */
michael@0 433 /* internal autofit structures to stdout (using `printf'): */
michael@0 434 /* */
michael@0 435 /* af_glyph_hints_dump_points */
michael@0 436 /* af_glyph_hints_dump_segments */
michael@0 437 /* af_glyph_hints_dump_edges */
michael@0 438 /* */
michael@0 439 /* As an argument, they use another global variable: */
michael@0 440 /* */
michael@0 441 /* _af_debug_hints */
michael@0 442 /* */
michael@0 443 /* Please have a look at the `ftgrid' demo program to see how those */
michael@0 444 /* variables and macros should be used. */
michael@0 445 /* */
michael@0 446 /* Do not #undef these macros here since the build system might define */
michael@0 447 /* them for certain configurations only. */
michael@0 448 /* */
michael@0 449 #define FT_DEBUG_AUTOFIT
michael@0 450
michael@0 451
michael@0 452 /*************************************************************************/
michael@0 453 /* */
michael@0 454 /* Memory Debugging */
michael@0 455 /* */
michael@0 456 /* FreeType now comes with an integrated memory debugger that is */
michael@0 457 /* capable of detecting simple errors like memory leaks or double */
michael@0 458 /* deletes. To compile it within your build of the library, you */
michael@0 459 /* should define FT_DEBUG_MEMORY here. */
michael@0 460 /* */
michael@0 461 /* Note that the memory debugger is only activated at runtime when */
michael@0 462 /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
michael@0 463 /* */
michael@0 464 /* Do not #undef this macro here since the build system might define */
michael@0 465 /* it for certain configurations only. */
michael@0 466 /* */
michael@0 467 #define FT_DEBUG_MEMORY
michael@0 468
michael@0 469
michael@0 470 /*************************************************************************/
michael@0 471 /* */
michael@0 472 /* Module errors */
michael@0 473 /* */
michael@0 474 /* If this macro is set (which is _not_ the default), the higher byte */
michael@0 475 /* of an error code gives the module in which the error has occurred, */
michael@0 476 /* while the lower byte is the real error code. */
michael@0 477 /* */
michael@0 478 /* Setting this macro makes sense for debugging purposes only, since */
michael@0 479 /* it would break source compatibility of certain programs that use */
michael@0 480 /* FreeType 2. */
michael@0 481 /* */
michael@0 482 /* More details can be found in the files ftmoderr.h and fterrors.h. */
michael@0 483 /* */
michael@0 484 #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
michael@0 485
michael@0 486
michael@0 487 /*************************************************************************/
michael@0 488 /* */
michael@0 489 /* Position Independent Code */
michael@0 490 /* */
michael@0 491 /* If this macro is set (which is _not_ the default), FreeType2 will */
michael@0 492 /* avoid creating constants that require address fixups. Instead the */
michael@0 493 /* constants will be moved into a struct and additional intialization */
michael@0 494 /* code will be used. */
michael@0 495 /* */
michael@0 496 /* Setting this macro is needed for systems that prohibit address */
michael@0 497 /* fixups, such as BREW. */
michael@0 498 /* */
michael@0 499 /* #define FT_CONFIG_OPTION_PIC */
michael@0 500
michael@0 501
michael@0 502 /*************************************************************************/
michael@0 503 /*************************************************************************/
michael@0 504 /**** ****/
michael@0 505 /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
michael@0 506 /**** ****/
michael@0 507 /*************************************************************************/
michael@0 508 /*************************************************************************/
michael@0 509
michael@0 510
michael@0 511 /*************************************************************************/
michael@0 512 /* */
michael@0 513 /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
michael@0 514 /* embedded bitmaps in all formats using the SFNT module (namely */
michael@0 515 /* TrueType & OpenType). */
michael@0 516 /* */
michael@0 517 #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
michael@0 518
michael@0 519
michael@0 520 /*************************************************************************/
michael@0 521 /* */
michael@0 522 /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
michael@0 523 /* load and enumerate the glyph Postscript names in a TrueType or */
michael@0 524 /* OpenType file. */
michael@0 525 /* */
michael@0 526 /* Note that when you do not compile the `PSNames' module by undefining */
michael@0 527 /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
michael@0 528 /* contain additional code used to read the PS Names table from a font. */
michael@0 529 /* */
michael@0 530 /* (By default, the module uses `PSNames' to extract glyph names.) */
michael@0 531 /* */
michael@0 532 #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
michael@0 533
michael@0 534
michael@0 535 /*************************************************************************/
michael@0 536 /* */
michael@0 537 /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
michael@0 538 /* access the internal name table in a SFNT-based format like TrueType */
michael@0 539 /* or OpenType. The name table contains various strings used to */
michael@0 540 /* describe the font, like family name, copyright, version, etc. It */
michael@0 541 /* does not contain any glyph name though. */
michael@0 542 /* */
michael@0 543 /* Accessing SFNT names is done through the functions declared in */
michael@0 544 /* `ftsnames.h'. */
michael@0 545 /* */
michael@0 546 #define TT_CONFIG_OPTION_SFNT_NAMES
michael@0 547
michael@0 548
michael@0 549 /*************************************************************************/
michael@0 550 /* */
michael@0 551 /* TrueType CMap support */
michael@0 552 /* */
michael@0 553 /* Here you can fine-tune which TrueType CMap table format shall be */
michael@0 554 /* supported. */
michael@0 555 #define TT_CONFIG_CMAP_FORMAT_0
michael@0 556 #define TT_CONFIG_CMAP_FORMAT_2
michael@0 557 #define TT_CONFIG_CMAP_FORMAT_4
michael@0 558 #define TT_CONFIG_CMAP_FORMAT_6
michael@0 559 #define TT_CONFIG_CMAP_FORMAT_8
michael@0 560 #define TT_CONFIG_CMAP_FORMAT_10
michael@0 561 #define TT_CONFIG_CMAP_FORMAT_12
michael@0 562 #define TT_CONFIG_CMAP_FORMAT_13
michael@0 563 #define TT_CONFIG_CMAP_FORMAT_14
michael@0 564
michael@0 565
michael@0 566 /*************************************************************************/
michael@0 567 /*************************************************************************/
michael@0 568 /**** ****/
michael@0 569 /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
michael@0 570 /**** ****/
michael@0 571 /*************************************************************************/
michael@0 572 /*************************************************************************/
michael@0 573
michael@0 574 /*************************************************************************/
michael@0 575 /* */
michael@0 576 /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
michael@0 577 /* a bytecode interpreter in the TrueType driver. */
michael@0 578 /* */
michael@0 579 /* By undefining this, you will only compile the code necessary to load */
michael@0 580 /* TrueType glyphs without hinting. */
michael@0 581 /* */
michael@0 582 /* Do not #undef this macro here, since the build system might */
michael@0 583 /* define it for certain configurations only. */
michael@0 584 /* */
michael@0 585 #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
michael@0 586
michael@0 587
michael@0 588 /*************************************************************************/
michael@0 589 /* */
michael@0 590 /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
michael@0 591 /* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
michael@0 592 /* replaces the native TrueType hinting mechanism when anything but */
michael@0 593 /* FT_RENDER_MODE_MONO is requested. */
michael@0 594 /* */
michael@0 595 /* Enabling this causes the TrueType driver to ignore instructions under */
michael@0 596 /* certain conditions. This is done in accordance with the guide here, */
michael@0 597 /* with some minor differences: */
michael@0 598 /* */
michael@0 599 /* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
michael@0 600 /* */
michael@0 601 /* By undefining this, you only compile the code necessary to hint */
michael@0 602 /* TrueType glyphs with native TT hinting. */
michael@0 603 /* */
michael@0 604 /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
michael@0 605 /* defined. */
michael@0 606 /* */
michael@0 607 #define TT_CONFIG_OPTION_SUBPIXEL_HINTING
michael@0 608
michael@0 609
michael@0 610 /*************************************************************************/
michael@0 611 /* */
michael@0 612 /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
michael@0 613 /* of the TrueType bytecode interpreter is used that doesn't implement */
michael@0 614 /* any of the patented opcodes and algorithms. The patents related to */
michael@0 615 /* TrueType hinting have expired worldwide since May 2010; this option */
michael@0 616 /* is now deprecated. */
michael@0 617 /* */
michael@0 618 /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
michael@0 619 /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
michael@0 620 /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
michael@0 621 /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
michael@0 622 /* */
michael@0 623 /* This macro is only useful for a small number of font files (mostly */
michael@0 624 /* for Asian scripts) that require bytecode interpretation to properly */
michael@0 625 /* load glyphs. For all other fonts, this produces unpleasant results, */
michael@0 626 /* thus the unpatented interpreter is never used to load glyphs from */
michael@0 627 /* TrueType fonts unless one of the following two options is used. */
michael@0 628 /* */
michael@0 629 /* - The unpatented interpreter is explicitly activated by the user */
michael@0 630 /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
michael@0 631 /* when opening the FT_Face. */
michael@0 632 /* */
michael@0 633 /* - FreeType detects that the FT_Face corresponds to one of the */
michael@0 634 /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
michael@0 635 /* contains a hard-coded list of font names and other matching */
michael@0 636 /* parameters (see function `tt_face_init' in file */
michael@0 637 /* `src/truetype/ttobjs.c'). */
michael@0 638 /* */
michael@0 639 /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
michael@0 640 /* */
michael@0 641 /* { */
michael@0 642 /* FT_Parameter parameter; */
michael@0 643 /* FT_Open_Args open_args; */
michael@0 644 /* */
michael@0 645 /* */
michael@0 646 /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
michael@0 647 /* */
michael@0 648 /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
michael@0 649 /* open_args.pathname = my_font_pathname; */
michael@0 650 /* open_args.num_params = 1; */
michael@0 651 /* open_args.params = &parameter; */
michael@0 652 /* */
michael@0 653 /* error = FT_Open_Face( library, &open_args, index, &face ); */
michael@0 654 /* ... */
michael@0 655 /* } */
michael@0 656 /* */
michael@0 657 /* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
michael@0 658
michael@0 659
michael@0 660 /*************************************************************************/
michael@0 661 /* */
michael@0 662 /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
michael@0 663 /* bytecode interpreter with a huge switch statement, rather than a call */
michael@0 664 /* table. This results in smaller and faster code for a number of */
michael@0 665 /* architectures. */
michael@0 666 /* */
michael@0 667 /* Note however that on some compiler/processor combinations, undefining */
michael@0 668 /* this macro will generate faster, though larger, code. */
michael@0 669 /* */
michael@0 670 #define TT_CONFIG_OPTION_INTERPRETER_SWITCH
michael@0 671
michael@0 672
michael@0 673 /*************************************************************************/
michael@0 674 /* */
michael@0 675 /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
michael@0 676 /* TrueType glyph loader to use Apple's definition of how to handle */
michael@0 677 /* component offsets in composite glyphs. */
michael@0 678 /* */
michael@0 679 /* Apple and MS disagree on the default behavior of component offsets */
michael@0 680 /* in composites. Apple says that they should be scaled by the scaling */
michael@0 681 /* factors in the transformation matrix (roughly, it's more complex) */
michael@0 682 /* while MS says they should not. OpenType defines two bits in the */
michael@0 683 /* composite flags array which can be used to disambiguate, but old */
michael@0 684 /* fonts will not have them. */
michael@0 685 /* */
michael@0 686 /* http://www.microsoft.com/typography/otspec/glyf.htm */
michael@0 687 /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
michael@0 688 /* */
michael@0 689 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
michael@0 690
michael@0 691
michael@0 692 /*************************************************************************/
michael@0 693 /* */
michael@0 694 /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
michael@0 695 /* support for Apple's distortable font technology (fvar, gvar, cvar, */
michael@0 696 /* and avar tables). This has many similarities to Type 1 Multiple */
michael@0 697 /* Masters support. */
michael@0 698 /* */
michael@0 699 #define TT_CONFIG_OPTION_GX_VAR_SUPPORT
michael@0 700
michael@0 701
michael@0 702 /*************************************************************************/
michael@0 703 /* */
michael@0 704 /* Define TT_CONFIG_OPTION_BDF if you want to include support for */
michael@0 705 /* an embedded `BDF ' table within SFNT-based bitmap formats. */
michael@0 706 /* */
michael@0 707 #define TT_CONFIG_OPTION_BDF
michael@0 708
michael@0 709
michael@0 710 /*************************************************************************/
michael@0 711 /*************************************************************************/
michael@0 712 /**** ****/
michael@0 713 /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
michael@0 714 /**** ****/
michael@0 715 /*************************************************************************/
michael@0 716 /*************************************************************************/
michael@0 717
michael@0 718
michael@0 719 /*************************************************************************/
michael@0 720 /* */
michael@0 721 /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */
michael@0 722 /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
michael@0 723 /* required. */
michael@0 724 /* */
michael@0 725 #define T1_MAX_DICT_DEPTH 5
michael@0 726
michael@0 727
michael@0 728 /*************************************************************************/
michael@0 729 /* */
michael@0 730 /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
michael@0 731 /* calls during glyph loading. */
michael@0 732 /* */
michael@0 733 #define T1_MAX_SUBRS_CALLS 16
michael@0 734
michael@0 735
michael@0 736 /*************************************************************************/
michael@0 737 /* */
michael@0 738 /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
michael@0 739 /* minimum of 16 is required. */
michael@0 740 /* */
michael@0 741 /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
michael@0 742 /* */
michael@0 743 #define T1_MAX_CHARSTRINGS_OPERANDS 256
michael@0 744
michael@0 745
michael@0 746 /*************************************************************************/
michael@0 747 /* */
michael@0 748 /* Define this configuration macro if you want to prevent the */
michael@0 749 /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
michael@0 750 /* files into an existing face. Note that if set, the T1 driver will be */
michael@0 751 /* unable to produce kerning distances. */
michael@0 752 /* */
michael@0 753 #undef T1_CONFIG_OPTION_NO_AFM
michael@0 754
michael@0 755
michael@0 756 /*************************************************************************/
michael@0 757 /* */
michael@0 758 /* Define this configuration macro if you want to prevent the */
michael@0 759 /* compilation of the Multiple Masters font support in the Type 1 */
michael@0 760 /* driver. */
michael@0 761 /* */
michael@0 762 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
michael@0 763
michael@0 764
michael@0 765 /*************************************************************************/
michael@0 766 /*************************************************************************/
michael@0 767 /**** ****/
michael@0 768 /**** C F F D R I V E R C O N F I G U R A T I O N ****/
michael@0 769 /**** ****/
michael@0 770 /*************************************************************************/
michael@0 771 /*************************************************************************/
michael@0 772
michael@0 773
michael@0 774 /*************************************************************************/
michael@0 775 /* */
michael@0 776 /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */
michael@0 777 /* engine gets compiled into FreeType. If defined, it is possible to */
michael@0 778 /* switch between the two engines using the `hinting-engine' property of */
michael@0 779 /* the cff driver module. */
michael@0 780 /* */
michael@0 781 #define CFF_CONFIG_OPTION_OLD_ENGINE
michael@0 782
michael@0 783
michael@0 784 /*************************************************************************/
michael@0 785 /*************************************************************************/
michael@0 786 /**** ****/
michael@0 787 /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
michael@0 788 /**** ****/
michael@0 789 /*************************************************************************/
michael@0 790 /*************************************************************************/
michael@0 791
michael@0 792
michael@0 793 /*************************************************************************/
michael@0 794 /* */
michael@0 795 /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
michael@0 796 /* support. */
michael@0 797 /* */
michael@0 798 #define AF_CONFIG_OPTION_CJK
michael@0 799
michael@0 800 /*************************************************************************/
michael@0 801 /* */
michael@0 802 /* Compile autofit module with Indic script support. */
michael@0 803 /* */
michael@0 804 #define AF_CONFIG_OPTION_INDIC
michael@0 805
michael@0 806 /*************************************************************************/
michael@0 807 /* */
michael@0 808 /* Compile autofit module with warp hinting. The idea of the warping */
michael@0 809 /* code is to slightly scale and shift a glyph within a single dimension */
michael@0 810 /* so that as much of its segments are aligned (more or less) on the */
michael@0 811 /* grid. To find out the optimal scaling and shifting value, various */
michael@0 812 /* parameter combinations are tried and scored. */
michael@0 813 /* */
michael@0 814 /* This experimental option is only active if the render mode is */
michael@0 815 /* FT_RENDER_MODE_LIGHT. */
michael@0 816 /* */
michael@0 817 #define AF_CONFIG_OPTION_USE_WARPER
michael@0 818
michael@0 819 /* */
michael@0 820
michael@0 821
michael@0 822 /*
michael@0 823 * This macro is obsolete. Support has been removed in FreeType
michael@0 824 * version 2.5.
michael@0 825 */
michael@0 826 /* #define FT_CONFIG_OPTION_OLD_INTERNALS */
michael@0 827
michael@0 828
michael@0 829 /*
michael@0 830 * This macro is defined if either unpatented or native TrueType
michael@0 831 * hinting is requested by the definitions above.
michael@0 832 */
michael@0 833 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
michael@0 834 #define TT_USE_BYTECODE_INTERPRETER
michael@0 835 #undef TT_CONFIG_OPTION_UNPATENTED_HINTING
michael@0 836 #elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
michael@0 837 #define TT_USE_BYTECODE_INTERPRETER
michael@0 838 #endif
michael@0 839
michael@0 840 FT_END_HEADER
michael@0 841
michael@0 842
michael@0 843 #endif /* __FTOPTION_H__ */
michael@0 844
michael@0 845
michael@0 846 /* END */

mercurial