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