e6f34b431080cd2a6ab5c53394c5188dc73848c8
1 /***************************************************************************/
5 /* User-selectable configuration macros (specification only). */
7 /* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
16 /***************************************************************************/
19 #ifndef __FTOPTION_H__
20 #define __FTOPTION_H__
28 /*************************************************************************/
30 /* USER-SELECTABLE CONFIGURATION MACROS */
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: */
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. */
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. */
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. */
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, */
53 /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
54 /* #include <freetype/config/ftheader.h> */
56 /* will use "$BUILD/myftoptions.h" instead of this file for macro */
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>. */
64 /* We highly recommend using the third method whenever possible. */
66 /*************************************************************************/
69 /*************************************************************************/
70 /*************************************************************************/
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 ****/
74 /*************************************************************************/
75 /*************************************************************************/
78 /*************************************************************************/
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. */
84 /* For this reason, the use of 64-bit integers is normally disabled when */
85 /* the __STDC__ macro is defined. You can however disable this by */
86 /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
88 /* For most compilers, this will only create compilation warnings when */
89 /* building the library. */
91 /* ObNote: The compiler-specific 64-bit integers are detected in the */
92 /* file "ftconfig.h" either statically or through the */
93 /* `configure' script on supported platforms. */
95 #undef FT_CONFIG_OPTION_FORCE_INT64
98 /*************************************************************************/
100 /* LZW-compressed file support. */
102 /* FreeType now handles font files that have been compressed with the */
103 /* 'compress' program. This is mostly used to parse many of the PCF */
104 /* files that come with various X11 distributions. The implementation */
105 /* uses NetBSD's `zopen' to partially uncompress the file on the fly */
106 /* (see src/lzw/ftgzip.c). */
108 /* Define this macro if you want to enable this `feature'. */
110 #define FT_CONFIG_OPTION_USE_LZW
113 /*************************************************************************/
115 /* Gzip-compressed file support. */
117 /* FreeType now handles font files that have been compressed with the */
118 /* 'gzip' program. This is mostly used to parse many of the PCF files */
119 /* that come with XFree86. The implementation uses `zlib' to */
120 /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
122 /* Define this macro if you want to enable this `feature'. See also */
123 /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
125 #define FT_CONFIG_OPTION_USE_ZLIB
128 /*************************************************************************/
130 /* ZLib library selection */
132 /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
133 /* It allows FreeType's `ftgzip' component to link to the system's */
134 /* installation of the ZLib library. This is useful on systems like */
135 /* Unix or VMS where it generally is already available. */
137 /* If you let it undefined, the component will use its own copy */
138 /* of the zlib sources instead. These have been modified to be */
139 /* included directly within the component and *not* export external */
140 /* function names. This allows you to link any program with FreeType */
141 /* _and_ ZLib without linking conflicts. */
143 /* Do not #undef this macro here since the build system might define */
144 /* it for certain configurations only. */
146 /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
149 /*************************************************************************/
151 /* DLL export compilation */
153 /* When compiling FreeType as a DLL, some systems/compilers need a */
154 /* special keyword in front OR after the return type of function */
157 /* Two macros are used within the FreeType source code to define */
158 /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
160 /* FT_EXPORT( return_type ) */
162 /* is used in a function declaration, as in */
164 /* FT_EXPORT( FT_Error ) */
165 /* FT_Init_FreeType( FT_Library* alibrary ); */
168 /* FT_EXPORT_DEF( return_type ) */
170 /* is used in a function definition, as in */
172 /* FT_EXPORT_DEF( FT_Error ) */
173 /* FT_Init_FreeType( FT_Library* alibrary ) */
175 /* ... some code ... */
176 /* return FT_Err_Ok; */
179 /* You can provide your own implementation of FT_EXPORT and */
180 /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
181 /* will be later automatically defined as `extern return_type' to */
182 /* allow normal compilation. */
184 /* Do not #undef these macros here since the build system might define */
185 /* them for certain configurations only. */
187 /* #define FT_EXPORT(x) extern x */
188 /* #define FT_EXPORT_DEF(x) x */
191 /*************************************************************************/
193 /* Glyph Postscript Names handling */
195 /* By default, FreeType 2 is compiled with the `PSNames' module. This */
196 /* module is in charge of converting a glyph name string into a */
197 /* Unicode value, or return a Macintosh standard glyph name for the */
198 /* use with the TrueType `post' table. */
200 /* Undefine this macro if you do not want `PSNames' compiled in your */
201 /* build of FreeType. This has the following effects: */
203 /* - The TrueType driver will provide its own set of glyph names, */
204 /* if you build it to support postscript names in the TrueType */
207 /* - The Type 1 driver will not be able to synthetize a Unicode */
208 /* charmap out of the glyphs found in the fonts. */
210 /* You would normally undefine this configuration macro when building */
211 /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
213 #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
216 /*************************************************************************/
218 /* Postscript Names to Unicode Values support */
220 /* By default, FreeType 2 is built with the `PSNames' module compiled */
221 /* in. Among other things, the module is used to convert a glyph name */
222 /* into a Unicode value. This is especially useful in order to */
223 /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
224 /* through a big table named the `Adobe Glyph List' (AGL). */
226 /* Undefine this macro if you do not want the Adobe Glyph List */
227 /* compiled in your `PSNames' module. The Type 1 driver will not be */
228 /* able to synthetize a Unicode charmap out of the glyphs found in the */
231 #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
234 /*************************************************************************/
236 /* Support for Mac fonts */
238 /* Define this macro if you want support for outline fonts in Mac */
239 /* format (mac dfont, mac resource, macbinary containing a mac */
240 /* resource) on non-Mac platforms. */
242 /* Note that the `FOND' resource isn't checked. */
244 #define FT_CONFIG_OPTION_MAC_FONTS
247 /*************************************************************************/
249 /* Guessing methods to access embedded resource forks */
251 /* Enable extra Mac fonts support on non-Mac platforms (e.g. */
254 /* Resource forks which include fonts data are stored sometimes in */
255 /* locations which users or developers don't expected. In some cases, */
256 /* resource forks start with some offset from the head of a file. In */
257 /* other cases, the actual resource fork is stored in file different */
258 /* from what the user specifies. If this option is activated, */
259 /* FreeType tries to guess whether such offsets or different file */
260 /* names must be used. */
262 /* Note that normal, direct access of resource forks is controlled via */
263 /* the FT_CONFIG_OPTION_MAC_FONTS option. */
265 #ifdef FT_CONFIG_OPTION_MAC_FONTS
266 #define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
270 /*************************************************************************/
272 /* Allow the use of FT_Incremental_Interface to load typefaces that */
273 /* contain no glyph data, but supply it via a callback function. */
274 /* This allows FreeType to be used with the PostScript language, using */
275 /* the GhostScript interpreter. */
277 /* #define FT_CONFIG_OPTION_INCREMENTAL */
280 /*************************************************************************/
282 /* The size in bytes of the render pool used by the scan-line converter */
283 /* to do all of its work. */
285 /* This must be greater than 4KByte. */
287 #define FT_RENDER_POOL_SIZE 16384L
290 /*************************************************************************/
294 /* The maximum number of modules that can be registered in a single */
295 /* FreeType library object. 32 is the default. */
297 #define FT_MAX_MODULES 32
300 /*************************************************************************/
304 /* FreeType can be compiled in debug or trace mode. In debug mode, */
305 /* errors are reported through the `ftdebug' component. In trace */
306 /* mode, additional messages are sent to the standard output during */
309 /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
310 /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
312 /* Don't define any of these macros to compile in `release' mode! */
314 /* Do not #undef these macros here since the build system might define */
315 /* them for certain configurations only. */
317 /* #define FT_DEBUG_LEVEL_ERROR */
318 /* #define FT_DEBUG_LEVEL_TRACE */
321 /*************************************************************************/
323 /* Memory Debugging */
325 /* FreeType now comes with an integrated memory debugger that is */
326 /* capable of detecting simple errors like memory leaks or double */
327 /* deletes. To compile it within your build of the library, you */
328 /* should define FT_DEBUG_MEMORY here. */
330 /* Note that the memory debugger is only activated at runtime when */
331 /* when the _environment_ variable "FT2_DEBUG_MEMORY" is defined also! */
333 /* Do not #undef this macro here since the build system might define */
334 /* it for certain configurations only. */
336 /* #define FT_DEBUG_MEMORY */
339 /*************************************************************************/
343 /* If this macro is set (which is _not_ the default), the higher byte */
344 /* of an error code gives the module in which the error has occurred, */
345 /* while the lower byte is the real error code. */
347 /* Setting this macro makes sense for debugging purposes only, since */
348 /* it would break source compatibility of certain programs that use */
351 /* More details can be found in the files ftmoderr.h and fterrors.h. */
353 #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
357 /*************************************************************************/
358 /*************************************************************************/
360 /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
362 /*************************************************************************/
363 /*************************************************************************/
366 /*************************************************************************/
368 /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
369 /* embedded bitmaps in all formats using the SFNT module (namely */
370 /* TrueType & OpenType). */
372 #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
375 /*************************************************************************/
377 /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
378 /* load and enumerate the glyph Postscript names in a TrueType or */
381 /* Note that when you do not compile the `PSNames' module by undefining */
382 /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
383 /* contain additional code used to read the PS Names table from a font. */
385 /* (By default, the module uses `PSNames' to extract glyph names.) */
387 #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
390 /*************************************************************************/
392 /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
393 /* access the internal name table in a SFNT-based format like TrueType */
394 /* or OpenType. The name table contains various strings used to */
395 /* describe the font, like family name, copyright, version, etc. It */
396 /* does not contain any glyph name though. */
398 /* Accessing SFNT names is done through the functions declared in */
399 /* `freetype/ftnames.h'. */
401 #define TT_CONFIG_OPTION_SFNT_NAMES
404 /*************************************************************************/
406 /* TrueType CMap support */
408 /* Here you can fine-tune which TrueType CMap table format shall be */
410 #define TT_CONFIG_CMAP_FORMAT_0
411 #define TT_CONFIG_CMAP_FORMAT_2
412 #define TT_CONFIG_CMAP_FORMAT_4
413 #define TT_CONFIG_CMAP_FORMAT_6
414 #define TT_CONFIG_CMAP_FORMAT_8
415 #define TT_CONFIG_CMAP_FORMAT_10
416 #define TT_CONFIG_CMAP_FORMAT_12
419 /*************************************************************************/
420 /*************************************************************************/
422 /**** 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 ****/
424 /*************************************************************************/
425 /*************************************************************************/
427 /*************************************************************************/
429 /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
430 /* a bytecode interpreter in the TrueType driver. Note that there are */
431 /* important patent issues related to the use of the interpreter. */
433 /* By undefining this, you will only compile the code necessary to load */
434 /* TrueType glyphs without hinting. */
436 /* Do not #undef this macro here, since the build system might */
437 /* define it for certain configurations only. */
439 #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
442 /*************************************************************************/
444 /* Define TT_CONFIG_OPTION_UNPATENTED_HINTING (in addition to */
445 /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER) to compile the unpatented */
446 /* work-around hinting system. Note that for the moment, the algorithm */
447 /* is only used when selected at runtime through the parameter tag */
448 /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */
449 /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally activated. */
451 //#define TT_CONFIG_OPTION_UNPATENTED_HINTING
454 /*************************************************************************/
456 /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
457 /* bytecode interpreter with a huge switch statement, rather than a call */
458 /* table. This results in smaller and faster code for a number of */
461 /* Note however that on some compiler/processor combinations, undefining */
462 /* this macro will generate faster, though larger, code. */
464 #define TT_CONFIG_OPTION_INTERPRETER_SWITCH
467 /*************************************************************************/
469 /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
470 /* TrueType glyph loader to use Apple's definition of how to handle */
471 /* component offsets in composite glyphs. */
473 /* Apple and MS disagree on the default behavior of component offsets */
474 /* in composites. Apple says that they should be scaled by the scale */
475 /* factors in the transformation matrix (roughly, it's more complex) */
476 /* while MS says they should not. OpenType defines two bits in the */
477 /* composite flags array which can be used to disambiguate, but old */
478 /* fonts will not have them. */
480 /* http://partners.adobe.com/asn/developer/opentype/glyf.html */
481 /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
483 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
486 /*************************************************************************/
488 /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
489 /* support for Apple's distortable font technology (fvar, gvar, cvar, */
490 /* and avar tables). This has many similarities to Type 1 Multiple */
491 /* Masters support. */
493 #define TT_CONFIG_OPTION_GX_VAR_SUPPORT
496 /*************************************************************************/
497 /*************************************************************************/
499 /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
501 /*************************************************************************/
502 /*************************************************************************/
505 /*************************************************************************/
507 /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
508 /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
511 #define T1_MAX_DICT_DEPTH 5
514 /*************************************************************************/
516 /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
517 /* calls during glyph loading. */
519 #define T1_MAX_SUBRS_CALLS 16
522 /*************************************************************************/
524 /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
525 /* minimum of 16 is required. */
527 /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
529 #define T1_MAX_CHARSTRINGS_OPERANDS 256
532 /*************************************************************************/
534 /* Define this configuration macro if you want to prevent the */
535 /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
536 /* files into an existing face. Note that if set, the T1 driver will be */
537 /* unable to produce kerning distances. */
539 #undef T1_CONFIG_OPTION_NO_AFM
542 /*************************************************************************/
544 /* Define this configuration macro if you want to prevent the */
545 /* compilation of the Multiple Masters font support in the Type 1 */
548 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
553 * This temporary macro is used to control various optimizations for
554 * reducing the heap footprint of memory-mapped TrueType files.
557 /* #define FT_OPTIMIZE_MEMORY */
562 #endif /* __FTOPTION_H__ */