Update to FreeType 2.1.9
[reactos.git] / reactos / lib / freetype / include / freetype / config / ftoption.h
1 /***************************************************************************/
2 /* */
3 /* ftoption.h */
4 /* */
5 /* User-selectable configuration macros (specification only). */
6 /* */
7 /* Copyright 1996-2001, 2002, 2003, 2004 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 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. */
87 /* */
88 /* For most compilers, this will only create compilation warnings when */
89 /* building the library. */
90 /* */
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. */
94 /* */
95 #undef FT_CONFIG_OPTION_FORCE_INT64
96
97
98 /*************************************************************************/
99 /* */
100 /* LZW-compressed file support. */
101 /* */
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). */
107 /* */
108 /* Define this macro if you want to enable this `feature'. */
109 /* */
110 #define FT_CONFIG_OPTION_USE_LZW
111
112
113 /*************************************************************************/
114 /* */
115 /* Gzip-compressed file support. */
116 /* */
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). */
121 /* */
122 /* Define this macro if you want to enable this `feature'. See also */
123 /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
124 /* */
125 #define FT_CONFIG_OPTION_USE_ZLIB
126
127
128 /*************************************************************************/
129 /* */
130 /* ZLib library selection */
131 /* */
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. */
136 /* */
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. */
142 /* */
143 /* Do not #undef this macro here since the build system might define */
144 /* it for certain configurations only. */
145 /* */
146 /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
147
148
149 /*************************************************************************/
150 /* */
151 /* DLL export compilation */
152 /* */
153 /* When compiling FreeType as a DLL, some systems/compilers need a */
154 /* special keyword in front OR after the return type of function */
155 /* declarations. */
156 /* */
157 /* Two macros are used within the FreeType source code to define */
158 /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
159 /* */
160 /* FT_EXPORT( return_type ) */
161 /* */
162 /* is used in a function declaration, as in */
163 /* */
164 /* FT_EXPORT( FT_Error ) */
165 /* FT_Init_FreeType( FT_Library* alibrary ); */
166 /* */
167 /* */
168 /* FT_EXPORT_DEF( return_type ) */
169 /* */
170 /* is used in a function definition, as in */
171 /* */
172 /* FT_EXPORT_DEF( FT_Error ) */
173 /* FT_Init_FreeType( FT_Library* alibrary ) */
174 /* { */
175 /* ... some code ... */
176 /* return FT_Err_Ok; */
177 /* } */
178 /* */
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. */
183 /* */
184 /* Do not #undef these macros here since the build system might define */
185 /* them for certain configurations only. */
186 /* */
187 /* #define FT_EXPORT(x) extern x */
188 /* #define FT_EXPORT_DEF(x) x */
189
190
191 /*************************************************************************/
192 /* */
193 /* Glyph Postscript Names handling */
194 /* */
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. */
199 /* */
200 /* Undefine this macro if you do not want `PSNames' compiled in your */
201 /* build of FreeType. This has the following effects: */
202 /* */
203 /* - The TrueType driver will provide its own set of glyph names, */
204 /* if you build it to support postscript names in the TrueType */
205 /* `post' table. */
206 /* */
207 /* - The Type 1 driver will not be able to synthetize a Unicode */
208 /* charmap out of the glyphs found in the fonts. */
209 /* */
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. */
212 /* */
213 #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
214
215
216 /*************************************************************************/
217 /* */
218 /* Postscript Names to Unicode Values support */
219 /* */
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). */
225 /* */
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 */
229 /* fonts. */
230 /* */
231 #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
232
233
234 /*************************************************************************/
235 /* */
236 /* Support for Mac fonts */
237 /* */
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. */
241 /* */
242 /* Note that the `FOND' resource isn't checked. */
243 /* */
244 #define FT_CONFIG_OPTION_MAC_FONTS
245
246
247 /*************************************************************************/
248 /* */
249 /* Guessing methods to access embedded resource forks */
250 /* */
251 /* Enable extra Mac fonts support on non-Mac platforms (e.g. */
252 /* GNU/Linux). */
253 /* */
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. */
261 /* */
262 /* Note that normal, direct access of resource forks is controlled via */
263 /* the FT_CONFIG_OPTION_MAC_FONTS option. */
264 /* */
265 #ifdef FT_CONFIG_OPTION_MAC_FONTS
266 #define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
267 #endif
268
269
270 /*************************************************************************/
271 /* */
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. */
276 /* */
277 /* #define FT_CONFIG_OPTION_INCREMENTAL */
278
279
280 /*************************************************************************/
281 /* */
282 /* The size in bytes of the render pool used by the scan-line converter */
283 /* to do all of its work. */
284 /* */
285 /* This must be greater than 4KByte. */
286 /* */
287 #define FT_RENDER_POOL_SIZE 16384L
288
289
290 /*************************************************************************/
291 /* */
292 /* FT_MAX_MODULES */
293 /* */
294 /* The maximum number of modules that can be registered in a single */
295 /* FreeType library object. 32 is the default. */
296 /* */
297 #define FT_MAX_MODULES 32
298
299
300 /*************************************************************************/
301 /* */
302 /* Debug level */
303 /* */
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 */
307 /* execution. */
308 /* */
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. */
311 /* */
312 /* Don't define any of these macros to compile in `release' mode! */
313 /* */
314 /* Do not #undef these macros here since the build system might define */
315 /* them for certain configurations only. */
316 /* */
317 /* #define FT_DEBUG_LEVEL_ERROR */
318 /* #define FT_DEBUG_LEVEL_TRACE */
319
320
321 /*************************************************************************/
322 /* */
323 /* Memory Debugging */
324 /* */
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. */
329 /* */
330 /* Note that the memory debugger is only activated at runtime when */
331 /* when the _environment_ variable "FT2_DEBUG_MEMORY" is defined also! */
332 /* */
333 /* Do not #undef this macro here since the build system might define */
334 /* it for certain configurations only. */
335 /* */
336 /* #define FT_DEBUG_MEMORY */
337
338
339 /*************************************************************************/
340 /* */
341 /* Module errors */
342 /* */
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. */
346 /* */
347 /* Setting this macro makes sense for debugging purposes only, since */
348 /* it would break source compatibility of certain programs that use */
349 /* FreeType 2. */
350 /* */
351 /* More details can be found in the files ftmoderr.h and fterrors.h. */
352 /* */
353 #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
354
355
356
357 /*************************************************************************/
358 /*************************************************************************/
359 /**** ****/
360 /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
361 /**** ****/
362 /*************************************************************************/
363 /*************************************************************************/
364
365
366 /*************************************************************************/
367 /* */
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). */
371 /* */
372 #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
373
374
375 /*************************************************************************/
376 /* */
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 */
379 /* OpenType file. */
380 /* */
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. */
384 /* */
385 /* (By default, the module uses `PSNames' to extract glyph names.) */
386 /* */
387 #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
388
389
390 /*************************************************************************/
391 /* */
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. */
397 /* */
398 /* Accessing SFNT names is done through the functions declared in */
399 /* `freetype/ftnames.h'. */
400 /* */
401 #define TT_CONFIG_OPTION_SFNT_NAMES
402
403
404 /*************************************************************************/
405 /* */
406 /* TrueType CMap support */
407 /* */
408 /* Here you can fine-tune which TrueType CMap table format shall be */
409 /* supported. */
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
417
418
419 /*************************************************************************/
420 /*************************************************************************/
421 /**** ****/
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 ****/
423 /**** ****/
424 /*************************************************************************/
425 /*************************************************************************/
426
427 /*************************************************************************/
428 /* */
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. */
432 /* */
433 /* By undefining this, you will only compile the code necessary to load */
434 /* TrueType glyphs without hinting. */
435 /* */
436 /* Do not #undef this macro here, since the build system might */
437 /* define it for certain configurations only. */
438 /* */
439 /* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
440
441
442 /*************************************************************************/
443 /* */
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 actived */
450 /* */
451 #define TT_CONFIG_OPTION_UNPATENTED_HINTING
452
453
454 /*************************************************************************/
455 /* */
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 */
459 /* architectures. */
460 /* */
461 /* Note however that on some compiler/processor combinations, undefining */
462 /* this macro will generate faster, though larger, code. */
463 /* */
464 #define TT_CONFIG_OPTION_INTERPRETER_SWITCH
465
466
467 /*************************************************************************/
468 /* */
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. */
472 /* */
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. */
479 /* */
480 /* http://partners.adobe.com/asn/developer/opentype/glyf.html */
481 /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
482 /* */
483 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
484
485
486 /*************************************************************************/
487 /* */
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. */
492 /* */
493 #define TT_CONFIG_OPTION_GX_VAR_SUPPORT
494
495
496 /*************************************************************************/
497 /*************************************************************************/
498 /**** ****/
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 ****/
500 /**** ****/
501 /*************************************************************************/
502 /*************************************************************************/
503
504
505 /*************************************************************************/
506 /* */
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 */
509 /* required. */
510 /* */
511 #define T1_MAX_DICT_DEPTH 5
512
513
514 /*************************************************************************/
515 /* */
516 /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
517 /* calls during glyph loading. */
518 /* */
519 #define T1_MAX_SUBRS_CALLS 16
520
521
522 /*************************************************************************/
523 /* */
524 /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
525 /* minimum of 16 is required. */
526 /* */
527 /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
528 /* */
529 #define T1_MAX_CHARSTRINGS_OPERANDS 256
530
531
532 /*************************************************************************/
533 /* */
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. */
538 /* */
539 #undef T1_CONFIG_OPTION_NO_AFM
540
541
542 /*************************************************************************/
543 /* */
544 /* Define this configuration macro if you want to prevent the */
545 /* compilation of the Multiple Masters font support in the Type 1 */
546 /* driver. */
547 /* */
548 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
549
550 /* */
551
552 /*
553 * The FT_CONFIG_OPTION_CHESTER_XXXX macros are used to toggle some recent
554 * improvements to the auto-hinter contributed by David Chester. They will
555 * most likely disappear completely in the next release. For now, you
556 * should always keep them defined.
557 *
558 */
559 #define FT_CONFIG_OPTION_CHESTER_HINTS
560
561 #ifdef FT_CONFIG_OPTION_CHESTER_HINTS
562
563 #define FT_CONFIG_CHESTER_SMALL_F
564 #define FT_CONFIG_CHESTER_ASCENDER
565 #define FT_CONFIG_CHESTER_SERIF
566 #define FT_CONFIG_CHESTER_STEM
567 #define FT_CONFIG_CHESTER_BLUE_SCALE
568
569 #endif /* FT_CONFIG_OPTION_CHESTER_HINTS */
570
571 FT_END_HEADER
572
573
574 #endif /* __FTOPTION_H__ */
575
576
577 /* END */