1 /***************************************************************************/ 2 /* */ 3 /* ftoption.h */ 4 /* */ 5 /* User-selectable configuration macros (specification only). */ 6 /* */ 7 /* Copyright 1996-2001, 2002 by */ 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 /* */ 10 /* This file is part of the FreeType project, and may only be used, */ 11 /* modified, and distributed under the terms of the FreeType project */ 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 /* this file you indicate that you have read the license and */ 14 /* understand and accept it fully. */ 15 /* */ 16 /***************************************************************************/ 17 18 19 #ifndef __FTOPTION_H__ 20 #define __FTOPTION_H__ 21 22 23 #include <ft2build.h> 24 25 26 FT_BEGIN_HEADER 27 28 /*************************************************************************/ 29 /* */ 30 /* USER-SELECTABLE CONFIGURATION MACROS */ 31 /* */ 32 /* This file contains the default configuration macro definitions for */ 33 /* a standard build of the FreeType library. There are three ways to */ 34 /* use this file to build project-specific versions of the library: */ 35 /* */ 36 /* - You can modify this file by hand, but this is not recommended in */ 37 /* cases where you would like to build several versions of the */ 38 /* library from a single source directory. */ 39 /* */ 40 /* - You can put a copy of this file in your build directory, more */ 41 /* precisely in "$BUILD/freetype/config/ftoption.h", where "$BUILD" */ 42 /* is the name of a directory that is included _before_ the FreeType */ 43 /* include path during compilation. */ 44 /* */ 45 /* The default FreeType Makefiles and Jamfiles use the build */ 46 /* directory "builds/<system>" by default, but you can easily change */ 47 /* that for your own projects. */ 48 /* */ 49 /* - Copy the file <ft2build.h> to "$BUILD/ft2build.h" and modify it */ 50 /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */ 51 /* locate this file during the build. For example, */ 52 /* */ 53 /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */ 54 /* #include <freetype/config/ftheader.h> */ 55 /* */ 56 /* will use "$BUILD/myftoptions.h" instead of this file for macro */ 57 /* definitions. */ 58 /* */ 59 /* Note also that you can similarly pre-define the macro */ 60 /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */ 61 /* that are statically linked to the library at compile time. By */ 62 /* default, this file is <freetype/config/ftmodule.h>. */ 63 /* */ 64 /* We highly recommend using the third method whenever possible. */ 65 /* */ 66 /*************************************************************************/ 67 68 69 /*************************************************************************/ 70 /*************************************************************************/ 71 /**** ****/ 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 ****/ 73 /**** ****/ 74 /*************************************************************************/ 75 /*************************************************************************/ 76 77 78 /*************************************************************************/ 79 /* */ 80 /* Many compilers provide a non-ANSI 64-bit data type that can be used */ 81 /* by FreeType to speed up some computations. However, this will create */ 82 /* some problems when compiling the library in strict ANSI mode. */ 83 /* */ 84 /* For this reason, the use of 64-bit ints is normally disabled when */ 85 /* the __STDC__ macro is defined. You can however disable this by */ 86 /* defining here the macro FT_CONFIG_OPTION_FORCE_INT64. */ 87 /* */ 88 /* For most compilers, this will only create compilation warnings */ 89 /* when building the library. */ 90 /* */ 91 /* ObNote: The compiler-specific 64-bit integers are detected in the */ 92 /* file "ftconfig.h" either statically, or through Autoconf */ 93 /* on platforms that support it. */ 94 /* */ 95 #undef FT_CONFIG_OPTION_FORCE_INT64 96 97 98 /*************************************************************************/ 99 /* */ 100 /* Gzip-compressed file support. */ 101 /* */ 102 /* FreeType now handles font files that have been compressed with the */ 103 /* 'gzip' program. This is mostly used to parse many of the PCF files */ 104 /* that come with XFree86. The implementation uses 'zlib' to */ 105 /* partially uncompress the file on the fly (see src/base/ftgzip.c). */ 106 /* */ 107 /* Define this macro if you want to enable this "feature". Note that */ 108 /* this will however force you to link the zlib to any program that */ 109 /* also uses FreeType. */ 110 /* */ 111 #define FT_CONFIG_OPTION_USE_ZLIB 112 113 114 /*************************************************************************/ 115 /* */ 116 /* ZLib library selection */ 117 /* */ 118 /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */ 119 /* It allows FreeType's "ftgzip" component to link to the system's */ 120 /* installation of the ZLib library. This is useful on systems like */ 121 /* Unix or VMS where it generally is already available. */ 122 /* */ 123 /* If you let it undefined, the component will use its own copy */ 124 /* of the zlib sources instead. These have been modified to be */ 125 /* included directly within the component and *not* export external */ 126 /* function names. This allows you to link any program with FreeType */ 127 /* _and_ ZLib without linking conflicts. */ 128 /* */ 129 /* do not #undef this macro here, since the build system might */ 130 /* define for certain configurations */ 131 /* */ 132 /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ 133 134 135 /*************************************************************************/ 136 /* */ 137 /* DLL export compilation */ 138 /* */ 139 /* When compiling FreeType as a DLL, some systems/compilers need a */ 140 /* special keyword in front OR after the return type of function */ 141 /* declarations. */ 142 /* */ 143 /* Two macros are used within the FreeType source code to define */ 144 /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ 145 /* */ 146 /* FT_EXPORT( return_type ) */ 147 /* */ 148 /* is used in a function declaration, as in */ 149 /* */ 150 /* FT_EXPORT( FT_Error ) */ 151 /* FT_Init_FreeType( FT_Library* alibrary ); */ 152 /* */ 153 /* */ 154 /* FT_EXPORT_DEF( return_type ) */ 155 /* */ 156 /* is used in a function definition, as in */ 157 /* */ 158 /* FT_EXPORT_DEF( FT_Error ) */ 159 /* FT_Init_FreeType( FT_Library* alibrary ) */ 160 /* { */ 161 /* ... some code ... */ 162 /* return FT_Err_Ok; */ 163 /* } */ 164 /* */ 165 /* You can provide your own implementation of FT_EXPORT and */ 166 /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */ 167 /* will be later automatically defined as `extern return_type' to */ 168 /* allow normal compilation. */ 169 /* */ 170 /* #define FT_EXPORT(x) extern x */ 171 /* #define FT_EXPORT_DEF(x) x */ 172 173 174 /*************************************************************************/ 175 /* */ 176 /* Glyph Postscript Names handling */ 177 /* */ 178 /* By default, FreeType 2 is compiled with the `PSNames' module. This */ 179 /* module is in charge of converting a glyph name string into a */ 180 /* Unicode value, or return a Macintosh standard glyph name for the */ 181 /* use with the TrueType `post' table. */ 182 /* */ 183 /* Undefine this macro if you do not want `PSNames' compiled in your */ 184 /* build of FreeType. This has the following effects: */ 185 /* */ 186 /* - The TrueType driver will provide its own set of glyph names, */ 187 /* if you build it to support postscript names in the TrueType */ 188 /* `post' table. */ 189 /* */ 190 /* - The Type 1 driver will not be able to synthetize a Unicode */ 191 /* charmap out of the glyphs found in the fonts. */ 192 /* */ 193 /* You would normally undefine this configuration macro when building */ 194 /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */ 195 /* */ 196 #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES 197 198 199 /*************************************************************************/ 200 /* */ 201 /* Postscript Names to Unicode Values support */ 202 /* */ 203 /* By default, FreeType 2 is built with the `PSNames' module compiled */ 204 /* in. Among other things, the module is used to convert a glyph name */ 205 /* into a Unicode value. This is especially useful in order to */ 206 /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */ 207 /* through a big table named the `Adobe Glyph List' (AGL). */ 208 /* */ 209 /* Undefine this macro if you do not want the Adobe Glyph List */ 210 /* compiled in your `PSNames' module. The Type 1 driver will not be */ 211 /* able to synthetize a Unicode charmap out of the glyphs found in the */ 212 /* fonts. */ 213 /* */ 214 #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST 215 216 217 /*************************************************************************/ 218 /* */ 219 /* Allow the use of FT_Incremental_Interface to load typefaces that */ 220 /* contain no glyph data, but supply it via a callback function. */ 221 /* This allows FreeType to be used with the PostScript language, using */ 222 /* the GhostScript interpreter. */ 223 /* */ 224 /* #define FT_CONFIG_OPTION_INCREMENTAL */ 225 226 227 /*************************************************************************/ 228 /* */ 229 /* The size in bytes of the render pool used by the scan-line converter */ 230 /* to do all of its work. */ 231 /* */ 232 /* This must be greater than 4kByte. */ 233 /* */ 234 #define FT_RENDER_POOL_SIZE 16384L 235 236 237 /*************************************************************************/ 238 /* */ 239 /* FT_MAX_MODULES */ 240 /* */ 241 /* The maximum number of modules that can be registered in a single */ 242 /* FreeType library object. 32 is the default. */ 243 /* */ 244 #define FT_MAX_MODULES 32 245 246 247 /*************************************************************************/ 248 /* */ 249 /* Debug level */ 250 /* */ 251 /* FreeType can be compiled in debug or trace mode. In debug mode, */ 252 /* errors are reported through the `ftdebug' component. In trace */ 253 /* mode, additional messages are sent to the standard output during */ 254 /* execution. */ 255 /* */ 256 /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */ 257 /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */ 258 /* */ 259 /* Don't define any of these macros to compile in `release' mode! */ 260 /* */ 261 /* #define FT_DEBUG_LEVEL_ERROR */ 262 /* #define FT_DEBUG_LEVEL_TRACE */ 263 264 265 /*************************************************************************/ 266 /* */ 267 /* Memory Debugging */ 268 /* */ 269 /* FreeType now comes with an integrated memory debugger that is */ 270 /* capable of detecting simple errors like memory leaks or double */ 271 /* deletes. To compile it within your build of the library, you */ 272 /* should define FT_DEBUG_MEMORY here. */ 273 /* */ 274 /* Note that the memory debugger is only activated at runtime when */ 275 /* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */ 276 /* */ 277 /* #define FT_DEBUG_MEMORY */ 278 279 280 281 /*************************************************************************/ 282 /* */ 283 /* Module errors */ 284 /* */ 285 /* If this macro is set (which is _not_ the default), the higher byte */ 286 /* of an error code gives the module in which the error has occurred, */ 287 /* while the lower byte is the real error code. */ 288 /* */ 289 /* Setting this macro makes sense for debugging purposes only, since */ 290 /* it would break source compatibility of certain programs that use */ 291 /* FreeType 2. */ 292 /* */ 293 /* More details can be found in the files ftmoderr.h and fterrors.h. */ 294 /* */ 295 #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS 296 297 298 299 /*************************************************************************/ 300 /*************************************************************************/ 301 /**** ****/ 302 /**** S F N T D R I V E R C O N F I G U R A T I O N ****/ 303 /**** ****/ 304 /*************************************************************************/ 305 /*************************************************************************/ 306 307 308 /*************************************************************************/ 309 /* */ 310 /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */ 311 /* embedded bitmaps in all formats using the SFNT module (namely */ 312 /* TrueType & OpenType). */ 313 /* */ 314 #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS 315 316 317 /*************************************************************************/ 318 /* */ 319 /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */ 320 /* load and enumerate the glyph Postscript names in a TrueType or */ 321 /* OpenType file. */ 322 /* */ 323 /* Note that when you do not compile the `PSNames' module by undefining */ 324 /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */ 325 /* contain additional code used to read the PS Names table from a font. */ 326 /* */ 327 /* (By default, the module uses `PSNames' to extract glyph names.) */ 328 /* */ 329 #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES 330 331 332 /*************************************************************************/ 333 /* */ 334 /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */ 335 /* access the internal name table in a SFNT-based format like TrueType */ 336 /* or OpenType. The name table contains various strings used to */ 337 /* describe the font, like family name, copyright, version, etc. It */ 338 /* does not contain any glyph name though. */ 339 /* */ 340 /* Accessing SFNT names is done through the functions declared in */ 341 /* `freetype/ftnames.h'. */ 342 /* */ 343 #define TT_CONFIG_OPTION_SFNT_NAMES 344 345 346 /*************************************************************************/ 347 /* */ 348 /* TrueType CMap support */ 349 /* */ 350 /* Here you can fine-tune which TrueType CMap table format shall be */ 351 /* supported. */ 352 #define TT_CONFIG_CMAP_FORMAT_0 353 #define TT_CONFIG_CMAP_FORMAT_2 354 #define TT_CONFIG_CMAP_FORMAT_4 355 #define TT_CONFIG_CMAP_FORMAT_6 356 #define TT_CONFIG_CMAP_FORMAT_8 357 #define TT_CONFIG_CMAP_FORMAT_10 358 #define TT_CONFIG_CMAP_FORMAT_12 359 360 361 /*************************************************************************/ 362 /*************************************************************************/ 363 /**** ****/ 364 /**** 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 ****/ 365 /**** ****/ 366 /*************************************************************************/ 367 /*************************************************************************/ 368 369 /*************************************************************************/ 370 /* */ 371 /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ 372 /* a bytecode interpreter in the TrueType driver. Note that there are */ 373 /* important patent issues related to the use of the interpreter. */ 374 /* */ 375 /* By undefining this, you will only compile the code necessary to load */ 376 /* TrueType glyphs without hinting. */ 377 /* */ 378 /* do not #undef this macro here, since the build system might */ 379 /* define for certain configurations */ 380 /* */ 381 /*#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER*/ 382 383 384 /*************************************************************************/ 385 /* */ 386 /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */ 387 /* bytecode interpreter with a huge switch statement, rather than a call */ 388 /* table. This results in smaller and faster code for a number of */ 389 /* architectures. */ 390 /* */ 391 /* Note however that on some compiler/processor combinations, undefining */ 392 /* this macro will generate faster, though larger, code. */ 393 /* */ 394 #define TT_CONFIG_OPTION_INTERPRETER_SWITCH 395 396 397 /*************************************************************************/ 398 /* */ 399 /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ 400 /* TrueType glyph loader to use Apple's definition of how to handle */ 401 /* component offsets in composite glyphs. */ 402 /* */ 403 /* Apple and MS disagree on the default behavior of component offsets */ 404 /* in composites. Apple says that they should be scaled by the scale */ 405 /* factors in the transformation matrix (roughly, it's more complex) */ 406 /* while MS says they should not. OpenType defines two bits in the */ 407 /* composite flags array which can be used to disambiguate, but old */ 408 /* fonts will not have them. */ 409 /* */ 410 /* http://partners.adobe.com/asn/developer/opentype/glyf.html */ 411 /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ 412 /* */ 413 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED 414 415 416 /*************************************************************************/ 417 /*************************************************************************/ 418 /**** ****/ 419 /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ 420 /**** ****/ 421 /*************************************************************************/ 422 /*************************************************************************/ 423 424 425 /*************************************************************************/ 426 /* */ 427 /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */ 428 /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */ 429 /* required. */ 430 /* */ 431 #define T1_MAX_DICT_DEPTH 5 432 433 434 /*************************************************************************/ 435 /* */ 436 /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */ 437 /* calls during glyph loading. */ 438 /* */ 439 #define T1_MAX_SUBRS_CALLS 16 440 441 442 /*************************************************************************/ 443 /* */ 444 /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */ 445 /* minimum of 16 is required. */ 446 /* */ 447 /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */ 448 /* */ 449 #define T1_MAX_CHARSTRINGS_OPERANDS 256 450 451 452 /*************************************************************************/ 453 /* */ 454 /* Define this configuration macro if you want to prevent the */ 455 /* compilation of `t1afm', which is in charge of reading Type 1 AFM */ 456 /* files into an existing face. Note that if set, the T1 driver will be */ 457 /* unable to produce kerning distances. */ 458 /* */ 459 #undef T1_CONFIG_OPTION_NO_AFM 460 461 462 /*************************************************************************/ 463 /* */ 464 /* Define this configuration macro if you want to prevent the */ 465 /* compilation of the Multiple Masters font support in the Type 1 */ 466 /* driver. */ 467 /* */ 468 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT 469 470 /* */ 471 472 FT_END_HEADER 473 474 475 #endif /* __FTOPTION_H__ */ 476 477 478 /* END */ 479