ftdriver.h 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249
  1. /****************************************************************************
  2. *
  3. * ftdriver.h
  4. *
  5. * FreeType API for controlling driver modules (specification only).
  6. *
  7. * Copyright (C) 2017-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 FTDRIVER_H_
  18. #define FTDRIVER_H_
  19. #include <freetype/freetype.h>
  20. #include <freetype/ftparams.h>
  21. #ifdef FREETYPE_H
  22. #error "freetype.h of FreeType 1 has been loaded!"
  23. #error "Please fix the directory search order for header files"
  24. #error "so that freetype.h of FreeType 2 is found first."
  25. #endif
  26. FT_BEGIN_HEADER
  27. /**************************************************************************
  28. *
  29. * @section:
  30. * auto_hinter
  31. *
  32. * @title:
  33. * The auto-hinter
  34. *
  35. * @abstract:
  36. * Controlling the auto-hinting module.
  37. *
  38. * @description:
  39. * While FreeType's auto-hinter doesn't expose API functions by itself,
  40. * it is possible to control its behaviour with @FT_Property_Set and
  41. * @FT_Property_Get. The following lists the available properties
  42. * together with the necessary macros and structures.
  43. *
  44. * Note that the auto-hinter's module name is 'autofitter' for historical
  45. * reasons.
  46. *
  47. * Available properties are @increase-x-height, @no-stem-darkening
  48. * (experimental), @darkening-parameters (experimental),
  49. * @glyph-to-script-map (experimental), @fallback-script (experimental),
  50. * and @default-script (experimental), as documented in the @properties
  51. * section.
  52. *
  53. */
  54. /**************************************************************************
  55. *
  56. * @section:
  57. * cff_driver
  58. *
  59. * @title:
  60. * The CFF driver
  61. *
  62. * @abstract:
  63. * Controlling the CFF driver module.
  64. *
  65. * @description:
  66. * While FreeType's CFF driver doesn't expose API functions by itself, it
  67. * is possible to control its behaviour with @FT_Property_Set and
  68. * @FT_Property_Get.
  69. *
  70. * The CFF driver's module name is 'cff'.
  71. *
  72. * Available properties are @hinting-engine, @no-stem-darkening,
  73. * @darkening-parameters, and @random-seed, as documented in the
  74. * @properties section.
  75. *
  76. *
  77. * **Hinting and anti-aliasing principles of the new engine**
  78. *
  79. * The rasterizer is positioning horizontal features (e.g., ascender
  80. * height & x-height, or crossbars) on the pixel grid and minimizing the
  81. * amount of anti-aliasing applied to them, while placing vertical
  82. * features (vertical stems) on the pixel grid without hinting, thus
  83. * representing the stem position and weight accurately. Sometimes the
  84. * vertical stems may be only partially black. In this context,
  85. * 'anti-aliasing' means that stems are not positioned exactly on pixel
  86. * borders, causing a fuzzy appearance.
  87. *
  88. * There are two principles behind this approach.
  89. *
  90. * 1) No hinting in the horizontal direction: Unlike 'superhinted'
  91. * TrueType, which changes glyph widths to accommodate regular
  92. * inter-glyph spacing, Adobe's approach is 'faithful to the design' in
  93. * representing both the glyph width and the inter-glyph spacing designed
  94. * for the font. This makes the screen display as close as it can be to
  95. * the result one would get with infinite resolution, while preserving
  96. * what is considered the key characteristics of each glyph. Note that
  97. * the distances between unhinted and grid-fitted positions at small
  98. * sizes are comparable to kerning values and thus would be noticeable
  99. * (and distracting) while reading if hinting were applied.
  100. *
  101. * One of the reasons to not hint horizontally is anti-aliasing for LCD
  102. * screens: The pixel geometry of modern displays supplies three vertical
  103. * subpixels as the eye moves horizontally across each visible pixel. On
  104. * devices where we can be certain this characteristic is present a
  105. * rasterizer can take advantage of the subpixels to add increments of
  106. * weight. In Western writing systems this turns out to be the more
  107. * critical direction anyway; the weights and spacing of vertical stems
  108. * (see above) are central to Armenian, Cyrillic, Greek, and Latin type
  109. * designs. Even when the rasterizer uses greyscale anti-aliasing instead
  110. * of color (a necessary compromise when one doesn't know the screen
  111. * characteristics), the unhinted vertical features preserve the design's
  112. * weight and spacing much better than aliased type would.
  113. *
  114. * 2) Alignment in the vertical direction: Weights and spacing along the
  115. * y~axis are less critical; what is much more important is the visual
  116. * alignment of related features (like cap-height and x-height). The
  117. * sense of alignment for these is enhanced by the sharpness of grid-fit
  118. * edges, while the cruder vertical resolution (full pixels instead of
  119. * 1/3 pixels) is less of a problem.
  120. *
  121. * On the technical side, horizontal alignment zones for ascender,
  122. * x-height, and other important height values (traditionally called
  123. * 'blue zones') as defined in the font are positioned independently,
  124. * each being rounded to the nearest pixel edge, taking care of overshoot
  125. * suppression at small sizes, stem darkening, and scaling.
  126. *
  127. * Hstems (this is, hint values defined in the font to help align
  128. * horizontal features) that fall within a blue zone are said to be
  129. * 'captured' and are aligned to that zone. Uncaptured stems are moved
  130. * in one of four ways, top edge up or down, bottom edge up or down.
  131. * Unless there are conflicting hstems, the smallest movement is taken to
  132. * minimize distortion.
  133. *
  134. */
  135. /**************************************************************************
  136. *
  137. * @section:
  138. * pcf_driver
  139. *
  140. * @title:
  141. * The PCF driver
  142. *
  143. * @abstract:
  144. * Controlling the PCF driver module.
  145. *
  146. * @description:
  147. * While FreeType's PCF driver doesn't expose API functions by itself, it
  148. * is possible to control its behaviour with @FT_Property_Set and
  149. * @FT_Property_Get. Right now, there is a single property
  150. * @no-long-family-names available if FreeType is compiled with
  151. * PCF_CONFIG_OPTION_LONG_FAMILY_NAMES.
  152. *
  153. * The PCF driver's module name is 'pcf'.
  154. *
  155. */
  156. /**************************************************************************
  157. *
  158. * @section:
  159. * t1_cid_driver
  160. *
  161. * @title:
  162. * The Type 1 and CID drivers
  163. *
  164. * @abstract:
  165. * Controlling the Type~1 and CID driver modules.
  166. *
  167. * @description:
  168. * It is possible to control the behaviour of FreeType's Type~1 and
  169. * Type~1 CID drivers with @FT_Property_Set and @FT_Property_Get.
  170. *
  171. * Behind the scenes, both drivers use the Adobe CFF engine for hinting;
  172. * however, the used properties must be specified separately.
  173. *
  174. * The Type~1 driver's module name is 'type1'; the CID driver's module
  175. * name is 't1cid'.
  176. *
  177. * Available properties are @hinting-engine, @no-stem-darkening,
  178. * @darkening-parameters, and @random-seed, as documented in the
  179. * @properties section.
  180. *
  181. * Please see the @cff_driver section for more details on the new hinting
  182. * engine.
  183. *
  184. */
  185. /**************************************************************************
  186. *
  187. * @section:
  188. * tt_driver
  189. *
  190. * @title:
  191. * The TrueType driver
  192. *
  193. * @abstract:
  194. * Controlling the TrueType driver module.
  195. *
  196. * @description:
  197. * While FreeType's TrueType driver doesn't expose API functions by
  198. * itself, it is possible to control its behaviour with @FT_Property_Set
  199. * and @FT_Property_Get.
  200. *
  201. * The TrueType driver's module name is 'truetype'; a single property
  202. * @interpreter-version is available, as documented in the @properties
  203. * section.
  204. *
  205. * To help understand the differences between interpreter versions, we
  206. * introduce a list of definitions, kindly provided by Greg Hitchcock.
  207. *
  208. * _Bi-Level Rendering_
  209. *
  210. * Monochromatic rendering, exclusively used in the early days of
  211. * TrueType by both Apple and Microsoft. Microsoft's GDI interface
  212. * supported hinting of the right-side bearing point, such that the
  213. * advance width could be non-linear. Most often this was done to
  214. * achieve some level of glyph symmetry. To enable reasonable
  215. * performance (e.g., not having to run hinting on all glyphs just to get
  216. * the widths) there was a bit in the head table indicating if the side
  217. * bearing was hinted, and additional tables, 'hdmx' and 'LTSH', to cache
  218. * hinting widths across multiple sizes and device aspect ratios.
  219. *
  220. * _Font Smoothing_
  221. *
  222. * Microsoft's GDI implementation of anti-aliasing. Not traditional
  223. * anti-aliasing as the outlines were hinted before the sampling. The
  224. * widths matched the bi-level rendering.
  225. *
  226. * _ClearType Rendering_
  227. *
  228. * Technique that uses physical subpixels to improve rendering on LCD
  229. * (and other) displays. Because of the higher resolution, many methods
  230. * of improving symmetry in glyphs through hinting the right-side bearing
  231. * were no longer necessary. This lead to what GDI calls 'natural
  232. * widths' ClearType, see
  233. * http://rastertragedy.com/RTRCh4.htm#Sec21. Since hinting
  234. * has extra resolution, most non-linearity went away, but it is still
  235. * possible for hints to change the advance widths in this mode.
  236. *
  237. * _ClearType Compatible Widths_
  238. *
  239. * One of the earliest challenges with ClearType was allowing the
  240. * implementation in GDI to be selected without requiring all UI and
  241. * documents to reflow. To address this, a compatible method of
  242. * rendering ClearType was added where the font hints are executed once
  243. * to determine the width in bi-level rendering, and then re-run in
  244. * ClearType, with the difference in widths being absorbed in the font
  245. * hints for ClearType (mostly in the white space of hints); see
  246. * http://rastertragedy.com/RTRCh4.htm#Sec20. Somewhat by
  247. * definition, compatible width ClearType allows for non-linear widths,
  248. * but only when the bi-level version has non-linear widths.
  249. *
  250. * _ClearType Subpixel Positioning_
  251. *
  252. * One of the nice benefits of ClearType is the ability to more crisply
  253. * display fractional widths; unfortunately, the GDI model of integer
  254. * bitmaps did not support this. However, the WPF and Direct Write
  255. * frameworks do support fractional widths. DWrite calls this 'natural
  256. * mode', not to be confused with GDI's 'natural widths'. Subpixel
  257. * positioning, in the current implementation of Direct Write,
  258. * unfortunately does not support hinted advance widths, see
  259. * http://rastertragedy.com/RTRCh4.htm#Sec22. Note that the
  260. * TrueType interpreter fully allows the advance width to be adjusted in
  261. * this mode, just the DWrite client will ignore those changes.
  262. *
  263. * _ClearType Backward Compatibility_
  264. *
  265. * This is a set of exceptions made in the TrueType interpreter to
  266. * minimize hinting techniques that were problematic with the extra
  267. * resolution of ClearType; see
  268. * http://rastertragedy.com/RTRCh4.htm#Sec1 and
  269. * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
  270. * This technique is not to be confused with ClearType compatible widths.
  271. * ClearType backward compatibility has no direct impact on changing
  272. * advance widths, but there might be an indirect impact on disabling
  273. * some deltas. This could be worked around in backward compatibility
  274. * mode.
  275. *
  276. * _Native ClearType Mode_
  277. *
  278. * (Not to be confused with 'natural widths'.) This mode removes all the
  279. * exceptions in the TrueType interpreter when running with ClearType.
  280. * Any issues on widths would still apply, though.
  281. *
  282. */
  283. /**************************************************************************
  284. *
  285. * @section:
  286. * ot_svg_driver
  287. *
  288. * @title:
  289. * The SVG driver
  290. *
  291. * @abstract:
  292. * Controlling the external rendering of OT-SVG glyphs.
  293. *
  294. * @description:
  295. * By default, FreeType can only load the 'SVG~' table of OpenType fonts
  296. * if configuration macro `FT_CONFIG_OPTION_SVG` is defined. To make it
  297. * render SVG glyphs, an external SVG rendering library is needed. All
  298. * details on the interface between FreeType and the external library
  299. * via function hooks can be found in section @svg_fonts.
  300. *
  301. * The OT-SVG driver's module name is 'ot-svg'; it supports a single
  302. * property called @svg-hooks, documented below in the @properties
  303. * section.
  304. *
  305. */
  306. /**************************************************************************
  307. *
  308. * @section:
  309. * properties
  310. *
  311. * @title:
  312. * Driver properties
  313. *
  314. * @abstract:
  315. * Controlling driver modules.
  316. *
  317. * @description:
  318. * Driver modules can be controlled by setting and unsetting properties,
  319. * using the functions @FT_Property_Set and @FT_Property_Get. This
  320. * section documents the available properties, together with auxiliary
  321. * macros and structures.
  322. *
  323. */
  324. /**************************************************************************
  325. *
  326. * @enum:
  327. * FT_HINTING_XXX
  328. *
  329. * @description:
  330. * A list of constants used for the @hinting-engine property to select
  331. * the hinting engine for CFF, Type~1, and CID fonts.
  332. *
  333. * @values:
  334. * FT_HINTING_FREETYPE ::
  335. * Use the old FreeType hinting engine.
  336. *
  337. * FT_HINTING_ADOBE ::
  338. * Use the hinting engine contributed by Adobe.
  339. *
  340. * @since:
  341. * 2.9
  342. *
  343. */
  344. #define FT_HINTING_FREETYPE 0
  345. #define FT_HINTING_ADOBE 1
  346. /* these constants (introduced in 2.4.12) are deprecated */
  347. #define FT_CFF_HINTING_FREETYPE FT_HINTING_FREETYPE
  348. #define FT_CFF_HINTING_ADOBE FT_HINTING_ADOBE
  349. /**************************************************************************
  350. *
  351. * @property:
  352. * hinting-engine
  353. *
  354. * @description:
  355. * Thanks to Adobe, which contributed a new hinting (and parsing) engine,
  356. * an application can select between 'freetype' and 'adobe' if compiled
  357. * with `CFF_CONFIG_OPTION_OLD_ENGINE`. If this configuration macro
  358. * isn't defined, 'hinting-engine' does nothing.
  359. *
  360. * The same holds for the Type~1 and CID modules if compiled with
  361. * `T1_CONFIG_OPTION_OLD_ENGINE`.
  362. *
  363. * For the 'cff' module, the default engine is 'adobe'. For both the
  364. * 'type1' and 't1cid' modules, the default engine is 'adobe', too.
  365. *
  366. * @note:
  367. * This property can be used with @FT_Property_Get also.
  368. *
  369. * This property can be set via the `FREETYPE_PROPERTIES` environment
  370. * variable (using values 'adobe' or 'freetype').
  371. *
  372. * @example:
  373. * The following example code demonstrates how to select Adobe's hinting
  374. * engine for the 'cff' module (omitting the error handling).
  375. *
  376. * ```
  377. * FT_Library library;
  378. * FT_UInt hinting_engine = FT_HINTING_ADOBE;
  379. *
  380. *
  381. * FT_Init_FreeType( &library );
  382. *
  383. * FT_Property_Set( library, "cff",
  384. * "hinting-engine", &hinting_engine );
  385. * ```
  386. *
  387. * @since:
  388. * 2.4.12 (for 'cff' module)
  389. *
  390. * 2.9 (for 'type1' and 't1cid' modules)
  391. *
  392. */
  393. /**************************************************************************
  394. *
  395. * @property:
  396. * no-stem-darkening
  397. *
  398. * @description:
  399. * All glyphs that pass through the auto-hinter will be emboldened unless
  400. * this property is set to TRUE. The same is true for the CFF, Type~1,
  401. * and CID font modules if the 'Adobe' engine is selected (which is the
  402. * default).
  403. *
  404. * Stem darkening emboldens glyphs at smaller sizes to make them more
  405. * readable on common low-DPI screens when using linear alpha blending
  406. * and gamma correction, see @FT_Render_Glyph. When not using linear
  407. * alpha blending and gamma correction, glyphs will appear heavy and
  408. * fuzzy!
  409. *
  410. * Gamma correction essentially lightens fonts since shades of grey are
  411. * shifted to higher pixel values (=~higher brightness) to match the
  412. * original intention to the reality of our screens. The side-effect is
  413. * that glyphs 'thin out'. Mac OS~X and Adobe's proprietary font
  414. * rendering library implement a counter-measure: stem darkening at
  415. * smaller sizes where shades of gray dominate. By emboldening a glyph
  416. * slightly in relation to its pixel size, individual pixels get higher
  417. * coverage of filled-in outlines and are therefore 'blacker'. This
  418. * counteracts the 'thinning out' of glyphs, making text remain readable
  419. * at smaller sizes.
  420. *
  421. * For the auto-hinter, stem-darkening is experimental currently and thus
  422. * switched off by default (this is, `no-stem-darkening` is set to TRUE
  423. * by default). Total consistency with the CFF driver is not achieved
  424. * right now because the emboldening method differs and glyphs must be
  425. * scaled down on the Y-axis to keep outline points inside their
  426. * precomputed blue zones. The smaller the size (especially 9ppem and
  427. * down), the higher the loss of emboldening versus the CFF driver.
  428. *
  429. * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
  430. *
  431. * @note:
  432. * This property can be used with @FT_Property_Get also.
  433. *
  434. * This property can be set via the `FREETYPE_PROPERTIES` environment
  435. * variable (using values 1 and 0 for 'on' and 'off', respectively). It
  436. * can also be set per face using @FT_Face_Properties with
  437. * @FT_PARAM_TAG_STEM_DARKENING.
  438. *
  439. * @example:
  440. * ```
  441. * FT_Library library;
  442. * FT_Bool no_stem_darkening = TRUE;
  443. *
  444. *
  445. * FT_Init_FreeType( &library );
  446. *
  447. * FT_Property_Set( library, "cff",
  448. * "no-stem-darkening", &no_stem_darkening );
  449. * ```
  450. *
  451. * @since:
  452. * 2.4.12 (for 'cff' module)
  453. *
  454. * 2.6.2 (for 'autofitter' module)
  455. *
  456. * 2.9 (for 'type1' and 't1cid' modules)
  457. *
  458. */
  459. /**************************************************************************
  460. *
  461. * @property:
  462. * darkening-parameters
  463. *
  464. * @description:
  465. * By default, the Adobe hinting engine, as used by the CFF, Type~1, and
  466. * CID font drivers, darkens stems as follows (if the `no-stem-darkening`
  467. * property isn't set):
  468. *
  469. * ```
  470. * stem width <= 0.5px: darkening amount = 0.4px
  471. * stem width = 1px: darkening amount = 0.275px
  472. * stem width = 1.667px: darkening amount = 0.275px
  473. * stem width >= 2.333px: darkening amount = 0px
  474. * ```
  475. *
  476. * and piecewise linear in-between. At configuration time, these four
  477. * control points can be set with the macro
  478. * `CFF_CONFIG_OPTION_DARKENING_PARAMETERS`; the CFF, Type~1, and CID
  479. * drivers share these values. At runtime, the control points can be
  480. * changed using the `darkening-parameters` property (see the example
  481. * below that demonstrates this for the Type~1 driver).
  482. *
  483. * The x~values give the stem width, and the y~values the darkening
  484. * amount. The unit is 1000th of pixels. All coordinate values must be
  485. * positive; the x~values must be monotonically increasing; the y~values
  486. * must be monotonically decreasing and smaller than or equal to 500
  487. * (corresponding to half a pixel); the slope of each linear piece must
  488. * be shallower than -1 (e.g., -.4).
  489. *
  490. * The auto-hinter provides this property, too, as an experimental
  491. * feature. See @no-stem-darkening for more.
  492. *
  493. * @note:
  494. * This property can be used with @FT_Property_Get also.
  495. *
  496. * This property can be set via the `FREETYPE_PROPERTIES` environment
  497. * variable, using eight comma-separated integers without spaces. Here
  498. * the above example, using `\` to break the line for readability.
  499. *
  500. * ```
  501. * FREETYPE_PROPERTIES=\
  502. * type1:darkening-parameters=500,300,1000,200,1500,100,2000,0
  503. * ```
  504. *
  505. * @example:
  506. * ```
  507. * FT_Library library;
  508. * FT_Int darken_params[8] = { 500, 300, // x1, y1
  509. * 1000, 200, // x2, y2
  510. * 1500, 100, // x3, y3
  511. * 2000, 0 }; // x4, y4
  512. *
  513. *
  514. * FT_Init_FreeType( &library );
  515. *
  516. * FT_Property_Set( library, "type1",
  517. * "darkening-parameters", darken_params );
  518. * ```
  519. *
  520. * @since:
  521. * 2.5.1 (for 'cff' module)
  522. *
  523. * 2.6.2 (for 'autofitter' module)
  524. *
  525. * 2.9 (for 'type1' and 't1cid' modules)
  526. *
  527. */
  528. /**************************************************************************
  529. *
  530. * @property:
  531. * random-seed
  532. *
  533. * @description:
  534. * By default, the seed value for the CFF 'random' operator and the
  535. * similar '0 28 callothersubr pop' command for the Type~1 and CID
  536. * drivers is set to a random value. However, mainly for debugging
  537. * purposes, it is often necessary to use a known value as a seed so that
  538. * the pseudo-random number sequences generated by 'random' are
  539. * repeatable.
  540. *
  541. * The `random-seed` property does that. Its argument is a signed 32bit
  542. * integer; if the value is zero or negative, the seed given by the
  543. * `intitialRandomSeed` private DICT operator in a CFF file gets used (or
  544. * a default value if there is no such operator). If the value is
  545. * positive, use it instead of `initialRandomSeed`, which is consequently
  546. * ignored.
  547. *
  548. * @note:
  549. * This property can be set via the `FREETYPE_PROPERTIES` environment
  550. * variable. It can also be set per face using @FT_Face_Properties with
  551. * @FT_PARAM_TAG_RANDOM_SEED.
  552. *
  553. * @since:
  554. * 2.8 (for 'cff' module)
  555. *
  556. * 2.9 (for 'type1' and 't1cid' modules)
  557. *
  558. */
  559. /**************************************************************************
  560. *
  561. * @property:
  562. * no-long-family-names
  563. *
  564. * @description:
  565. * If `PCF_CONFIG_OPTION_LONG_FAMILY_NAMES` is active while compiling
  566. * FreeType, the PCF driver constructs long family names.
  567. *
  568. * There are many PCF fonts just called 'Fixed' which look completely
  569. * different, and which have nothing to do with each other. When
  570. * selecting 'Fixed' in KDE or Gnome one gets results that appear rather
  571. * random, the style changes often if one changes the size and one cannot
  572. * select some fonts at all. The improve this situation, the PCF module
  573. * prepends the foundry name (plus a space) to the family name. It also
  574. * checks whether there are 'wide' characters; all put together, family
  575. * names like 'Sony Fixed' or 'Misc Fixed Wide' are constructed.
  576. *
  577. * If `no-long-family-names` is set, this feature gets switched off.
  578. *
  579. * @note:
  580. * This property can be used with @FT_Property_Get also.
  581. *
  582. * This property can be set via the `FREETYPE_PROPERTIES` environment
  583. * variable (using values 1 and 0 for 'on' and 'off', respectively).
  584. *
  585. * @example:
  586. * ```
  587. * FT_Library library;
  588. * FT_Bool no_long_family_names = TRUE;
  589. *
  590. *
  591. * FT_Init_FreeType( &library );
  592. *
  593. * FT_Property_Set( library, "pcf",
  594. * "no-long-family-names",
  595. * &no_long_family_names );
  596. * ```
  597. *
  598. * @since:
  599. * 2.8
  600. */
  601. /**************************************************************************
  602. *
  603. * @enum:
  604. * TT_INTERPRETER_VERSION_XXX
  605. *
  606. * @description:
  607. * A list of constants used for the @interpreter-version property to
  608. * select the hinting engine for Truetype fonts.
  609. *
  610. * The numeric value in the constant names represents the version number
  611. * as returned by the 'GETINFO' bytecode instruction.
  612. *
  613. * @values:
  614. * TT_INTERPRETER_VERSION_35 ::
  615. * Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
  616. * Windows~98; only grayscale and B/W rasterizing is supported.
  617. *
  618. * TT_INTERPRETER_VERSION_38 ::
  619. * Version~38 corresponds to MS rasterizer v.1.9; it is roughly
  620. * equivalent to the hinting provided by DirectWrite ClearType (as can
  621. * be found, for example, in the Internet Explorer~9 running on
  622. * Windows~7). It is used in FreeType to select the 'Infinality'
  623. * subpixel hinting code. The code may be removed in a future version.
  624. *
  625. * TT_INTERPRETER_VERSION_40 ::
  626. * Version~40 corresponds to MS rasterizer v.2.1; it is roughly
  627. * equivalent to the hinting provided by DirectWrite ClearType (as can
  628. * be found, for example, in Microsoft's Edge Browser on Windows~10).
  629. * It is used in FreeType to select the 'minimal' subpixel hinting
  630. * code, a stripped-down and higher performance version of the
  631. * 'Infinality' code.
  632. *
  633. * @note:
  634. * This property controls the behaviour of the bytecode interpreter and
  635. * thus how outlines get hinted. It does **not** control how glyph get
  636. * rasterized! In particular, it does not control subpixel color
  637. * filtering.
  638. *
  639. * If FreeType has not been compiled with the configuration option
  640. * `TT_CONFIG_OPTION_SUBPIXEL_HINTING`, selecting version~38 or~40 causes
  641. * an `FT_Err_Unimplemented_Feature` error.
  642. *
  643. * Depending on the graphics framework, Microsoft uses different bytecode
  644. * and rendering engines. As a consequence, the version numbers returned
  645. * by a call to the 'GETINFO' bytecode instruction are more convoluted
  646. * than desired.
  647. *
  648. * Here are two tables that try to shed some light on the possible values
  649. * for the MS rasterizer engine, together with the additional features
  650. * introduced by it.
  651. *
  652. * ```
  653. * GETINFO framework version feature
  654. * -------------------------------------------------------------------
  655. * 3 GDI (Win 3.1), v1.0 16-bit, first version
  656. * TrueImage
  657. * 33 GDI (Win NT 3.1), v1.5 32-bit
  658. * HP Laserjet
  659. * 34 GDI (Win 95) v1.6 font smoothing,
  660. * new SCANTYPE opcode
  661. * 35 GDI (Win 98/2000) v1.7 (UN)SCALED_COMPONENT_OFFSET
  662. * bits in composite glyphs
  663. * 36 MGDI (Win CE 2) v1.6+ classic ClearType
  664. * 37 GDI (XP and later), v1.8 ClearType
  665. * GDI+ old (before Vista)
  666. * 38 GDI+ old (Vista, Win 7), v1.9 subpixel ClearType,
  667. * WPF Y-direction ClearType,
  668. * additional error checking
  669. * 39 DWrite (before Win 8) v2.0 subpixel ClearType flags
  670. * in GETINFO opcode,
  671. * bug fixes
  672. * 40 GDI+ (after Win 7), v2.1 Y-direction ClearType flag
  673. * DWrite (Win 8) in GETINFO opcode,
  674. * Gray ClearType
  675. * ```
  676. *
  677. * The 'version' field gives a rough orientation only, since some
  678. * applications provided certain features much earlier (as an example,
  679. * Microsoft Reader used subpixel and Y-direction ClearType already in
  680. * Windows 2000). Similarly, updates to a given framework might include
  681. * improved hinting support.
  682. *
  683. * ```
  684. * version sampling rendering comment
  685. * x y x y
  686. * --------------------------------------------------------------
  687. * v1.0 normal normal B/W B/W bi-level
  688. * v1.6 high high gray gray grayscale
  689. * v1.8 high normal color-filter B/W (GDI) ClearType
  690. * v1.9 high high color-filter gray Color ClearType
  691. * v2.1 high normal gray B/W Gray ClearType
  692. * v2.1 high high gray gray Gray ClearType
  693. * ```
  694. *
  695. * Color and Gray ClearType are the two available variants of
  696. * 'Y-direction ClearType', meaning grayscale rasterization along the
  697. * Y-direction; the name used in the TrueType specification for this
  698. * feature is 'symmetric smoothing'. 'Classic ClearType' is the original
  699. * algorithm used before introducing a modified version in Win~XP.
  700. * Another name for v1.6's grayscale rendering is 'font smoothing', and
  701. * 'Color ClearType' is sometimes also called 'DWrite ClearType'. To
  702. * differentiate between today's Color ClearType and the earlier
  703. * ClearType variant with B/W rendering along the vertical axis, the
  704. * latter is sometimes called 'GDI ClearType'.
  705. *
  706. * 'Normal' and 'high' sampling describe the (virtual) resolution to
  707. * access the rasterized outline after the hinting process. 'Normal'
  708. * means 1 sample per grid line (i.e., B/W). In the current Microsoft
  709. * implementation, 'high' means an extra virtual resolution of 16x16 (or
  710. * 16x1) grid lines per pixel for bytecode instructions like 'MIRP'.
  711. * After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid
  712. * lines for color filtering if Color ClearType is activated.
  713. *
  714. * Note that 'Gray ClearType' is essentially the same as v1.6's grayscale
  715. * rendering. However, the GETINFO instruction handles it differently:
  716. * v1.6 returns bit~12 (hinting for grayscale), while v2.1 returns
  717. * bits~13 (hinting for ClearType), 18 (symmetrical smoothing), and~19
  718. * (Gray ClearType). Also, this mode respects bits 2 and~3 for the
  719. * version~1 gasp table exclusively (like Color ClearType), while v1.6
  720. * only respects the values of version~0 (bits 0 and~1).
  721. *
  722. * Keep in mind that the features of the above interpreter versions might
  723. * not map exactly to FreeType features or behavior because it is a
  724. * fundamentally different library with different internals.
  725. *
  726. */
  727. #define TT_INTERPRETER_VERSION_35 35
  728. #define TT_INTERPRETER_VERSION_38 38
  729. #define TT_INTERPRETER_VERSION_40 40
  730. /**************************************************************************
  731. *
  732. * @property:
  733. * interpreter-version
  734. *
  735. * @description:
  736. * Currently, three versions are available, two representing the bytecode
  737. * interpreter with subpixel hinting support (old 'Infinality' code and
  738. * new stripped-down and higher performance 'minimal' code) and one
  739. * without, respectively. The default is subpixel support if
  740. * `TT_CONFIG_OPTION_SUBPIXEL_HINTING` is defined, and no subpixel
  741. * support otherwise (since it isn't available then).
  742. *
  743. * If subpixel hinting is on, many TrueType bytecode instructions behave
  744. * differently compared to B/W or grayscale rendering (except if 'native
  745. * ClearType' is selected by the font). Microsoft's main idea is to
  746. * render at a much increased horizontal resolution, then sampling down
  747. * the created output to subpixel precision. However, many older fonts
  748. * are not suited to this and must be specially taken care of by applying
  749. * (hardcoded) tweaks in Microsoft's interpreter.
  750. *
  751. * Details on subpixel hinting and some of the necessary tweaks can be
  752. * found in Greg Hitchcock's whitepaper at
  753. * 'https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
  754. * Note that FreeType currently doesn't really 'subpixel hint' (6x1, 6x2,
  755. * or 6x5 supersampling) like discussed in the paper. Depending on the
  756. * chosen interpreter, it simply ignores instructions on vertical stems
  757. * to arrive at very similar results.
  758. *
  759. * @note:
  760. * This property can be used with @FT_Property_Get also.
  761. *
  762. * This property can be set via the `FREETYPE_PROPERTIES` environment
  763. * variable (using values '35', '38', or '40').
  764. *
  765. * @example:
  766. * The following example code demonstrates how to deactivate subpixel
  767. * hinting (omitting the error handling).
  768. *
  769. * ```
  770. * FT_Library library;
  771. * FT_Face face;
  772. * FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35;
  773. *
  774. *
  775. * FT_Init_FreeType( &library );
  776. *
  777. * FT_Property_Set( library, "truetype",
  778. * "interpreter-version",
  779. * &interpreter_version );
  780. * ```
  781. *
  782. * @since:
  783. * 2.5
  784. */
  785. /**************************************************************************
  786. *
  787. * @property:
  788. * svg-hooks
  789. *
  790. * @description:
  791. * Set up the interface between FreeType and an extern SVG rendering
  792. * library like 'librsvg'. All details on the function hooks can be
  793. * found in section @svg_fonts.
  794. *
  795. * @example:
  796. * The following example code expects that the four hook functions
  797. * `svg_*` are defined elsewhere. Error handling is omitted, too.
  798. *
  799. * ```
  800. * FT_Library library;
  801. * SVG_RendererHooks hooks = {
  802. * (SVG_Lib_Init_Func)svg_init,
  803. * (SVG_Lib_Free_Func)svg_free,
  804. * (SVG_Lib_Render_Func)svg_render,
  805. * (SVG_Lib_Preset_Slot_Func)svg_preset_slot };
  806. *
  807. *
  808. * FT_Init_FreeType( &library );
  809. *
  810. * FT_Property_Set( library, "ot-svg",
  811. * "svg-hooks", &hooks );
  812. * ```
  813. *
  814. * @since:
  815. * 2.12
  816. */
  817. /**************************************************************************
  818. *
  819. * @property:
  820. * glyph-to-script-map
  821. *
  822. * @description:
  823. * **Experimental only**
  824. *
  825. * The auto-hinter provides various script modules to hint glyphs.
  826. * Examples of supported scripts are Latin or CJK. Before a glyph is
  827. * auto-hinted, the Unicode character map of the font gets examined, and
  828. * the script is then determined based on Unicode character ranges, see
  829. * below.
  830. *
  831. * OpenType fonts, however, often provide much more glyphs than character
  832. * codes (small caps, superscripts, ligatures, swashes, etc.), to be
  833. * controlled by so-called 'features'. Handling OpenType features can be
  834. * quite complicated and thus needs a separate library on top of
  835. * FreeType.
  836. *
  837. * The mapping between glyph indices and scripts (in the auto-hinter
  838. * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an array
  839. * with `num_glyphs` elements, as found in the font's @FT_Face structure.
  840. * The `glyph-to-script-map` property returns a pointer to this array,
  841. * which can be modified as needed. Note that the modification should
  842. * happen before the first glyph gets processed by the auto-hinter so
  843. * that the global analysis of the font shapes actually uses the modified
  844. * mapping.
  845. *
  846. * @example:
  847. * The following example code demonstrates how to access it (omitting the
  848. * error handling).
  849. *
  850. * ```
  851. * FT_Library library;
  852. * FT_Face face;
  853. * FT_Prop_GlyphToScriptMap prop;
  854. *
  855. *
  856. * FT_Init_FreeType( &library );
  857. * FT_New_Face( library, "foo.ttf", 0, &face );
  858. *
  859. * prop.face = face;
  860. *
  861. * FT_Property_Get( library, "autofitter",
  862. * "glyph-to-script-map", &prop );
  863. *
  864. * // adjust `prop.map' as needed right here
  865. *
  866. * FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
  867. * ```
  868. *
  869. * @since:
  870. * 2.4.11
  871. *
  872. */
  873. /**************************************************************************
  874. *
  875. * @enum:
  876. * FT_AUTOHINTER_SCRIPT_XXX
  877. *
  878. * @description:
  879. * **Experimental only**
  880. *
  881. * A list of constants used for the @glyph-to-script-map property to
  882. * specify the script submodule the auto-hinter should use for hinting a
  883. * particular glyph.
  884. *
  885. * @values:
  886. * FT_AUTOHINTER_SCRIPT_NONE ::
  887. * Don't auto-hint this glyph.
  888. *
  889. * FT_AUTOHINTER_SCRIPT_LATIN ::
  890. * Apply the latin auto-hinter. For the auto-hinter, 'latin' is a very
  891. * broad term, including Cyrillic and Greek also since characters from
  892. * those scripts share the same design constraints.
  893. *
  894. * By default, characters from the following Unicode ranges are
  895. * assigned to this submodule.
  896. *
  897. * ```
  898. * U+0020 - U+007F // Basic Latin (no control characters)
  899. * U+00A0 - U+00FF // Latin-1 Supplement (no control characters)
  900. * U+0100 - U+017F // Latin Extended-A
  901. * U+0180 - U+024F // Latin Extended-B
  902. * U+0250 - U+02AF // IPA Extensions
  903. * U+02B0 - U+02FF // Spacing Modifier Letters
  904. * U+0300 - U+036F // Combining Diacritical Marks
  905. * U+0370 - U+03FF // Greek and Coptic
  906. * U+0400 - U+04FF // Cyrillic
  907. * U+0500 - U+052F // Cyrillic Supplement
  908. * U+1D00 - U+1D7F // Phonetic Extensions
  909. * U+1D80 - U+1DBF // Phonetic Extensions Supplement
  910. * U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement
  911. * U+1E00 - U+1EFF // Latin Extended Additional
  912. * U+1F00 - U+1FFF // Greek Extended
  913. * U+2000 - U+206F // General Punctuation
  914. * U+2070 - U+209F // Superscripts and Subscripts
  915. * U+20A0 - U+20CF // Currency Symbols
  916. * U+2150 - U+218F // Number Forms
  917. * U+2460 - U+24FF // Enclosed Alphanumerics
  918. * U+2C60 - U+2C7F // Latin Extended-C
  919. * U+2DE0 - U+2DFF // Cyrillic Extended-A
  920. * U+2E00 - U+2E7F // Supplemental Punctuation
  921. * U+A640 - U+A69F // Cyrillic Extended-B
  922. * U+A720 - U+A7FF // Latin Extended-D
  923. * U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures)
  924. * U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
  925. * U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
  926. * ```
  927. *
  928. * FT_AUTOHINTER_SCRIPT_CJK ::
  929. * Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
  930. * Vietnamese, and some other scripts.
  931. *
  932. * By default, characters from the following Unicode ranges are
  933. * assigned to this submodule.
  934. *
  935. * ```
  936. * U+1100 - U+11FF // Hangul Jamo
  937. * U+2E80 - U+2EFF // CJK Radicals Supplement
  938. * U+2F00 - U+2FDF // Kangxi Radicals
  939. * U+2FF0 - U+2FFF // Ideographic Description Characters
  940. * U+3000 - U+303F // CJK Symbols and Punctuation
  941. * U+3040 - U+309F // Hiragana
  942. * U+30A0 - U+30FF // Katakana
  943. * U+3100 - U+312F // Bopomofo
  944. * U+3130 - U+318F // Hangul Compatibility Jamo
  945. * U+3190 - U+319F // Kanbun
  946. * U+31A0 - U+31BF // Bopomofo Extended
  947. * U+31C0 - U+31EF // CJK Strokes
  948. * U+31F0 - U+31FF // Katakana Phonetic Extensions
  949. * U+3200 - U+32FF // Enclosed CJK Letters and Months
  950. * U+3300 - U+33FF // CJK Compatibility
  951. * U+3400 - U+4DBF // CJK Unified Ideographs Extension A
  952. * U+4DC0 - U+4DFF // Yijing Hexagram Symbols
  953. * U+4E00 - U+9FFF // CJK Unified Ideographs
  954. * U+A960 - U+A97F // Hangul Jamo Extended-A
  955. * U+AC00 - U+D7AF // Hangul Syllables
  956. * U+D7B0 - U+D7FF // Hangul Jamo Extended-B
  957. * U+F900 - U+FAFF // CJK Compatibility Ideographs
  958. * U+FE10 - U+FE1F // Vertical forms
  959. * U+FE30 - U+FE4F // CJK Compatibility Forms
  960. * U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms
  961. * U+1B000 - U+1B0FF // Kana Supplement
  962. * U+1D300 - U+1D35F // Tai Xuan Hing Symbols
  963. * U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
  964. * U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
  965. * U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
  966. * U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
  967. * U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
  968. * ```
  969. *
  970. * FT_AUTOHINTER_SCRIPT_INDIC ::
  971. * Apply the indic auto-hinter, covering all major scripts from the
  972. * Indian sub-continent and some other related scripts like Thai, Lao,
  973. * or Tibetan.
  974. *
  975. * By default, characters from the following Unicode ranges are
  976. * assigned to this submodule.
  977. *
  978. * ```
  979. * U+0900 - U+0DFF // Indic Range
  980. * U+0F00 - U+0FFF // Tibetan
  981. * U+1900 - U+194F // Limbu
  982. * U+1B80 - U+1BBF // Sundanese
  983. * U+A800 - U+A82F // Syloti Nagri
  984. * U+ABC0 - U+ABFF // Meetei Mayek
  985. * U+11800 - U+118DF // Sharada
  986. * ```
  987. *
  988. * Note that currently Indic support is rudimentary only, missing blue
  989. * zone support.
  990. *
  991. * @since:
  992. * 2.4.11
  993. *
  994. */
  995. #define FT_AUTOHINTER_SCRIPT_NONE 0
  996. #define FT_AUTOHINTER_SCRIPT_LATIN 1
  997. #define FT_AUTOHINTER_SCRIPT_CJK 2
  998. #define FT_AUTOHINTER_SCRIPT_INDIC 3
  999. /**************************************************************************
  1000. *
  1001. * @struct:
  1002. * FT_Prop_GlyphToScriptMap
  1003. *
  1004. * @description:
  1005. * **Experimental only**
  1006. *
  1007. * The data exchange structure for the @glyph-to-script-map property.
  1008. *
  1009. * @since:
  1010. * 2.4.11
  1011. *
  1012. */
  1013. typedef struct FT_Prop_GlyphToScriptMap_
  1014. {
  1015. FT_Face face;
  1016. FT_UShort* map;
  1017. } FT_Prop_GlyphToScriptMap;
  1018. /**************************************************************************
  1019. *
  1020. * @property:
  1021. * fallback-script
  1022. *
  1023. * @description:
  1024. * **Experimental only**
  1025. *
  1026. * If no auto-hinter script module can be assigned to a glyph, a fallback
  1027. * script gets assigned to it (see also the @glyph-to-script-map
  1028. * property). By default, this is @FT_AUTOHINTER_SCRIPT_CJK. Using the
  1029. * `fallback-script` property, this fallback value can be changed.
  1030. *
  1031. * @note:
  1032. * This property can be used with @FT_Property_Get also.
  1033. *
  1034. * It's important to use the right timing for changing this value: The
  1035. * creation of the glyph-to-script map that eventually uses the fallback
  1036. * script value gets triggered either by setting or reading a
  1037. * face-specific property like @glyph-to-script-map, or by auto-hinting
  1038. * any glyph from that face. In particular, if you have already created
  1039. * an @FT_Face structure but not loaded any glyph (using the
  1040. * auto-hinter), a change of the fallback script will affect this face.
  1041. *
  1042. * @example:
  1043. * ```
  1044. * FT_Library library;
  1045. * FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
  1046. *
  1047. *
  1048. * FT_Init_FreeType( &library );
  1049. *
  1050. * FT_Property_Set( library, "autofitter",
  1051. * "fallback-script", &fallback_script );
  1052. * ```
  1053. *
  1054. * @since:
  1055. * 2.4.11
  1056. *
  1057. */
  1058. /**************************************************************************
  1059. *
  1060. * @property:
  1061. * default-script
  1062. *
  1063. * @description:
  1064. * **Experimental only**
  1065. *
  1066. * If FreeType gets compiled with `FT_CONFIG_OPTION_USE_HARFBUZZ` to make
  1067. * the HarfBuzz library access OpenType features for getting better glyph
  1068. * coverages, this property sets the (auto-fitter) script to be used for
  1069. * the default (OpenType) script data of a font's GSUB table. Features
  1070. * for the default script are intended for all scripts not explicitly
  1071. * handled in GSUB; an example is a 'dlig' feature, containing the
  1072. * combination of the characters 'T', 'E', and 'L' to form a 'TEL'
  1073. * ligature.
  1074. *
  1075. * By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the
  1076. * `default-script` property, this default value can be changed.
  1077. *
  1078. * @note:
  1079. * This property can be used with @FT_Property_Get also.
  1080. *
  1081. * It's important to use the right timing for changing this value: The
  1082. * creation of the glyph-to-script map that eventually uses the default
  1083. * script value gets triggered either by setting or reading a
  1084. * face-specific property like @glyph-to-script-map, or by auto-hinting
  1085. * any glyph from that face. In particular, if you have already created
  1086. * an @FT_Face structure but not loaded any glyph (using the
  1087. * auto-hinter), a change of the default script will affect this face.
  1088. *
  1089. * @example:
  1090. * ```
  1091. * FT_Library library;
  1092. * FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE;
  1093. *
  1094. *
  1095. * FT_Init_FreeType( &library );
  1096. *
  1097. * FT_Property_Set( library, "autofitter",
  1098. * "default-script", &default_script );
  1099. * ```
  1100. *
  1101. * @since:
  1102. * 2.5.3
  1103. *
  1104. */
  1105. /**************************************************************************
  1106. *
  1107. * @property:
  1108. * increase-x-height
  1109. *
  1110. * @description:
  1111. * For ppem values in the range 6~<= ppem <= `increase-x-height`, round
  1112. * up the font's x~height much more often than normally. If the value is
  1113. * set to~0, which is the default, this feature is switched off. Use
  1114. * this property to improve the legibility of small font sizes if
  1115. * necessary.
  1116. *
  1117. * @note:
  1118. * This property can be used with @FT_Property_Get also.
  1119. *
  1120. * Set this value right after calling @FT_Set_Char_Size, but before
  1121. * loading any glyph (using the auto-hinter).
  1122. *
  1123. * @example:
  1124. * ```
  1125. * FT_Library library;
  1126. * FT_Face face;
  1127. * FT_Prop_IncreaseXHeight prop;
  1128. *
  1129. *
  1130. * FT_Init_FreeType( &library );
  1131. * FT_New_Face( library, "foo.ttf", 0, &face );
  1132. * FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
  1133. *
  1134. * prop.face = face;
  1135. * prop.limit = 14;
  1136. *
  1137. * FT_Property_Set( library, "autofitter",
  1138. * "increase-x-height", &prop );
  1139. * ```
  1140. *
  1141. * @since:
  1142. * 2.4.11
  1143. *
  1144. */
  1145. /**************************************************************************
  1146. *
  1147. * @struct:
  1148. * FT_Prop_IncreaseXHeight
  1149. *
  1150. * @description:
  1151. * The data exchange structure for the @increase-x-height property.
  1152. *
  1153. */
  1154. typedef struct FT_Prop_IncreaseXHeight_
  1155. {
  1156. FT_Face face;
  1157. FT_UInt limit;
  1158. } FT_Prop_IncreaseXHeight;
  1159. /**************************************************************************
  1160. *
  1161. * @property:
  1162. * warping
  1163. *
  1164. * @description:
  1165. * **Obsolete**
  1166. *
  1167. * This property was always experimental and probably never worked
  1168. * correctly. It was entirely removed from the FreeType~2 sources. This
  1169. * entry is only here for historical reference.
  1170. *
  1171. * Warping only worked in 'normal' auto-hinting mode replacing it. The
  1172. * idea of the code was to slightly scale and shift a glyph along the
  1173. * non-hinted dimension (which is usually the horizontal axis) so that as
  1174. * much of its segments were aligned (more or less) to the grid. To find
  1175. * out a glyph's optimal scaling and shifting value, various parameter
  1176. * combinations were tried and scored.
  1177. *
  1178. * @since:
  1179. * 2.6
  1180. *
  1181. */
  1182. /* */
  1183. FT_END_HEADER
  1184. #endif /* FTDRIVER_H_ */
  1185. /* END */