michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* ftoption.h (for development) */ michael@0: /* */ michael@0: /* User-selectable configuration macros (specification only). */ michael@0: /* */ michael@0: /* Copyright 1996-2013 by */ michael@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ michael@0: /* */ michael@0: /* This file is part of the FreeType project, and may only be used, */ michael@0: /* modified, and distributed under the terms of the FreeType project */ michael@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ michael@0: /* this file you indicate that you have read the license and */ michael@0: /* understand and accept it fully. */ michael@0: /* */ michael@0: /***************************************************************************/ michael@0: michael@0: michael@0: #ifndef __FTOPTION_H__ michael@0: #define __FTOPTION_H__ michael@0: michael@0: michael@0: #include michael@0: michael@0: michael@0: FT_BEGIN_HEADER michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* USER-SELECTABLE CONFIGURATION MACROS */ michael@0: /* */ michael@0: /* This file contains the default configuration macro definitions for */ michael@0: /* a standard build of the FreeType library. There are three ways to */ michael@0: /* use this file to build project-specific versions of the library: */ michael@0: /* */ michael@0: /* - You can modify this file by hand, but this is not recommended in */ michael@0: /* cases where you would like to build several versions of the */ michael@0: /* library from a single source directory. */ michael@0: /* */ michael@0: /* - You can put a copy of this file in your build directory, more */ michael@0: /* precisely in `$BUILD/config/ftoption.h', where `$BUILD' is the */ michael@0: /* name of a directory that is included _before_ the FreeType include */ michael@0: /* path during compilation. */ michael@0: /* */ michael@0: /* The default FreeType Makefiles and Jamfiles use the build */ michael@0: /* directory `builds/' by default, but you can easily change */ michael@0: /* that for your own projects. */ michael@0: /* */ michael@0: /* - Copy the file to `$BUILD/ft2build.h' and modify it */ michael@0: /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */ michael@0: /* locate this file during the build. For example, */ michael@0: /* */ michael@0: /* #define FT_CONFIG_OPTIONS_H */ michael@0: /* #include */ michael@0: /* */ michael@0: /* will use `$BUILD/myftoptions.h' instead of this file for macro */ michael@0: /* definitions. */ michael@0: /* */ michael@0: /* Note also that you can similarly pre-define the macro */ michael@0: /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */ michael@0: /* that are statically linked to the library at compile time. By */ michael@0: /* default, this file is . */ michael@0: /* */ michael@0: /* We highly recommend using the third method whenever possible. */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /**** ****/ michael@0: /**** 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 ****/ michael@0: /**** ****/ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Uncomment the line below if you want to activate sub-pixel rendering */ michael@0: /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */ michael@0: /* */ michael@0: /* Note that this feature is covered by several Microsoft patents */ michael@0: /* and should not be activated in any default build of the library. */ michael@0: /* */ michael@0: /* This macro has no impact on the FreeType API, only on its */ michael@0: /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */ michael@0: /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */ michael@0: /* the original size in case this macro isn't defined; however, each */ michael@0: /* triplet of subpixels has R=G=B. */ michael@0: /* */ michael@0: /* This is done to allow FreeType clients to run unmodified, forcing */ michael@0: /* them to display normal gray-level anti-aliased glyphs. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Many compilers provide a non-ANSI 64-bit data type that can be used */ michael@0: /* by FreeType to speed up some computations. However, this will create */ michael@0: /* some problems when compiling the library in strict ANSI mode. */ michael@0: /* */ michael@0: /* For this reason, the use of 64-bit integers is normally disabled when */ michael@0: /* the __STDC__ macro is defined. You can however disable this by */ michael@0: /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */ michael@0: /* */ michael@0: /* For most compilers, this will only create compilation warnings when */ michael@0: /* building the library. */ michael@0: /* */ michael@0: /* ObNote: The compiler-specific 64-bit integers are detected in the */ michael@0: /* file `ftconfig.h' either statically or through the */ michael@0: /* `configure' script on supported platforms. */ michael@0: /* */ michael@0: #undef FT_CONFIG_OPTION_FORCE_INT64 michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* If this macro is defined, do not try to use an assembler version of */ michael@0: /* performance-critical functions (e.g. FT_MulFix). You should only do */ michael@0: /* that to verify that the assembler function works properly, or to */ michael@0: /* execute benchmark tests of the various implementations. */ michael@0: /* #define FT_CONFIG_OPTION_NO_ASSEMBLER */ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* If this macro is defined, try to use an inlined assembler version of */ michael@0: /* the `FT_MulFix' function, which is a `hotspot' when loading and */ michael@0: /* hinting glyphs, and which should be executed as fast as possible. */ michael@0: /* */ michael@0: /* Note that if your compiler or CPU is not supported, this will default */ michael@0: /* to the standard and portable implementation found in `ftcalc.c'. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_INLINE_MULFIX michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* LZW-compressed file support. */ michael@0: /* */ michael@0: /* FreeType now handles font files that have been compressed with the */ michael@0: /* `compress' program. This is mostly used to parse many of the PCF */ michael@0: /* files that come with various X11 distributions. The implementation */ michael@0: /* uses NetBSD's `zopen' to partially uncompress the file on the fly */ michael@0: /* (see src/lzw/ftgzip.c). */ michael@0: /* */ michael@0: /* Define this macro if you want to enable this `feature'. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_USE_LZW michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Gzip-compressed file support. */ michael@0: /* */ michael@0: /* FreeType now handles font files that have been compressed with the */ michael@0: /* `gzip' program. This is mostly used to parse many of the PCF files */ michael@0: /* that come with XFree86. The implementation uses `zlib' to */ michael@0: /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */ michael@0: /* */ michael@0: /* Define this macro if you want to enable this `feature'. See also */ michael@0: /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_USE_ZLIB michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* ZLib library selection */ michael@0: /* */ michael@0: /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */ michael@0: /* It allows FreeType's `ftgzip' component to link to the system's */ michael@0: /* installation of the ZLib library. This is useful on systems like */ michael@0: /* Unix or VMS where it generally is already available. */ michael@0: /* */ michael@0: /* If you let it undefined, the component will use its own copy */ michael@0: /* of the zlib sources instead. These have been modified to be */ michael@0: /* included directly within the component and *not* export external */ michael@0: /* function names. This allows you to link any program with FreeType */ michael@0: /* _and_ ZLib without linking conflicts. */ michael@0: /* */ michael@0: /* Do not #undef this macro here since the build system might define */ michael@0: /* it for certain configurations only. */ michael@0: /* */ michael@0: /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Bzip2-compressed file support. */ michael@0: /* */ michael@0: /* FreeType now handles font files that have been compressed with the */ michael@0: /* `bzip2' program. This is mostly used to parse many of the PCF */ michael@0: /* files that come with XFree86. The implementation uses `libbz2' to */ michael@0: /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */ michael@0: /* Contrary to gzip, bzip2 currently is not included and need to use */ michael@0: /* the system available bzip2 implementation. */ michael@0: /* */ michael@0: /* Define this macro if you want to enable this `feature'. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_USE_BZIP2 michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* PNG bitmap support. */ michael@0: /* */ michael@0: /* FreeType now handles loading color bitmap glyphs in the PNG format. */ michael@0: /* This requires help from the external libpng library. Uncompressed */ michael@0: /* color bitmaps do not need any external libraries and will be */ michael@0: /* supported regardless of this configuration. */ michael@0: /* */ michael@0: /* Define this macro if you want to enable this `feature'. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_USE_PNG michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* HarfBuzz support. */ michael@0: /* */ michael@0: /* FreeType uses the HarfBuzz library to improve auto-hinting of */ michael@0: /* OpenType fonts. If available, many glyphs not directly addressable */ michael@0: /* by a font's character map will be hinted also. */ michael@0: /* */ michael@0: /* Define this macro if you want to enable this `feature'. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_USE_HARFBUZZ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define to disable the use of file stream functions and types, FILE, */ michael@0: /* fopen() etc. Enables the use of smaller system libraries on embedded */ michael@0: /* systems that have multiple system libraries, some with or without */ michael@0: /* file stream support, in the cases where file stream support is not */ michael@0: /* necessary such as memory loading of font files. */ michael@0: /* */ michael@0: /* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* DLL export compilation */ michael@0: /* */ michael@0: /* When compiling FreeType as a DLL, some systems/compilers need a */ michael@0: /* special keyword in front OR after the return type of function */ michael@0: /* declarations. */ michael@0: /* */ michael@0: /* Two macros are used within the FreeType source code to define */ michael@0: /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ michael@0: /* */ michael@0: /* FT_EXPORT( return_type ) */ michael@0: /* */ michael@0: /* is used in a function declaration, as in */ michael@0: /* */ michael@0: /* FT_EXPORT( FT_Error ) */ michael@0: /* FT_Init_FreeType( FT_Library* alibrary ); */ michael@0: /* */ michael@0: /* */ michael@0: /* FT_EXPORT_DEF( return_type ) */ michael@0: /* */ michael@0: /* is used in a function definition, as in */ michael@0: /* */ michael@0: /* FT_EXPORT_DEF( FT_Error ) */ michael@0: /* FT_Init_FreeType( FT_Library* alibrary ) */ michael@0: /* { */ michael@0: /* ... some code ... */ michael@0: /* return FT_Err_Ok; */ michael@0: /* } */ michael@0: /* */ michael@0: /* You can provide your own implementation of FT_EXPORT and */ michael@0: /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */ michael@0: /* will be later automatically defined as `extern return_type' to */ michael@0: /* allow normal compilation. */ michael@0: /* */ michael@0: /* Do not #undef these macros here since the build system might define */ michael@0: /* them for certain configurations only. */ michael@0: /* */ michael@0: /* #define FT_EXPORT(x) extern x */ michael@0: /* #define FT_EXPORT_DEF(x) x */ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Glyph Postscript Names handling */ michael@0: /* */ michael@0: /* By default, FreeType 2 is compiled with the `psnames' module. This */ michael@0: /* module is in charge of converting a glyph name string into a */ michael@0: /* Unicode value, or return a Macintosh standard glyph name for the */ michael@0: /* use with the TrueType `post' table. */ michael@0: /* */ michael@0: /* Undefine this macro if you do not want `psnames' compiled in your */ michael@0: /* build of FreeType. This has the following effects: */ michael@0: /* */ michael@0: /* - The TrueType driver will provide its own set of glyph names, */ michael@0: /* if you build it to support postscript names in the TrueType */ michael@0: /* `post' table. */ michael@0: /* */ michael@0: /* - The Type 1 driver will not be able to synthesize a Unicode */ michael@0: /* charmap out of the glyphs found in the fonts. */ michael@0: /* */ michael@0: /* You would normally undefine this configuration macro when building */ michael@0: /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Postscript Names to Unicode Values support */ michael@0: /* */ michael@0: /* By default, FreeType 2 is built with the `PSNames' module compiled */ michael@0: /* in. Among other things, the module is used to convert a glyph name */ michael@0: /* into a Unicode value. This is especially useful in order to */ michael@0: /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */ michael@0: /* through a big table named the `Adobe Glyph List' (AGL). */ michael@0: /* */ michael@0: /* Undefine this macro if you do not want the Adobe Glyph List */ michael@0: /* compiled in your `PSNames' module. The Type 1 driver will not be */ michael@0: /* able to synthesize a Unicode charmap out of the glyphs found in the */ michael@0: /* fonts. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Support for Mac fonts */ michael@0: /* */ michael@0: /* Define this macro if you want support for outline fonts in Mac */ michael@0: /* format (mac dfont, mac resource, macbinary containing a mac */ michael@0: /* resource) on non-Mac platforms. */ michael@0: /* */ michael@0: /* Note that the `FOND' resource isn't checked. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_MAC_FONTS michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Guessing methods to access embedded resource forks */ michael@0: /* */ michael@0: /* Enable extra Mac fonts support on non-Mac platforms (e.g. */ michael@0: /* GNU/Linux). */ michael@0: /* */ michael@0: /* Resource forks which include fonts data are stored sometimes in */ michael@0: /* locations which users or developers don't expected. In some cases, */ michael@0: /* resource forks start with some offset from the head of a file. In */ michael@0: /* other cases, the actual resource fork is stored in file different */ michael@0: /* from what the user specifies. If this option is activated, */ michael@0: /* FreeType tries to guess whether such offsets or different file */ michael@0: /* names must be used. */ michael@0: /* */ michael@0: /* Note that normal, direct access of resource forks is controlled via */ michael@0: /* the FT_CONFIG_OPTION_MAC_FONTS option. */ michael@0: /* */ michael@0: #ifdef FT_CONFIG_OPTION_MAC_FONTS michael@0: #define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK michael@0: #endif michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Allow the use of FT_Incremental_Interface to load typefaces that */ michael@0: /* contain no glyph data, but supply it via a callback function. */ michael@0: /* This is required by clients supporting document formats which */ michael@0: /* supply font data incrementally as the document is parsed, such */ michael@0: /* as the Ghostscript interpreter for the PostScript language. */ michael@0: /* */ michael@0: #define FT_CONFIG_OPTION_INCREMENTAL michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* The size in bytes of the render pool used by the scan-line converter */ michael@0: /* to do all of its work. */ michael@0: /* */ michael@0: /* This must be greater than 4KByte if you use FreeType to rasterize */ michael@0: /* glyphs; otherwise, you may set it to zero to avoid unnecessary */ michael@0: /* allocation of the render pool. */ michael@0: /* */ michael@0: #define FT_RENDER_POOL_SIZE 16384L michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* FT_MAX_MODULES */ michael@0: /* */ michael@0: /* The maximum number of modules that can be registered in a single */ michael@0: /* FreeType library object. 32 is the default. */ michael@0: /* */ michael@0: #define FT_MAX_MODULES 32 michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Debug level */ michael@0: /* */ michael@0: /* FreeType can be compiled in debug or trace mode. In debug mode, */ michael@0: /* errors are reported through the `ftdebug' component. In trace */ michael@0: /* mode, additional messages are sent to the standard output during */ michael@0: /* execution. */ michael@0: /* */ michael@0: /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */ michael@0: /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */ michael@0: /* */ michael@0: /* Don't define any of these macros to compile in `release' mode! */ michael@0: /* */ michael@0: /* Do not #undef these macros here since the build system might define */ michael@0: /* them for certain configurations only. */ michael@0: /* */ michael@0: #define FT_DEBUG_LEVEL_ERROR michael@0: #define FT_DEBUG_LEVEL_TRACE michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Autofitter debugging */ michael@0: /* */ michael@0: /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */ michael@0: /* control the autofitter behaviour for debugging purposes with global */ michael@0: /* boolean variables (consequently, you should *never* enable this */ michael@0: /* while compiling in `release' mode): */ michael@0: /* */ michael@0: /* _af_debug_disable_horz_hints */ michael@0: /* _af_debug_disable_vert_hints */ michael@0: /* _af_debug_disable_blue_hints */ michael@0: /* */ michael@0: /* Additionally, the following functions provide dumps of various */ michael@0: /* internal autofit structures to stdout (using `printf'): */ michael@0: /* */ michael@0: /* af_glyph_hints_dump_points */ michael@0: /* af_glyph_hints_dump_segments */ michael@0: /* af_glyph_hints_dump_edges */ michael@0: /* */ michael@0: /* As an argument, they use another global variable: */ michael@0: /* */ michael@0: /* _af_debug_hints */ michael@0: /* */ michael@0: /* Please have a look at the `ftgrid' demo program to see how those */ michael@0: /* variables and macros should be used. */ michael@0: /* */ michael@0: /* Do not #undef these macros here since the build system might define */ michael@0: /* them for certain configurations only. */ michael@0: /* */ michael@0: #define FT_DEBUG_AUTOFIT michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Memory Debugging */ michael@0: /* */ michael@0: /* FreeType now comes with an integrated memory debugger that is */ michael@0: /* capable of detecting simple errors like memory leaks or double */ michael@0: /* deletes. To compile it within your build of the library, you */ michael@0: /* should define FT_DEBUG_MEMORY here. */ michael@0: /* */ michael@0: /* Note that the memory debugger is only activated at runtime when */ michael@0: /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */ michael@0: /* */ michael@0: /* Do not #undef this macro here since the build system might define */ michael@0: /* it for certain configurations only. */ michael@0: /* */ michael@0: #define FT_DEBUG_MEMORY michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Module errors */ michael@0: /* */ michael@0: /* If this macro is set (which is _not_ the default), the higher byte */ michael@0: /* of an error code gives the module in which the error has occurred, */ michael@0: /* while the lower byte is the real error code. */ michael@0: /* */ michael@0: /* Setting this macro makes sense for debugging purposes only, since */ michael@0: /* it would break source compatibility of certain programs that use */ michael@0: /* FreeType 2. */ michael@0: /* */ michael@0: /* More details can be found in the files ftmoderr.h and fterrors.h. */ michael@0: /* */ michael@0: #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Position Independent Code */ michael@0: /* */ michael@0: /* If this macro is set (which is _not_ the default), FreeType2 will */ michael@0: /* avoid creating constants that require address fixups. Instead the */ michael@0: /* constants will be moved into a struct and additional intialization */ michael@0: /* code will be used. */ michael@0: /* */ michael@0: /* Setting this macro is needed for systems that prohibit address */ michael@0: /* fixups, such as BREW. */ michael@0: /* */ michael@0: /* #define FT_CONFIG_OPTION_PIC */ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /**** ****/ michael@0: /**** S F N T D R I V E R C O N F I G U R A T I O N ****/ michael@0: /**** ****/ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */ michael@0: /* embedded bitmaps in all formats using the SFNT module (namely */ michael@0: /* TrueType & OpenType). */ michael@0: /* */ michael@0: #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */ michael@0: /* load and enumerate the glyph Postscript names in a TrueType or */ michael@0: /* OpenType file. */ michael@0: /* */ michael@0: /* Note that when you do not compile the `PSNames' module by undefining */ michael@0: /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */ michael@0: /* contain additional code used to read the PS Names table from a font. */ michael@0: /* */ michael@0: /* (By default, the module uses `PSNames' to extract glyph names.) */ michael@0: /* */ michael@0: #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */ michael@0: /* access the internal name table in a SFNT-based format like TrueType */ michael@0: /* or OpenType. The name table contains various strings used to */ michael@0: /* describe the font, like family name, copyright, version, etc. It */ michael@0: /* does not contain any glyph name though. */ michael@0: /* */ michael@0: /* Accessing SFNT names is done through the functions declared in */ michael@0: /* `ftsnames.h'. */ michael@0: /* */ michael@0: #define TT_CONFIG_OPTION_SFNT_NAMES michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* TrueType CMap support */ michael@0: /* */ michael@0: /* Here you can fine-tune which TrueType CMap table format shall be */ michael@0: /* supported. */ michael@0: #define TT_CONFIG_CMAP_FORMAT_0 michael@0: #define TT_CONFIG_CMAP_FORMAT_2 michael@0: #define TT_CONFIG_CMAP_FORMAT_4 michael@0: #define TT_CONFIG_CMAP_FORMAT_6 michael@0: #define TT_CONFIG_CMAP_FORMAT_8 michael@0: #define TT_CONFIG_CMAP_FORMAT_10 michael@0: #define TT_CONFIG_CMAP_FORMAT_12 michael@0: #define TT_CONFIG_CMAP_FORMAT_13 michael@0: #define TT_CONFIG_CMAP_FORMAT_14 michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /**** ****/ michael@0: /**** 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 ****/ michael@0: /**** ****/ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ michael@0: /* a bytecode interpreter in the TrueType driver. */ michael@0: /* */ michael@0: /* By undefining this, you will only compile the code necessary to load */ michael@0: /* TrueType glyphs without hinting. */ michael@0: /* */ michael@0: /* Do not #undef this macro here, since the build system might */ michael@0: /* define it for certain configurations only. */ michael@0: /* */ michael@0: #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */ michael@0: /* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */ michael@0: /* replaces the native TrueType hinting mechanism when anything but */ michael@0: /* FT_RENDER_MODE_MONO is requested. */ michael@0: /* */ michael@0: /* Enabling this causes the TrueType driver to ignore instructions under */ michael@0: /* certain conditions. This is done in accordance with the guide here, */ michael@0: /* with some minor differences: */ michael@0: /* */ michael@0: /* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */ michael@0: /* */ michael@0: /* By undefining this, you only compile the code necessary to hint */ michael@0: /* TrueType glyphs with native TT hinting. */ michael@0: /* */ michael@0: /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */ michael@0: /* defined. */ michael@0: /* */ michael@0: #define TT_CONFIG_OPTION_SUBPIXEL_HINTING michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ michael@0: /* of the TrueType bytecode interpreter is used that doesn't implement */ michael@0: /* any of the patented opcodes and algorithms. The patents related to */ michael@0: /* TrueType hinting have expired worldwide since May 2010; this option */ michael@0: /* is now deprecated. */ michael@0: /* */ michael@0: /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */ michael@0: /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */ michael@0: /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ michael@0: /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ michael@0: /* */ michael@0: /* This macro is only useful for a small number of font files (mostly */ michael@0: /* for Asian scripts) that require bytecode interpretation to properly */ michael@0: /* load glyphs. For all other fonts, this produces unpleasant results, */ michael@0: /* thus the unpatented interpreter is never used to load glyphs from */ michael@0: /* TrueType fonts unless one of the following two options is used. */ michael@0: /* */ michael@0: /* - The unpatented interpreter is explicitly activated by the user */ michael@0: /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */ michael@0: /* when opening the FT_Face. */ michael@0: /* */ michael@0: /* - FreeType detects that the FT_Face corresponds to one of the */ michael@0: /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */ michael@0: /* contains a hard-coded list of font names and other matching */ michael@0: /* parameters (see function `tt_face_init' in file */ michael@0: /* `src/truetype/ttobjs.c'). */ michael@0: /* */ michael@0: /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */ michael@0: /* */ michael@0: /* { */ michael@0: /* FT_Parameter parameter; */ michael@0: /* FT_Open_Args open_args; */ michael@0: /* */ michael@0: /* */ michael@0: /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */ michael@0: /* */ michael@0: /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */ michael@0: /* open_args.pathname = my_font_pathname; */ michael@0: /* open_args.num_params = 1; */ michael@0: /* open_args.params = ¶meter; */ michael@0: /* */ michael@0: /* error = FT_Open_Face( library, &open_args, index, &face ); */ michael@0: /* ... */ michael@0: /* } */ michael@0: /* */ michael@0: /* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */ michael@0: /* bytecode interpreter with a huge switch statement, rather than a call */ michael@0: /* table. This results in smaller and faster code for a number of */ michael@0: /* architectures. */ michael@0: /* */ michael@0: /* Note however that on some compiler/processor combinations, undefining */ michael@0: /* this macro will generate faster, though larger, code. */ michael@0: /* */ michael@0: #define TT_CONFIG_OPTION_INTERPRETER_SWITCH michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ michael@0: /* TrueType glyph loader to use Apple's definition of how to handle */ michael@0: /* component offsets in composite glyphs. */ michael@0: /* */ michael@0: /* Apple and MS disagree on the default behavior of component offsets */ michael@0: /* in composites. Apple says that they should be scaled by the scaling */ michael@0: /* factors in the transformation matrix (roughly, it's more complex) */ michael@0: /* while MS says they should not. OpenType defines two bits in the */ michael@0: /* composite flags array which can be used to disambiguate, but old */ michael@0: /* fonts will not have them. */ michael@0: /* */ michael@0: /* http://www.microsoft.com/typography/otspec/glyf.htm */ michael@0: /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ michael@0: /* */ michael@0: #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */ michael@0: /* support for Apple's distortable font technology (fvar, gvar, cvar, */ michael@0: /* and avar tables). This has many similarities to Type 1 Multiple */ michael@0: /* Masters support. */ michael@0: /* */ michael@0: #define TT_CONFIG_OPTION_GX_VAR_SUPPORT michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define TT_CONFIG_OPTION_BDF if you want to include support for */ michael@0: /* an embedded `BDF ' table within SFNT-based bitmap formats. */ michael@0: /* */ michael@0: #define TT_CONFIG_OPTION_BDF michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /**** ****/ michael@0: /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ michael@0: /**** ****/ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */ michael@0: /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */ michael@0: /* required. */ michael@0: /* */ michael@0: #define T1_MAX_DICT_DEPTH 5 michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */ michael@0: /* calls during glyph loading. */ michael@0: /* */ michael@0: #define T1_MAX_SUBRS_CALLS 16 michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */ michael@0: /* minimum of 16 is required. */ michael@0: /* */ michael@0: /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */ michael@0: /* */ michael@0: #define T1_MAX_CHARSTRINGS_OPERANDS 256 michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define this configuration macro if you want to prevent the */ michael@0: /* compilation of `t1afm', which is in charge of reading Type 1 AFM */ michael@0: /* files into an existing face. Note that if set, the T1 driver will be */ michael@0: /* unable to produce kerning distances. */ michael@0: /* */ michael@0: #undef T1_CONFIG_OPTION_NO_AFM michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Define this configuration macro if you want to prevent the */ michael@0: /* compilation of the Multiple Masters font support in the Type 1 */ michael@0: /* driver. */ michael@0: /* */ michael@0: #undef T1_CONFIG_OPTION_NO_MM_SUPPORT michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /**** ****/ michael@0: /**** C F F D R I V E R C O N F I G U R A T I O N ****/ michael@0: /**** ****/ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */ michael@0: /* engine gets compiled into FreeType. If defined, it is possible to */ michael@0: /* switch between the two engines using the `hinting-engine' property of */ michael@0: /* the cff driver module. */ michael@0: /* */ michael@0: #define CFF_CONFIG_OPTION_OLD_ENGINE michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: /**** ****/ michael@0: /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ michael@0: /**** ****/ michael@0: /*************************************************************************/ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */ michael@0: /* support. */ michael@0: /* */ michael@0: #define AF_CONFIG_OPTION_CJK michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Compile autofit module with Indic script support. */ michael@0: /* */ michael@0: #define AF_CONFIG_OPTION_INDIC michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* Compile autofit module with warp hinting. The idea of the warping */ michael@0: /* code is to slightly scale and shift a glyph within a single dimension */ michael@0: /* so that as much of its segments are aligned (more or less) on the */ michael@0: /* grid. To find out the optimal scaling and shifting value, various */ michael@0: /* parameter combinations are tried and scored. */ michael@0: /* */ michael@0: /* This experimental option is only active if the render mode is */ michael@0: /* FT_RENDER_MODE_LIGHT. */ michael@0: /* */ michael@0: #define AF_CONFIG_OPTION_USE_WARPER michael@0: michael@0: /* */ michael@0: michael@0: michael@0: /* michael@0: * This macro is obsolete. Support has been removed in FreeType michael@0: * version 2.5. michael@0: */ michael@0: /* #define FT_CONFIG_OPTION_OLD_INTERNALS */ michael@0: michael@0: michael@0: /* michael@0: * This macro is defined if either unpatented or native TrueType michael@0: * hinting is requested by the definitions above. michael@0: */ michael@0: #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER michael@0: #define TT_USE_BYTECODE_INTERPRETER michael@0: #undef TT_CONFIG_OPTION_UNPATENTED_HINTING michael@0: #elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING michael@0: #define TT_USE_BYTECODE_INTERPRETER michael@0: #endif michael@0: michael@0: FT_END_HEADER michael@0: michael@0: michael@0: #endif /* __FTOPTION_H__ */ michael@0: michael@0: michael@0: /* END */