ftoption.h 39 KB

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