/usr/include/ttfautohint.h is in libttfautohint-dev 1.8.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 | /* ttfautohint.h */
/*
* Copyright (C) 2011-2017 by Werner Lemberg.
*
* This file is part of the ttfautohint library, and may only be used,
* modified, and distributed under the terms given in `COPYING'. By
* continuing to use, modify, or distribute this file you indicate that you
* have read `COPYING' and understand and accept it fully.
*
* The file `COPYING' mentioned in the previous paragraph is distributed
* with the ttfautohint library.
*/
#ifndef TTFAUTOHINT_H_
#define TTFAUTOHINT_H_
#include <stdarg.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _WIN32
# ifdef DLL_EXPORT
# define TA_LIB_EXPORT __declspec(dllexport)
# elif defined(DLL_IMPORT)
# define TA_LIB_EXPORT __declspec(dllimport)
# endif
#endif
#ifndef TA_LIB_EXPORT
# define TA_LIB_EXPORT
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* This file gets processed with a simple sed script to extract the
* documentation (written in pandoc's markdown format); code between the
* `pandoc' markers are retained, everything else is discarded. C comments
* are uncommented so that column 4 becomes column 1; empty lines outside of
* comments are removed.
*/
/* pandoc-start */
/*
* The ttfautohint API
* ===================
*
* This section documents the public functions of the ttfautohint library
* together with its callback functions. All information has been directly
* extracted from the `ttfautohint.h` header file.
*
*/
/*
* Preprocessor Macros, Typedefs, and Enums
* ----------------------------------------
*
* Some default values.
*
* ```C
*/
#define TA_HINTING_RANGE_MIN 8
#define TA_HINTING_RANGE_MAX 50
#define TA_HINTING_LIMIT 200
#define TA_INCREASE_X_HEIGHT 14
/*
*```
*
* An error type.
*
* ```C
*/
typedef int TA_Error;
/*
*```
*
* An enum type for stem width algorithm selection.
*
* ```C
*/
enum
{
TA_STEM_WIDTH_MODE_NATURAL = -1,
TA_STEM_WIDTH_MODE_QUANTIZED = 0,
TA_STEM_WIDTH_MODE_STRONG = 1
};
/*
* ```
*
*/
/*
* Function Pointer: `TA_Alloc_Func`
* ---------------------------------
*
* A pointer to a function provided by the calling application to allocate
* memory. The ttfautohint library uses this for allocating the buffer
* given by the `out-buffer` field of
* [`TTF_autohint`](#function-ttf_autohint) and for allocating the `str`
* buffer in the [`TA_Info_Func`](#callback-ta_info_func) callback.
*
* The signature is identical to standard\ C's `malloc` function (in header
* file `stdlib.h`).
*
* ```C
*/
typedef void *
(*TA_Alloc_Func)(size_t size);
/*
* ```
*
*/
/*
* Function Pointer: `TA_Free_Func`
* --------------------------------
*
* A pointer to a function provided by the calling application to free
* memory allocated with [`TA_Alloc_Func`](#function-pointer-ta_alloc_func).
* The ttfautohint library calls this for deallocating the `str` buffers in
* the [`TA_Info_Func`](#callback-ta_info_func) callback after they have
* been used.
*
* The signature is identical to standard\ C's `free` function (in header
* file `stdlib.h`).
*
* ```C
*/
typedef void
(*TA_Free_Func)(void *ptr);
/*
* ```
*
*/
/*
* Callback: `TA_Progress_Func`
* ----------------------------
*
* A callback function to get progress information. *curr_idx* gives the
* currently processed glyph index; if it is negative, an error has
* occurred. *num_glyphs* holds the total number of glyphs in the font
* (this value can't be larger than 65535).
*
* *curr_sfnt* gives the current subfont within a TrueType Collection (TTC),
* and *num_sfnts* the total number of subfonts.
*
* If the return value is non-zero, `TTF_autohint` aborts with
* `TA_Err_Canceled`. Use this for a 'Cancel' button or similar features in
* interactive use.
*
* *progress_data* is a void pointer to user-supplied data.
*
* ```C
*/
typedef int
(*TA_Progress_Func)(long curr_idx,
long num_glyphs,
long curr_sfnt,
long num_sfnts,
void* progress_data);
/*
* ```
*
*/
/*
* Callback: `TA_Error_Func`
* -------------------------
*
* A callback function to get error information.
*
* *error* is the value `TTF_autohint` returns. See file
* `ttfautohint-errors.h` for a list. Error codes not in this list are
* directly taken from FreeType; see the FreeType header file `fterrdef.h`
* for more.
*
* *error_string*, if non-NULL, is a pointer to an error message that
* represents *error*.
*
* The next three parameters help identify the origin of text string parsing
* errors. *linenum*, if non-zero, contains the line number. *line*, if
* non-NULL, is a pointer to the input line that can't be processed.
* *errpos*, if non-NULL, holds a pointer to the position in *line* where
* the problem occurs.
*
* *error_data* is a void pointer to user-supplied data.
*
* ```C
*/
typedef void
(*TA_Error_Func)(TA_Error error,
const char* error_string,
unsigned int linenum,
const char* line,
const char* errpos,
void* error_data);
/*
* ```
*
*/
/*
* Callback: `TA_Info_Func`
* ------------------------
*
* A callback function to access or modify strings in the `name` table; it
* is called in a loop that iterates over all `name` table entries. If
* defined, [`TA_Info_Post_Func`](#callback-ta_info_post_func) gets executed
* after this loop so that the collected data can be written back to the
* `name` table.
*
* *platform_id*, *encoding_id*, *language_id*, and *name_id* are the
* identifiers of a `name` table entry pointed to by *str* with a length
* pointed to by *str_len* (in bytes; the string has no trailing NULL byte).
* Please refer to the [OpenType specification of the `name` table] for a
* detailed description of the various parameters, in particular which
* encoding is used for a given platform and encoding ID.
*
* [OpenType specification of the `name` table]: http://www.microsoft.com/typography/otspec/name.htm
*
* The string *str* is allocated with the function specified by the
* `alloc-func` field of [`TTF_autohint`](#function-ttf_autohint); the
* application should reallocate the data if necessary, ensuring that the
* string length doesn't exceed 0xFFFF.
*
* *info_data* is a void pointer to user-supplied data.
*
* If an error occurs, return a non-zero value and don't modify *str* and
* *str_len* (such errors are handled as non-fatal).
*
* ```C
*/
typedef int
(*TA_Info_Func)(unsigned short platform_id,
unsigned short encoding_id,
unsigned short language_id,
unsigned short name_id,
unsigned short* str_len,
unsigned char** str,
void* info_data);
/*
* ```
*
*/
/*
* Callback: `TA_Info_Post_Func`
* -----------------------------
*
* A callback function, giving the application the possibility to access or
* modify strings in the `name` table after
* [`TA_Info_Func`](#callback-ta_info_func) has iterated over all `name`
* table entries.
*
* It is expected that `TA_Info_Func` stores pointers to the `name` table
* entries it wants to access or modify; the only parameter is thus
* *info_data*, which is a void pointer to the user-supplied data already
* provided to `TA_Info_Func`. Obviously, calling `TA_Info_Post_Func` with
* `TA_Info_Func` undefined has no effect.
*
* The `name` table strings are allocated with the function specified by the
* `alloc-func` field of [`TTF_autohint`](#function-ttf_autohint); the
* application should reallocate the data if necessary, ensuring that no
* string length exceeds 0xFFFF.
*
* If an error occurs, return a non-zero value and don't modify the affected
* string and string length (such errors are handled as non-fatal).
*
* ```C
*/
typedef int
(*TA_Info_Post_Func)(void* info_data);
/*
* ```
*
*/
/* pandoc-end */
/*
* Error values in addition to the FT_Err_XXX constants from FreeType.
*
* All error values specific to ttfautohint start with `TA_Err_'.
*/
#include <ttfautohint-errors.h>
/* pandoc-start */
/*
* Function: `TTF_autohint`
* ------------------------
*
* Read a TrueType font, remove existing bytecode (in the SFNT tables
* `prep`, `fpgm`, `cvt `, and `glyf`), and write a new TrueType font with
* new bytecode based on the autohinting of the FreeType library, optionally
* using a reference font to derive blue zones.
*
* It expects a format string *options* and a variable number of arguments,
* depending on the fields in *options*. The fields are comma separated;
* whitespace within the format string is not significant, a trailing comma
* is ignored. Fields are parsed from left to right; if a field occurs
* multiple times, the last field's argument wins. The same is true for
* fields that are mutually exclusive. Depending on the field, zero or one
* argument is expected.
*
* Note that fields marked as 'not implemented yet' are subject to change.
*
*
* ### Memory Management
*
* The next two fields are necessary on some platforms if ttfautohint is
* compiled as a shared library, and the application uses a different
* runtime library. This can happen, for example, on the MS Windows
* platform if your program is written in Python and communicates via [the
* 'ctypes' interface](https://docs.python.org/3/library/ctypes.html) with
* the ttfautohint DLL.
*
* `alloc-func`
* : A pointer of type [`TA_Alloc_Func`](#function-pointer-ta_alloc_func)
* specifying a memory allocation function. It gets used to allocate
* the buffer given by the `out-buffer` field and the data exposed by
* the [`TA_Info_Func`](#callback-ta_info_func) callback. If not set or
* set to NULL, or if `out-buffer` is not set or set to NULL,
* standard\ C's `malloc` function is used.
*
* `free-func`
* : A pointer of type [`TA_Free_Func`](#function-pointer-ta_free_func)
* specifying a memory deallocation function. It gets called to free
* the data exposed by the [`TA_Info_Func`](#callback-ta_info_func)
* callback after it has been used. If not set or set to NULL, or if
* `out_buffer` is not set or set to NULL, standard\ C's `free` function
* is used.
*
*
* ### I/O
*
* `in-file`
* : A pointer of type `FILE*` to the data stream of the input font,
* opened for binary reading. Mutually exclusive with `in-buffer`.
*
* `in-buffer`
* : A pointer of type `const char*` to a buffer that contains the input
* font. Needs `in-buffer-len`. Mutually exclusive with `in-file`.
*
* `in-buffer-len`
* : A value of type `size_t`, giving the length of the input buffer.
* Needs `in-buffer`.
*
* `out-file`
* : A pointer of type `FILE*` to the data stream of the output font,
* opened for binary writing. Mutually exclusive with `out-buffer`.
*
* `out-buffer`
* : A pointer of type `char**` to a buffer that contains the output
* font. Needs `out-buffer-len`. Mutually exclusive with `out-file`.
* The application should deallocate the memory with the function given
* by `free-func`.
*
* `out-buffer-len`
* : A pointer of type `size_t*` to a value giving the length of the
* output buffer. Needs `out-buffer`.
*
* `control-file`
* : A pointer of type `FILE*` to the data stream of control instructions.
* Mutually exclusive with `control-buffer`.
*
* See '[Control Instructions](#control-instructions)' for the syntax
* used in such a file or buffer.
*
* `control-buffer`
* : A pointer of type `const char*` to a buffer that contains control
* instructions. Needs `control-buffer-len`. Mutually exclusive with
* `control-file`.
*
* `control-buffer-len`
* : A value of type `size_t`, giving the length of the control
* instructions buffer. Needs `control-buffer`.
*
* `reference-file`
* : A pointer of type `FILE*` to the data stream of the reference font,
* opened for binary reading. Mutually exclusive with
* `reference-buffer`.
*
* `reference-buffer`
* : A pointer of type `const char*` to a buffer that contains the
* reference font. Needs `reference-buffer-len`. Mutually exclusive
* with `reference-file`.
*
* `reference-buffer-len`
* : A value of type `size_t`, giving the length of the reference buffer.
* Needs `reference-buffer`.
*
* `reference-index`
* : The face index to be used in the reference font. The default value
* is\ 0.
*
* `reference-name`
* : A string that specifies the name of the reference font. It is only
* used to emit a sensible value for the `TTFA` table if `TTFA-info` is
* set.
*
*
* ### Messages and Callbacks
*
* `progress-callback`
* : A pointer of type [`TA_Progress_Func`](#callback-ta_progress_func),
* specifying a callback function for progress reports. This function
* gets called after a single glyph has been processed. If this field
* is not set or set to NULL, no progress callback function is used.
*
* `progress-callback-data`
* : A pointer of type `void*` to user data that is passed to the
* progress callback function.
*
* `error-string`
* : A pointer of type `unsigned char**` to a string (in UTF-8 encoding)
* that verbally describes the error code. You must not change the
* returned value.
*
* `error-callback`
* : A pointer of type [`TA_Error_Func`](#callback-ta_error_func),
* specifying a callback function for error messages. This function
* gets called right before `TTF_autohint` exits. If this field is not
* set or set to NULL, no error callback function is used.
*
* Use it as a more sophisticated alternative to `error-string`.
*
* `error-callback-data`
* : A point of type `void*` to user data that is passed to the error
* callback function.
*
* `info-callback`
* : A pointer of type [`TA_Info_Func`](#callback-ta_info_func),
* specifying a callback function for manipulating the `name` table.
* This function gets called for each `name` table entry. If not set or
* set to NULL, `TA_Info_Func` is not called.
*
* `info-post-callback`
* : A pointer of type [`TA_Info_Post_Func`](#callback-ta_info_post_func),
* specifying a callback function for manipulating the `name` table. It
* is called after the function specified with `info-callback` has
* iterated over all `name` table entries. If not set or set to NULL,
* `TA_Info_Post_Func` is not called.
*
* `info-callback-data`
* : A pointer of type `void*` to user data that is passed to the info
* callback functions.
*
* `debug`
* : If this integer is set to\ 1, lots of debugging information is print
* to stderr. The default value is\ 0.
*
*
* ### General Hinting Options
*
* `hinting-range-min`
* : An integer (which must be larger than or equal to\ 2) giving the
* lowest PPEM value used for autohinting. If this field is not set, it
* defaults to
* [`TA_HINTING_RANGE_MIN`](#preprocessor-macros-typedefs-and-enums).
*
* `hinting-range-max`
* : An integer (which must be larger than or equal to the value of
* `hinting-range-min`) giving the highest PPEM value used for
* autohinting. If this field is not set, it defaults to
* [`TA_HINTING_RANGE_MAX`](#preprocessor-macros-typedefs-and-enums).
*
* `hinting-limit`
* : An integer (which must be larger than or equal to the value of
* `hinting-range-max`) that gives the largest PPEM value at which
* hinting is applied. For larger values, hinting is switched off. If
* this field is not set, it defaults to
* [`TA_HINTING_LIMIT`](#preprocessor-macros-typedefs-and-enums). If it
* is set to\ 0, no hinting limit is added to the bytecode.
*
* `hint-composites`
* : If this integer is set to\ 1, composite glyphs get separate hints.
* This implies adding a special glyph to the font called
* ['.ttfautohint'](#the-.ttfautohint-glyph). Setting it to\ 0 (which
* is the default), the hints of the composite glyphs' components are
* used. Adding hints for composite glyphs increases the size of the
* resulting bytecode a lot, but it might deliver better hinting
* results. However, this depends on the processed font and must be
* checked by inspection.
*
* `adjust-subglyphs`
* : An integer (1\ for 'on' and 0\ for 'off', which is the default) to
* specify whether native TrueType hinting of the *input font* shall be
* applied to all glyphs before passing them to the (internal)
* autohinter. The used resolution is the em-size in font units; for
* most fonts this is 2048ppem. Use this only if the old hints move or
* scale subglyphs independently of the output resolution, for example
* some exotic CJK fonts.
*
* `pre-hinting` is a deprecated alias name for this option.
*
*
* ### Hinting Algorithms
*
* ttfautohint provides three different algorithms for computing
* horizontal stem widths and the positioning of blue zones.
*
* * `TA_STEM_WIDTH_MODE_NATURAL`: No adjustments to stem
* widths, discrete blue zone positioning. This is what FreeType uses for
* its 'light' (auto-)hinting mode.
*
* * `TA_STEM_WIDTH_MODE_QUANTIZED`: Both stem widths and blue zone
* positions are slightly quantized to take discrete values. For
* example, stem values 50, 51, 72, 76, and 100 would become 50, 74, and
* 100 (or something similar).
*
* * `TA_STEM_WIDTH_MODE_STRONG`: If active, stem widths and blue zones are
* snapped and positioned to integer pixel values as much as possible.
*
* These values are arguments to ttfautohint's three different hinting mode
* options.
*
* `gray-stem-width-mode`
* : Specify the stem width algorithm for grayscale rendering. Possible
* integer values are `TA_STEM_WIDTH_MODE_NATURAL`,
* `TA_STEM_WIDTH_MODE_QUANTIZED` (the default), and
* `TA_STEM_WIDTH_MODE_STRONG`, as discussed above.
*
* `gdi-cleartype-stem-width-mode`
* : Specify the stem width algorithm for GDI ClearType rendering, this
* is, the rasterizer version (as returned by the GETINFO bytecode
* instruction) is in the range 36\ <= version <\ 38 and ClearType is
* enabled. Possible integer values are `TA_STEM_WIDTH_MODE_NATURAL`,
* `TA_STEM_WIDTH_MODE_QUANTIZED`, and `TA_STEM_WIDTH_MODE_STRONG` (the
* default), as discussed above.
*
* `dw-cleartype-stem-width-mode`
* : Specify the stem width algorithm for DW ClearType rendering, this is,
* the rasterizer version (as returned by the GETINFO bytecode
* instruction) is >=\ 38, ClearType is enabled, and subpixel
* positioning is enabled also. Possible integer values are
* `TA_STEM_WIDTH_MODE_NATURAL`, `TA_STEM_WIDTH_MODE_QUANTIZED` (the
* default), and `TA_STEM_WIDTH_MODE_STRONG`, as discussed above.
*
* `increase-x-height`
* : An integer. For PPEM values in the range 6\ <= PPEM
* <= `increase-x-height`, round up the font's x\ height much more often
* than normally (to use the terminology of TrueType's 'Super Round'
* bytecode instruction, the threshold gets increased from 5/8px to
* 13/16px). If it is set to\ 0, this feature is switched off. If this
* field is not set, it defaults to
* [`TA_INCREASE_X_HEIGHT`](#preprocessor-macros-typedefs-and-enums).
* Use this flag to improve the legibility of small font sizes if
* necessary.
*
* `x-height-snapping-exceptions`
* : A pointer of type `const char*` to a null-terminated string that
* gives a list of comma separated PPEM values or value ranges at which
* no x\ height snapping shall be applied. A value range has the form
* *value*~1~`-`*value*~2~, meaning *value*~1~ <= PPEM <= *value*~2~.
* *value*~1~ or *value*~2~ (or both) can be missing; a missing value is
* replaced by the beginning or end of the whole interval of valid PPEM
* values, respectively. Whitespace is not significant; superfluous
* commas are ignored, and ranges must be specified in increasing order.
* For example, the string `"3, 5-7, 9-"` means the values 3, 5, 6, 7,
* 9, 10, 11, 12, etc. Consequently, if the supplied argument is `"-"`,
* no x\ height snapping takes place at all. The default is the empty
* string (`""`), meaning no snapping exceptions.
*
* `windows-compatibility`
* : If this integer is set to\ 1, two artificial blue zones are used,
* positioned at the `usWinAscent` and `usWinDescent` values (from the
* font's `OS/2` table). The idea is to help ttfautohint so that the
* hinted glyphs stay within this horizontal stripe since Windows clips
* everything falling outside. The default is\ 0.
*
* `gray-strong-stem-width`
* : Deprecated. The argument values 0 and 1 of this field correspond to
* the argument values `TA_STEM_WIDTH_MODE_QUANTIZED` and
* `TA_STEM_WIDTH_MODE_STRONG` of the field 'gray-stem-width-mode',
* respectively.
*
* `gdi-cleartype-strong-stem-width`
* : Deprecated. The argument values 0 and 1 of this field correspond to
* the argument values `TA_STEM_WIDTH_MODE_QUANTIZED` and
* `TA_STEM_WIDTH_MODE_STRONG` of the field
* 'gdi-cleartype-stem-width-mode', respectively.
*
* `dw-cleartype-strong-stem-width`
* : Deprecated. The argument values 0 and 1 of this field correspond to
* the argument values `TA_STEM_WIDTH_MODE_QUANTIZED` and
* `TA_STEM_WIDTH_MODE_STRONG` of the field
* 'dw-cleartype-stem-width-mode', respectively.
*
*
* ### Scripts
*
* `default-script`
* : A string consisting of four lowercase characters that specifies the
* default script for OpenType features. After applying all features
* that are handled specially, use this value for the remaining
* features. The default value is `"latn"`; if set to `"none"`, no
* script is used. Valid values can be found in the header file
* `ttfautohint-scripts.h`.
*
* `fallback-script`
* : A string consisting of four lowercase characters, specifying the
* default script for glyphs that can't be mapped to a script
* automatically. By default, such glyphs are hinted; if option
* `fallback-scaling` is set, they are scaled only instead. Valid
* values can be found in the header file `ttfautohint-scripts.h`.
*
* Default value is `"none"`, which means hinting without using a
* script's blue zones if `fallback-scaling` isn't set. If
* `fallback_scaling` is set, value `"none"` implies no hinting for
* unmapped glyphs.
*
* `fallback-scaling`
* : Set this integer to\ 1 if glyphs handled by the fallback script
* should be scaled only with the fallback script's scaling value,
* instead of being hinted with the fallback script's hinting
* parameters.
*
* `symbol`
* : Set this integer to\ 1 if you want to process a font that ttfautohint
* would refuse otherwise because it can't find a single standard
* character for any of the supported scripts. ttfautohint then uses a
* default (hinting) value for the standard stem width instead of
* deriving it from a script's set of standard characters (for the latin
* script, one of them is character 'o'). The default value of this
* option is\ 0.
*
* `fallback-stem-width`
* : Set the horizontal stem width (hinting) value for all scripts that
* lack proper standard characters. The value is given in font units
* and must be a positive integer. If not set, or the value is zero,
* ttfautohint uses a hard-coded default (50\ units at 2048 units per
* EM, and linearly scaled for other UPEM values, for example 24\ units
* at 1000 UPEM).
*
* For symbol fonts (i.e., option `symbol` is given),
* `fallback-stem-width` has an effect only if `fallback-script` is set
* also.
*
*
* ### Miscellaneous
*
* `ignore-restrictions`
* : If the font has set bit\ 1 in the 'fsType' field of the `OS/2` table,
* the ttfautohint library refuses to process the font since a
* permission to do that is required from the font's legal owner. In
* case you have such a permission you might set the integer argument to
* value\ 1 to make ttfautohint handle the font. The default value
* is\ 0.
*
* `TTFA-info`
* : If set to\ 1, ttfautohint creates an SFNT table called `TTFA` and
* fills it with information on the parameters used while calling
* `TTF_autohint`. The format of the output data resembles the
* information at the very beginning of the dump emitted by option
* `debug`. The default value is\ 0.
*
* Main use of this option is for font editing purposes. For example,
* after a font editor has added some glyphs, a front-end to
* `TTF_autohint` can parse `TTFA` and feed the parameters into another
* call of `TTF_autohint`. The new glyphs are then hinted while hints
* of the old glyphs stay unchanged.
*
* If this option is not set, and the font to be processed contains a
* `TTFA` table, it gets removed.
*
* Note that such a `TTFA` table gets ignored by all font rendering
* engines. In TrueType Collections, the `TTFA` table is added to the
* first subfont.
*
* `dehint`
* : If set to\ 1, remove all hints from the font. All other hinting
* options are ignored.
*
* `epoch`
* : An integer of type `unsigned long long`, defined as the number of
* seconds (excluding leap seconds) since 01 Jan 1970 00:00:00 UTC. If
* set, or if the value is not equal to `ULLONG_MAX`, this epoch gets
* used instead of the current date and time for the 'modification time'
* field in the TTF header. Use this to get [reproducible
* builds](https://reproducible-builds.org/).
*
*
* ### Remarks
*
* * Obviously, it is necessary to have an input and an output data
* stream. All other options are optional.
*
* * `hinting-range-min` and `hinting-range-max` specify the range for
* which the autohinter generates optimized hinting code. If a PPEM
* value is smaller than the value of `hinting-range-min`, hinting still
* takes place but the configuration created for `hinting-range-min` is
* used. The analogous action is taken for `hinting-range-max`, only
* limited by the value given with `hinting-limit`. The font's `gasp`
* table is set up to always use grayscale rendering with grid-fitting
* for standard hinting, and symmetric grid-fitting and symmetric
* smoothing for horizontal subpixel hinting (ClearType).
*
* * ttfautohint can process its own output a second time only if option
* `hint-composites` is not set (or if the font doesn't contain
* composite glyphs at all). This limitation might change in the
* future.
*
* ```C
*/
TA_LIB_EXPORT TA_Error
TTF_autohint(const char* options,
...);
/*
* ```
*
* Macros: `TTFAUTOHINT_MAJOR`, `TTFAUTOHINT_MINOR`, `TTFAUTOHINT_REVISION`
* ------------------------------------------------------------------------
*
* These three macros give the major, minor, and revision number of the
* library, respectively. See function
* [`TTF_autohint_version`](#function-ttf_autohint_version) for more
* details.
*
* ```C
*/
#define TTFAUTOHINT_MAJOR 1
#define TTFAUTOHINT_MINOR 8
#define TTFAUTOHINT_REVISION 1
/*
* ```
*
* Macro: `TTFAUTOHINT_VERSION`
* ----------------------------
*
* This macro holds the ttfautohint version string.
*
* For tarball releases it has the form *X*.*Y*[.*Z*], with *X*, *Y*,
* and\ *Z* the major, minor, and revision numbers, respectively. If the
* revision number is zero, it is omitted. Examples: `2.7`, `2.7.1`.
*
* If compiling directly from the git repository, ttfautohint's bootstrap
* script derives the version number from the `git describe` output,
* appending the number of commits after a tag together with a shortened
* commit ID. Example: `2.7.1.23-379b`.
*
* See function [`TTF_autohint_version`](#function-ttf_autohint_version) for
* more details.
*
* ```C
*/
#define TTFAUTOHINT_VERSION "1.8.1"
/*
* ```
*
* Function: `TTF_autohint_version`
* --------------------------------
*
* Return the ttfautohint version triplet. This function is useful when
* dynamically linking to the library, since the macros `TTFAUTOHINT_MAJOR`,
* `TTFAUTOHINT_MINOR`, and `TTFAUTOHINT_PATCH` cannot be used in that case.
*
* The returned integer triplet is _not_ the same as the shared library's
* version triplet (which the dynamic linker uses to resolve runtime
* dependencies). For example, hypothetical ttfautohint versions 2.27 and
* 2.27.1 might both correspond to shared library version 1.0.38 in case
* there are only, say, documentation or packaging differences that don't
* affect the library code.
*
* If the pkg-config configuration file `ttfautohint.pc` is installed in a
* place that pkg-config can find, a call to
*
* ```
* pkg-config ttfautohint --modversion
* ```
*
* returns the shared library version.
*
* ```C
*/
TA_LIB_EXPORT void
TTF_autohint_version(int *major,
int *minor,
int *revision);
/*
* ```
*
* Function: `TTF_autohint_version_string`
* ---------------------------------------
*
* Return the ttfautohint version string. This function is useful when
* dynamically linking to the library, since the macro `TTFAUTOHINT_VERSION`
* cannot be used in that case.
*
* ```C
*/
TA_LIB_EXPORT const char*
TTF_autohint_version_string(void);
/*
* ```
*
*/
/* pandoc-end */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* TTFAUTOHINT_H_ */
/* end of ttfautohint.h */
|