1 /***************************************************************************/
5 /* User-selectable configuration macros (specification only). */
7 /* Copyright 1996-2001 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__
29 /*************************************************************************/
31 /* USER-SELECTABLE CONFIGURATION MACROS */
33 /* These macros can be toggled by developers to enable or disable */
34 /* certain aspects of FreeType. This is a default file, where all major */
35 /* options are enabled. */
37 /* Note that if some modifications are required for your build, we */
38 /* advise you to put a modified copy of this file in your build */
39 /* directory, rather than modifying it in-place. */
41 /* The build directory is normally `freetype/builds/<system>' and */
42 /* contains build or system-specific files that are included in */
43 /* priority when building the library. */
45 /*************************************************************************/
48 /*************************************************************************/
49 /*************************************************************************/
51 /**** 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 ****/
53 /*************************************************************************/
54 /*************************************************************************/
57 /*************************************************************************/
59 /* Convenience functions support */
61 /* Some functions of the FreeType 2 API are provided as a convenience */
62 /* for client applications and developers. However, they are not */
63 /* required to build and run the library itself. */
65 /* By defining this configuration macro, you'll disable the */
66 /* compilation of these functions at build time. This can be useful */
67 /* to reduce the library's code size when you don't need any of */
68 /* these functions. */
70 /* All convenience functions are declared as such in their */
73 #undef FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS
76 /*************************************************************************/
80 /* If this macro is set (which is _not_ the default), the higher byte */
81 /* of an error code gives the module in which the error has occurred, */
82 /* while the lower byte is the real error code. */
84 /* Setting this macro makes sense for debugging purposes only, since */
85 /* it would break source compatibility of certain programs that use */
88 /* More details can be found in the files ftmoderr.h and fterrors.h. */
90 #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
93 /*************************************************************************/
95 /* Alternate Glyph Image Format support */
97 /* By default, the glyph images returned by the FreeType glyph loader */
98 /* can either be a pixmap or a vectorial outline defined through */
99 /* Bezier control points. When defining the following configuration */
100 /* macro, some font drivers will be able to register alternate */
101 /* glyph image formats. */
103 /* Unset this macro if you are sure that you will never use a font */
104 /* driver with an alternate glyph format; this will reduce the size of */
105 /* the base layer code. */
107 /* Note that a few Type 1 fonts, as well as Windows `vector' fonts */
108 /* use a vector `plotter' format that isn't supported when this */
109 /* macro is undefined. */
111 #define FT_CONFIG_OPTION_ALTERNATE_GLYPH_FORMATS
114 /*************************************************************************/
116 /* Glyph Postscript Names handling */
118 /* By default, FreeType 2 is compiled with the `PSNames' module. This */
119 /* This module is in charge of converting a glyph name string into a */
120 /* Unicode value, or return a Macintosh standard glyph name for the */
121 /* use with the TrueType `post' table. */
123 /* Undefine this macro if you do not want `PSNames' compiled in your */
124 /* build of FreeType. This has the following effects: */
126 /* - The TrueType driver will provide its own set of glyph names, */
127 /* if you build it to support postscript names in the TrueType */
130 /* - The Type 1 driver will not be able to synthetize a Unicode */
131 /* charmap out of the glyphs found in the fonts. */
133 /* You would normally undefine this configuration macro when building */
134 /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
136 #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
139 /*************************************************************************/
141 /* Postscript Names to Unicode Values support */
143 /* By default, FreeType 2 is built with the `PSNames' module compiled */
144 /* in. Among other things, the module is used to convert a glyph name */
145 /* into a Unicode value. This is especially useful in order to */
146 /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
147 /* through a big table named the `Adobe Glyph List' (AGL). */
149 /* Undefine this macro if you do not want the Adobe Glyph List */
150 /* compiled in your `PSNames' module. The Type 1 driver will not be */
151 /* able to synthetize a Unicode charmap out of the glyphs found in the */
154 #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
157 /*************************************************************************/
159 /* Many compilers provide a non-ANSI 64-bit data type that can be used */
160 /* by FreeType to speed up some computations. However, this will create */
161 /* some problems when compiling the library in strict ANSI mode. */
163 /* For this reason, the use of 64-bit ints is normally disabled when */
164 /* the __STDC__ macro is defined. You can however disable this by */
165 /* defining here the macro FT_CONFIG_OPTION_FORCE_INT64. */
167 /* For most compilers, this will only create compilation warnings */
168 /* when building the library. */
170 /* ObNote: The compiler-specific 64-bit integers are detected in the */
171 /* file "ftconfig.h" either statically, or through Autoconf */
172 /* on platforms that support it. */
174 #define FT_CONFIG_OPTION_FORCE_INT64
177 /*************************************************************************/
179 /* DLL export compilation */
181 /* When compiling FreeType as a DLL, some systems/compilers need a */
182 /* special keyword in front OR after the return type of function */
185 /* Two macros are used within the FreeType source code to define */
186 /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
188 /* FT_EXPORT( return_type ) */
190 /* is used in a function declaration, as in */
192 /* FT_EXPORT( FT_Error ) */
193 /* FT_Init_FreeType( FT_Library* alibrary ); */
196 /* FT_EXPORT_DEF( return_type ) */
198 /* is used in a function definition, as in */
200 /* FT_EXPORT_DEF( FT_Error ) */
201 /* FT_Init_FreeType( FT_Library* alibrary ) */
203 /* ... some code ... */
204 /* return FT_Err_Ok; */
207 /* You can provide your own implementation of FT_EXPORT and */
208 /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
209 /* will be later automatically defined as `extern return_type' to */
210 /* allow normal compilation. */
216 /*************************************************************************/
220 /* FreeType can be compiled in debug or trace mode. In debug mode, */
221 /* errors are reported through the `ftdebug' component. In trace */
222 /* mode, additional messages are sent to the standard output during */
225 /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
226 /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
228 /* Don't define any of these macros to compile in `release' mode! */
230 /* #define FT_DEBUG_LEVEL_ERROR */
231 /* #define FT_DEBUG_LEVEL_TRACE */
234 /*************************************************************************/
236 /* Computation Algorithms */
238 /* Used for debugging, this configuration macro should disappear */
241 #undef FT_CONFIG_OPTION_OLD_CALCS
244 /*************************************************************************/
246 /* The size in bytes of the render pool used by the scan-line converter */
247 /* to do all of its work. */
249 /* This must be greater than 4kByte. */
251 #define FT_RENDER_POOL_SIZE 32768L
254 /*************************************************************************/
258 /* The maximum number of modules that can be registered in a single */
259 /* FreeType library object. 16 is the default. */
261 #define FT_MAX_MODULES 16
264 /*************************************************************************/
266 /* FT_MAX_EXTENSIONS */
268 /* The maximum number of extensions that can be registered in a single */
269 /* font driver. 8 is the default. */
271 /* If you don't know what this means, you certainly do not need to */
272 /* change this value. */
274 #define FT_MAX_EXTENSIONS 8
277 /*************************************************************************/
278 /*************************************************************************/
280 /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
282 /*************************************************************************/
283 /*************************************************************************/
286 /*************************************************************************/
288 /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
289 /* embedded bitmaps in all formats using the SFNT module (namely */
290 /* TrueType & OpenType). */
292 #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
295 /*************************************************************************/
297 /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
298 /* load and enumerate the glyph Postscript names in a TrueType or */
301 /* Note that when you do not compile the `PSNames' module by undefining */
302 /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
303 /* contain additional code used to read the PS Names table from a font. */
305 /* (By default, the module uses `PSNames' to extract glyph names.) */
307 #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
310 /*************************************************************************/
312 /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
313 /* access the internal name table in a SFNT-based format like TrueType */
314 /* or OpenType. The name table contains various strings used to */
315 /* describe the font, like family name, copyright, version, etc. It */
316 /* does not contain any glyph name though. */
318 /* Accessing SFNT names is done through the functions declared in */
319 /* `freetype/ftnames.h'. */
321 #define TT_CONFIG_OPTION_SFNT_NAMES
324 /*************************************************************************/
325 /*************************************************************************/
327 /**** 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 ****/
329 /*************************************************************************/
330 /*************************************************************************/
332 /*************************************************************************/
334 /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
335 /* a bytecode interpreter in the TrueType driver. Note that there are */
336 /* important patent issues related to the use of the interpreter. */
338 /* By undefining this, you will only compile the code necessary to load */
339 /* TrueType glyphs without hinting. */
341 #undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
344 /*************************************************************************/
346 /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
347 /* bytecode interpreter with a huge switch statement, rather than a call */
348 /* table. This results in smaller and faster code for a number of */
351 /* Note however that on some compiler/processor combinations, undefining */
352 /* this macro will generate faster, though larger, code. */
354 #define TT_CONFIG_OPTION_INTERPRETER_SWITCH
357 /*************************************************************************/
358 /*************************************************************************/
360 /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
362 /*************************************************************************/
363 /*************************************************************************/
366 /*************************************************************************/
368 /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
369 /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
372 #define T1_MAX_DICT_DEPTH 5
375 /*************************************************************************/
377 /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
378 /* calls during glyph loading. */
380 #define T1_MAX_SUBRS_CALLS 16
383 /*************************************************************************/
385 /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
386 /* minimum of 16 is required. */
388 /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
390 #define T1_MAX_CHARSTRINGS_OPERANDS 256
393 /*************************************************************************/
395 /* Define T1_CONFIG_OPTION_DISABLE_HINTER if you want to generate a */
396 /* driver with no hinter. This can be useful to debug the parser. */
398 #undef T1_CONFIG_OPTION_DISABLE_HINTER
401 /*************************************************************************/
403 /* Define this configuration macro if you want to prevent the */
404 /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
405 /* files into an existing face. Note that if set, the T1 driver will be */
406 /* unable to produce kerning distances. */
408 #undef T1_CONFIG_OPTION_NO_AFM
411 /*************************************************************************/
413 /* Define this configuration macro if you want to prevent the */
414 /* compilation of the Multiple Masters font support in the Type 1 */
417 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
423 #endif /* __FTOPTION_H__ */