update for HEAD-2003050101
[reactos.git] / lib / freetype / devel / ftoption.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftoption.h                                                             */
4 /*                                                                         */
5 /*    User-selectable configuration macros (specification only).           */
6 /*                                                                         */
7 /*  Copyright 1996-2001, 2002 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    * this is a special developer version of "ftoption.h", it is used
27    * to define all debugging options, as well as the TrueType bytecode
28    * interpreter
29    */
30
31 FT_BEGIN_HEADER
32
33   /*************************************************************************/
34   /*                                                                       */
35   /*                 USER-SELECTABLE CONFIGURATION MACROS                  */
36   /*                                                                       */
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:      */
40   /*                                                                       */
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.                            */
44   /*                                                                       */
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.                                   */
49   /*                                                                       */
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.                                        */
53   /*                                                                       */
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,                   */
57   /*                                                                       */
58   /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */
59   /*      #include <freetype/config/ftheader.h>                            */
60   /*                                                                       */
61   /*    will use "$BUILD/myftoptions.h" instead of this file for macro     */
62   /*    definitions.                                                       */
63   /*                                                                       */
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>.                */
68   /*                                                                       */
69   /*  We highly recommend using the third method whenever possible.        */
70   /*                                                                       */
71   /*************************************************************************/
72
73
74   /*************************************************************************/
75   /*************************************************************************/
76   /****                                                                 ****/
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 ****/
78   /****                                                                 ****/
79   /*************************************************************************/
80   /*************************************************************************/
81
82
83   /*************************************************************************/
84   /*                                                                       */
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.         */
88   /*                                                                       */
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.                 */
92   /*                                                                       */
93   /* For most compilers, this will only create compilation warnings        */
94   /* when building the library.                                            */
95   /*                                                                       */
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.                                 */
99   /*                                                                       */
100 #undef  FT_CONFIG_OPTION_FORCE_INT64
101
102
103   /*************************************************************************/
104   /*                                                                       */
105   /* Gzip-compressed file support.                                         */
106   /*                                                                       */
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).   */
111   /*                                                                       */
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.                                                 */
115   /*                                                                       */
116 #define FT_CONFIG_OPTION_USE_ZLIB
117
118
119   /*************************************************************************/
120   /*                                                                       */
121   /* ZLib library selection                                                */
122   /*                                                                       */
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.                */
127   /*                                                                       */
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.                               */
133   /*                                                                       */
134   /*   do not #undef this macro here, since the build system might         */
135   /*   define for certain configurations                                   */
136   /*                                                                       */
137 /* #define  FT_CONFIG_OPTION_SYSTEM_ZLIB */
138
139
140   /*************************************************************************/
141   /*                                                                       */
142   /* DLL export compilation                                                */
143   /*                                                                       */
144   /*   When compiling FreeType as a DLL, some systems/compilers need a     */
145   /*   special keyword in front OR after the return type of function       */
146   /*   declarations.                                                       */
147   /*                                                                       */
148   /*   Two macros are used within the FreeType source code to define       */
149   /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */
150   /*                                                                       */
151   /*     FT_EXPORT( return_type )                                          */
152   /*                                                                       */
153   /*       is used in a function declaration, as in                        */
154   /*                                                                       */
155   /*         FT_EXPORT( FT_Error )                                         */
156   /*         FT_Init_FreeType( FT_Library*  alibrary );                    */
157   /*                                                                       */
158   /*                                                                       */
159   /*     FT_EXPORT_DEF( return_type )                                      */
160   /*                                                                       */
161   /*       is used in a function definition, as in                         */
162   /*                                                                       */
163   /*         FT_EXPORT_DEF( FT_Error )                                     */
164   /*         FT_Init_FreeType( FT_Library*  alibrary )                     */
165   /*         {                                                             */
166   /*           ... some code ...                                           */
167   /*           return FT_Err_Ok;                                           */
168   /*         }                                                             */
169   /*                                                                       */
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.                                           */
174   /*                                                                       */
175 /* #define  FT_EXPORT(x)       extern x */
176 /* #define  FT_EXPORT_DEF(x)   x */
177
178
179   /*************************************************************************/
180   /*                                                                       */
181   /* Glyph Postscript Names handling                                       */
182   /*                                                                       */
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.                                 */
187   /*                                                                       */
188   /*   Undefine this macro if you do not want `PSNames' compiled in your   */
189   /*   build of FreeType.  This has the following effects:                 */
190   /*                                                                       */
191   /*   - The TrueType driver will provide its own set of glyph names,      */
192   /*     if you build it to support postscript names in the TrueType       */
193   /*     `post' table.                                                     */
194   /*                                                                       */
195   /*   - The Type 1 driver will not be able to synthetize a Unicode        */
196   /*     charmap out of the glyphs found in the fonts.                     */
197   /*                                                                       */
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.  */
200   /*                                                                       */
201 #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
202
203
204   /*************************************************************************/
205   /*                                                                       */
206   /* Postscript Names to Unicode Values support                            */
207   /*                                                                       */
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).             */
213   /*                                                                       */
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 */
217   /*   fonts.                                                              */
218   /*                                                                       */
219 #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
220
221
222   /*************************************************************************/
223   /*                                                                       */
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.                                          */
228   /*                                                                       */
229 /* #define  FT_CONFIG_OPTION_INCREMENTAL */
230
231
232   /*************************************************************************/
233   /*                                                                       */
234   /* The size in bytes of the render pool used by the scan-line converter  */
235   /* to do all of its work.                                                */
236   /*                                                                       */
237   /* This must be greater than 4kByte.                                     */
238   /*                                                                       */
239 #define FT_RENDER_POOL_SIZE  16384L
240
241
242   /*************************************************************************/
243   /*                                                                       */
244   /* FT_MAX_MODULES                                                        */
245   /*                                                                       */
246   /*   The maximum number of modules that can be registered in a single    */
247   /*   FreeType library object.  32 is the default.                        */
248   /*                                                                       */
249 #define FT_MAX_MODULES  32
250
251
252   /*************************************************************************/
253   /*                                                                       */
254   /* Debug level                                                           */
255   /*                                                                       */
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    */
259   /*   execution.                                                          */
260   /*                                                                       */
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.              */
263   /*                                                                       */
264   /*   Don't define any of these macros to compile in `release' mode!      */
265   /*                                                                       */
266 #define  FT_DEBUG_LEVEL_ERROR
267 #define  FT_DEBUG_LEVEL_TRACE
268
269
270   /*************************************************************************/
271   /*                                                                       */
272   /* Memory Debugging                                                      */
273   /*                                                                       */
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.                                 */
278   /*                                                                       */
279   /*   Note that the memory debugger is only activated at runtime when     */
280   /*   when the _environment_ variable "FT_DEBUG_MEMORY" is also defined!  */
281   /*                                                                       */
282 #define  FT_DEBUG_MEMORY
283
284
285
286   /*************************************************************************/
287   /*                                                                       */
288   /* Module errors                                                         */
289   /*                                                                       */
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.                        */
293   /*                                                                       */
294   /*   Setting this macro makes sense for debugging purposes only, since   */
295   /*   it would break source compatibility of certain programs that use    */
296   /*   FreeType 2.                                                         */
297   /*                                                                       */
298   /*   More details can be found in the files ftmoderr.h and fterrors.h.   */
299   /*                                                                       */
300 #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
301
302
303
304   /*************************************************************************/
305   /*************************************************************************/
306   /****                                                                 ****/
307   /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/
308   /****                                                                 ****/
309   /*************************************************************************/
310   /*************************************************************************/
311
312
313   /*************************************************************************/
314   /*                                                                       */
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).                                                 */
318   /*                                                                       */
319 #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
320
321
322   /*************************************************************************/
323   /*                                                                       */
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        */
326   /* OpenType file.                                                        */
327   /*                                                                       */
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.  */
331   /*                                                                       */
332   /* (By default, the module uses `PSNames' to extract glyph names.)       */
333   /*                                                                       */
334 #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
335
336
337   /*************************************************************************/
338   /*                                                                       */
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.                               */
344   /*                                                                       */
345   /* Accessing SFNT names is done through the functions declared in        */
346   /* `freetype/ftnames.h'.                                                 */
347   /*                                                                       */
348 #define TT_CONFIG_OPTION_SFNT_NAMES
349
350
351   /*************************************************************************/
352   /*                                                                       */
353   /* TrueType CMap support                                                 */
354   /*                                                                       */
355   /*   Here you can fine-tune which TrueType CMap table format shall be    */
356   /*   supported.                                                          */
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
364
365
366   /*************************************************************************/
367   /*************************************************************************/
368   /****                                                                 ****/
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   ****/
370   /****                                                                 ****/
371   /*************************************************************************/
372   /*************************************************************************/
373
374   /*************************************************************************/
375   /*                                                                       */
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.        */
379   /*                                                                       */
380   /* By undefining this, you will only compile the code necessary to load  */
381   /* TrueType glyphs without hinting.                                      */
382   /*                                                                       */
383   /*   do not #undef this macro here, since the build system might         */
384   /*   define for certain configurations                                   */
385   /*                                                                       */
386 #define  TT_CONFIG_OPTION_BYTECODE_INTERPRETER
387
388
389   /*************************************************************************/
390   /*                                                                       */
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       */
394   /* architectures.                                                        */
395   /*                                                                       */
396   /* Note however that on some compiler/processor combinations, undefining */
397   /* this macro will generate faster, though larger, code.                 */
398   /*                                                                       */
399 #define TT_CONFIG_OPTION_INTERPRETER_SWITCH
400
401
402   /*************************************************************************/
403   /*                                                                       */
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.                                */
407   /*                                                                       */
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.                                             */
414   /*                                                                       */
415   /*   http://partners.adobe.com/asn/developer/opentype/glyf.html          */
416   /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */
417   /*                                                                       */
418 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
419
420
421   /*************************************************************************/
422   /*************************************************************************/
423   /****                                                                 ****/
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       ****/
425   /****                                                                 ****/
426   /*************************************************************************/
427   /*************************************************************************/
428
429
430   /*************************************************************************/
431   /*                                                                       */
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        */
434   /* required.                                                             */
435   /*                                                                       */
436 #define T1_MAX_DICT_DEPTH  5
437
438
439   /*************************************************************************/
440   /*                                                                       */
441   /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */
442   /* calls during glyph loading.                                           */
443   /*                                                                       */
444 #define T1_MAX_SUBRS_CALLS  16
445
446
447   /*************************************************************************/
448   /*                                                                       */
449   /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */
450   /* minimum of 16 is required.                                            */
451   /*                                                                       */
452   /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
453   /*                                                                       */
454 #define T1_MAX_CHARSTRINGS_OPERANDS  256
455
456
457   /*************************************************************************/
458   /*                                                                       */
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.                                  */
463   /*                                                                       */
464 #undef T1_CONFIG_OPTION_NO_AFM
465
466
467   /*************************************************************************/
468   /*                                                                       */
469   /* Define this configuration macro if you want to prevent the            */
470   /* compilation of the Multiple Masters font support in the Type 1        */
471   /* driver.                                                               */
472   /*                                                                       */
473 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
474
475  /* */
476
477 /*
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
482  *
483  */
484 #define  FT_CONFIG_OPTION_CHESTER_HINTS
485
486 #ifdef   FT_CONFIG_OPTION_CHESTER_HINTS
487
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
493
494 #endif /* FT_CONFIG_OPTION_CHESTER_HINTS */
495
496 FT_END_HEADER
497
498
499 #endif /* __FTOPTION_H__ */
500
501
502 /* END */