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