OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* ftautoh.h */ | 3 /* ftautoh.h */ |
4 /* */ | 4 /* */ |
5 /* FreeType API for controlling the auto-hinter (specification only). */ | 5 /* FreeType API for controlling the auto-hinter (specification only). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 2012, 2013 by */ | 7 /* Copyright 2012, 2013 by */ |
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 /* */ | 9 /* */ |
10 /* This file is part of the FreeType project, and may only be used, */ | 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 */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
15 /* */ | 15 /* */ |
16 /***************************************************************************/ | 16 /***************************************************************************/ |
17 | 17 |
18 | 18 |
19 #ifndef __FTAUTOH_H__ | 19 #ifndef __FTAUTOH_H__ |
20 #define __FTAUTOH_H__ | 20 #define __FTAUTOH_H__ |
21 | 21 |
22 #include "../ft2build.h" | 22 #include <ft2build.h> |
23 #include "freetype.h" | 23 #include FT_FREETYPE_H |
24 | 24 |
25 #ifdef FREETYPE_H | 25 #ifdef FREETYPE_H |
26 #error "freetype.h of FreeType 1 has been loaded!" | 26 #error "freetype.h of FreeType 1 has been loaded!" |
27 #error "Please fix the directory search order for header files" | 27 #error "Please fix the directory search order for header files" |
28 #error "so that freetype.h of FreeType 2 is found first." | 28 #error "so that freetype.h of FreeType 2 is found first." |
29 #endif | 29 #endif |
30 | 30 |
31 | 31 |
32 FT_BEGIN_HEADER | 32 FT_BEGIN_HEADER |
33 | 33 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 * OpenType fonts, however, often provide much more glyphs than | 72 * OpenType fonts, however, often provide much more glyphs than |
73 * character codes (small caps, superscripts, ligatures, swashes, etc.), | 73 * character codes (small caps, superscripts, ligatures, swashes, etc.), |
74 * to be controlled by so-called `features'. Handling OpenType features | 74 * to be controlled by so-called `features'. Handling OpenType features |
75 * can be quite complicated and thus needs a separate library on top of | 75 * can be quite complicated and thus needs a separate library on top of |
76 * FreeType. | 76 * FreeType. |
77 * | 77 * |
78 * The mapping between glyph indices and scripts (in the auto-hinter | 78 * The mapping between glyph indices and scripts (in the auto-hinter |
79 * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an | 79 * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an |
80 * array with `num_glyphs' elements, as found in the font's @FT_Face | 80 * array with `num_glyphs' elements, as found in the font's @FT_Face |
81 * structure. The `glyph-to-script-map' property returns a pointer to | 81 * structure. The `glyph-to-script-map' property returns a pointer to |
82 * this array which can be modified as needed. Note that the | 82 * this array, which can be modified as needed. Note that the |
83 * modification should happen before the first glyph gets processed by | 83 * modification should happen before the first glyph gets processed by |
84 * the auto-hinter so that the global analysis of the font shapes | 84 * the auto-hinter so that the global analysis of the font shapes |
85 * actually uses the modified mapping. | 85 * actually uses the modified mapping. |
86 * | 86 * |
87 * The following example code demonstrates how to access it (omitting | 87 * The following example code demonstrates how to access it (omitting |
88 * the error handling). | 88 * the error handling). |
89 * | 89 * |
90 * { | 90 * { |
91 * FT_Library library; | 91 * FT_Library library; |
92 * FT_Face face; | 92 * FT_Face face; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 * | 238 * |
239 * @struct: | 239 * @struct: |
240 * FT_Prop_GlyphToScriptMap | 240 * FT_Prop_GlyphToScriptMap |
241 * | 241 * |
242 * @description: | 242 * @description: |
243 * *Experimental* *only* | 243 * *Experimental* *only* |
244 * | 244 * |
245 * The data exchange structure for the @glyph-to-script-map property. | 245 * The data exchange structure for the @glyph-to-script-map property. |
246 * | 246 * |
247 */ | 247 */ |
248 typedef struct FT_Prop_GlyphToScriptMap_ | 248 typedef struct FT_Prop_GlyphToScriptMap_ |
249 { | 249 { |
250 FT_Face face; | 250 FT_Face face; |
251 FT_Byte* map; | 251 FT_Byte* map; |
252 | 252 |
253 } FT_Prop_GlyphToScriptMap; | 253 } FT_Prop_GlyphToScriptMap; |
254 | 254 |
255 | 255 |
256 /************************************************************************** | 256 /************************************************************************** |
257 * | 257 * |
258 * @property: | 258 * @property: |
259 * fallback-script | 259 * fallback-script |
260 * | 260 * |
261 * @description: | 261 * @description: |
262 * *Experimental* *only* | 262 * *Experimental* *only* |
263 * | 263 * |
(...skipping 11 matching lines...) Expand all Loading... |
275 * FT_Init_FreeType( &library ); | 275 * FT_Init_FreeType( &library ); |
276 * | 276 * |
277 * FT_Property_Set( library, "autofitter", | 277 * FT_Property_Set( library, "autofitter", |
278 * "fallback-script", &fallback_script ); | 278 * "fallback-script", &fallback_script ); |
279 * } | 279 * } |
280 * | 280 * |
281 * @note: | 281 * @note: |
282 * This property can be used with @FT_Property_Get also. | 282 * This property can be used with @FT_Property_Get also. |
283 * | 283 * |
284 * It's important to use the right timing for changing this value: The | 284 * It's important to use the right timing for changing this value: The |
285 * creation of the glyph-to-script map which eventually uses the | 285 * creation of the glyph-to-script map that eventually uses the |
286 * fallback script value gets triggered either by setting or reading a | 286 * fallback script value gets triggered either by setting or reading a |
287 * face-specific property like @glyph-to-script-map, or by auto-hinting | 287 * face-specific property like @glyph-to-script-map, or by auto-hinting |
288 * any glyph from that face. In particular, if you have already created | 288 * any glyph from that face. In particular, if you have already created |
289 * an @FT_Face structure but not loaded any glyph (using the | 289 * an @FT_Face structure but not loaded any glyph (using the |
290 * auto-hinter), a change of the fallback glyph will affect this face. | 290 * auto-hinter), a change of the fallback script will affect this face. |
291 * | 291 * |
292 */ | 292 */ |
293 | 293 |
| 294 |
| 295 /************************************************************************** |
| 296 * |
| 297 * @property: |
| 298 * default-script |
| 299 * |
| 300 * @description: |
| 301 * *Experimental* *only* |
| 302 * |
| 303 * If Freetype gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make |
| 304 * the HarfBuzz library access OpenType features for getting better |
| 305 * glyph coverages, this property sets the (auto-fitter) script to be |
| 306 * used for the default (OpenType) script data of a font's GSUB table. |
| 307 * Features for the default script are intended for all scripts not |
| 308 * explicitly handled in GSUB; an example is a `dlig' feature, |
| 309 * containing the combination of the characters `T', `E', and `L' to |
| 310 * form a `TEL' ligature. |
| 311 * |
| 312 * By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the |
| 313 * `default-script' property, this default value can be changed. |
| 314 * |
| 315 * { |
| 316 * FT_Library library; |
| 317 * FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE; |
| 318 * |
| 319 * |
| 320 * FT_Init_FreeType( &library ); |
| 321 * |
| 322 * FT_Property_Set( library, "autofitter", |
| 323 * "default-script", &default_script ); |
| 324 * } |
| 325 * |
| 326 * @note: |
| 327 * This property can be used with @FT_Property_Get also. |
| 328 * |
| 329 * It's important to use the right timing for changing this value: The |
| 330 * creation of the glyph-to-script map that eventually uses the |
| 331 * default script value gets triggered either by setting or reading a |
| 332 * face-specific property like @glyph-to-script-map, or by auto-hinting |
| 333 * any glyph from that face. In particular, if you have already created |
| 334 * an @FT_Face structure but not loaded any glyph (using the |
| 335 * auto-hinter), a change of the default script will affect this face. |
| 336 * |
| 337 */ |
| 338 |
294 | 339 |
295 /************************************************************************** | 340 /************************************************************************** |
296 * | 341 * |
297 * @property: | 342 * @property: |
298 * increase-x-height | 343 * increase-x-height |
299 * | 344 * |
300 * @description: | 345 * @description: |
301 * For ppem values in the range 6~<= ppem <= `increase-x-height', round | 346 * For ppem values in the range 6~<= ppem <= `increase-x-height', round |
302 * up the font's x~height much more often than normally. If the value | 347 * up the font's x~height much more often than normally. If the value |
303 * is set to~0, which is the default, this feature is switched off. Use | 348 * is set to~0, which is the default, this feature is switched off. Use |
(...skipping 28 matching lines...) Expand all Loading... |
332 | 377 |
333 /************************************************************************** | 378 /************************************************************************** |
334 * | 379 * |
335 * @struct: | 380 * @struct: |
336 * FT_Prop_IncreaseXHeight | 381 * FT_Prop_IncreaseXHeight |
337 * | 382 * |
338 * @description: | 383 * @description: |
339 * The data exchange structure for the @increase-x-height property. | 384 * The data exchange structure for the @increase-x-height property. |
340 * | 385 * |
341 */ | 386 */ |
342 typedef struct FT_Prop_IncreaseXHeight_ | 387 typedef struct FT_Prop_IncreaseXHeight_ |
343 { | 388 { |
344 FT_Face face; | 389 FT_Face face; |
345 FT_UInt limit; | 390 FT_UInt limit; |
346 | 391 |
347 } FT_Prop_IncreaseXHeight; | 392 } FT_Prop_IncreaseXHeight; |
348 | 393 |
| 394 /* */ |
349 | 395 |
350 /* */ | |
351 | 396 |
352 FT_END_HEADER | 397 FT_END_HEADER |
353 | 398 |
354 #endif /* __FTAUTOH_H__ */ | 399 #endif /* __FTAUTOH_H__ */ |
355 | 400 |
356 | 401 |
357 /* END */ | 402 /* END */ |
OLD | NEW |