1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftoption.h                                                             */
4 /*                                                                         */
5 /*    User-selectable configuration macros (specification only).           */
6 /*                                                                         */
7 /*  Copyright 1996-2001, 2002, 2003 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   /* Gzip-compressed file support.                                         */
101   /*                                                                       */
102   /*   FreeType now handles font files that have been compressed with the  */
103   /*   'gzip' program.  This is mostly used to parse many of the PCF files */
104   /*   that come with XFree86.  The implementation uses `zlib' to          */
105   /*   partially uncompress the file on the fly (see src/base/ftgzip.c).   */
106   /*                                                                       */
107   /*   Define this macro if you want to enable this "feature".  Note that  */
108   /*   this will however force you to link the zlib to any program that    */
109   /*   also uses FreeType.                                                 */
110   /*                                                                       */
111 #define FT_CONFIG_OPTION_USE_ZLIB
112 
113 
114   /*************************************************************************/
115   /*                                                                       */
116   /* ZLib library selection                                                */
117   /*                                                                       */
118   /*   This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined.  */
119   /*   It allows FreeType's "ftgzip" component to link to the system's     */
120   /*   installation of the ZLib library.  This is useful on systems like   */
121   /*   Unix or VMS where it generally is already available.                */
122   /*                                                                       */
123   /*   If you let it undefined, the component will use its own copy        */
124   /*   of the zlib sources instead.  These have been modified to be        */
125   /*   included directly within the component and *not* export external    */
126   /*   function names.  This allows you to link any program with FreeType  */
127   /*   _and_ ZLib without linking conflicts.                               */
128   /*                                                                       */
129   /*   Do not #undef this macro here since the build system might define   */
130   /*   it for certain configurations only.                                 */
131   /*                                                                       */
132 /* #define  FT_CONFIG_OPTION_SYSTEM_ZLIB */
133 
134 
135   /*************************************************************************/
136   /*                                                                       */
137   /* DLL export compilation                                                */
138   /*                                                                       */
139   /*   When compiling FreeType as a DLL, some systems/compilers need a     */
140   /*   special keyword in front OR after the return type of function       */
141   /*   declarations.                                                       */
142   /*                                                                       */
143   /*   Two macros are used within the FreeType source code to define       */
144   /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */
145   /*                                                                       */
146   /*     FT_EXPORT( return_type )                                          */
147   /*                                                                       */
148   /*       is used in a function declaration, as in                        */
149   /*                                                                       */
150   /*         FT_EXPORT( FT_Error )                                         */
151   /*         FT_Init_FreeType( FT_Library*  alibrary );                    */
152   /*                                                                       */
153   /*                                                                       */
154   /*     FT_EXPORT_DEF( return_type )                                      */
155   /*                                                                       */
156   /*       is used in a function definition, as in                         */
157   /*                                                                       */
158   /*         FT_EXPORT_DEF( FT_Error )                                     */
159   /*         FT_Init_FreeType( FT_Library*  alibrary )                     */
160   /*         {                                                             */
161   /*           ... some code ...                                           */
162   /*           return FT_Err_Ok;                                           */
163   /*         }                                                             */
164   /*                                                                       */
165   /*   You can provide your own implementation of FT_EXPORT and            */
166   /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */
167   /*   will be later automatically defined as `extern return_type' to      */
168   /*   allow normal compilation.                                           */
169   /*                                                                       */
170   /*   Do not #undef these macros here since the build system might define */
171   /*   them for certain configurations only.                               */
172   /*                                                                       */
173 /* #define  FT_EXPORT(x)       extern x */
174 /* #define  FT_EXPORT_DEF(x)   x */
175 
176 
177   /*************************************************************************/
178   /*                                                                       */
179   /* Glyph Postscript Names handling                                       */
180   /*                                                                       */
181   /*   By default, FreeType 2 is compiled with the `PSNames' module.  This */
182   /*   module is in charge of converting a glyph name string into a        */
183   /*   Unicode value, or return a Macintosh standard glyph name for the    */
184   /*   use with the TrueType `post' table.                                 */
185   /*                                                                       */
186   /*   Undefine this macro if you do not want `PSNames' compiled in your   */
187   /*   build of FreeType.  This has the following effects:                 */
188   /*                                                                       */
189   /*   - The TrueType driver will provide its own set of glyph names,      */
190   /*     if you build it to support postscript names in the TrueType       */
191   /*     `post' table.                                                     */
192   /*                                                                       */
193   /*   - The Type 1 driver will not be able to synthetize a Unicode        */
194   /*     charmap out of the glyphs found in the fonts.                     */
195   /*                                                                       */
196   /*   You would normally undefine this configuration macro when building  */
197   /*   a version of FreeType that doesn't contain a Type 1 or CFF driver.  */
198   /*                                                                       */
199 #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
200 
201 
202   /*************************************************************************/
203   /*                                                                       */
204   /* Postscript Names to Unicode Values support                            */
205   /*                                                                       */
206   /*   By default, FreeType 2 is built with the `PSNames' module compiled  */
207   /*   in.  Among other things, the module is used to convert a glyph name */
208   /*   into a Unicode value.  This is especially useful in order to        */
209   /*   synthetize on the fly a Unicode charmap from the CFF/Type 1 driver  */
210   /*   through a big table named the `Adobe Glyph List' (AGL).             */
211   /*                                                                       */
212   /*   Undefine this macro if you do not want the Adobe Glyph List         */
213   /*   compiled in your `PSNames' module.  The Type 1 driver will not be   */
214   /*   able to synthetize a Unicode charmap out of the glyphs found in the */
215   /*   fonts.                                                              */
216   /*                                                                       */
217 #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
218 
219 
220   /*************************************************************************/
221   /*                                                                       */
222   /* Support for Mac fonts                                                 */
223   /*                                                                       */
224   /*   Define this macro if you want support for outline fonts in Mac      */
225   /*   format (mac dfont, mac resource, macbinary containing a mac         */
226   /*   resource) on non-Mac platforms.                                     */
227   /*                                                                       */
228   /*   Note that the `FOND' resource isn't checked.                        */
229   /*                                                                       */
230 #define FT_CONFIG_OPTION_MAC_FONTS
231 
232 
233   /*************************************************************************/
234   /*                                                                       */
235   /* Allow the use of FT_Incremental_Interface to load typefaces that      */
236   /* contain no glyph data, but supply it via a callback function.         */
237   /* This allows FreeType to be used with the PostScript language, using   */
238   /* the GhostScript interpreter.                                          */
239   /*                                                                       */
240 /* #define FT_CONFIG_OPTION_INCREMENTAL */
241 
242 
243   /*************************************************************************/
244   /*                                                                       */
245   /* The size in bytes of the render pool used by the scan-line converter  */
246   /* to do all of its work.                                                */
247   /*                                                                       */
248   /* This must be greater than 4KByte.                                     */
249   /*                                                                       */
250 #define FT_RENDER_POOL_SIZE  16384L
251 
252 
253   /*************************************************************************/
254   /*                                                                       */
255   /* FT_MAX_MODULES                                                        */
256   /*                                                                       */
257   /*   The maximum number of modules that can be registered in a single    */
258   /*   FreeType library object.  32 is the default.                        */
259   /*                                                                       */
260 #define FT_MAX_MODULES  32
261 
262 
263   /*************************************************************************/
264   /*                                                                       */
265   /* Debug level                                                           */
266   /*                                                                       */
267   /*   FreeType can be compiled in debug or trace mode.  In debug mode,    */
268   /*   errors are reported through the `ftdebug' component.  In trace      */
269   /*   mode, additional messages are sent to the standard output during    */
270   /*   execution.                                                          */
271   /*                                                                       */
272   /*   Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode.     */
273   /*   Define FT_DEBUG_LEVEL_TRACE to build it in trace mode.              */
274   /*                                                                       */
275   /*   Don't define any of these macros to compile in `release' mode!      */
276   /*                                                                       */
277   /*   Do not #undef these macros here since the build system might define */
278   /*   them for certain configurations only.                               */
279   /*                                                                       */
280 /* #define FT_DEBUG_LEVEL_ERROR */
281 /* #define FT_DEBUG_LEVEL_TRACE */
282 
283 
284   /*************************************************************************/
285   /*                                                                       */
286   /* Memory Debugging                                                      */
287   /*                                                                       */
288   /*   FreeType now comes with an integrated memory debugger that is       */
289   /*   capable of detecting simple errors like memory leaks or double      */
290   /*   deletes.  To compile it within your build of the library, you       */
291   /*   should define FT_DEBUG_MEMORY here.                                 */
292   /*                                                                       */
293   /*   Note that the memory debugger is only activated at runtime when     */
294   /*   when the _environment_ variable "FT2_DEBUG_MEMORY" is defined also! */
295   /*                                                                       */
296   /*   Do not #undef this macro here since the build system might define   */
297   /*   it for certain configurations only.                                 */
298   /*                                                                       */
299 /* #define FT_DEBUG_MEMORY */
300 
301 
302   /*************************************************************************/
303   /*                                                                       */
304   /* Module errors                                                         */
305   /*                                                                       */
306   /*   If this macro is set (which is _not_ the default), the higher byte  */
307   /*   of an error code gives the module in which the error has occurred,  */
308   /*   while the lower byte is the real error code.                        */
309   /*                                                                       */
310   /*   Setting this macro makes sense for debugging purposes only, since   */
311   /*   it would break source compatibility of certain programs that use    */
312   /*   FreeType 2.                                                         */
313   /*                                                                       */
314   /*   More details can be found in the files ftmoderr.h and fterrors.h.   */
315   /*                                                                       */
316 #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
317 
318 
319 
320   /*************************************************************************/
321   /*************************************************************************/
322   /****                                                                 ****/
323   /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/
324   /****                                                                 ****/
325   /*************************************************************************/
326   /*************************************************************************/
327 
328 
329   /*************************************************************************/
330   /*                                                                       */
331   /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */
332   /* embedded bitmaps in all formats using the SFNT module (namely         */
333   /* TrueType & OpenType).                                                 */
334   /*                                                                       */
335 #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
336 
337 
338   /*************************************************************************/
339   /*                                                                       */
340   /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to    */
341   /* load and enumerate the glyph Postscript names in a TrueType or        */
342   /* OpenType file.                                                        */
343   /*                                                                       */
344   /* Note that when you do not compile the `PSNames' module by undefining  */
345   /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will   */
346   /* contain additional code used to read the PS Names table from a font.  */
347   /*                                                                       */
348   /* (By default, the module uses `PSNames' to extract glyph names.)       */
349   /*                                                                       */
350 #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
351 
352 
353   /*************************************************************************/
354   /*                                                                       */
355   /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to       */
356   /* access the internal name table in a SFNT-based format like TrueType   */
357   /* or OpenType.  The name table contains various strings used to         */
358   /* describe the font, like family name, copyright, version, etc.  It     */
359   /* does not contain any glyph name though.                               */
360   /*                                                                       */
361   /* Accessing SFNT names is done through the functions declared in        */
362   /* `freetype/ftnames.h'.                                                 */
363   /*                                                                       */
364 #define TT_CONFIG_OPTION_SFNT_NAMES
365 
366 
367   /*************************************************************************/
368   /*                                                                       */
369   /* TrueType CMap support                                                 */
370   /*                                                                       */
371   /*   Here you can fine-tune which TrueType CMap table format shall be    */
372   /*   supported.                                                          */
373 #define TT_CONFIG_CMAP_FORMAT_0
374 #define TT_CONFIG_CMAP_FORMAT_2
375 #define TT_CONFIG_CMAP_FORMAT_4
376 #define TT_CONFIG_CMAP_FORMAT_6
377 #define TT_CONFIG_CMAP_FORMAT_8
378 #define TT_CONFIG_CMAP_FORMAT_10
379 #define TT_CONFIG_CMAP_FORMAT_12
380 
381 
382   /*************************************************************************/
383   /*************************************************************************/
384   /****                                                                 ****/
385   /****    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   ****/
386   /****                                                                 ****/
387   /*************************************************************************/
388   /*************************************************************************/
389 
390   /*************************************************************************/
391   /*                                                                       */
392   /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile   */
393   /* a bytecode interpreter in the TrueType driver.  Note that there are   */
394   /* important patent issues related to the use of the interpreter.        */
395   /*                                                                       */
396   /* By undefining this, you will only compile the code necessary to load  */
397   /* TrueType glyphs without hinting.                                      */
398   /*                                                                       */
399   /*   Do not #undef this macro here, since the build system might         */
400   /*   define it for certain configurations only.                          */
401   /*                                                                       */
402 /* #define  TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
403 
404 
405   /*************************************************************************/
406   /*                                                                       */
407   /* Define TT_CONFIG_OPTION_UNPATENTED_HINTING (in addition to            */
408   /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER) to compile the unpatented      */
409   /* work-around hinting system.  Note that for the moment, the algorithm  */
410   /* is only used when selected at runtime through the parameter tag       */
411   /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook               */
412   /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally actived                  */
413   /*                                                                       */
414 #define TT_CONFIG_OPTION_UNPATENTED_HINTING
415 
416 
417   /*************************************************************************/
418   /*                                                                       */
419   /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType    */
420   /* bytecode interpreter with a huge switch statement, rather than a call */
421   /* table.  This results in smaller and faster code for a number of       */
422   /* architectures.                                                        */
423   /*                                                                       */
424   /* Note however that on some compiler/processor combinations, undefining */
425   /* this macro will generate faster, though larger, code.                 */
426   /*                                                                       */
427 #define TT_CONFIG_OPTION_INTERPRETER_SWITCH
428 
429 
430   /*************************************************************************/
431   /*                                                                       */
432   /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the        */
433   /* TrueType glyph loader to use Apple's definition of how to handle      */
434   /* component offsets in composite glyphs.                                */
435   /*                                                                       */
436   /* Apple and MS disagree on the default behavior of component offsets    */
437   /* in composites.  Apple says that they should be scaled by the scale    */
438   /* factors in the transformation matrix (roughly, it's more complex)     */
439   /* while MS says they should not.  OpenType defines two bits in the      */
440   /* composite flags array which can be used to disambiguate, but old      */
441   /* fonts will not have them.                                             */
442   /*                                                                       */
443   /*   http://partners.adobe.com/asn/developer/opentype/glyf.html          */
444   /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */
445   /*                                                                       */
446 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
447 
448 
449   /*************************************************************************/
450   /*************************************************************************/
451   /****                                                                 ****/
452   /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/
453   /****                                                                 ****/
454   /*************************************************************************/
455   /*************************************************************************/
456 
457 
458   /*************************************************************************/
459   /*                                                                       */
460   /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and       */
461   /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */
462   /* required.                                                             */
463   /*                                                                       */
464 #define T1_MAX_DICT_DEPTH  5
465 
466 
467   /*************************************************************************/
468   /*                                                                       */
469   /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */
470   /* calls during glyph loading.                                           */
471   /*                                                                       */
472 #define T1_MAX_SUBRS_CALLS  16
473 
474 
475   /*************************************************************************/
476   /*                                                                       */
477   /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */
478   /* minimum of 16 is required.                                            */
479   /*                                                                       */
480   /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
481   /*                                                                       */
482 #define T1_MAX_CHARSTRINGS_OPERANDS  256
483 
484 
485   /*************************************************************************/
486   /*                                                                       */
487   /* Define this configuration macro if you want to prevent the            */
488   /* compilation of `t1afm', which is in charge of reading Type 1 AFM      */
489   /* files into an existing face.  Note that if set, the T1 driver will be */
490   /* unable to produce kerning distances.                                  */
491   /*                                                                       */
492 #undef T1_CONFIG_OPTION_NO_AFM
493 
494 
495   /*************************************************************************/
496   /*                                                                       */
497   /* Define this configuration macro if you want to prevent the            */
498   /* compilation of the Multiple Masters font support in the Type 1        */
499   /* driver.                                                               */
500   /*                                                                       */
501 #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
502 
503  /* */
504 
505 /*
506  * The FT_CONFIG_OPTION_CHESTER_XXXX macros are used to toggle some recent
507  * improvements to the auto-hinter contributed by David Chester.  They will
508  * most likely disappear completely in the next release.  For now, you
509  * should always keep them defined.
510  *
511  */
512 #define  FT_CONFIG_OPTION_CHESTER_HINTS
513 
514 #ifdef   FT_CONFIG_OPTION_CHESTER_HINTS
515 
516 #define  FT_CONFIG_CHESTER_SMALL_F
517 #define  FT_CONFIG_CHESTER_ASCENDER
518 #define  FT_CONFIG_CHESTER_SERIF
519 #define  FT_CONFIG_CHESTER_STEM
520 #define  FT_CONFIG_CHESTER_BLUE_SCALE
521 
522 #endif /* FT_CONFIG_OPTION_CHESTER_HINTS */
523 
524 FT_END_HEADER
525 
526 
527 #endif /* __FTOPTION_H__ */
528 
529 
530 /* END */
531