1 /***************************************************************************/
5 /* User-selectable configuration macros (specification only). */
7 /* Copyright 1996-2001, 2002 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__
26 * this is a special developer version of "ftoption.h", it is used
27 * to define all debugging options, as well as the TrueType bytecode
33 /*************************************************************************/
35 /* USER-SELECTABLE CONFIGURATION MACROS */
37 /* This file contains the default configuration macro definitions for */
38 /* a standard build of the FreeType library. There are three ways to */
39 /* use this file to build project-specific versions of the library: */
41 /* - You can modify this file by hand, but this is not recommended in */
42 /* cases where you would like to build several versions of the */
43 /* library from a single source directory. */
45 /* - You can put a copy of this file in your build directory, more */
46 /* precisely in "$BUILD/freetype/config/ftoption.h", where "$BUILD" */
47 /* is the name of a directory that is included _before_ the FreeType */
48 /* include path during compilation. */
50 /* The default FreeType Makefiles and Jamfiles use the build */
51 /* directory "builds/<system>" by default, but you can easily change */
52 /* that for your own projects. */
54 /* - Copy the file <ft2build.h> to "$BUILD/ft2build.h" and modify it */
55 /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
56 /* locate this file during the build. For example, */
58 /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
59 /* #include <freetype/config/ftheader.h> */
61 /* will use "$BUILD/myftoptions.h" instead of this file for macro */
64 /* Note also that you can similarly pre-define the macro */
65 /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
66 /* that are statically linked to the library at compile time. By */
67 /* default, this file is <freetype/config/ftmodule.h>. */
69 /* We highly recommend using the third method whenever possible. */
71 /*************************************************************************/
74 /*************************************************************************/
75 /*************************************************************************/
77 /**** 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 ****/
79 /*************************************************************************/
80 /*************************************************************************/
83 /*************************************************************************/
85 /* Many compilers provide a non-ANSI 64-bit data type that can be used */
86 /* by FreeType to speed up some computations. However, this will create */
87 /* some problems when compiling the library in strict ANSI mode. */
89 /* For this reason, the use of 64-bit ints is normally disabled when */
90 /* the __STDC__ macro is defined. You can however disable this by */
91 /* defining here the macro FT_CONFIG_OPTION_FORCE_INT64. */
93 /* For most compilers, this will only create compilation warnings */
94 /* when building the library. */
96 /* ObNote: The compiler-specific 64-bit integers are detected in the */
97 /* file "ftconfig.h" either statically, or through Autoconf */
98 /* on platforms that support it. */
100 #undef FT_CONFIG_OPTION_FORCE_INT64
103 /*************************************************************************/
105 /* Gzip-compressed file support. */
107 /* FreeType now handles font files that have been compressed with the */
108 /* 'gzip' program. This is mostly used to parse many of the PCF files */
109 /* that come with XFree86. The implementation uses 'zlib' to */
110 /* partially uncompress the file on the fly (see src/base/ftgzip.c). */
112 /* Define this macro if you want to enable this "feature". Note that */
113 /* this will however force you to link the zlib to any program that */
114 /* also uses FreeType. */
116 #define FT_CONFIG_OPTION_USE_ZLIB
119 /*************************************************************************/
121 /* ZLib library selection */
123 /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
124 /* It allows FreeType's "ftgzip" component to link to the system's */
125 /* installation of the ZLib library. This is useful on systems like */
126 /* Unix or VMS where it generally is already available. */
128 /* If you let it undefined, the component will use its own copy */
129 /* of the zlib sources instead. These have been modified to be */
130 /* included directly within the component and *not* export external */
131 /* function names. This allows you to link any program with FreeType */
132 /* _and_ ZLib without linking conflicts. */
134 /* do not #undef this macro here, since the build system might */
135 /* define for certain configurations */
137 /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
140 /*************************************************************************/
142 /* DLL export compilation */
144 /* When compiling FreeType as a DLL, some systems/compilers need a */
145 /* special keyword in front OR after the return type of function */
148 /* Two macros are used within the FreeType source code to define */
149 /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
151 /* FT_EXPORT( return_type ) */
153 /* is used in a function declaration, as in */
155 /* FT_EXPORT( FT_Error ) */
156 /* FT_Init_FreeType( FT_Library* alibrary ); */
159 /* FT_EXPORT_DEF( return_type ) */
161 /* is used in a function definition, as in */
163 /* FT_EXPORT_DEF( FT_Error ) */
164 /* FT_Init_FreeType( FT_Library* alibrary ) */
166 /* ... some code ... */
167 /* return FT_Err_Ok; */
170 /* You can provide your own implementation of FT_EXPORT and */
171 /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
172 /* will be later automatically defined as `extern return_type' to */
173 /* allow normal compilation. */
175 /* #define FT_EXPORT(x) extern x */
176 /* #define FT_EXPORT_DEF(x) x */
179 /*************************************************************************/
181 /* Glyph Postscript Names handling */
183 /* By default, FreeType 2 is compiled with the `PSNames' module. This */
184 /* module is in charge of converting a glyph name string into a */
185 /* Unicode value, or return a Macintosh standard glyph name for the */
186 /* use with the TrueType `post' table. */
188 /* Undefine this macro if you do not want `PSNames' compiled in your */
189 /* build of FreeType. This has the following effects: */
191 /* - The TrueType driver will provide its own set of glyph names, */
192 /* if you build it to support postscript names in the TrueType */
195 /* - The Type 1 driver will not be able to synthetize a Unicode */
196 /* charmap out of the glyphs found in the fonts. */
198 /* You would normally undefine this configuration macro when building */
199 /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
201 #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
204 /*************************************************************************/
206 /* Postscript Names to Unicode Values support */
208 /* By default, FreeType 2 is built with the `PSNames' module compiled */
209 /* in. Among other things, the module is used to convert a glyph name */
210 /* into a Unicode value. This is especially useful in order to */
211 /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
212 /* through a big table named the `Adobe Glyph List' (AGL). */
214 /* Undefine this macro if you do not want the Adobe Glyph List */
215 /* compiled in your `PSNames' module. The Type 1 driver will not be */
216 /* able to synthetize a Unicode charmap out of the glyphs found in the */
219 #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
222 /*************************************************************************/
224 /* Allow the use of FT_Incremental_Interface to load typefaces that */
225 /* contain no glyph data, but supply it via a callback function. */
226 /* This allows FreeType to be used with the PostScript language, using */
227 /* the GhostScript interpreter. */
229 /* #define FT_CONFIG_OPTION_INCREMENTAL */
232 /*************************************************************************/
234 /* The size in bytes of the render pool used by the scan-line converter */
235 /* to do all of its work. */
237 /* This must be greater than 4kByte. */
239 #define FT_RENDER_POOL_SIZE 16384L
242 /*************************************************************************/
246 /* The maximum number of modules that can be registered in a single */
247 /* FreeType library object. 32 is the default. */
249 #define FT_MAX_MODULES 32
252 /*************************************************************************/
256 /* FreeType can be compiled in debug or trace mode. In debug mode, */
257 /* errors are reported through the `ftdebug' component. In trace */
258 /* mode, additional messages are sent to the standard output during */
261 /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
262 /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
264 /* Don't define any of these macros to compile in `release' mode! */
266 #define FT_DEBUG_LEVEL_ERROR
267 #define FT_DEBUG_LEVEL_TRACE
270 /*************************************************************************/
272 /* Memory Debugging */
274 /* FreeType now comes with an integrated memory debugger that is */
275 /* capable of detecting simple errors like memory leaks or double */
276 /* deletes. To compile it within your build of the library, you */
277 /* should define FT_DEBUG_MEMORY here. */
279 /* Note that the memory debugger is only activated at runtime when */
280 /* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */
282 #define FT_DEBUG_MEMORY
286 /*************************************************************************/
290 /* If this macro is set (which is _not_ the default), the higher byte */
291 /* of an error code gives the module in which the error has occurred, */
292 /* while the lower byte is the real error code. */
294 /* Setting this macro makes sense for debugging purposes only, since */
295 /* it would break source compatibility of certain programs that use */
298 /* More details can be found in the files ftmoderr.h and fterrors.h. */
300 #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
304 /*************************************************************************/
305 /*************************************************************************/
307 /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
309 /*************************************************************************/
310 /*************************************************************************/
313 /*************************************************************************/
315 /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
316 /* embedded bitmaps in all formats using the SFNT module (namely */
317 /* TrueType & OpenType). */
319 #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
322 /*************************************************************************/
324 /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
325 /* load and enumerate the glyph Postscript names in a TrueType or */
328 /* Note that when you do not compile the `PSNames' module by undefining */
329 /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
330 /* contain additional code used to read the PS Names table from a font. */
332 /* (By default, the module uses `PSNames' to extract glyph names.) */
334 #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
337 /*************************************************************************/
339 /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
340 /* access the internal name table in a SFNT-based format like TrueType */
341 /* or OpenType. The name table contains various strings used to */
342 /* describe the font, like family name, copyright, version, etc. It */
343 /* does not contain any glyph name though. */
345 /* Accessing SFNT names is done through the functions declared in */
346 /* `freetype/ftnames.h'. */
348 #define TT_CONFIG_OPTION_SFNT_NAMES
351 /*************************************************************************/
353 /* TrueType CMap support */
355 /* Here you can fine-tune which TrueType CMap table format shall be */
357 #define TT_CONFIG_CMAP_FORMAT_0
358 #define TT_CONFIG_CMAP_FORMAT_2
359 #define TT_CONFIG_CMAP_FORMAT_4
360 #define TT_CONFIG_CMAP_FORMAT_6
361 #define TT_CONFIG_CMAP_FORMAT_8
362 #define TT_CONFIG_CMAP_FORMAT_10
363 #define TT_CONFIG_CMAP_FORMAT_12
366 /*************************************************************************/
367 /*************************************************************************/
369 /**** 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 ****/
371 /*************************************************************************/
372 /*************************************************************************/
374 /*************************************************************************/
376 /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
377 /* a bytecode interpreter in the TrueType driver. Note that there are */
378 /* important patent issues related to the use of the interpreter. */
380 /* By undefining this, you will only compile the code necessary to load */
381 /* TrueType glyphs without hinting. */
383 /* do not #undef this macro here, since the build system might */
384 /* define for certain configurations */
386 #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
389 /*************************************************************************/
391 /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
392 /* bytecode interpreter with a huge switch statement, rather than a call */
393 /* table. This results in smaller and faster code for a number of */
396 /* Note however that on some compiler/processor combinations, undefining */
397 /* this macro will generate faster, though larger, code. */
399 #define TT_CONFIG_OPTION_INTERPRETER_SWITCH
402 /*************************************************************************/
404 /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
405 /* TrueType glyph loader to use Apple's definition of how to handle */
406 /* component offsets in composite glyphs. */
408 /* Apple and MS disagree on the default behavior of component offsets */
409 /* in composites. Apple says that they should be scaled by the scale */
410 /* factors in the transformation matrix (roughly, it's more complex) */
411 /* while MS says they should not. OpenType defines two bits in the */
412 /* composite flags array which can be used to disambiguate, but old */
413 /* fonts will not have them. */
415 /* http://partners.adobe.com/asn/developer/opentype/glyf.html */
416 /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
418 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
421 /*************************************************************************/
422 /*************************************************************************/
424 /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
426 /*************************************************************************/
427 /*************************************************************************/
430 /*************************************************************************/
432 /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
433 /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
436 #define T1_MAX_DICT_DEPTH 5
439 /*************************************************************************/
441 /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
442 /* calls during glyph loading. */
444 #define T1_MAX_SUBRS_CALLS 16
447 /*************************************************************************/
449 /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
450 /* minimum of 16 is required. */
452 /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
454 #define T1_MAX_CHARSTRINGS_OPERANDS 256
457 /*************************************************************************/
459 /* Define this configuration macro if you want to prevent the */
460 /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
461 /* files into an existing face. Note that if set, the T1 driver will be */
462 /* unable to produce kerning distances. */
464 #undef T1_CONFIG_OPTION_NO_AFM
467 /*************************************************************************/
469 /* Define this configuration macro if you want to prevent the */
470 /* compilation of the Multiple Masters font support in the Type 1 */
473 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
478 * the FT_CONFIG_OPTION_CHESTER_XXXX macros are used to toggle some recent
479 * improvements to the auto-hinter contributed by David Chester. They will
480 * most likely disappear completely in the next release. For now, you should
481 * always keep them defined
484 #define FT_CONFIG_OPTION_CHESTER_HINTS
486 #ifdef FT_CONFIG_OPTION_CHESTER_HINTS
488 # define FT_CONFIG_CHESTER_SMALL_F
489 # define FT_CONFIG_CHESTER_ASCENDER
490 # define FT_CONFIG_CHESTER_SERIF
491 # define FT_CONFIG_CHESTER_STEM
492 # define FT_CONFIG_CHESTER_BLUE_SCALE
494 #endif /* FT_CONFIG_OPTION_CHESTER_HINTS */
499 #endif /* __FTOPTION_H__ */