ftoption.h 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  1. /***************************************************************************/
  2. /* */
  3. /* ftoption.h (for development) */
  4. /* */
  5. /* User-selectable configuration macros (specification only). */
  6. /* */
  7. /* Copyright 1996-2017 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. #ifndef FTOPTION_H_
  18. #define FTOPTION_H_
  19. #include <ft2build.h>
  20. FT_BEGIN_HEADER
  21. /*************************************************************************/
  22. /* */
  23. /* USER-SELECTABLE CONFIGURATION MACROS */
  24. /* */
  25. /* This file contains the default configuration macro definitions for */
  26. /* a standard build of the FreeType library. There are three ways to */
  27. /* use this file to build project-specific versions of the library: */
  28. /* */
  29. /* - You can modify this file by hand, but this is not recommended in */
  30. /* cases where you would like to build several versions of the */
  31. /* library from a single source directory. */
  32. /* */
  33. /* - You can put a copy of this file in your build directory, more */
  34. /* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
  35. /* is the name of a directory that is included _before_ the FreeType */
  36. /* include path during compilation. */
  37. /* */
  38. /* The default FreeType Makefiles and Jamfiles use the build */
  39. /* directory `builds/<system>' by default, but you can easily change */
  40. /* that for your own projects. */
  41. /* */
  42. /* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
  43. /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
  44. /* locate this file during the build. For example, */
  45. /* */
  46. /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
  47. /* #include <freetype/config/ftheader.h> */
  48. /* */
  49. /* will use `$BUILD/myftoptions.h' instead of this file for macro */
  50. /* definitions. */
  51. /* */
  52. /* Note also that you can similarly pre-define the macro */
  53. /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
  54. /* that are statically linked to the library at compile time. By */
  55. /* default, this file is <freetype/config/ftmodule.h>. */
  56. /* */
  57. /* We highly recommend using the third method whenever possible. */
  58. /* */
  59. /*************************************************************************/
  60. /*************************************************************************/
  61. /*************************************************************************/
  62. /**** ****/
  63. /**** 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 ****/
  64. /**** ****/
  65. /*************************************************************************/
  66. /*************************************************************************/
  67. /*************************************************************************/
  68. /* */
  69. /* If you enable this configuration option, FreeType recognizes an */
  70. /* environment variable called `FREETYPE_PROPERTIES', which can be used */
  71. /* to control the various font drivers and modules. The controllable */
  72. /* properties are listed in the section `Controlling FreeType Modules' */
  73. /* in the reference's table of contents; currently there are properties */
  74. /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), */
  75. /* TrueType (file `ftttdrv.h'), and PCF (file `ftpcfdrv.h'). */
  76. /* */
  77. /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
  78. /* multiple lines for better readability). */
  79. /* */
  80. /* <optional whitespace> */
  81. /* <module-name1> ':' */
  82. /* <property-name1> '=' <property-value1> */
  83. /* <whitespace> */
  84. /* <module-name2> ':' */
  85. /* <property-name2> '=' <property-value2> */
  86. /* ... */
  87. /* */
  88. /* Example: */
  89. /* */
  90. /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
  91. /* cff:no-stem-darkening=1 \ */
  92. /* autofitter:warping=1 */
  93. /* */
  94. #define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
  95. /*************************************************************************/
  96. /* */
  97. /* Uncomment the line below if you want to activate LCD rendering */
  98. /* technology similar to ClearType in this build of the library. This */
  99. /* technology triples the resolution in the direction color subpixels. */
  100. /* To mitigate color fringes inherent to this technology, you also need */
  101. /* to explicitly set up LCD filtering. */
  102. /* */
  103. /* Note that this feature is covered by several Microsoft patents */
  104. /* and should not be activated in any default build of the library. */
  105. /* When this macro is not defined, FreeType offers alternative LCD */
  106. /* rendering technology that produces excellent output without LCD */
  107. /* filtering. */
  108. /* */
  109. /* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
  110. /*************************************************************************/
  111. /* */
  112. /* Many compilers provide a non-ANSI 64-bit data type that can be used */
  113. /* by FreeType to speed up some computations. However, this will create */
  114. /* some problems when compiling the library in strict ANSI mode. */
  115. /* */
  116. /* For this reason, the use of 64-bit integers is normally disabled when */
  117. /* the __STDC__ macro is defined. You can however disable this by */
  118. /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
  119. /* */
  120. /* For most compilers, this will only create compilation warnings when */
  121. /* building the library. */
  122. /* */
  123. /* ObNote: The compiler-specific 64-bit integers are detected in the */
  124. /* file `ftconfig.h' either statically or through the */
  125. /* `configure' script on supported platforms. */
  126. /* */
  127. #undef FT_CONFIG_OPTION_FORCE_INT64
  128. /*************************************************************************/
  129. /* */
  130. /* If this macro is defined, do not try to use an assembler version of */
  131. /* performance-critical functions (e.g. FT_MulFix). You should only do */
  132. /* that to verify that the assembler function works properly, or to */
  133. /* execute benchmark tests of the various implementations. */
  134. /* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
  135. /*************************************************************************/
  136. /* */
  137. /* If this macro is defined, try to use an inlined assembler version of */
  138. /* the `FT_MulFix' function, which is a `hotspot' when loading and */
  139. /* hinting glyphs, and which should be executed as fast as possible. */
  140. /* */
  141. /* Note that if your compiler or CPU is not supported, this will default */
  142. /* to the standard and portable implementation found in `ftcalc.c'. */
  143. /* */
  144. #define FT_CONFIG_OPTION_INLINE_MULFIX
  145. /*************************************************************************/
  146. /* */
  147. /* LZW-compressed file support. */
  148. /* */
  149. /* FreeType now handles font files that have been compressed with the */
  150. /* `compress' program. This is mostly used to parse many of the PCF */
  151. /* files that come with various X11 distributions. The implementation */
  152. /* uses NetBSD's `zopen' to partially uncompress the file on the fly */
  153. /* (see src/lzw/ftgzip.c). */
  154. /* */
  155. /* Define this macro if you want to enable this `feature'. */
  156. /* */
  157. #define FT_CONFIG_OPTION_USE_LZW
  158. /*************************************************************************/
  159. /* */
  160. /* Gzip-compressed file support. */
  161. /* */
  162. /* FreeType now handles font files that have been compressed with the */
  163. /* `gzip' program. This is mostly used to parse many of the PCF files */
  164. /* that come with XFree86. The implementation uses `zlib' to */
  165. /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
  166. /* */
  167. /* Define this macro if you want to enable this `feature'. See also */
  168. /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
  169. /* */
  170. #define FT_CONFIG_OPTION_USE_ZLIB
  171. /*************************************************************************/
  172. /* */
  173. /* ZLib library selection */
  174. /* */
  175. /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
  176. /* It allows FreeType's `ftgzip' component to link to the system's */
  177. /* installation of the ZLib library. This is useful on systems like */
  178. /* Unix or VMS where it generally is already available. */
  179. /* */
  180. /* If you let it undefined, the component will use its own copy */
  181. /* of the zlib sources instead. These have been modified to be */
  182. /* included directly within the component and *not* export external */
  183. /* function names. This allows you to link any program with FreeType */
  184. /* _and_ ZLib without linking conflicts. */
  185. /* */
  186. /* Do not #undef this macro here since the build system might define */
  187. /* it for certain configurations only. */
  188. /* */
  189. /* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
  190. /*************************************************************************/
  191. /* */
  192. /* Bzip2-compressed file support. */
  193. /* */
  194. /* FreeType now handles font files that have been compressed with the */
  195. /* `bzip2' program. This is mostly used to parse many of the PCF */
  196. /* files that come with XFree86. The implementation uses `libbz2' to */
  197. /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
  198. /* Contrary to gzip, bzip2 currently is not included and need to use */
  199. /* the system available bzip2 implementation. */
  200. /* */
  201. /* Define this macro if you want to enable this `feature'. */
  202. /* */
  203. #define FT_CONFIG_OPTION_USE_BZIP2
  204. /*************************************************************************/
  205. /* */
  206. /* Define to disable the use of file stream functions and types, FILE, */
  207. /* fopen() etc. Enables the use of smaller system libraries on embedded */
  208. /* systems that have multiple system libraries, some with or without */
  209. /* file stream support, in the cases where file stream support is not */
  210. /* necessary such as memory loading of font files. */
  211. /* */
  212. /* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
  213. /*************************************************************************/
  214. /* */
  215. /* PNG bitmap support. */
  216. /* */
  217. /* FreeType now handles loading color bitmap glyphs in the PNG format. */
  218. /* This requires help from the external libpng library. Uncompressed */
  219. /* color bitmaps do not need any external libraries and will be */
  220. /* supported regardless of this configuration. */
  221. /* */
  222. /* Define this macro if you want to enable this `feature'. */
  223. /* */
  224. #define FT_CONFIG_OPTION_USE_PNG
  225. /*************************************************************************/
  226. /* */
  227. /* HarfBuzz support. */
  228. /* */
  229. /* FreeType uses the HarfBuzz library to improve auto-hinting of */
  230. /* OpenType fonts. If available, many glyphs not directly addressable */
  231. /* by a font's character map will be hinted also. */
  232. /* */
  233. /* Define this macro if you want to enable this `feature'. */
  234. /* */
  235. #define FT_CONFIG_OPTION_USE_HARFBUZZ
  236. /*************************************************************************/
  237. /* */
  238. /* DLL export compilation */
  239. /* */
  240. /* When compiling FreeType as a DLL, some systems/compilers need a */
  241. /* special keyword in front OR after the return type of function */
  242. /* declarations. */
  243. /* */
  244. /* Two macros are used within the FreeType source code to define */
  245. /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
  246. /* */
  247. /* FT_EXPORT( return_type ) */
  248. /* */
  249. /* is used in a function declaration, as in */
  250. /* */
  251. /* FT_EXPORT( FT_Error ) */
  252. /* FT_Init_FreeType( FT_Library* alibrary ); */
  253. /* */
  254. /* */
  255. /* FT_EXPORT_DEF( return_type ) */
  256. /* */
  257. /* is used in a function definition, as in */
  258. /* */
  259. /* FT_EXPORT_DEF( FT_Error ) */
  260. /* FT_Init_FreeType( FT_Library* alibrary ) */
  261. /* { */
  262. /* ... some code ... */
  263. /* return FT_Err_Ok; */
  264. /* } */
  265. /* */
  266. /* You can provide your own implementation of FT_EXPORT and */
  267. /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
  268. /* will be later automatically defined as `extern return_type' to */
  269. /* allow normal compilation. */
  270. /* */
  271. /* Do not #undef these macros here since the build system might define */
  272. /* them for certain configurations only. */
  273. /* */
  274. /* #define FT_EXPORT(x) extern x */
  275. /* #define FT_EXPORT_DEF(x) x */
  276. /*************************************************************************/
  277. /* */
  278. /* Glyph Postscript Names handling */
  279. /* */
  280. /* By default, FreeType 2 is compiled with the `psnames' module. This */
  281. /* module is in charge of converting a glyph name string into a */
  282. /* Unicode value, or return a Macintosh standard glyph name for the */
  283. /* use with the TrueType `post' table. */
  284. /* */
  285. /* Undefine this macro if you do not want `psnames' compiled in your */
  286. /* build of FreeType. This has the following effects: */
  287. /* */
  288. /* - The TrueType driver will provide its own set of glyph names, */
  289. /* if you build it to support postscript names in the TrueType */
  290. /* `post' table, but will not synthesize a missing Unicode charmap. */
  291. /* */
  292. /* - The Type 1 driver will not be able to synthesize a Unicode */
  293. /* charmap out of the glyphs found in the fonts. */
  294. /* */
  295. /* You would normally undefine this configuration macro when building */
  296. /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
  297. /* */
  298. #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
  299. /*************************************************************************/
  300. /* */
  301. /* Postscript Names to Unicode Values support */
  302. /* */
  303. /* By default, FreeType 2 is built with the `PSNames' module compiled */
  304. /* in. Among other things, the module is used to convert a glyph name */
  305. /* into a Unicode value. This is especially useful in order to */
  306. /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
  307. /* through a big table named the `Adobe Glyph List' (AGL). */
  308. /* */
  309. /* Undefine this macro if you do not want the Adobe Glyph List */
  310. /* compiled in your `PSNames' module. The Type 1 driver will not be */
  311. /* able to synthesize a Unicode charmap out of the glyphs found in the */
  312. /* fonts. */
  313. /* */
  314. #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
  315. /*************************************************************************/
  316. /* */
  317. /* Support for Mac fonts */
  318. /* */
  319. /* Define this macro if you want support for outline fonts in Mac */
  320. /* format (mac dfont, mac resource, macbinary containing a mac */
  321. /* resource) on non-Mac platforms. */
  322. /* */
  323. /* Note that the `FOND' resource isn't checked. */
  324. /* */
  325. #define FT_CONFIG_OPTION_MAC_FONTS
  326. /*************************************************************************/
  327. /* */
  328. /* Guessing methods to access embedded resource forks */
  329. /* */
  330. /* Enable extra Mac fonts support on non-Mac platforms (e.g. */
  331. /* GNU/Linux). */
  332. /* */
  333. /* Resource forks which include fonts data are stored sometimes in */
  334. /* locations which users or developers don't expected. In some cases, */
  335. /* resource forks start with some offset from the head of a file. In */
  336. /* other cases, the actual resource fork is stored in file different */
  337. /* from what the user specifies. If this option is activated, */
  338. /* FreeType tries to guess whether such offsets or different file */
  339. /* names must be used. */
  340. /* */
  341. /* Note that normal, direct access of resource forks is controlled via */
  342. /* the FT_CONFIG_OPTION_MAC_FONTS option. */
  343. /* */
  344. #ifdef FT_CONFIG_OPTION_MAC_FONTS
  345. #define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
  346. #endif
  347. /*************************************************************************/
  348. /* */
  349. /* Allow the use of FT_Incremental_Interface to load typefaces that */
  350. /* contain no glyph data, but supply it via a callback function. */
  351. /* This is required by clients supporting document formats which */
  352. /* supply font data incrementally as the document is parsed, such */
  353. /* as the Ghostscript interpreter for the PostScript language. */
  354. /* */
  355. #define FT_CONFIG_OPTION_INCREMENTAL
  356. /*************************************************************************/
  357. /* */
  358. /* The size in bytes of the render pool used by the scan-line converter */
  359. /* to do all of its work. */
  360. /* */
  361. #define FT_RENDER_POOL_SIZE 16384L
  362. /*************************************************************************/
  363. /* */
  364. /* FT_MAX_MODULES */
  365. /* */
  366. /* The maximum number of modules that can be registered in a single */
  367. /* FreeType library object. 32 is the default. */
  368. /* */
  369. #define FT_MAX_MODULES 32
  370. /*************************************************************************/
  371. /* */
  372. /* Debug level */
  373. /* */
  374. /* FreeType can be compiled in debug or trace mode. In debug mode, */
  375. /* errors are reported through the `ftdebug' component. In trace */
  376. /* mode, additional messages are sent to the standard output during */
  377. /* execution. */
  378. /* */
  379. /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
  380. /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
  381. /* */
  382. /* Don't define any of these macros to compile in `release' mode! */
  383. /* */
  384. /* Do not #undef these macros here since the build system might define */
  385. /* them for certain configurations only. */
  386. /* */
  387. #define FT_DEBUG_LEVEL_ERROR
  388. #define FT_DEBUG_LEVEL_TRACE
  389. /*************************************************************************/
  390. /* */
  391. /* Autofitter debugging */
  392. /* */
  393. /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */
  394. /* control the autofitter behaviour for debugging purposes with global */
  395. /* boolean variables (consequently, you should *never* enable this */
  396. /* while compiling in `release' mode): */
  397. /* */
  398. /* _af_debug_disable_horz_hints */
  399. /* _af_debug_disable_vert_hints */
  400. /* _af_debug_disable_blue_hints */
  401. /* */
  402. /* Additionally, the following functions provide dumps of various */
  403. /* internal autofit structures to stdout (using `printf'): */
  404. /* */
  405. /* af_glyph_hints_dump_points */
  406. /* af_glyph_hints_dump_segments */
  407. /* af_glyph_hints_dump_edges */
  408. /* af_glyph_hints_get_num_segments */
  409. /* af_glyph_hints_get_segment_offset */
  410. /* */
  411. /* As an argument, they use another global variable: */
  412. /* */
  413. /* _af_debug_hints */
  414. /* */
  415. /* Please have a look at the `ftgrid' demo program to see how those */
  416. /* variables and macros should be used. */
  417. /* */
  418. /* Do not #undef these macros here since the build system might define */
  419. /* them for certain configurations only. */
  420. /* */
  421. #define FT_DEBUG_AUTOFIT
  422. /*************************************************************************/
  423. /* */
  424. /* Memory Debugging */
  425. /* */
  426. /* FreeType now comes with an integrated memory debugger that is */
  427. /* capable of detecting simple errors like memory leaks or double */
  428. /* deletes. To compile it within your build of the library, you */
  429. /* should define FT_DEBUG_MEMORY here. */
  430. /* */
  431. /* Note that the memory debugger is only activated at runtime when */
  432. /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
  433. /* */
  434. /* Do not #undef this macro here since the build system might define */
  435. /* it for certain configurations only. */
  436. /* */
  437. #define FT_DEBUG_MEMORY
  438. /*************************************************************************/
  439. /* */
  440. /* Module errors */
  441. /* */
  442. /* If this macro is set (which is _not_ the default), the higher byte */
  443. /* of an error code gives the module in which the error has occurred, */
  444. /* while the lower byte is the real error code. */
  445. /* */
  446. /* Setting this macro makes sense for debugging purposes only, since */
  447. /* it would break source compatibility of certain programs that use */
  448. /* FreeType 2. */
  449. /* */
  450. /* More details can be found in the files ftmoderr.h and fterrors.h. */
  451. /* */
  452. #undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
  453. /*************************************************************************/
  454. /* */
  455. /* Position Independent Code */
  456. /* */
  457. /* If this macro is set (which is _not_ the default), FreeType2 will */
  458. /* avoid creating constants that require address fixups. Instead the */
  459. /* constants will be moved into a struct and additional intialization */
  460. /* code will be used. */
  461. /* */
  462. /* Setting this macro is needed for systems that prohibit address */
  463. /* fixups, such as BREW. [Note that standard compilers like gcc or */
  464. /* clang handle PIC generation automatically; you don't have to set */
  465. /* FT_CONFIG_OPTION_PIC, which is only necessary for very special */
  466. /* compilers.] */
  467. /* */
  468. /* Note that FT_CONFIG_OPTION_PIC support is not available for all */
  469. /* modules (see `modules.cfg' for a complete list). For building with */
  470. /* FT_CONFIG_OPTION_PIC support, do the following. */
  471. /* */
  472. /* 0. Clone the repository. */
  473. /* 1. Define FT_CONFIG_OPTION_PIC. */
  474. /* 2. Remove all subdirectories in `src' that don't have */
  475. /* FT_CONFIG_OPTION_PIC support. */
  476. /* 3. Comment out the corresponding modules in `modules.cfg'. */
  477. /* 4. Compile. */
  478. /* */
  479. /* #define FT_CONFIG_OPTION_PIC */
  480. /*************************************************************************/
  481. /*************************************************************************/
  482. /**** ****/
  483. /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
  484. /**** ****/
  485. /*************************************************************************/
  486. /*************************************************************************/
  487. /*************************************************************************/
  488. /* */
  489. /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
  490. /* embedded bitmaps in all formats using the SFNT module (namely */
  491. /* TrueType & OpenType). */
  492. /* */
  493. #define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
  494. /*************************************************************************/
  495. /* */
  496. /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
  497. /* load and enumerate the glyph Postscript names in a TrueType or */
  498. /* OpenType file. */
  499. /* */
  500. /* Note that when you do not compile the `PSNames' module by undefining */
  501. /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
  502. /* contain additional code used to read the PS Names table from a font. */
  503. /* */
  504. /* (By default, the module uses `PSNames' to extract glyph names.) */
  505. /* */
  506. #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
  507. /*************************************************************************/
  508. /* */
  509. /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
  510. /* access the internal name table in a SFNT-based format like TrueType */
  511. /* or OpenType. The name table contains various strings used to */
  512. /* describe the font, like family name, copyright, version, etc. It */
  513. /* does not contain any glyph name though. */
  514. /* */
  515. /* Accessing SFNT names is done through the functions declared in */
  516. /* `ftsnames.h'. */
  517. /* */
  518. #define TT_CONFIG_OPTION_SFNT_NAMES
  519. /*************************************************************************/
  520. /* */
  521. /* TrueType CMap support */
  522. /* */
  523. /* Here you can fine-tune which TrueType CMap table format shall be */
  524. /* supported. */
  525. #define TT_CONFIG_CMAP_FORMAT_0
  526. #define TT_CONFIG_CMAP_FORMAT_2
  527. #define TT_CONFIG_CMAP_FORMAT_4
  528. #define TT_CONFIG_CMAP_FORMAT_6
  529. #define TT_CONFIG_CMAP_FORMAT_8
  530. #define TT_CONFIG_CMAP_FORMAT_10
  531. #define TT_CONFIG_CMAP_FORMAT_12
  532. #define TT_CONFIG_CMAP_FORMAT_13
  533. #define TT_CONFIG_CMAP_FORMAT_14
  534. /*************************************************************************/
  535. /*************************************************************************/
  536. /**** ****/
  537. /**** 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 ****/
  538. /**** ****/
  539. /*************************************************************************/
  540. /*************************************************************************/
  541. /*************************************************************************/
  542. /* */
  543. /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
  544. /* a bytecode interpreter in the TrueType driver. */
  545. /* */
  546. /* By undefining this, you will only compile the code necessary to load */
  547. /* TrueType glyphs without hinting. */
  548. /* */
  549. /* Do not #undef this macro here, since the build system might */
  550. /* define it for certain configurations only. */
  551. /* */
  552. #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
  553. /*************************************************************************/
  554. /* */
  555. /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
  556. /* subpixel hinting support into the TrueType driver. This modifies the */
  557. /* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */
  558. /* requested. */
  559. /* */
  560. /* In particular, it modifies the bytecode interpreter to interpret (or */
  561. /* not) instructions in a certain way so that all TrueType fonts look */
  562. /* like they do in a Windows ClearType (DirectWrite) environment. See */
  563. /* [1] for a technical overview on what this means. See `ttinterp.h' */
  564. /* for more details on the LEAN option. */
  565. /* */
  566. /* There are three options. */
  567. /* */
  568. /* 1. This option is associated with the `Infinality' moniker. */
  569. /* Contributed by an individual nicknamed Infinality with the goal of */
  570. /* making TrueType fonts render better than on Windows. A high */
  571. /* amount of configurability and flexibility, down to rules for */
  572. /* single glyphs in fonts, but also very slow. Its experimental and */
  573. /* slow nature and the original developer losing interest meant that */
  574. /* this option was never enabled in default builds. */
  575. /* */
  576. /* 2. The new default mode for the TrueType driver. The Infinality code */
  577. /* base was stripped to the bare minimum and all configurability */
  578. /* removed in the name of speed and simplicity. The configurability */
  579. /* was mainly aimed at legacy fonts like Arial, Times New Roman, or */
  580. /* Courier. Legacy fonts are fonts that modify vertical stems to */
  581. /* achieve clean black-and-white bitmaps. The new mode focuses on */
  582. /* applying a minimal set of rules to all fonts indiscriminately so */
  583. /* that modern and web fonts render well while legacy fonts render */
  584. /* okay. */
  585. /* */
  586. /* 3. Compile both. */
  587. /* */
  588. /* By undefining these, you get rendering behavior like on Windows */
  589. /* without ClearType, i.e., Windows XP without ClearType enabled and */
  590. /* Win9x (interpreter version v35). Or not, depending on how much */
  591. /* hinting blood and testing tears the font designer put into a given */
  592. /* font. If you define one or both subpixel hinting options, you can */
  593. /* switch between between v35 and the ones you define. */
  594. /* */
  595. /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
  596. /* defined. */
  597. /* */
  598. /* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
  599. /* */
  600. /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
  601. /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
  602. #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 )
  603. /*************************************************************************/
  604. /* */
  605. /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
  606. /* TrueType glyph loader to use Apple's definition of how to handle */
  607. /* component offsets in composite glyphs. */
  608. /* */
  609. /* Apple and MS disagree on the default behavior of component offsets */
  610. /* in composites. Apple says that they should be scaled by the scaling */
  611. /* factors in the transformation matrix (roughly, it's more complex) */
  612. /* while MS says they should not. OpenType defines two bits in the */
  613. /* composite flags array which can be used to disambiguate, but old */
  614. /* fonts will not have them. */
  615. /* */
  616. /* http://www.microsoft.com/typography/otspec/glyf.htm */
  617. /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html */
  618. /* */
  619. #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
  620. /*************************************************************************/
  621. /* */
  622. /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
  623. /* support for Apple's distortable font technology (fvar, gvar, cvar, */
  624. /* and avar tables). This has many similarities to Type 1 Multiple */
  625. /* Masters support. */
  626. /* */
  627. #define TT_CONFIG_OPTION_GX_VAR_SUPPORT
  628. /*************************************************************************/
  629. /* */
  630. /* Define TT_CONFIG_OPTION_BDF if you want to include support for */
  631. /* an embedded `BDF ' table within SFNT-based bitmap formats. */
  632. /* */
  633. #define TT_CONFIG_OPTION_BDF
  634. /*************************************************************************/
  635. /* */
  636. /* Option TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES controls the maximum */
  637. /* number of bytecode instructions executed for a single run of the */
  638. /* bytecode interpreter, needed to prevent infinite loops. You don't */
  639. /* want to change this except for very special situations (e.g., making */
  640. /* a library fuzzer spend less time to handle broken fonts). */
  641. /* */
  642. /* It is not expected that this value is ever modified by a configuring */
  643. /* script; instead, it gets surrounded with #ifndef ... #endif so that */
  644. /* the value can be set as a preprocessor option on the compiler's */
  645. /* command line. */
  646. /* */
  647. #ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES
  648. #define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L
  649. #endif
  650. /*************************************************************************/
  651. /*************************************************************************/
  652. /**** ****/
  653. /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
  654. /**** ****/
  655. /*************************************************************************/
  656. /*************************************************************************/
  657. /*************************************************************************/
  658. /* */
  659. /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */
  660. /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
  661. /* required. */
  662. /* */
  663. #define T1_MAX_DICT_DEPTH 5
  664. /*************************************************************************/
  665. /* */
  666. /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
  667. /* calls during glyph loading. */
  668. /* */
  669. #define T1_MAX_SUBRS_CALLS 16
  670. /*************************************************************************/
  671. /* */
  672. /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
  673. /* minimum of 16 is required. */
  674. /* */
  675. /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
  676. /* */
  677. #define T1_MAX_CHARSTRINGS_OPERANDS 256
  678. /*************************************************************************/
  679. /* */
  680. /* Define this configuration macro if you want to prevent the */
  681. /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
  682. /* files into an existing face. Note that if set, the T1 driver will be */
  683. /* unable to produce kerning distances. */
  684. /* */
  685. #undef T1_CONFIG_OPTION_NO_AFM
  686. /*************************************************************************/
  687. /* */
  688. /* Define this configuration macro if you want to prevent the */
  689. /* compilation of the Multiple Masters font support in the Type 1 */
  690. /* driver. */
  691. /* */
  692. #undef T1_CONFIG_OPTION_NO_MM_SUPPORT
  693. /*************************************************************************/
  694. /*************************************************************************/
  695. /**** ****/
  696. /**** C F F D R I V E R C O N F I G U R A T I O N ****/
  697. /**** ****/
  698. /*************************************************************************/
  699. /*************************************************************************/
  700. /*************************************************************************/
  701. /* */
  702. /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is */
  703. /* possible to set up the default values of the four control points that */
  704. /* define the stem darkening behaviour of the (new) CFF engine. For */
  705. /* more details please read the documentation of the */
  706. /* `darkening-parameters' property of the cff driver module (file */
  707. /* `ftcffdrv.h'), which allows the control at run-time. */
  708. /* */
  709. /* Do *not* undefine these macros! */
  710. /* */
  711. #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500
  712. #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400
  713. #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000
  714. #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275
  715. #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667
  716. #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275
  717. #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333
  718. #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0
  719. /*************************************************************************/
  720. /* */
  721. /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */
  722. /* engine gets compiled into FreeType. If defined, it is possible to */
  723. /* switch between the two engines using the `hinting-engine' property of */
  724. /* the cff driver module. */
  725. /* */
  726. #define CFF_CONFIG_OPTION_OLD_ENGINE
  727. /*************************************************************************/
  728. /*************************************************************************/
  729. /**** ****/
  730. /**** P C F D R I V E R C O N F I G U R A T I O N ****/
  731. /**** ****/
  732. /*************************************************************************/
  733. /*************************************************************************/
  734. /*************************************************************************/
  735. /* */
  736. /* There are many PCF fonts just called `Fixed' which look completely */
  737. /* different, and which have nothing to do with each other. When */
  738. /* selecting `Fixed' in KDE or Gnome one gets results that appear rather */
  739. /* random, the style changes often if one changes the size and one */
  740. /* cannot select some fonts at all. This option makes the PCF module */
  741. /* prepend the foundry name (plus a space) to the family name. */
  742. /* */
  743. /* We also check whether we have `wide' characters; all put together, we */
  744. /* get family names like `Sony Fixed' or `Misc Fixed Wide'. */
  745. /* */
  746. /* If this option is activated, it can be controlled with the */
  747. /* `no-long-family-names' property of the pcf driver module. */
  748. /* */
  749. #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
  750. /*************************************************************************/
  751. /*************************************************************************/
  752. /**** ****/
  753. /**** 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 ****/
  754. /**** ****/
  755. /*************************************************************************/
  756. /*************************************************************************/
  757. /*************************************************************************/
  758. /* */
  759. /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
  760. /* support. */
  761. /* */
  762. #define AF_CONFIG_OPTION_CJK
  763. /*************************************************************************/
  764. /* */
  765. /* Compile autofit module with Indic script support. */
  766. /* */
  767. #define AF_CONFIG_OPTION_INDIC
  768. /*************************************************************************/
  769. /* */
  770. /* Compile autofit module with warp hinting. The idea of the warping */
  771. /* code is to slightly scale and shift a glyph within a single dimension */
  772. /* so that as much of its segments are aligned (more or less) on the */
  773. /* grid. To find out the optimal scaling and shifting value, various */
  774. /* parameter combinations are tried and scored. */
  775. /* */
  776. /* This experimental option is active only if the rendering mode is */
  777. /* FT_RENDER_MODE_LIGHT; you can switch warping on and off with the */
  778. /* `warping' property of the auto-hinter (see file `ftautoh.h' for more */
  779. /* information; by default it is switched off). */
  780. /* */
  781. #define AF_CONFIG_OPTION_USE_WARPER
  782. /* */
  783. /*
  784. * This macro is obsolete. Support has been removed in FreeType
  785. * version 2.5.
  786. */
  787. /* #define FT_CONFIG_OPTION_OLD_INTERNALS */
  788. /*
  789. * This macro is defined if native TrueType hinting is requested by the
  790. * definitions above.
  791. */
  792. #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
  793. #define TT_USE_BYTECODE_INTERPRETER
  794. #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
  795. #if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
  796. #define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
  797. #endif
  798. #if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
  799. #define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
  800. #endif
  801. #endif
  802. #endif
  803. /*
  804. * Check CFF darkening parameters. The checks are the same as in function
  805. * `cff_property_set' in file `cffdrivr.c'.
  806. */
  807. #if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \
  808. CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \
  809. CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \
  810. CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \
  811. \
  812. CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \
  813. CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \
  814. CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \
  815. CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \
  816. \
  817. CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \
  818. CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \
  819. CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \
  820. CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \
  821. CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \
  822. CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \
  823. \
  824. CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \
  825. CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \
  826. CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \
  827. CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500
  828. #error "Invalid CFF darkening parameters!"
  829. #endif
  830. FT_END_HEADER
  831. #endif /* FTOPTION_H_ */
  832. /* END */