File: ttfautohint.html

package info (click to toggle)
ttfautohint 1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,504 kB
  • ctags: 4,347
  • sloc: ansic: 38,386; sh: 5,749; cpp: 4,131; perl: 340; makefile: 309; sed: 39
file content (3825 lines) | stat: -rw-r--r-- 202,846 bytes parent folder | download
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
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
<!DOCTYPE html PUBLIC
  "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="Content-Type"
        content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type"
        content="text/css" />
  <meta name="generator"
        content="pandoc" />
  <meta name="author"
        content="Werner Lemberg" />
  <meta name="version"
        content="1.6" />

  <title>ttfautohint</title>

  <style type="text/css">
    /* use Droid fonts */
    @import url("http://fonts.googleapis.com/css?family=Droid+Serif");
    @import url("http://fonts.googleapis.com/css?family=Droid+Sans+Mono");
  
    /* top-level appearance */
    body {
      width: 100%;
      margin: 0;
      padding: 0;
      border: 0;
      text-align: left;
      font-size: large;
      font-family: "Droid Serif", serif;
      line-height: 130%; }
  
    /* table of contents; */
    /* width and offsets must be synchronized with col2 below */
    #TOC {
      position: fixed;
      overflow: auto;
      height: 100%;
      /* use smaller font size for TOC */
      font-size: 80%;
      line-height: 120%;
      left: 0em;
      width: 17em; }
    /* don't display list markers in TOC */
    #TOC ul {
      list-style: none; }
    #TOC li {
      /* reduce indentation of nesting levels */
      margin-left: -1.5em;
      /* negative indentation for the first line of a TOC entry */
      text-indent: -0.5em;
      /* leave some vertical space between TOC entries */
      margin-bottom: 1ex; }
    /* since nested `ul' groups are directly embedded into `li' tags, */
    /* handle first element specially to get vertical space here, too */
    #TOC ul li:first-child {
      margin-top: 1ex; }
    /* no link color necessary for TOC entries */
    #TOC a {
      color: black; }
  
    /* pop-up window for a footnote */
    #footnotediv {
      background-color: white;
      padding: 3px;
      padding-left: 12px;
      padding-right: 12px;
      border: 1px solid #CDBBB5;
      box-shadow: #555555 0 0 10px;
      -webkit-box-shadow: #555555 0 0 10px;
      -moz-box-shadow: 0 0 10px #555555;
    }
  
    /* column container */
    .colmask {
      /* this fixes the IE7 overflow hidden bug */
      /* and stops the layout jumping out of place */
      position: relative;
      clear: both;
      float: left;
      width: 100%;
      /* this chops off any overhanging `div's */
      overflow: hidden; }
    /* two-column left menu settings (col1 is right, col2 is left) */
    .leftmenu {
      background: white; }
    .leftmenu .colright {
      float: left;
      width: 200%;
      position: relative;
      left: 15em; /* pad2_l + wd2 + pad2_r */
      background: white; }
    .leftmenu .col1wrap {
      float: right;
      width: 50%;
      position: relative;
      right: 15em; /* pad2_l + wd2 + pad2_r */
      padding-bottom: 1ex; }
    .leftmenu .col1 {
      margin: 0 1em   /* pad2_r */
              0 15em; /* pad2_l + wd2 + pad2_r + pad1_l */
      position: relative;
      right: 100%;
      width: 45em;
      max-width: 66%;
      /* overflow: hidden; */ }
    .leftmenu .col2 {
      float: left;
      width: 17em; /* wd2 */
      position: relative;
      right: 14em; } /* wd2 + pad2_r */
  
    /* we want the same appearance of markups within blockquotes */
    /* as with LaTeX */
    blockquote {
      font-style: italic;
    }
    blockquote em {
      font-style: normal;
    }
  
    code {
      font-family: "Droid Sans Mono", monospace;
      white-space: nowrap; }
    pre code {
      white-space: pre; }
  
    /* no underline for links */
    a {
      text-decoration: none; }
  
    /* we want neither superscripts or subscripts */
    /* consume extra vertical space */
    sup, sub {
      line-height: 0.1ex; }
  
    /* pandoc uses superscripts for footnote numbers, */
    /* however, we want a number in brackets */
    /* (which is easier to select with the mouse) */
    a.footnoteRef > sup:before {
      content: "["; }
    a.footnoteRef > sup:after {
      content: "]"; }
  
    h1 {
      margin-top: 3.5ex; }
    h2 {
      margin-top: 3ex; }
    h3 {
      margin-top: 2.5ex; }
    h4 { }
    h5 { }
    h6 { }
    h1.title {
     text-align: center; }
    h2.author {
     text-align: center; }
    h3.date {
     text-align: center; }
    /* since we have a TOC at a fixed position, */
    /* links in headers back to the TOC are unnecessary */
    h1 a,
    h2 a,
    h3 a,
    h4 a,
    h5 a,
    h6 a {
      color: black; }
  
    /* figures */
    div.figure {
      text-align: center;
      margin-top: 5ex;
      margin-bottom: 5ex; }
    p.caption {
      font-size: smaller; }
  
    /* tables */
    table {
      border-collapse: collapse;
      /* the next two lines center the table horizontally */
      margin-left: auto;
      margin-right: auto;
      margin-top: 5ex;
      margin-bottom: 5ex; }
    td {
      padding-left: 0.8em;
      padding-right: 0.8em; }
    thead {
      /* a horizontal rule between table head and body */
      border-bottom: solid thin; }
    th {
      font-weight: normal;
      padding-left: 0.8em;
      padding-right: 0.8em;
      /* some vertical space before the horizontal rule */
      padding-bottom: 1ex; }
    tbody tr:first-child td {
      /* some vertical space after the horizontal rule */
      padding-top: 1ex; }
    caption {
      font-weight: bold;
      padding-bottom: 2ex; }
  
    /* if we have paragraphs in definition lists, */
    /* suppress the very first vertical space */
    dd > p:first-child {
      margin-top: 0; }
  
    /* source-code highlighting */
    table.sourceCode,
    tr.sourceCode,
    td.lineNumbers,
    td.sourceCode,
    table.sourceCode pre {
      margin: 0;
      padding: 0;
      border: 0;
      vertical-align: baseline;
      border: none; }
    td.lineNumbers {
      border-right: 1px solid #AAAAAA;
      text-align: right;
      color: #AAAAAA;
      padding-right: 5px;
      padding-left: 5px; }
    td.sourceCode {
      padding-left: 5px; }
  
    pre.sourceCode {
      margin-left: 2em; }
  
    code.sourceCode span.kw {
      color: #007020;
      font-weight: bold; }
    code.sourceCode span.dt {
      color: #902000; }
    code.sourceCode span.dv {
      color: #40a070; }
    code.sourceCode span.bn {
      color: #40a070; }
    code.sourceCode span.fl {
      color: #40a070; }
    code.sourceCode span.ch {
      color: #4070a0; }
    code.sourceCode span.st {
      color: #4070a0; }
    code.sourceCode span.co {
      color: #60a0b0;
      font-style: italic; }
    code.sourceCode span.ot {
      color: #007020; }
    code.sourceCode span.al {
      color: red;
      font-weight: bold; }
    code.sourceCode span.fu {
      color: #06287e; }
    code.sourceCode span.re { }
    code.sourceCode span.er {
      color: red;
      font-weight: bold; }
  </style>
  <script type="text/javascript"
          src="jquery-1.11.2.min.js">
  </script>
  <script type="text/javascript"
          src="toc-unfold.js">
  </script>
  <script type="text/javascript"
          src="footnote-popup.js">
  </script>
</head>

<body>

<div class="colmask leftmenu">
  <div class="colright">
    <div class="col1wrap">
      <div class="col1">
<div id="header">
<h1 class="title">ttfautohint</h1>
<h2 class="author">Werner Lemberg</h2>
<h3 class="date">Version 1.6</h3>
</div>

<!--
  Copyright (C) 2011-2016 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.
-->
<h1 id="introduction">Introduction</h1>
<p><strong>ttfautohint</strong> is a library written in C that takes a TrueType font as the input, removes its bytecode instructions (if any), and returns a new font where all glyphs are bytecode hinted using the information given by FreeType’s auto-hinting module. The idea is to provide the excellent quality of the auto-hinter on platforms that don’t use FreeType.</p>
<p>The library has a single API function, <code>TTF_autohint</code>, which is described <a href="#the-ttfautohint-api">below</a>.</p>
<p>Bundled with the library there are two front-end programs, <a href="#ttfautohint-and-ttfautohintgui"><code>ttfautohint</code> and <code>ttfautohintGUI</code></a>, being a command line program and an application with a Graphics User Interface (GUI), respectively.</p>
<h2 id="what-exactly-are-hints">What exactly are hints?</h2>
<p>To cite <a href="http://en.wikipedia.org/wiki/Font_hinting">Wikipedia</a>:</p>
<blockquote>
<p><strong>Font hinting</strong> (also known as <strong>instructing</strong>) is the use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid. At low screen resolutions, hinting is critical for producing a clear, legible text. It can be accompanied by antialiasing and (on liquid crystal displays) subpixel rendering for further clarity.</p>
</blockquote>
<p>and Apple’s <a href="https://developer.apple.com/fonts/TrueType-Reference-Manual/RM03/Chap3.html#features">TrueType Reference Manual</a>:</p>
<blockquote>
<p>For optimal results, a font instructor should follow these guidelines:</p>
<ul>
<li><p>At small sizes, chance effects should not be allowed to magnify small differences in the original outline design of a glyph.</p></li>
<li><p>At large sizes, the subtlety of the original design should emerge.</p></li>
</ul>
</blockquote>
<p>In general, there are three possible ways to hint a glyph.</p>
<ol style="list-style-type: decimal">
<li><p>The font contains hints (in the original sense of this word) to guide the rasterizer, telling it which shapes of the glyphs need special consideration. The hinting logic is partly in the font and partly in the rasterizer. More sophisticated rasterizers are able to produce better rendering results.</p>
<p>This is how Type 1 and CFF hints work.</p></li>
<li><p>The font contains exact instructions (also called <em>bytecode</em>) on how to move the points of its outlines, depending on the resolution of the output device, and which intentionally distort the (outline) shape to produce a well-rasterized result. The hinting logic is in the font; ideally, all rasterizers simply process these instructions to get the same result on all platforms.</p>
<p>This is how TrueType hints work.</p></li>
<li><p>The font gets auto-hinted (at run-time). The hinting logic is completely in the rasterizer. No hints in the font are used or needed; instead, the rasterizer scans and analyzes the glyphs to apply corrections by itself.</p>
<p>This is how FreeType’s auto-hinter works; see <a href="#background-and-technical-details">below</a> for more.</p></li>
</ol>
<h2 id="what-problems-can-arise-with-truetype-hinting">What problems can arise with TrueType hinting?</h2>
<p>While it is relatively easy to specify PostScript hints (either manually or by an auto-hinter that works at font creation time), creating TrueType hints is far more difficult. There are at least two reasons:</p>
<ul>
<li><p>TrueType instructions form a programming language, operating at a very low level. They are comparable to assembler code, thus lacking all high-level concepts to make programming more comfortable.</p>
<p>Here an example how such code looks like:</p>
<pre><code>    SVTCA[0]
    PUSHB[ ]  /* 3 values pushed */
    18 1 0
    CALL[ ]
    PUSHB[ ]  /* 2 values pushed */
    15 4
    MIRP[01001]
    PUSHB[ ]  /* 3 values pushed */
    7 3 0
    CALL[ ]</code></pre>
<p>Another major obstacle is the fact that font designers usually aren’t programmers.</p></li>
<li><p>It is very time consuming to manually hint glyphs. Given that the number of specialists for TrueType hinting is very limited, hinting a large set of glyphs for a font or font family can become very expensive.</p></li>
</ul>
<h2 id="why-ttfautohint">Why ttfautohint?</h2>
<p>The ttfautohint library brings the excellent quality of FreeType rendering to platforms that don’t use FreeType, yet require hinting for text to look good – like Microsoft Windows. Roughly speaking, it converts the glyph analysis done by FreeType’s auto-hinting module to TrueType bytecode. Internally, the auto-hinter’s algorithm resembles PostScript hinting methods; it thus combines all three hinting methods discussed <a href="#what-exactly-are-hints">previously</a>.</p>
<p>The simple interface of the front-ends (both on the command line and with the GUI) allows quick hinting of a whole font with a few mouse clicks or a single command on the prompt. As a result, you get better rendering results with web browsers, for example.</p>
<p>Across Windows rendering environments today, fonts processed with ttfautohint look best with ClearType enabled. This is the default for Windows 7. Good visual results are also seen in recent MacOS X versions and GNU/Linux systems (including Android, ChromeOS, and other mobile operating systems) that use FreeType for rendering glyphs.</p>
<p>The goal of the project is to generate a ‘first pass’ of hinting that font developers can refine further for ultimate quality.</p>
<h2 id="smooth-hinting">‘Smooth’ hinting</h2>
<p>Fundamentally, there are two approaches to hinting. The older approach, let’s call it ‘sharp’, popular when text was rendered in pure black-and-white, was to make all stems round to full pixels so that in a text line, all stems would be either one pixel or (at a larger point size) two pixels. When grayscale antialiasing came about, this approach actually started harming the rendering rather than helping it, because the horizontal and vertical stems would render very dark but round or diagonal stems would render very light.</p>
<p>So a new approach was developed, let’s call it ‘fuzzy’, where all stems and other elements are equalized so that in grayscale (or ClearType) rendering, they all are of roughly equal color. This means that stems are not rounded to full pixels but in fact to fractions of a pixel. However, with black-and-white renderers, this approach yields poor results because in black-and-white you cannot render a fraction of a pixel, so some stems become one pixel and some become two.</p>
<p>The TrueType auto-hinters in <a href="http://fontforge.sf.net">FontForge</a> and <a href="http://www.fontlab.com/font-editor/fontlab-studio">FontLab Studio</a>, to name two well-known font editors, take the ‘sharp’ approach, while the TrueType auto-hinter in ttfautohint takes the ‘fuzzy’ approach.</p>
<p>In theory, a hybrid approach is possible, using TrueType conditional hints: If the rasterizer is black-and-white, ‘sharp’ rendering could happen, while if the rasterizer is ClearType, the ‘fuzzy’ rendering could be used. It is not intended to add black-and-white auto-hinting to ttfautohint. However, it is planned to develop an interface so that ttfautohint can cooperate with font editors, providing this hybrid hinting.</p>
<h1 id="ttfautohint-and-ttfautohintgui"><code>ttfautohint</code> and <code>ttfautohintGUI</code></h1>
<p>On all supported platforms (GNU/Linux, Windows, and Mac OS X), the GUI looks quite similar; the used toolkit is <a href="http://qt.io">Qt</a>, which in turn uses the platform’s native widgets.</p>
<div class="figure">
<img src="img/ttfautohintGUI.png" alt="ttfautohintGUI on GNU/Linux running KDE" />
<p class="caption"><code>ttfautohintGUI</code> on GNU/Linux running KDE</p>
</div>
<p>Both the GUI and console version share the same features, to be discussed in the next subsection.</p>
<p><strong>Warning: ttfautohint cannot always process a font a second time.</strong> If the font contains composite glyphs, and option <a href="#hint-composites"><code>-c</code></a> is used, reprocessing with ttfautohint will fail. For this reason it is strongly recommended to <em>not</em> delete the original, unhinted font so that you can always rerun ttfautohint.</p>
<h2 id="calling-ttfautohint">Calling <code>ttfautohint</code></h2>
<pre><code>    ttfautohint [OPTION]... [IN-FILE [OUT-FILE]]</code></pre>
<p>The command-line binary, <code>ttfautohint</code>, works like a Unix filter, this is, it reads data from standard input if no input file name is given, and it sends its output to standard output if no output file name is specified.</p>
<p>A typical call looks like the following.</p>
<pre><code>    ttfautohint -v -f latn foo.ttf foo-autohinted.ttf</code></pre>
<p>For demonstration purposes, here the same using a pipe and redirection. Note that Windows’s default command line interpreter, <code>cmd.exe</code>, doesn’t support piping with binary files, unfortunately.</p>
<pre><code>    cat foo.ttf | ttfautohint -v -f latn &gt; foo-autohinted.ttf</code></pre>
<h2 id="calling-ttfautohintgui">Calling <code>ttfautohintGUI</code></h2>
<pre><code>    ttfautohintGUI [OPTION]...</code></pre>
<p><code>ttfautohintGUI</code> doesn’t send any output to a console; however, it accepts (almost) the same command line options as <code>ttfautohint</code>, setting default values for the GUI.</p>
<p>The following command line options are not available in <code>ttfautohintGUI</code>; however, the corresponding functionality can be selected interactively: <a href="#control-instructions-file"><code>--control-file</code></a>, <a href="#blue-zone-reference-font"><code>--reference</code></a>, <a href="#reference-face-index"><code>--reference-index</code></a>.</p>
<p>Two options, namely <code>--ttfa-info</code> and <code>--debug</code>, emit information at standard output and standard error, respectively; they are thus not available in <code>ttfautohintGUI</code> at all.</p>
<h2 id="options">Options</h2>
<p>Long options can be given with one or two dashes, and with and without an equal sign between option and argument. This means that the following forms are acceptable: <code>-foo=</code><em>bar</em>, <code>--foo=</code><em>bar</em>, <code>-foo</code> <em>bar</em>, and <code>--foo</code> <em>bar</em>.</p>
<p>Below, the section title refers to the command’s label in the GUI (if applicable), then comes the name of the corresponding long command line option and its short equivalent, followed by a description.</p>
<p>Background and technical details on the meaning of the various options are given <a href="#background-and-technical-details">afterwards</a>.</p>
<h3 id="control-instructions-file">Control Instructions File</h3>
<dl>
<dt><code>--control-file=</code><em>file</em>, <code>-m</code> <em>file</em></dt>
<dd><p>Specify the name of a control instructions file to manually tweak the hinting process. This feature can be used to correct glitches in ttfautohint’s hinting algorithm. The syntax used in a control instructions file is given <a href="#control-instructions">below</a>.</p>
<p><code>ttfautohintGUI</code> doesn’t have this command line option.</p>
</dd>
</dl>
<h3 id="blue-zone-reference-font">Blue Zone Reference Font</h3>
<dl>
<dt><code>--reference=</code><em>file</em>, <code>-R</code> <em>file</em></dt>
<dd><p>Derive all blue zones from the given font, which can either be a normal TrueType font or a TrueType collection – for the latter you can select the face index with a <a href="#reference-face-index">separate option</a>.</p>
<p>Use this to harmonize font families, avoiding ugly height differences at small sizes.</p>
<div class="figure">
<img src="img/fira-16px-ie11-win81.png" alt="Fira Regular and Bold (version 4.106), auto-hinted with ttfautohint and displayed at 16px using Internet Explorer 11 under Windows 8.1. The bold series shown on the right side uses the regular variant as the reference font." />
<p class="caption">Fira Regular and Bold (version 4.106), auto-hinted with ttfautohint and displayed at 16px using Internet Explorer 11 under Windows 8.1. The bold series shown on the right side uses the regular variant as the reference font.</p>
</div>
<p>To make this work the reference font must obviously be similar enough to the font to be hinted; in particular, it must have proper blue zone characters so that ttfautohint can derive blue zones at all.</p>
<p><code>ttfautohintGUI</code> doesn’t have this command line option.</p>
</dd>
</dl>
<h3 id="hint-set-range-minimum-hint-set-range-maximum">Hint Set Range Minimum, Hint Set Range Maximum</h3>
<p>See ‘<a href="#hint-sets">Hint Sets</a>’ for a definition and explanation.</p>
<dl>
<dt><code>--hinting-range-min=</code><em>n</em>, <code>-l</code> <em>n</em></dt>
<dd>The minimum PPEM value (in pixels) at which hint sets are created. The default value for <em>n</em> is 8.
</dd>
<dt><code>--hinting-range-max=</code><em>n</em>, <code>-r</code> <em>n</em></dt>
<dd>The maximum PPEM value (in pixels) at which hint sets are created. The default value for <em>n</em> is 50.
</dd>
</dl>
<p>Increasing the range given by <code>-l</code> and <code>-r</code> normally makes the font’s bytecode larger.</p>
<h3 id="default-script">Default Script</h3>
<dl>
<dt><code>--default-script=</code><em>s</em>, <code>-D</code> <em>s</em></dt>
<dd>Set default script to tag <em>s</em>, which is a string consisting of four lowercase characters like <code>latn</code> or <code>dflt</code>. It is needed to specify the OpenType default script: After applying all features that are handled specially (like small caps or superscript), ttfautohint uses this value for the remaining features. The default value is <code>latn</code>. See <a href="#opentype-features">below</a> for more details.
</dd>
</dl>
<h3 id="fallback-script">Fallback Script</h3>
<dl>
<dt><code>--fallback-script=</code><em>s</em>, <code>-f</code> <em>s</em></dt>
<dd>Set fallback script to tag <em>s</em>, which is a string consisting of four characters like <code>latn</code> or <code>dflt</code>. It gets used for for all glyphs that can’t be assigned to a script automatically. The default value is <code>none</code>. See <a href="#scripts">below</a> for more details.
</dd>
<dt><code>--fallback-scaling</code>, <code>-S</code></dt>
<dd>Use scaling for glyphs covered by the fallback script, not hinting. See <a href="#scripts">below</a> for more details.
</dd>
</dl>
<h3 id="hinting-limit">Hinting Limit</h3>
<dl>
<dt><code>--hinting-limit=</code><em>n</em>, <code>-G</code> <em>n</em></dt>
<dd><p>The <em>hinting limit</em> is the PPEM value (in pixels) where hinting gets switched off (using the <code>INSTCTRL</code> bytecode instruction, not the <code>gasp</code> table data); it does not influence the file size. The default value for <em>n</em> is 200, which means that the font is not hinted for PPEM values larger than 200.</p>
<p>Note that hinting in the range ‘hinting-range-max’ up to ‘hinting-limit’ uses the hinting configuration for ‘hinting-range-max’.</p>
<p>To omit a hinting limit, use <code>--hinting-limit=0</code> (or check the ‘No Hinting Limit’ box in the GUI). Since this causes internal math overflow in the rasterizer for large pixel values (&gt; 1500px approx.) it is strongly recommended to not use this except for testing purposes.</p>
</dd>
</dl>
<h3 id="x-height-increase-limit">x Height Increase Limit</h3>
<dl>
<dt><code>--increase-x-height=</code><em>n</em>, <code>-x</code> <em>n</em></dt>
<dd><p>Normally, ttfautohint rounds the x height to the pixel grid, with a slight preference for rounding up (to use the terminology of TrueType’s ‘Super Round’ bytecode instruction, the threshold is 5/8px). If this flag is set, values in the range 6 PPEM to <em>n</em> PPEM are much more often rounded up (setting the threshold to 13/16px). The default value for <em>n</em> is 14. Use this flag to increase the legibility of small sizes if necessary; you might get weird rendering results otherwise for glyphs like ‘a’ or ‘e’, depending on the font design.</p>
<p>To switch off this feature, use <code>--increase-x-height=0</code> (or check the ‘No x Height Increase’ box in the GUI). To switch off rounding the x height to the pixel grid in general, either partially or completely, see ‘<a href="#x-height-snapping-exceptions">x Height Snapping Exceptions</a>’.</p>
<p>The following FontForge snapshot images use the font ‘<a href="https://github.com/vernnobile/mertzFont/tree/master/FINAL/Mertz-Bold">Mertz Bold</a>’ from Vernon Adams.</p>
<div class="figure">
<img src="img/e-17px-x14.png" alt="At 17px, without option -x and -w &quot;&quot;, the hole in glyph e looks very grey in the FontForge snapshot, and the GDI ClearType rendering (which is the default on older Windows versions) fills it completely with black because it uses B/W rendering along the y axis. FreeType’s light autohint mode (which corresponds to ttfautohint’s smooth stem width algorithm) intentionally aligns horizontal lines to non-integer (but still discrete) values to avoid large glyph shape distortions." />
<p class="caption">At 17px, without option <code>-x</code> and ‘<code>-w &quot;&quot;</code>’, the hole in glyph ‘e’ looks very grey in the FontForge snapshot, and the GDI ClearType rendering (which is the default on older Windows versions) fills it completely with black because it uses B/W rendering along the y axis. FreeType’s ‘light’ autohint mode (which corresponds to ttfautohint’s ‘smooth’ stem width algorithm) intentionally aligns horizontal lines to non-integer (but still discrete) values to avoid large glyph shape distortions.</p>
</div>
<div class="figure">
<img src="img/e-17px-x17.png" alt="The same, this time with option -x 17 (and -w &quot;&quot;)." />
<p class="caption">The same, this time with option <code>-x 17</code> (and ‘<code>-w &quot;&quot;</code>’).</p>
</div>
</dd>
</dl>
<h3 id="x-height-snapping-exceptions">x Height Snapping Exceptions</h3>
<dl>
<dt><code>--x-height-snapping-exceptions=</code><em>string</em>, <code>-X</code> <em>string</em></dt>
<dd><p>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 <em>value</em><sub>1</sub><code>-</code><em>value</em><sub>2</sub>, meaning <em>value</em><sub>1</sub> &lt;= PPEM &lt;= <em>value</em><sub>2</sub>. <em>value</em><sub>1</sub> or <em>value</em><sub>2</sub> (or both) can be missing; a missing value is replaced by the beginning or end of the whole interval of valid PPEM values, respectively (6 to 32767). Whitespace is not significant; superfluous commas are ignored, and ranges must be specified in increasing order. For example, the string <code>&quot;7-9, 11, 13-&quot;</code> means the values 7, 8, 9, 11, 13, 14, 15, etc. Consequently, if the supplied argument is <code>&quot;-&quot;</code>, no x height snapping takes place at all. The default is the empty string (<code>&quot;&quot;</code>), meaning no snapping exceptions.</p>
<p>Normally, x height snapping means a slight increase in the overall vertical glyph size so that the height of lowercase glyphs gets aligned to the pixel grid (this is a global feature, affecting <em>all</em> glyphs of a font). However, having larger vertical glyph sizes is not always desired, especially if it is not possible to adjust the <code>usWinAscent</code> and <code>usWinDescent</code> values from the font’s <code>OS/2</code> table so that they are not too tight. See ‘<a href="#windows-compatibility">Windows Compatibility</a>’ for more details.</p>
</dd>
</dl>
<h3 id="fallback-stem-width">Fallback Stem Width</h3>
<dl>
<dt><code>--fallback-stem-width=</code><em>n</em>, <code>-H</code> <em>n</em></dt>
<dd><p>Set the horizontal stem width (hinting) value for all scripts that lack proper standard characters in the font. The value is given in font units and must be a positive integer. If not set, 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).</p>
<p>For symbol fonts, you need option <code>--fallback-script</code> too (to set up a script at all).</p>
<p>In the GUI, uncheck the ‘Default Fallback Stem Width’ box to activate this feature.</p>
</dd>
</dl>
<h3 id="windows-compatibility">Windows Compatibility</h3>
<dl>
<dt><code>--windows-compatibility</code>, <code>-W</code></dt>
<dd><p>This option makes ttfautohint add two artificial blue zones, positioned at the <code>usWinAscent</code> and <code>usWinDescent</code> values (from the font’s <code>OS/2</code> table). The idea is to help ttfautohint so that the hinted glyphs stay within this horizontal stripe since Windows clips everything falling outside.</p>
<p>There is a general problem with tight values for <code>usWinAscent</code> and <code>usWinDescent</code>; a good description is given in the <a href="http://typophile.com/node/13081">Vertical Metrics How-To</a>. Additionally, there is a special problem with tight values if used in combination with ttfautohint because the auto-hinter tends to slightly increase the vertical glyph dimensions at smaller sizes to improve legibility. This enlargement can make the heights and depths of glyphs exceed the range given by <code>usWinAscent</code> and <code>usWinDescent</code>.</p>
<p>If ttfautohint is part of the font creation tool chain, and the font designer can adjust those two values, a better solution instead of using option <code>-W</code> is to reserve some vertical space for ‘padding’: For the auto-hinter, the difference between a top or bottom outline point before and after hinting is less than 1px, thus a vertical padding of 2px is sufficient. Assuming a minimum hinting size of 6ppem, adding two pixels gives an increase factor of 8÷6 = 1.33. This is near to the default baseline-to-baseline distance used by TeX and other sophisticated text processing applications, namely 1.2×designsize, which gives satisfying results in most cases. It is also near to the factor 1.25 recommended in the abovementioned how-to. For example, if the vertical extension of the largest glyph is 2000 units (assuming that it approximately represents the designsize), the sum of <code>usWinAscent</code> and <code>usWinDescent</code> could be 1.25×2000 = 2500.</p>
<p>In case ttfautohint is used as an auto-hinting tool for fonts that can be no longer modified to change the metrics, option <code>-W</code> in combination with ‘<code>-X &quot;-&quot;</code>’ to suppress any vertical enlargement should prevent almost all clipping.</p>
</dd>
</dl>
<h3 id="adjust-subglyphs">Adjust Subglyphs</h3>
<dl>
<dt><code>--adjust-subglyphs</code>, <code>-p</code></dt>
<dd><em>Adjusting subglyphs</em> makes a font’s original bytecode be applied to all glyphs before it is replaced with bytecode created by ttfautohint. This makes only sense if your font already has some hints in it that modify the shape even at EM size (normally 2048px); in particular, some CJK fonts need this because the bytecode is used to scale and shift subglyphs (hence the option’s long name). For most fonts, however, this is not the case.
</dd>
</dl>
<h3 id="hint-composites">Hint Composites</h3>
<dl>
<dt><code>--composites</code>, <code>-c</code></dt>
<dd><p>By default, the components of a composite glyph get hinted separately. If this flag is set, the composite glyph itself gets hinted (and the hints of the components are ignored). Using this flag increases the bytecode size a lot, however, it might yield better hinting results.</p>
<p>If this option is used (and a font actually contains composite glyphs), ttfautohint currently cannot reprocess its own output for technical reasons, see <a href="#the-.ttfautohint-glyph">below</a>.</p>
</dd>
</dl>
<h3 id="symbol-font">Symbol Font</h3>
<dl>
<dt><code>--symbol</code>, <code>-s</code></dt>
<dd><p>Process a font that ttfautohint would refuse otherwise because it can’t find a single standard character for any of the supported scripts.</p>
<p>For all scripts that lack proper standard characters, ttfautohint 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’).</p>
<p>Use this option (usually in combination with the <a href="#fallback-script"><code>--fallback-script</code></a> and/or <a href="#fallback-stem-width"><code>--fallback-stem-width</code></a> option) to hint symbol or dingbat fonts or math glyphs, for example.</p>
</dd>
</dl>
<h3 id="dehint">Dehint</h3>
<dl>
<dt><code>--dehint</code>, <code>-d</code></dt>
<dd>Strip off all hints without generating new hints. Consequently, all other hinting options are ignored. This option is intended for testing purposes.
</dd>
</dl>
<h3 id="ttfautohint-info">ttfautohint Info</h3>
<dl>
<dt><code>--no-info</code>, <code>-n</code></dt>
<dd><p>Don’t add ttfautohint version and command line information to the version string or strings (with name ID 5) in the font’s <code>name</code> table. In the GUI, it corresponds to value ‘None’ in the ‘ttfautohint info’ combo box.</p>
<p>This option is mutually exclusive with option <code>-I</code>.</p>
</dd>
<dt><code>--detailed-info</code>, <code>-I</code></dt>
<dd><p>Add ttfautohint version and command line information to the version string or strings (with name ID 5) in the font’s <code>name</code> table. In the GUI, it corresponds to value ‘Version and Parameters’ in the ‘ttfautohint info’ combo box.</p>
<p>This option is mutually exclusive with option <code>-n</code>.</p>
</dd>
</dl>
<p>If neither <code>-n</code> nor <code>-I</code> is set, the string ‘<code>ttfautohint (vNNN)</code>’ gets added to the <code>name</code> table (with <em>NNN</em> the current version); this correponds to value ‘Version’ in the ‘ttfautohint info’ combo box.</p>
<h3 id="add-ttfa-info-table">Add TTFA Info Table</h3>
<dl>
<dt><code>--ttfa-table</code>, <code>-t</code></dt>
<dd><p>Add an SFNT table called <code>TTFA</code> to the output font that holds a dump of all parameters; the data resembles the format of the <code>--debug</code> option’s parameter listing. In particular, it lists all ttfautohint control instructions (which are <em>not</em> shown in the <code>name</code> table info). This option is mainly for archival purposes so that all information used to create a font is stored in the font itself. Note that such a <code>TTFA</code> table gets ignored by all TrueType rendering engines.</p>
<p>Forthcoming versions of the ttfautohint front-ends will be able to use this data so that a font can be processed another time with exactly the same parameters, thus providing a means for round-tripping fonts.</p>
</dd>
</dl>
<h3 id="family-suffix">Family Suffix</h3>
<dl>
<dt><code>--family-suffix=</code><em>string</em>, <code>-F</code> <em>string</em></dt>
<dd><p>A string that gets appended to the family name in entries with IDs 1, 4, 6, 16, and 21 in the font’s <code>name</code> table. Allowed input is ASCII in the range 0x20-0x7E except characters <code>%()/&lt;&gt;[]{}</code>.</p>
<p>Assuming an input family name ‘Foo’, a full name ‘Foo Bold’, and a family suffix ‘ 1’, the output family name will be ‘Foo 1’ and the full name ‘Foo 1 Bold’. For the PostScript name in ID 6, ttfautohint uses the suffix with space characters removed (for example ‘Foo1Bold’).</p>
<p>This option is mainly for testing purposes, enabling the operating system to simultaneously display several instances of a font that are processed with different ttfautohint parameters.</p>
</dd>
</dl>
<h3 id="reference-face-index">Reference Face Index</h3>
<dl>
<dt><code>--reference-index=</code><em>n</em>, <code>-Z</code> <em>n</em></dt>
<dd><p>Set the face index for the <a href="#blue-zone-reference-font">blue zone reference font</a> if the font is a TrueType collection (<code>.ttc</code>). For normal TrueType fonts, the value is always zero (which is also the default).</p>
<p><code>ttfautohintGUI</code> doesn’t have this command line option.</p>
</dd>
</dl>
<h3 id="strong-stem-width-and-positioning">Strong Stem Width and Positioning</h3>
<dl>
<dt><code>--strong-stem-width=</code><em>string</em>, <code>-w</code> <em>string</em></dt>
<dd><p>ttfautohint offers two different routines to handle (horizontal) stem widths and stem positions: ‘smooth’ and ‘strong’. The former uses discrete values that slightly increase the stem contrast with almost no distortion of the outlines, while the latter snaps both stem widths and stem positions to integer pixel values as much as possible, yielding a crisper appearance at the cost of much more distortion.</p>
<p>These two routines are mapped onto three possible rendering targets:</p>
<ul>
<li><p>grayscale rendering, with or without optimization for subpixel positioning (e.g. Android)</p></li>
<li><p>‘GDI ClearType’ rendering: the rasterizer version, as returned by the GETINFO bytecode instruction, is in the range 36 &lt;= version &lt; 38 and ClearType is enabled (e.g. Windows XP)</p></li>
<li><p>‘DirectWrite ClearType’ rendering: the rasterizer version, as returned by the GETINFO bytecode instruction, is &gt;= 38, ClearType is enabled, and subpixel positioning is enabled also (e.g. Internet Explorer 9 running on Windows 7)</p></li>
</ul>
<p>GDI ClearType uses a mode similar to B/W rendering along the vertical axis, while DW ClearType applies grayscale rendering. Additionally, only DW ClearType provides subpixel positioning along the x axis. For what it’s worth, the rasterizers version 36 and version 38 in Microsoft Windows are two completely different rendering engines.</p>
<p>The command line option expects <em>string</em> to contain up to three letters with possible values ‘<code>g</code>’ for grayscale, ‘<code>G</code>’ for GDI ClearType, and ‘<code>D</code>’ for DW ClearType. If a letter is found in <em>string</em>, the strong stem width routine is used for the corresponding rendering target (and smooth stem width handling otherwise). The default value is ‘<code>G</code>’, which means that strong stem width handling is activated for GDI ClearType only. To use smooth stem width handling for all three rendering targets, use the empty string as an argument, usually connoted with ‘<code>&quot;&quot;</code>’.</p>
<p>In the GUI, simply set the corresponding check box to select the strong width routine for a given rendering target. If you unset the check box, the smooth width routine gets used.</p>
<p>The following images again use the font ‘Mertz Bold’.</p>
<div class="figure">
<img src="img/ff-g-26px.png" alt="The left part shows the glyph g unhinted at 26px, the right part with hints, using the smooth stem algorithm." />
<p class="caption">The left part shows the glyph ‘g’ unhinted at 26px, the right part with hints, using the ‘smooth’ stem algorithm.</p>
</div>
<div class="figure">
<img src="img/ff-g-26px-wD.png" alt="The same, but this time using the strong algorithm. Note how the stems are aligned to the pixel grid." />
<p class="caption">The same, but this time using the ‘strong’ algorithm. Note how the stems are aligned to the pixel grid.</p>
</div>
</dd>
</dl>
<h3 id="miscellaneous">Miscellaneous</h3>
<dl>
<dt>Watch input files   (<code>ttfautohintGUI</code> only)</dt>
<dd><p>If this checkbox is set, automatically regenerate the output file as soon as an input file (either the font, the control instructions file, or the reference font) gets modified.</p>
<p>Pressing the ‘Run’ button starts watching. If an error occurs, watching stops and must be restarted with the ‘Run’ button.</p>
</dd>
<dt><code>--ignore-restrictions</code>, <code>-i</code></dt>
<dd><p>By default, fonts that have bit 1 set in the ‘fsType’ field of the <code>OS/2</code> table are rejected. If you have a permission of the font’s legal owner to modify the font, specify this command line option.</p>
<p>If this option is not set, <code>ttfautohintGUI</code> shows a dialogue to handle such fonts if necessary.</p>
</dd>
<dt><code>--help</code>, <code>-h</code></dt>
<dd>On the console, print a brief documentation on standard output and exit. This doesn’t work with <code>ttfautohintGUI</code> on MS Windows.
</dd>
<dt><code>--version</code>, <code>-v</code></dt>
<dd>On the console, print version information on standard output and exit. This doesn’t work with <code>ttfautohintGUI</code> on MS Windows.
</dd>
<dt><code>--ttfa-info</code>, <code>-T</code>   (not in <code>ttfautohintGUI</code>)</dt>
<dd>Print <a href="#add-ttfa-info-table"><code>TTFA</code> table</a> of the input font on standard output if present, then exit.
</dd>
<dt><code>--debug</code>   (not in <code>ttfautohintGUI</code>)</dt>
<dd><p>Print <em>a lot</em> of debugging information on standard error while processing a font (you should redirect stderr to a file).</p>
<p>To reduce the amount of debug data it is recommended to restrict the hinting process to a single PPEM value, e.g.,</p>
<pre><code>   ttfautohint --debug -l 15 -r 15 ... &gt; debug.txt 2&gt;&amp;1</code></pre>
</dd>
</dl>
<h1 id="background-and-technical-details">Background and Technical Details</h1>
<p><a href="http://www.tug.org/TUGboat/tb24-3/lemberg.pdf">Real-Time Grid Fitting of Typographic Outlines</a> is a scholarly paper that describes FreeType’s auto-hinter in some detail. Regarding the described data structures it is slightly out of date, but the algorithm itself hasn’t changed in general.</p>
<p>The next few subsections are mainly based on this article, introducing some important concepts. Note that ttfautohint only does hinting along the vertical direction (modifying y coordinates only).</p>
<h2 id="segments-and-edges">Segments and Edges</h2>
<p>A glyph consists of one or more <em>contours</em> (this is, closed curves). For example, glyph ‘O’ consists of two contours, while glyph ‘I’ has only one.</p>
<div class="figure">
<img src="img/o-and-i.svg" alt="The letter O has two contours, an inner and an outer one, while letter I has only an outer contour." />
<p class="caption">The letter ‘O’ has two contours, an inner and an outer one, while letter ‘I’ has only an outer contour.</p>
</div>
<p>A <em>segment</em> is a series of consecutive points of a contour (including its Bézier control points) that are approximately aligned along a coordinate axis. A segment has one of three possible directions: left, right, or none (which means neither left nor right), derived from the TrueType outline directions. ttfautohint itself creates segments that contain at least two points. Using control instructions, however, it is possible to create one-point segments, which are useful for fine-tuning the hinting process.</p>
<div class="figure">
<img src="img/segment-edge.svg" alt="A serif. Contour and control points are represented by squares and circles, respectively. The bottom line DE is approximately aligned along the horizontal axis, thus it forms a segment of 7 points. Together with the two other horizontal segments, BC and FG, they form two edges (BC+FG, DE)." />
<p class="caption">A serif. Contour and control points are represented by squares and circles, respectively. The bottom ‘line’ DE is approximately aligned along the horizontal axis, thus it forms a segment of 7 points. Together with the two other horizontal segments, BC and FG, they form two edges (BC+FG, DE).</p>
</div>
<p>An <em>edge</em> corresponds to a single coordinate value (allowing for a small threshold) on the main dimension that collects one or more segments, all pointing into the same direction (either left or right, all others are ignored). While finding segments is done on the unscaled outline, finding edges is bound to the device resolution. See <a href="#hint-sets">below</a> for an example.</p>
<p>In general, segments and edges pointing into different directions ‘repel’ each other, thus preventing alignment on the same vertical coordinate if they are near. Note that this is a simplification, but it should help understand how to manipulate and/or create segments in control instructions files.</p>
<p>The analysis to find segments and edges is specific to a writing system, see <a href="#writing-systems">below</a>.</p>
<h2 id="feature-analysis">Feature Analysis</h2>
<p>The auto-hinter analyzes a font in two steps. Right now, everything described here happens for the horizontal axis only, providing vertical hinting.</p>
<ul>
<li><p>Global Analysis</p>
<p>This affects the hinting of all glyphs, trying to give them a uniform appearance.</p>
<ul>
<li><p>Compute standard horizontal stem width of the font. The value is normally taken from glyphs that resemble letter ‘o’.</p></li>
<li><p>Compute blue zones, see <a href="#blue-zones">below</a>.</p></li>
</ul>
<p>If the stem widths of single glyphs differ by a large value, or if ttfautohint fails to find proper blue zones, hinting becomes quite poor, possibly leading even to severe shape distortions.</p></li>
</ul>
<table>
<caption>script-specific standard characters of the ‘latin’ writing system</caption>
<thead>
<tr class="header">
<th align="center">Script</th>
<th align="left">Standard characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>arab</code></td>
<td align="left">‘ـ’, U+0640, ARABIC TATWEEL</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘ل’, U+0644, ARABIC LETTER LAM</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘ح’, U+062D, ARABIC LETTER HAH</td>
</tr>
<tr class="even">
<td align="center"><code>armn</code></td>
<td align="left">‘օ’, U+0585, ARMENIAN SMALL LETTER OH</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘Օ’, U+0555, ARMENIAN CAPITAL LETTER OH</td>
</tr>
<tr class="even">
<td align="center"><code>beng</code></td>
<td align="left">‘০’, U+09E6, BENGALI DIGIT ZERO</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘৪’, U+09EA, BENGALI DIGIT FOUR</td>
</tr>
<tr class="even">
<td align="center"><code>cyrl</code></td>
<td align="left">‘о’, U+043E, CYRILLIC SMALL LETTER O</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘О’, U+041E, CYRILLIC CAPITAL LETTER O</td>
</tr>
<tr class="even">
<td align="center"><code>cher</code></td>
<td align="left">‘Ꭴ’, U+13A4, CHEROKEE LETTER U</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘Ꮕ’, U+13C5, CHEROKEE LETTER NV</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘ꮕ’, U+AB95, CHEROKEE SMALL LETTER NV</td>
</tr>
<tr class="odd">
<td align="center"><code>deva</code></td>
<td align="left">‘ठ’, U+0920, DEVANAGARI LETTER TTHA</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘व’, U+0935, DEVANAGARI LETTER VA</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘ट’, U+091F, DEVANAGARI LETTER TTA</td>
</tr>
<tr class="even">
<td align="center"><code>ethi</code></td>
<td align="left">‘ዐ’, U+12D0, ETHIOPIC SYLLABLE PHARYNGEAL A</td>
</tr>
<tr class="odd">
<td align="center"><code>geor</code></td>
<td align="left">‘ი’, U+10D8, GEORGIAN LETTER IN</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘ე’, U+10D4, GEORGIAN LETTER EN</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘ა’, U+10D0, GEORGIAN LETTER AN</td>
</tr>
<tr class="even">
<td align="center"><code>geok</code></td>
<td align="left">‘Ⴖ’, U+10B6, GEORGIAN CAPITAL LETTER GHAN</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘Ⴑ’, U+10B1, GEORGIAN CAPITAL LETTER SAN</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘ⴙ’, U+2D19, GEORGIAN SMALL LETTER CHIN</td>
</tr>
<tr class="odd">
<td align="center"><code>grek</code></td>
<td align="left">‘ο’, U+03BF, GREEK SMALL LETTER OMICRON</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘Ο’, U+039F, GREEK CAPITAL LETTER OMICRON</td>
</tr>
<tr class="odd">
<td align="center"><code>gujr</code></td>
<td align="left">‘ટ’, U+0A9F, GUJARATI LETTER TTA</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘૦’, U+0AE6, GUJARATI DIGIT ZERO</td>
</tr>
<tr class="odd">
<td align="center"><code>guru</code></td>
<td align="left">‘ਠ’, U+0A20, GURMUKHI LETTER TTHA</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘ਰ’, U+0A30, GURMUKHI LETTER RA</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘੦’, U+0A66, GURMUKHI DIGIT ZERO</td>
</tr>
<tr class="even">
<td align="center"><code>hebr</code></td>
<td align="left">‘ם’, U+05DD, HEBREW LETTER FINAL MEM</td>
</tr>
<tr class="odd">
<td align="center"><code>knda</code></td>
<td align="left">‘೦’, U+0CE6, KANNADA DIGIT ZERO</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘ಬ’, U+0CAC, KANNADA LETTER BA</td>
</tr>
<tr class="odd">
<td align="center"><code>khmr</code></td>
<td align="left">‘០’, U+17E0, KHMER DIGIT ZERO</td>
</tr>
<tr class="even">
<td align="center"><code>lao</code></td>
<td align="left">‘໐’, U+0ED0, LAO DIGIT ZERO</td>
</tr>
<tr class="odd">
<td align="center"><code>latn</code></td>
<td align="left">‘o’, U+006F, LATIN SMALL LETTER O</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘O’, U+004F, LATIN CAPITAL LETTER O</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘0’, U+0030, DIGIT ZERO</td>
</tr>
<tr class="even">
<td align="center"><code>mlym</code></td>
<td align="left">‘ഠ’, U+0D20, MALAYALAM LETTER TTHA</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘റ’, U+0D31, MALAYALAM LETTER RRA</td>
</tr>
<tr class="even">
<td align="center"><code>mymr</code></td>
<td align="left">‘ဝ’, U+101D, MYANMAR LETTER WA</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘င’, U+1004, MYANMAR LETTER NGA</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘ဂ’, U+1002, MYANMAR LETTER GA</td>
</tr>
<tr class="odd">
<td align="center"><code>sinh</code></td>
<td align="left">‘ට’, U+0DA7, SINHALA LETTER ALPAPRAANA TTAYANNA</td>
</tr>
<tr class="even">
<td align="center"><code>taml</code></td>
<td align="left">‘௦’, U+0BE6, TAMIL DIGIT ZERO</td>
</tr>
<tr class="odd">
<td align="center"><code>telu</code></td>
<td align="left">‘౦’, U+0C66, TELUGU DIGIT ZERO</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘౧’, U+0C67, TELUGU DIGIT ONE</td>
</tr>
<tr class="odd">
<td align="center"><code>thai</code></td>
<td align="left">‘า’, U+0E32, THAI CHARACTER SARA AA</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘ๅ’, U+0E45, THAI CHARACTER LAKKHANGYAO</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘๐’, U+0E50, THAI DIGIT ZERO</td>
</tr>
</tbody>
</table>
<table>
<caption>standard characters of the ‘latin’ writing system, special scripts</caption>
<thead>
<tr class="header">
<th align="center">Script</th>
<th align="left">Standard characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>khms</code></td>
<td align="left">‘᧡’, U+19E1, KHMER SYMBOL MUOY KOET</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘᧪’, U+19EA, KHMER SYMBOL DAP KOET</td>
</tr>
<tr class="odd">
<td align="center"><code>latb</code></td>
<td align="left">‘ₒ’, U+2092, LATIN SUBSCRIPT SMALL LETTER O</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘₀’, U+2080, SUBSCRIPT ZERO</td>
</tr>
<tr class="odd">
<td align="center"><code>latp</code></td>
<td align="left">‘ᵒ’, U+1D52, MODIFIER LETTER SMALL O</td>
</tr>
<tr class="even">
<td align="center"></td>
<td align="left">‘ᴼ’, U+1D3C, MODIFIER LETTER CAPITAL O</td>
</tr>
<tr class="odd">
<td align="center"></td>
<td align="left">‘⁰’, U+2070, SUPERSCRIPT ZERO</td>
</tr>
</tbody>
</table>
<ul>
<li><p>Glyph Analysis</p>
<p>This is a per-glyph operation.</p>
<ul>
<li><p>Find segments and edges.</p></li>
<li><p>Link edges together to find stems and serifs. The abovementioned paper gives more details on what exactly constitutes a stem or a serif and how the algorithm works.</p></li>
</ul></li>
</ul>
<h2 id="blue-zones">Blue Zones</h2>
<div class="figure">
<img src="img/blue-zones.svg" alt="Two blue zones relevant to the glyph a. Vertical point coordinates of all glyphs within these zones are aligned, provided the blue zone is active (this is, its vertical size is smaller than 3/4 pixels)." />
<p class="caption">Two blue zones relevant to the glyph ‘a’. Vertical point coordinates of <em>all</em> glyphs within these zones are aligned, provided the blue zone is active (this is, its vertical size is smaller than 3/4 pixels).</p>
</div>
<p>Outlines of certain characters are used to determine <em>blue zones</em>. This concept is the same as with Type 1 fonts: All glyph points that lie in certain small horizontal zones get aligned vertically.</p>
<p>Here a series of tables that show the blue zone characters of the latin writing system’s available scripts; the values are hard-coded in the source code. Since the auto-hinter takes mean values it is not necessary that all characters of a zone are present.</p>
<p>‘Round’ characters in blue zones (e.g., the top and bottom of ‘O’ or the bottom of ‘g’) are used to control overshoot handling.</p>
<p>Blue zones marked with an asterisk are x height blue zones, which are adjusted to be on the pixel grid (to improve rendering at small sizes) by scaling the remaining blue zones before they are adjusted to the grid. See also option <a href="#x-height-increase-limit"><code>--increase-x-height</code></a>.</p>
<table>
<caption><code>arab</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of letters with vertical stroke</td>
<td align="left">ا إ ل ك ط ظ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">ت ث ط ظ ك</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">glyph joining</td>
<td align="left">ـ</td>
</tr>
</tbody>
</table>
<table>
<caption><code>armn</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of capital letters</td>
<td align="left">Ա Մ Ւ Փ Բ Գ Դ Օ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of capital letters</td>
<td align="left">Ւ Ո Փ Ճ Շ Ս Տ Օ</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ascenders of small letters</td>
<td align="left">ե է ի մ վ փ ֆ փ</td>
</tr>
<tr class="even">
<td align="left">4*</td>
<td align="left">top of small letters</td>
<td align="left">ա յ ւ ս գ ջ ր օ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of small letters</td>
<td align="left">հ ո ճ ա ե ծ ս օ</td>
</tr>
<tr class="even">
<td align="left">6</td>
<td align="left">bottom of descenders of small letters</td>
<td align="left">բ ը ի լ ղ պ փ ց</td>
</tr>
</tbody>
</table>
<table>
<caption><code>beng</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">baseline (flat glyphs only)</td>
<td align="left">অ ড ত ন ব ভ ল ক</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">top of ascenders</td>
<td align="left">ই ট ঠ ি ী ৈ ৗ</td>
</tr>
<tr class="odd">
<td align="left">3*</td>
<td align="left">top of baseline</td>
<td align="left">ও এ ড ত ন ব ল ক</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">bottom of base characters</td>
<td align="left">অ ড ত ন ব ভ ল ক</td>
</tr>
</tbody>
</table>
<p>Contrary to scripts like latin, the baseline in Bengali is on the top, and we hint from top to bottom.</p>
<table>
<caption><code>cher</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of capital letters</td>
<td align="left">Ꮖ Ꮋ Ꭼ Ꮓ Ꭴ Ꮳ Ꭶ Ꮥ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of capital letters</td>
<td align="left">Ꮖ Ꮋ Ꭼ Ꮓ Ꭴ Ꮳ Ꭶ Ꮥ</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ascenders of small letters</td>
<td align="left">ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ ꮝ ꮿ</td>
</tr>
<tr class="even">
<td align="left">4*</td>
<td align="left">top of small letters</td>
<td align="left">ꮖ ꭼ ꮓ ꮠ ꮳ ꭶ ꮥ ꮻ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of small letters</td>
<td align="left">ꮖ ꭼ ꮓ ꮠ ꮳ ꭶ ꮥ ꮻ</td>
</tr>
<tr class="even">
<td align="left">6</td>
<td align="left">bottom of descenders of small letters</td>
<td align="left">ᏸ ꮐ ꭹ ꭻ</td>
</tr>
</tbody>
</table>
<table>
<caption><code>cyrl</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of capital letters</td>
<td align="left">Б В Е П З О С Э</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of capital letters</td>
<td align="left">Б В Е Ш З О С Э</td>
</tr>
<tr class="odd">
<td align="left">3*</td>
<td align="left">top of small letters</td>
<td align="left">х п н ш е з о с</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">bottom of small letters</td>
<td align="left">х п н ш е з о с</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of descenders of small letters</td>
<td align="left">р у ф</td>
</tr>
</tbody>
</table>
<table>
<caption><code>deva</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of ascenders</td>
<td align="left">ई ऐ ओ औ ि ी ो ौ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">top of baseline</td>
<td align="left">क म अ आ थ ध भ श</td>
</tr>
<tr class="odd">
<td align="left">3*</td>
<td align="left">top of baseline (flat glyphs only)</td>
<td align="left">क न म उ छ ट ठ ड</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">bottom of base characters</td>
<td align="left">क न म उ छ ट ठ ड</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of descenders</td>
<td align="left">ु ृ</td>
</tr>
</tbody>
</table>
<p>Contrary to scripts like latin, the baseline in Devanagari is on the top, and we hint from top to bottom. Note that some fonts have extreme variation in the height of the round elements in Zone 3; for this reason we also define Zone 1, which must be always present.</p>
<table>
<caption><code>ethi</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of letters</td>
<td align="left">ሀ ሃ ዘ ፐ ማ በ ዋ ዐ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">ለ ሐ በ ዘ ሀ ሪ ዐ ጨ</td>
</tr>
</tbody>
</table>
<table>
<caption><code>geok</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of Asomtavruli letters</td>
<td align="left">Ⴑ Ⴇ Ⴙ Ⴜ Ⴄ Ⴅ Ⴓ Ⴚ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of Asomtavruli letters</td>
<td align="left">Ⴄ Ⴅ Ⴇ Ⴈ Ⴆ Ⴑ Ⴊ Ⴋ</td>
</tr>
<tr class="odd">
<td align="left">3*</td>
<td align="left">top of Nuskhuri letters</td>
<td align="left">ⴁ ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">bottom of Nuskhuri letters</td>
<td align="left">ⴈ ⴌ ⴖ ⴎ ⴃ ⴆ ⴋ ⴢ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">top of ascender Nuskhuri letters</td>
<td align="left">ⴐ ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ</td>
</tr>
<tr class="even">
<td align="left">6</td>
<td align="left">bottom of Nuskhuri descender letters</td>
<td align="left">ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ</td>
</tr>
</tbody>
</table>
<p>Georgian Asomtavruli and Nuskhuri form the old ecclesiastical script, Khutsuri. Note that fonts show a great variation in height and depth of ascender and descender letter forms.</p>
<table>
<caption><code>geor</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1*</td>
<td align="left">top of Mkhedruli letters</td>
<td align="left">გ დ ე ვ თ ი ო ღ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of Mkhedruli letters</td>
<td align="left">ა ზ მ ს შ ძ ხ ჰ</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ascender Mkhedruli letters</td>
<td align="left">ს ხ ქ ზ მ შ ჩ წ</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">bottom of descender Mkhedruli letters</td>
<td align="left">ე ვ ჟ ტ უ ფ ქ ყ</td>
</tr>
</tbody>
</table>
<p>Georgian Mkhedruli support is incomplete; it doesn’t yet contain characters for Mtavruli (which are not yet encoded in Unicode), the uppercase glyph variants of Mkhedruli.</p>
<table>
<caption><code>grek</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of capital letters</td>
<td align="left">Γ Β Ε Ζ Θ Ο Ω</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of capital letters</td>
<td align="left">Β Δ Ζ Ξ Θ Ο</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ‘small beta’ like letters</td>
<td align="left">β θ δ ζ λ ξ</td>
</tr>
<tr class="even">
<td align="left">4*</td>
<td align="left">top of small letters</td>
<td align="left">α ε ι ο π σ τ ω</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of small letters</td>
<td align="left">α ε ι ο π σ τ ω</td>
</tr>
<tr class="even">
<td align="left">6</td>
<td align="left">bottom of descenders of small letters</td>
<td align="left">β γ η μ ρ φ χ ψ</td>
</tr>
</tbody>
</table>
<table>
<caption><code>gujr</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1*</td>
<td align="left">top of letters</td>
<td align="left">ત ન ઋ ઌ છ ટ ર ૦</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">ખ ગ ઘ ઞ ઇ ઈ ઠ જ</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ascenders</td>
<td align="left">ઈ ઊ િ ી લી શ્ચિ જિ સી</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">bottom of descenders</td>
<td align="left">ુ ૃ ૄ ખુ છૃ છૄ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">top of Gujarati digits</td>
<td align="left">૦ ૧ ૨ ૩ ૭</td>
</tr>
</tbody>
</table>
<table>
<caption><code>guru</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of ascenders</td>
<td align="left">ਇ ਈ ਉ ਏ ਓ ੳ ਿ ੀ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">top of baseline</td>
<td align="left">ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ</td>
</tr>
<tr class="odd">
<td align="left">3*</td>
<td align="left">top of baseline (flat glyphs only)</td>
<td align="left">ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">bottom of characters</td>
<td align="left">ਅ ਏ ਓ ਗ ਜ ਠ ਰ ਸ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">top of Gurmukhi digits</td>
<td align="left">੦ ੧ ੨ ੩ ੭</td>
</tr>
</tbody>
</table>
<table>
<caption><code>hebr</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of letters</td>
<td align="left">ב ד ה ח ך כ ם ס</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">ב ט כ ם ס צ</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">bottom of descenders of letters</td>
<td align="left">ק ך ן ף ץ</td>
</tr>
</tbody>
</table>
<table>
<caption><code>knda</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of letters</td>
<td align="left">ಇ ಊ ಐ ಣ ಸಾ ನಾ ದಾ ರಾ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">ಅ ಉ ಎ ಲ ೦ ೨ ೬ ೭</td>
</tr>
</tbody>
</table>
<table>
<caption><code>khmr</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1*</td>
<td align="left">top of letters</td>
<td align="left">ខ ទ ន ឧ ឩ ា</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">top of subscript cluster components</td>
<td align="left">ក្ក ក្ខ ក្គ ក្ថ</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">bottom of letters</td>
<td align="left">ខ ឃ ច ឋ ប ម យ ឲ</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">bottom of descenders</td>
<td align="left">ត្រ រៀ ឲ្យ អឿ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of large descenders</td>
<td align="left">ន្ត្រៃ ង្ខ្យ ក្បៀ ច្រៀ ន្តឿ ល្បឿ</td>
</tr>
</tbody>
</table>
<table>
<caption><code>khms</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1*</td>
<td align="left">top of symbols for waxing</td>
<td align="left">᧠ ᧡</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of symbols for waning</td>
<td align="left">᧶ ᧹</td>
</tr>
</tbody>
</table>
<p>Khmer symbols are used for lunar dates.</p>
<table>
<caption><code>lao</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1*</td>
<td align="left">top of letters</td>
<td align="left">າ ດ ອ ມ ລ ວ ຣ ງ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">າ ອ ບ ຍ ຣ ຮ ວ ຢ</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ascenders</td>
<td align="left">ປ ຢ ຟ ຝ</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">top of large ascenders</td>
<td align="left">ໂ ໄ ໃ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of descenders</td>
<td align="left">ງ ຊ ຖ ຽ ໆ ຯ</td>
</tr>
</tbody>
</table>
<table>
<caption><code>latb</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of capital characters</td>
<td align="left">₀ ₃ ₅ ₇ ₈</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of capital characters</td>
<td align="left">₀ ₁ ₂ ₃ ₈</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ‘small f’ like characters</td>
<td align="left">ᵢ ⱼ ₕ ₖ ₗ</td>
</tr>
<tr class="even">
<td align="left">4*</td>
<td align="left">top of small characters</td>
<td align="left">ₐ ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of small characters</td>
<td align="left">ₐ ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ</td>
</tr>
<tr class="even">
<td align="left">6</td>
<td align="left">bottom of descenders of small characters</td>
<td align="left">ᵦ ᵧ ᵨ ᵩ ₚ</td>
</tr>
</tbody>
</table>
<p>Subscript latin characters are similar to normal latin characters.</p>
<table>
<caption><code>latn</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of capital letters</td>
<td align="left">T H E Z O C Q S</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of capital letters</td>
<td align="left">H E Z L O C U S</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ‘small f’ like letters</td>
<td align="left">f i j k d b h</td>
</tr>
<tr class="even">
<td align="left">4*</td>
<td align="left">top of small letters</td>
<td align="left">x z r o e s c</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of small letters</td>
<td align="left">x z r o e s c</td>
</tr>
<tr class="even">
<td align="left">6</td>
<td align="left">bottom of descenders of small letters</td>
<td align="left">p q g j y</td>
</tr>
</tbody>
</table>
<table>
<caption><code>latp</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of capital characters</td>
<td align="left">⁰ ³ ⁵ ⁷ ᵀ ᴴ ᴱ ᴼ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of capital characters</td>
<td align="left">⁰ ¹ ² ³ ᴱ ᴸ ᴼ ᵁ</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ‘small f’ like characters</td>
<td align="left">ᵇ ᵈ ᵏ ʰ ʲ ᶠ ⁱ</td>
</tr>
<tr class="even">
<td align="left">4*</td>
<td align="left">top of small characters</td>
<td align="left">ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">bottom of small characters</td>
<td align="left">ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ</td>
</tr>
<tr class="even">
<td align="left">6</td>
<td align="left">bottom of descenders of small characters</td>
<td align="left">ᵖ ʸ ᵍ</td>
</tr>
</tbody>
</table>
<p>Superscript latin characters are similar to normal latin characters.</p>
<table>
<caption><code>mlym</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of letters</td>
<td align="left">ഒ ട ഠ റ ച പ ച്ച പ്പ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">ട ഠ ധ ശ ഘ ച ഥ ല</td>
</tr>
</tbody>
</table>
<table>
<caption><code>mymr</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1*</td>
<td align="left">top of letters</td>
<td align="left">ခ ဂ င ဒ ဝ ၥ ၊ ။</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">င ဎ ဒ ပ ဗ ဝ ၊ ။</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">top of ascenders of characters</td>
<td align="left">ဩ ြ ၍ ၏ ၆ ါ ိ</td>
</tr>
<tr class="even">
<td align="left">3</td>
<td align="left">bottom of descenders of letters</td>
<td align="left">ဉ ည ဥ ဩ ဨ ၂ ၅ ၉</td>
</tr>
</tbody>
</table>
<table>
<caption><code>sinh</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of letters</td>
<td align="left">ඉ ක ඝ ඳ ප ය ල ෆ</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">එ ඔ ඝ ජ ට ථ ධ ර</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">bottom of descenders of letters</td>
<td align="left">ද ඳ උ ල තූ තු බු දු</td>
</tr>
</tbody>
</table>
<table>
<caption><code>taml</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top of letters</td>
<td align="left">உ ஒ ஓ ற ஈ க ங ச</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom of letters</td>
<td align="left">க ச ல ஶ உ ங ட ப</td>
</tr>
</tbody>
</table>
<table>
<caption><code>telu</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1</td>
<td align="left">top</td>
<td align="left">ఇ ఌ ఙ ఞ ణ ఱ ౯</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom</td>
<td align="left">అ క చ ర ఽ ౨ ౬</td>
</tr>
</tbody>
</table>
<table>
<caption><code>thai</code> blue zones</caption>
<thead>
<tr class="header">
<th align="left">ID</th>
<th align="left">Blue zone</th>
<th align="left">Characters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">1*</td>
<td align="left">top</td>
<td align="left">บ เ แ อ ก า</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">bottom</td>
<td align="left">บ ป ษ ฯ อ ย ฮ</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">ascender</td>
<td align="left">ป ฝ ฟ</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">large ascender</td>
<td align="left">โ ใ ไ</td>
</tr>
<tr class="odd">
<td align="left">5</td>
<td align="left">descender</td>
<td align="left">ฎ ฏ ฤ ฦ</td>
</tr>
<tr class="even">
<td align="left">6</td>
<td align="left">large descender</td>
<td align="left">ญ ฐ</td>
</tr>
<tr class="odd">
<td align="left">7</td>
<td align="left">top of Thai digits</td>
<td align="left">๐ ๑ ๓</td>
</tr>
</tbody>
</table>
<div class="figure">
<img src="img/glyph-terms.svg" alt="This image shows the relevant glyph terms for vertical blue zone positions." />
<p class="caption">This image shows the relevant glyph terms for vertical blue zone positions.</p>
</div>
<h2 id="grid-fitting">Grid Fitting</h2>
<p>Aligning outlines along the grid lines is called <em>grid fitting</em>. It doesn’t necessarily mean that the outlines are positioned <em>exactly</em> on the grid, however, especially if you want a smooth appearance at different sizes. This is the central routine of the auto-hinter; its actions are highly dependent on the used writing system. Currently, only one writing system is available (latin), providing support for scripts like Latin or Greek.</p>
<ul>
<li><p>Align edges linked to blue zones.</p></li>
<li><p>Fit edges to the pixel grid.</p></li>
<li><p>Align serif edges.</p></li>
<li><p>Handle remaining ‘strong’ points. Such points are not part of an edge but are still important for defining the shape. This roughly corresponds to the <code>IP</code> TrueType instruction.</p></li>
<li><p>Everything else (the ‘weak’ points) is handled with an ‘IUP’ instruction.</p></li>
</ul>
<p>The following images illustrate the hinting process, using glyph ‘a’ from the freely available font ‘<a href="http://font.ubuntu.com">Ubuntu Book</a>’. The manual hints were added by <a href="https://daltonmaag.com">Dalton Maag Ltd</a>, the used application to create the hinting debug snapshots was <a href="http://fontforge.sf.net">FontForge</a>.</p>
<div class="figure">
<img src="img/a-before-hinting.png" alt="Before hinting." />
<p class="caption">Before hinting.</p>
</div>
<div class="figure">
<img src="img/a-after-hinting.png" alt="After hinting, using manual hints." />
<p class="caption">After hinting, using manual hints.</p>
</div>
<div class="figure">
<img src="img/a-after-autohinting.png" alt="After hinting, using ttfautohint. Note that the hinting process doesn’t change horizontal positions." />
<p class="caption">After hinting, using ttfautohint. Note that the hinting process doesn’t change horizontal positions.</p>
</div>
<h2 id="hint-sets">Hint Sets</h2>
<p>In ttfautohint terminology, a <em>hint set</em> is the <em>optimal</em> configuration for a given PPEM (pixel per EM) value.</p>
<p>In the range given by the <code>--hinting-range-min</code> and <code>--hinting-range-max</code> options, ttfautohint creates hint sets for every PPEM value. For each glyph, ttfautohint automatically determines whether a new set should be emitted for a PPEM value if it finds that it differs from a previous one. For some glyphs it is possible that one set covers, say, the range 8px-1000px, while other glyphs need 10 or more such sets.</p>
<p>In the PPEM range below <code>--hinting-range-min</code>, ttfautohint always uses just one set, in the PPEM range between <code>--hinting-range-max</code> and <code>--hinting-limit</code>, it also uses just one set.</p>
<p>One of the hinting configuration parameters is the decision which segments form an edge. For example, let us assume that two segments get aligned on a single horizontal edge at 11px, while two edges are used at 12px. This change makes ttfautohint emit a new hint set to accomodate this situation. The next images illustrate this, using a Cyrillic letter (glyph ‘afii10108’) from the ‘Ubuntu book’ font, processed with ttfautohint.</p>
<div class="figure">
<img src="img/afii10108-11px-before-hinting.png" alt="Before hinting, size 11px." />
<p class="caption">Before hinting, size 11px.</p>
</div>
<div class="figure">
<img src="img/afii10108-11px-after-hinting.png" alt="After hinting, size 11px. Segments 43-27-28 and 14-15 are aligned on a single edge, as are segments 26-0-1 and 20-21." />
<p class="caption">After hinting, size 11px. Segments 43-27-28 and 14-15 are aligned on a single edge, as are segments 26-0-1 and 20-21.</p>
</div>
<div class="figure">
<img src="img/afii10108-12px-before-hinting.png" alt="Before hinting, size 12px." />
<p class="caption">Before hinting, size 12px.</p>
</div>
<div class="figure">
<img src="img/afii10108-12px-after-hinting.png" alt="After hinting, size 12px. The segments are not aligned. While segments 43-27-28 and 20-21 now have almost the same horizontal position, they don’t form an edge because the outlines passing through the segments point into different directions." />
<p class="caption">After hinting, size 12px. The segments are not aligned. While segments 43-27-28 and 20-21 now have almost the same horizontal position, they don’t form an edge because the outlines passing through the segments point into different directions.</p>
</div>
<p>Obviously, the more hint sets get emitted, the larger the bytecode ttfautohint adds to the output font. To find a good value <em>n</em> for <code>--hinting-range-max</code>, some experimentation is necessary since <em>n</em> depends on the glyph shapes in the input font. If the value is too low, the hint set created for the PPEM value <em>n</em> (this hint set gets used for all larger PPEM values) might distort the outlines too much in the PPEM range given by <em>n</em> and the value set by <code>--hinting-limit</code> (at which hinting gets switched off). If the value is too high, the font size increases due to more hint sets without any noticeable hinting effects.</p>
<p>Similar arguments hold for <code>--hinting-range-min</code> except that there is no lower limit at which hinting is switched off.</p>
<p>An example. Let’s assume that we have a hinting range 10 &lt;= ppem &lt;= 100, and the hinting limit is set to 250. For a given glyph, ttfautohint finds out that four hint sets must be computed to exactly cover this hinting range: 10-15, 16-40, 41-80, and 81-100. For ppem values below 10ppem, the hint set covering 10-15ppem is used, for ppem values larger than 100 the hint set covering 81-100ppem is used. For ppem values larger than 250, no hinting gets applied.</p>
<h2 id="composite-glyphs">Composite Glyphs</h2>
<p>The ttfautohint library (and programs) supports two solutions for handling composite glyphs, to be controlled with option <a href="#hint-composites"><code>--composites</code></a>. This section contains some general information, then covers the case where the option is off, while the next section describes how ttfautohint behaves if this option is activated.</p>
<p>Regardless of the <code>--composites</code> option, ttfautohint performs a scan over all composite glyphs to assure that components of a composite glyph inherit its style, as described <a href="#opentype-features">later</a>. However, components that are shifted vertically will be skipped. For example, if the glyph ‘Agrave’ uses a shifted ‘grave’ accent glyph, the accent is ignored. On the other hand, if there is a glyph ‘agrave’ that uses the same ‘grave’ glyph vertically unshifted, ‘grave’ does inherit the style.</p>
<p>If <code>--composites</code> is off, components are hinted separately, then put together. Separate hinting implies that the current style’s blue zones are applied to all subglyphs in its original, unshifted positions. In case you want to shift components vertically, it is <em>mandatory</em> to set bit 2 (value 4), <code>ROUND_XY_TO_GRID</code>, in the flag variable of the composite glyph description to get visually pleasing results, as the images below demonstrate.</p>
<div class="figure">
<img src="img/composite-no-round-xy-to-grid.png" alt="Here, the subscript glyphs are composites each having a single element that is shifted down. If option --composites is not used, subglyphs are hinted before they are glued together (possibly applying scaling and shifting). Because the ROUND_XY_TO_GRID flag isn’t set, the vertical translation doesn’t align the subglyph to the pixel grid, causing severe distortions." />
<p class="caption">Here, the subscript glyphs are composites each having a single element that is shifted down. If option <code>--composites</code> is not used, subglyphs are hinted before they are glued together (possibly applying scaling and shifting). Because the <code>ROUND_XY_TO_GRID</code> flag isn’t set, the vertical translation doesn’t align the subglyph to the pixel grid, causing severe distortions.</p>
</div>
<div class="figure">
<img src="img/composite-round-xy-to-grid.png" alt="The same as before, but with ROUND_XY_TO_GRID set. Now the subscript glyphs look identical to the superscripts." />
<p class="caption">The same as before, but with <code>ROUND_XY_TO_GRID</code> set. Now the subscript glyphs look identical to the superscripts.</p>
</div>
<div class="figure">
<img src="img/composite-no-round-xy-to-grid-option-c.png" alt="For comparison purposes, here the result with option --composites (and no ROUND_XY_TO_GRID). The composite glyphs as a whole get hinted; consequently, the subscript glyphs get separate blue zones. At the displayed size of 16ppem the vertical positions of the subscript blue zones are rounded differently if compared to the superscript zones, thus the smaller glyph height." />
<p class="caption">For comparison purposes, here the result <em>with</em> option <code>--composites</code> (and no <code>ROUND_XY_TO_GRID</code>). The composite glyphs as a whole get hinted; consequently, the subscript glyphs get separate blue zones. At the displayed size of 16ppem the vertical positions of the subscript blue zones are rounded differently if compared to the superscript zones, thus the smaller glyph height.</p>
</div>
<h2 id="the-.ttfautohint-glyph">The ‘.ttfautohint’ Glyph</h2>
<p>If option <a href="#hint-composites"><code>--composites</code></a> is used, ttfautohint doesn’t hint subglyphs of composite glyphs separately. Instead, it hints the whole glyph, this is, composites get recursively expanded internally so that they form simple glyphs, then hints are applied – this is the normal working mode of FreeType’s auto-hinter.</p>
<p>One problem, however, must be solved: Hinting for subglyphs (which usually are used as normal glyphs also) must be deactivated so that nothing but the final bytecode of the composite gets executed.</p>
<p>The trick used by ttfautohint is to prepend a composite element called ‘.ttfautohint’, a dummy glyph with a single point, and which has a single job: Its bytecode increases a variable (to be more precise, it is a CVT register called <code>cvtl_is_subglyph</code> in the source code), indicating that we are within a composite glyph. The final bytecode of the composite glyph eventually decrements this variable again.</p>
<p>As an example, let’s consider composite glyph ‘Agrave’ (‘À’), which has the subglyph ‘A’ as the base and ‘grave’ as its accent. After processing with ttfautohint it consists of three components: ‘.ttfautohint’, ‘A’, and ‘grave’ (in this order).</p>
<table>
<thead>
<tr class="header">
<th align="left">Bytecode of</th>
<th align="left">Action</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">.ttfautohint</td>
<td align="left">increase <code>cvtl_is_subglyph</code> (now: 1)</td>
</tr>
<tr class="even">
<td align="left">A</td>
<td align="left">do nothing because <code>cvtl_is_subglyph</code> &gt; 0</td>
</tr>
<tr class="odd">
<td align="left">grave</td>
<td align="left">do nothing because <code>cvtl_is_subglyph</code> &gt; 0</td>
</tr>
<tr class="even">
<td align="left">Agrave</td>
<td align="left">decrease <code>cvtl_is_subglyph</code> (now: 0)</td>
</tr>
<tr class="odd">
<td align="left"></td>
<td align="left">apply hints because <code>cvtl_is_subglyph</code> == 0</td>
</tr>
</tbody>
</table>
<p>Some technical details (which you might skip): All glyph point indices get adjusted since each ‘.ttfautohint’ subglyph shifts all following indices by one. This must be done for both the bytecode and one subformat of OpenType’s <code>GPOS</code> anchor tables.</p>
<p>While this approach works fine on all tested platforms, there is one single drawback: Direct rendering of the ‘.ttfautohint’ subglyph (this is, rendering as a stand-alone glyph) disables proper hinting of all glyphs in the font! Under normal circumstances this never happens because ‘.ttfautohint’ doesn’t have an entry in the font’s <code>cmap</code> table. (However, some test and demo programs like FreeType’s <code>ftview</code> application or other glyph viewers that are able to bypass the <code>cmap</code> table might be affected.)</p>
<h2 id="writing-systems">Writing Systems</h2>
<p>In FreeType terminology, a writing system is a set of functions that provides auto-hinting for certain scripts. Right now, only two writing systems from FreeType’s auto-hinter are available in ttfautohint: ‘dummy’ and ‘latin’. The former handles the ‘no-script’ case; details to ‘latin’ follow in the next section.</p>
<h2 id="scripts">Scripts</h2>
<p>ttfautohint needs to know which script should be used to hint a specific glyph. To do so, it checks a glyph’s Unicode character code whether it belongs to a given script.</p>
<p>See ‘<a href="#character-ranges">Character Ranges</a>’ for a complete list of all handled scripts and its ranges. This list is auto-generated from a source code file, covering the ‘latin’ writing system. It also covers some non-latin scripts (in the Unicode sense) that have similar typographical properties.</p>
<p>In ttfautohint, scripts are identified by four-character tags (if there are less characters, spaces are appended). The value <code>none</code> indicates ‘no script’.</p>
<p>Each script is represented by two tables to handle ‘base’ and ‘non-base’ characters. For ttfautohint, a non-base character is something that should not be affected by blue zones, regardless of whether this is a spacing or no-spacing glyph. In other words, non-base characters are hinted using a script’s default stem width without applying blue zones.</p>
<p>Right now, there are two pseudo-scripts that are used as fallbacks: <code>latb</code> and <code>latp</code>, used for latin subscript and superscript characters, respectively. Its main usage is support of phonetic alphabets like the IPA, which intermix those characters with normal characters sitting on the baseline, and which are not specially handled in corresponding OpenType features like <code>sups</code>.</p>
<p>If a glyph’s character code is not covered by a script range, it is handled by a <em>fallback script</em>. By default, the fallback script is <code>none</code>, which indicates handling by the ‘latin’ writing system without applying script-specific blue zones (but aligning stems to the grid if possible). The fallback script can be changed; see option <a href="#fallback-script"><code>--fallback-script</code></a>.</p>
<p>The user can also select whether uncovered glyphs are either hinted (which is the default) or scaled only with the fallback script’s scaling parameters. This can be controlled with option <a href="#fallback-script"><code>--fallback-scaling</code></a>. Note that fallback scaling only makes sense if the fallback script has x height blue zones, e.g., <code>cyrl</code> or <code>latn</code>.</p>
<p>As a special case, specifying <code>none</code> as a fallback script and switching on fallback scaling (‘<code>-f none -S</code>’), no hinting is applied at all to uncovered glyphs – using <code>none</code> always implies a scaling factor of 1.</p>
<h2 id="opentype-features">OpenType Features</h2>
<p>(Please read the <a href="http://www.microsoft.com/typography/otspec">OpenType specification</a> for details on <em>features</em>, <code>GSUB</code>, and <code>GPOS</code> tables, and how they relate to scripts.)</p>
<p>For modern OpenType fonts, character ranges are not sufficient to handle scripts.</p>
<ul>
<li><p>Due to glyph substitution in the font (as specified in a font’s <code>GSUB</code> table), which handles ligatures and similar typographic features, there is no longer a one-to-one mapping from an input Unicode character to a glyph index. Some ligatures, like ‘fi’, actually do have Unicode values for historical reasons, but most of them don’t. While it is possible to map ligature glyphs into Unicode’s Private Use Area (PUA), code values from this area are arbitrary by definition and thus unusable for ttfautohint.</p></li>
<li><p>Some features like <code>sups</code> (for handling superscript) completely change the appearance and even vertical position of the affected glyphs. Obviously, the blue zones for ‘normal’ glyphs no longer fit, thus the auto-hinter puts them into a separate group (called <em>style</em> in FreeType speak), having its own set of blue zones.</p></li>
</ul>
<table>
<caption>OpenType features handled specially by ttfautohint</caption>
<thead>
<tr class="header">
<th align="center">Feature tag</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>c2cp</code></td>
<td align="left">petite capitals from capitals</td>
</tr>
<tr class="even">
<td align="center"><code>c2sc</code></td>
<td align="left">small capitals from capitals</td>
</tr>
<tr class="odd">
<td align="center"><code>ordn</code></td>
<td align="left">ordinals</td>
</tr>
<tr class="even">
<td align="center"><code>pcap</code></td>
<td align="left">petite capitals</td>
</tr>
<tr class="odd">
<td align="center"><code>sinf</code></td>
<td align="left">scientific inferiors</td>
</tr>
<tr class="even">
<td align="center"><code>smcp</code></td>
<td align="left">small capitals</td>
</tr>
<tr class="odd">
<td align="center"><code>subs</code></td>
<td align="left">subscript</td>
</tr>
<tr class="even">
<td align="center"><code>sups</code></td>
<td align="left">superscript</td>
</tr>
<tr class="odd">
<td align="center"><code>titl</code></td>
<td align="left">titling</td>
</tr>
</tbody>
</table>
<p>There are two conditions to get a valid style for a feature in a given script.</p>
<ol style="list-style-type: decimal">
<li><p>One of the script’s standard characters must be available in the feature.</p></li>
<li><p>The feature must provide characters to form at least one blue zone; see <a href="#blue-zones">above</a>.</p></li>
</ol>
<p>An additional complication is that features from the above table might use data not only from the <code>GSUB</code> but also from the <code>GPOS</code> table, containing information for glyph positioning. For example, the <code>sups</code> feature for superscripts might use the same glyphs as the <code>subs</code> feature for subscripts, simply moved up. ttfautohint skips such vertically shifted glyphs (except for accessing standard characters) because glyph positioning happens after hinting. Continuing our example, the <code>sups</code> feature wouldn’t form a style, contrary to <code>subs</code>, which holds the unshifted glyphs.</p>
<p>The remaining OpenType features of a script are not handled specially; the affected glyphs are simply hinted together with the ‘normal’ glyphs of the script.</p>
<p>Note that a font might still contain some features not covered yet: OpenType has the concept of a <em>default script</em>; its data gets used for all scripts that aren’t explicitly handled in a font. By default, ttfautohint unifies all affected glyphs from default script features with the <code>latn</code> script. This can be changed with option <a href="#default-script"><code>--default-script</code></a>, if necessary.</p>
<p>ttfautohint uses the <a href="http://harfbuzz.org">HarfBuzz</a> library for handling OpenType features.</p>
<h2 id="sfnt-tables">SFNT Tables</h2>
<p>ttfautohint touches almost all SFNT tables within a TrueType or OpenType font. Note that only OpenType fonts with TrueType outlines are supported. OpenType fonts with a <code>CFF</code> table (this is, with PostScript outlines) won’t work.</p>
<ul>
<li><p><code>glyf</code>: All hints in the table are replaced with new ones. If option <a href="#hint-composites"><code>--composites</code></a> is used, one glyph gets added (namely the ‘.ttfautohint’ glyph) and all composites get an additional component.</p></li>
<li><p><code>cvt</code>, <code>prep</code>, and <code>fpgm</code>: These tables get replaced with data necessary for the new hinting bytecode.</p></li>
<li><p><code>gasp</code>: Set up to always use grayscale rendering, for all sizes, with grid-fitting for standard hinting, and symmetric grid-fitting and symmetric smoothing for horizontal subpixel hinting (ClearType).</p></li>
<li><p><code>DSIG</code>: If it exists, it gets replaced with a dummy version. ttfautohint can’t digitally sign a font; you have to do that afterwards.</p></li>
<li><p><code>name</code>: The ‘version’ entries are modified to add information about the parameters that have been used for calling ttfautohint. This can be controlled with the <a href="#ttfautohint-info"><code>--no-info</code></a> option.</p></li>
<li><p><code>GPOS</code>, <code>hmtx</code>, <code>loca</code>, <code>head</code>, <code>maxp</code>, <code>post</code>: Updated to fit the additional ‘.ttfautohint’ glyph, the additional subglyphs in composites, and the new hinting bytecode.</p></li>
<li><p><code>LTSH</code>, <code>hdmx</code>: Since ttfautohint doesn’t do any horizontal hinting, those tables are superfluous and thus removed.</p></li>
<li><p><code>VDMX</code>: Removed, since it depends on the original bytecode, which ttfautohint removes. A font editor might recompute the necessary data later on.</p></li>
</ul>
<h2 id="problems">Problems</h2>
<h3 id="interaction-with-freetype">Interaction With FreeType</h3>
<p>Recent versions of FreeType have an experimental extension for handling subpixel hinting; it is off by default and can be activated by defining the macro <code>TT_CONFIG_OPTION_SUBPIXEL_HINTING</code> at compile time. This code has been contributed mainly by <a href="http://infinality.net">Infinality</a>, being a subset of his original patch. Many GNU/Linux distributions activate this code, or provide packages to activate it.</p>
<p>This extension changes the behaviour of many bytecode instructions to get better rendering results. However, not all changes are global; some of them are specific to certain fonts. For example, it contains font-specific improvements for the ‘<a href="http://dejavu-fonts.org">DejaVu</a> Sans’ font family. The list of affected fonts is hard-coded; it can be found in FreeType’s source code file <code>ttsubpix.c</code>.</p>
<p>If you are going to process such specially-handled fonts with ttfautohint, serious rendering problems might show up. Since ttfautohint (intentionally) doesn’t change the font name in the <code>name</code> table, the Infinality extension has no chance to recognize that the hints are different. All such problems vanish if the font gets renamed in its <code>name</code> table (the name of the font file itself doesn’t matter).</p>
<h3 id="incorrect-unicode-character-map">Incorrect Unicode Character Map</h3>
<p>Fonts with an incorrect Unicode <code>cmap</code> table will not be properly hinted by ttfautohint. Especially older fonts do cheat; for example, there exist Hebrew fonts that map its glyphs to character codes ‘A’, ‘B’, etc., to make them work with non-localized versions of Windows 98, say.</p>
<p>Since ttfautohint needs to find both standard and blue zone characters, it relies on correct Unicode values. If you want to handle such fonts, please fix their <code>cmap</code> tables accordingly.</p>
<h3 id="irregular-glyph-heights">Irregular Glyph Heights</h3>
<p>The central concept of ttfautohint’s hinting algorithm, as discussed <a href="#segments-and-edges">above</a>, is to identify horizontal segments at extremum positions, especially for blue zones. If such a segment is missing, it cannot be associated with a blue zone, possibly leading to irregular heights for the particular glyph.</p>
<p>Normally, a segment has a horizontal length of at least 20 font units (assuming 2048 units per EM)<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a>. Using a <a href="#control-instructions-file">Control Instructions File</a>, however, it is possible to define additional segments at arbitrary points that help overcome this restriction, making it possible to fix (most of) such problems.</p>
<h3 id="diagonals">Diagonals</h3>
<p>ttfautohint doesn’t handle diagonal lines specially. For thin outlines, this might lead to strokes that look too thick at smaller sizes. A font designer might compensate this to a certain amount by slightly reducing the stroke width of diagonal lines. However, in many cases the sub-optimal appearance of a stroke with borders that don’t exactly fit the pixel grid is not the outline itself but an incorrect gamma value of the monitor: People tend to not properly adjust it, and the default values of most operating systems are too low, causing too much darkening of such strokes. It is thus of vital importance to compare ttfautohint’s results with similar fonts to exclude any systematic effect not related to the outlines themselves.</p>
<h2 id="extending-ttfautohint-with-new-scripts">Extending ttfautohint with new scripts</h2>
<p>Right now, adding new scripts to ttfautohint only works on the source code level, this is, you have to patch the C source code.</p>
<p>The process itself isn’t very complicated; it is demonstrated best by example. The following commits in ttfautohint add Ethiopian and Armenian, respectively.</p>
<p><a href="[http://repo.or.cz/ttfautohint.git/commitdiff/d14c7c0758539921b58f2854777175fde1267fb1">http://repo.or.cz/ttfautohint.git/commitdiff/d14c7c0758539921b58f2854777175fde1267fb1</a><br />
<a href="[http://repo.or.cz/ttfautohint.git/commitdiff/b5022cd9635b8b0d3b910310b69f4a57fe055fd0">http://repo.or.cz/ttfautohint.git/commitdiff/b5022cd9635b8b0d3b910310b69f4a57fe055fd0</a></p>
<p>It shows that you have to do the following steps.</p>
<ul>
<li><p>Add blue zone character data to the file <code>lib/tablue.dat</code>.</p></li>
<li><p>Add the proper Unicode ranges to <code>lib/taranges.c</code>, following the structure of similar entries.</p></li>
<li><p>Similarly, the files <code>lib/tastyles.h</code> and <code>lib/ttfautohint-script.h</code> must be updated. The latter holds the information on the used default character or characters; it also references the corresponding script tag <code>HB_SCRIPT_XXX</code> as used by the HarfBuzz library.</p></li>
</ul>
<p>If there are any questions, please contact the <a href="https://lists.nongnu.org/mailman/listinfo/freetype">FreeType mailing list</a> for help. Note that the script data in ttfautohint are hold in sync with FreeType’s auto-hinter.</p>
<h1 id="control-instructions">Control Instructions</h1>
<p>An entry in a control instructions file has various syntax forms, which are discussed here. Brackets indicate optional elements.</p>
<h2 id="common-syntax-elements">Common Syntax Elements</h2>
<p><em>font‑idx</em> gives the index of the font in a TrueType Collection, starting with value 0. If missing, it is set to zero. For normal TrueType fonts, only value zero is valid. A font index can be specified in decimal, octal, or hexadecimal format, the latter two indicated by the prefixes <code>0</code> and <code>0x</code>, respectively.</p>
<p><em>glyph‑id</em> is either a glyph’s name as listed in the <code>post</code> SFNT table or a glyph index. A glyph name consists of characters from the set ‘<code>A-Za-z0-9._</code>’ only and does not start with a digit or period, with the exceptions of the names ‘<code>.notdef</code>’ and ‘<code>.null</code>’. A glyph index starts with value 0 can be specified in decimal, octal, or hexadecimal format, the latter two indicated by the prefixes <code>0</code> and <code>0x</code>, respectively. Glyph names are internally converted to glyph indices.</p>
<p><em>points</em> are number ranges, see ‘<a href="#x-height-snapping-exceptions">x Height Snapping Exceptions</a>’ for the syntax.</p>
<p>Similar to the Bourne shell (<code>sh</code> or <code>bash</code>), a comment starts with character ‘<code>#</code>’; the rest of the line is ignored. An empty line is ignored also. Both the newline character and ‘<code>;</code>’ can be used as a separator between exception entries. A trailing ‘<code>\</code>’ at the end of a line continues the current line on the next one.</p>
<p>A control instructions file is parsed line by line; later entries override earlier entries (in case there is something to override).</p>
<h2 id="style-adjustments">Style Adjustments</h2>
<p>This syntax form makes it possible to override the style assignment algorithm of ttfautohint; see ‘<a href="#scripts">Scripts</a>’ and ‘<a href="#opentype-features">OpenType Features</a>’ for more details.</p>
<blockquote>
<p><em>[</em> font-idx <em>]</em>  script  feature  <em><code>@</code></em>  glyph-ids</p>
</blockquote>
<p><em>script</em> is a four-letter name of one of the scripts supported by ttfautohint. <em>feature</em> is one of the four-letter names of features supported by ttfautohint.</p>
<p>The elements of <em>glyph-ids</em> are a list of comma separated <em>glyph-id</em> values or value ranges. Note that is not necessary that elements are specified in increasing order.</p>
<p>Assuming that a font contains superscript digits ‘zero.sups’ to ‘nine.sups’ together with the glyphs ‘a.sups’ and ‘o.sups’, use a line</p>
<pre><code>    cyrl sups @ zero.sups-nine.sups, a.sups, o.sups</code></pre>
<p>to add those glyphs to the style handling Cyrillic superscript glyphs. However, it is still necessary that the selected script contains proper <a href="#blue-zones">Blue Zone characters</a>, otherwise those glyphs aren’t handled at all.</p>
<p>Use the <code>--debug</code> command line option to see how ttfautohint assigns glyph indices of a font to styles.</p>
<h2 id="glyph-adjustments">Glyph Adjustments</h2>
<p>The following syntax forms allows adjustments of a glyph’s hinting process.</p>
<h3 id="change-direction-of-points-artificial-segments">Change Direction of Points, Artificial Segments</h3>
<blockquote>
<em>[</em> font‑idx <em>]</em>  glyph‑id  <em><code>l</code>[<code>eft</code>]|<code>r</code>[<code>ight</code>]</em>  points  <em>[</em> <em><code>(</code></em> left‑offset <em><code>,</code></em> right‑offset <em><code>)</code></em> <em>]</em><br />

</blockquote>
<p>The mutually exclusive parameters <code>left</code> and <code>right</code> (which can be abbreviated as ‘<code>l</code>’ and ‘<code>r</code>’, respectively) indicate that the following points have left or right ‘out’ direction, respectively, overriding ttfautohint’s algorithm for setting point directions. The ‘out direction’ of a point is the direction of the outline <em>leaving</em> the point (or passing the control point). If the specified direction is identical to what ttfautohint computes, nothing special happens. Otherwise, a one-point segment with the specified direction gets created, see <a href="#segments-and-edges">above</a>. By default, its length is zero. Setting <em>left‑offset</em> and <em>right‑offset</em>, you can change the segment’s horizontal start and end position relative to the point position. <em>left‑offset</em> and <em>right‑offset</em> are integers measured in font units.</p>
<p>The following five images, displaying glyphs ‘O’ and ‘Q’ from the font <a href="http://www.google.com/fonts/specimen/Halant">Halant-Regular</a>, demonstrate how to use direction changes.</p>
<div class="figure">
<img src="img/Halant-Regular-O-Q.png" alt="The outlines of glyphs O and Q, as displayed in FontForge. They are sufficiently similar to expect that ttfautohint hints them equally. However, this is not the case." />
<p class="caption">The outlines of glyphs ‘O’ and ‘Q’, as displayed in FontForge. They are sufficiently similar to expect that ttfautohint hints them equally. However, this is not the case.</p>
</div>
<div class="figure">
<img src="img/Halant-Regular-O-Q-unhinted-12px.png" alt="The same glyphs, shown at 12px before hinting. [Please ignore the outline distortion in the upper right of glyph O; this is a bug in FontForge while running the TrueType debugger.]" />
<p class="caption">The same glyphs, shown at 12px before hinting. [Please ignore the outline distortion in the upper right of glyph ‘O’; this is a bug in FontForge while running the TrueType debugger.]</p>
</div>
<div class="figure">
<img src="img/Halant-Regular-O-good-Q-badly-hinted-12px.png" alt="Using only ttfautohint’s -w gGD parameter to force strong stem width and positioning, the hinting of glyph Q is really bad, making the glyph vertically two pixels larger! Reason is that this glyph doesn’t contain a horizontal segment at the baseline blue zone (y = 1; this corresponds to the segment 13-14 in the O glyph). Normally, segment 1-2 would form a stem with the baseline segment (as segment 7-8 does in glyph O). Instead, it forms a stem with segment 19-20, which gets moved down (y = −1) because the whole glyph appears to be stretched." />
<p class="caption">Using only ttfautohint’s ‘<code>-w gGD</code>’ parameter to force strong stem width and positioning, the hinting of glyph ‘Q’ is really bad, making the glyph vertically two pixels larger! Reason is that this glyph doesn’t contain a horizontal segment at the baseline blue zone (<em>y</em> = 1; this corresponds to the segment 13-14 in the ‘O’ glyph). Normally, segment 1-2 would form a ‘stem’ with the baseline segment (as segment 7-8 does in glyph ‘O’). Instead, it forms a stem with segment 19-20, which gets moved down (<em>y</em> = −1) because the whole glyph appears to be stretched.</p>
</div>
<div class="figure">
<img src="img/Halant-Regular-O-good-Q-better-hinted-12px.png" alt="To fix the problem, we change the direction of point 38 to left by writing a line Q left 38 (without the quotes) to a control description file Halant-Regular.txt. Adding option -m Halant-Regular.txt to ttfautohint, we get the shown image as a result, which is much better: Segment 1-2 now properly forms a stem with our artificial one-point segment 38, and the O-like shape is properly positioned. However, there is still room for improvement: Segment 19-20 is also positioned at the baseline, making the connection between the O shape and the tail too thin." />
<p class="caption">To fix the problem, we change the direction of point 38 to ‘left’ by writing a line ‘<code>Q left 38</code>’ (without the quotes) to a control description file <code>Halant-Regular.txt</code>. Adding option ‘<code>-m Halant-Regular.txt</code>’ to ttfautohint, we get the shown image as a result, which is much better: Segment 1-2 now properly forms a stem with our artificial one-point segment 38, and the ‘O’-like shape is properly positioned. However, there is still room for improvement: Segment 19-20 is also positioned at the baseline, making the connection between the ‘O’ shape and the tail too thin.</p>
</div>
<div class="figure">
<img src="img/Halant-Regular-O-good-Q-well-hinted-12px.png" alt="By giving the one-point segment 38 a horizontal width, we can prevent that segment 19-20 gets positioned at the baseline: Replace the line in the previous image description with Q left 38 (−70,20), making the segment extend 70 font units to the left and 20 to the right of point 38. The exact offset values don’t matter; it’s only important to start left of point 19. Another solution to the problem is to artificially change the direction of segment 19-20 by adding a second line Q right 19-20 to the control instructions file; for our Q glyph, this produces almost exactly the same hinting results. Note that such direction changes only influence the hinting process; an outline’s direction won’t be changed at all." />
<p class="caption">By giving the one-point segment 38 a horizontal width, we can prevent that segment 19-20 gets positioned at the baseline: Replace the line in the previous image description with ‘<code>Q left 38 (−70,20)</code>’, making the segment extend 70 font units to the left and 20 to the right of point 38. The exact offset values don’t matter; it’s only important to start left of point 19. Another solution to the problem is to artificially change the direction of segment 19-20 by adding a second line ‘<code>Q right 19-20</code>’ to the control instructions file; for our ‘Q’ glyph, this produces almost exactly the same hinting results. Note that such direction changes only influence the hinting process; an outline’s direction won’t be changed at all.</p>
</div>
<h3 id="unset-direction-of-points">Unset Direction of Points</h3>
<blockquote>
<em>[</em> font‑idx <em>]</em>  glyph‑id  <em><code>n</code>[<code>odir</code>]</em>  points<br />

</blockquote>
<p>Parameter <code>nodir</code> (or ‘<code>n</code>’) sets the ‘out’ direction of the following points to ‘no direction’, this is, neither left nor right. If the specified direction is identical to what ttfautohint computes, nothing special happens. Otherwise, ttfautohint no longer considers those points as part of horizontal segments, thus treating them as <a href="#grid-fitting">‘weak’</a> points.</p>
<p>Modifying or adding segments doesn’t directly modify the outlines; it only influences the hinting process.</p>
<h3 id="delta-exceptions">Delta Exceptions</h3>
<blockquote>
<em>[</em> font‑idx <em>]</em>  glyph‑id  <em><code>t</code>[<code>ouch</code>]|<code>p</code>[<code>oint</code>]</em>  points  <em>[</em> <em><code>x</code>[<code>shift</code>]</em> x‑shift <em>]</em>  <em>[</em> <em><code>y</code>[<code>shift</code>]</em> y‑shift <em>]</em>  <em><code>@</code></em>  ppems<br />

</blockquote>
<p>The mutually exclusive parameters <code>touch</code> and <code>point</code> (which can be abbreviated as ‘<code>t</code>’ and ‘<code>p</code>’, respectively) make ttfautohint apply delta exceptions for the given points, shifting them by the given values. Delta exceptions entered with <code>touch</code> are applied before the final ‘IUP’ (<em>interpolate untouched points</em>) instructions in a glyph’s bytecode, exceptions entered with <code>point</code> after ‘IUP’ (please consult Greg Hitchcock’s <a href="http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx">ClearType Whitepaper</a> for more on pre-IUP and post-IUP delta hints). Additionally, the <code>touch</code> parameter makes the bytecode <em>touch</em> the affected points; such points are no longer affected by ‘IUP’ at all. Note that in ClearType mode all deltas along the x axis are discarded, and deltas along the y axis are only executed for touched points. As a consequence, vertical delta exceptions entered with <code>point</code> should not be used in ClearType mode.<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a></p>
<p><em>ppems</em>, similar to <em>points</em>, are number ranges, see ‘<a href="#x-height-snapping-exceptions">x Height Snapping Exceptions</a>’ for the syntax.</p>
<p><em>x‑shift</em> and <em>y‑shift</em> represent real numbers that get rounded to multiples of 1/8 pixels. The entries for <code>xshift</code> (‘<code>x</code>’) and <code>yshift</code> (‘<code>y</code>’) are optional; if missing, the corresponding value is set to zero. If both values are zero, the delta exception entry is ignored as a whole.</p>
<p>Values for <em>x‑shift</em> and <em>y‑shift</em> must be in the range [−1.0;1.0]. Values for <em>ppems</em> must be in the range [6;53]. Values for <em>points</em> are limited by the number of points in the glyph.</p>
<p>Note that only character ‘<code>.</code>’ is recognized as a decimal point, and a thousands separator is not accepted.</p>
<p>As an example for delta instructions, let’s assume that you want to shift points 2, 3, and 4 in glyph ‘Aacute’ at ppem sizes 12 and 13 by a vertical amount of 0.25 pixels. This corresponds to the line</p>
<pre><code>    Aacute  touch 2-4  yshift 0.25  @ 12, 13</code></pre>
<p>in a control instructions file. Since we use <code>touch</code> and not <code>point</code>, points 2, 3, and 4 are no longer subject to the final ‘IUP’ instruction, which interpolates weak, untouched point positions between strong, touched ones, cf. the description <a href="https://developer.apple.com/fonts/TrueType-Reference-Manual/RM05/Chap5.html#IUP">here</a>.</p>
<h1 id="the-ttfautohint-api">The ttfautohint API</h1>
<p>This section documents the single function of the ttfautohint library, <code>TTF_autohint</code>, together with its callback functions, <code>TA_Progress_Func</code> and <code>TA_Info_Func</code>. All information has been directly extracted from the <code>ttfautohint.h</code> header file.</p>
<h2 id="preprocessor-macros-and-typedefs">Preprocessor Macros and Typedefs</h2>
<p>Some default values.</p>
<div class="sourceCode"><pre class="sourceCode c"><code class="sourceCode c"><span class="ot">#define TA_HINTING_RANGE_MIN 8</span>
<span class="ot">#define TA_HINTING_RANGE_MAX 50</span>
<span class="ot">#define TA_HINTING_LIMIT 200</span>
<span class="ot">#define TA_INCREASE_X_HEIGHT 14</span></code></pre></div>
<p>An error type.</p>
<div class="sourceCode"><pre class="sourceCode c"><code class="sourceCode c"><span class="kw">typedef</span> <span class="dt">int</span> TA_Error;</code></pre></div>
<h2 id="callback-ta_progress_func">Callback: <code>TA_Progress_Func</code></h2>
<p>A callback function to get progress information. <em>curr_idx</em> gives the currently processed glyph index; if it is negative, an error has occurred. <em>num_glyphs</em> holds the total number of glyphs in the font (this value can’t be larger than 65535).</p>
<p><em>curr_sfnt</em> gives the current subfont within a TrueType Collection (TTC), and <em>num_sfnts</em> the total number of subfonts.</p>
<p>If the return value is non-zero, <code>TTF_autohint</code> aborts with <code>TA_Err_Canceled</code>. Use this for a ‘Cancel’ button or similar features in interactive use.</p>
<p><em>progress_data</em> is a void pointer to user-supplied data.</p>
<div class="sourceCode"><pre class="sourceCode c"><code class="sourceCode c"><span class="kw">typedef</span> <span class="dt">int</span>
(*TA_Progress_Func)(<span class="dt">long</span> curr_idx,
                    <span class="dt">long</span> num_glyphs,
                    <span class="dt">long</span> curr_sfnt,
                    <span class="dt">long</span> num_sfnts,
                    <span class="dt">void</span>* progress_data);</code></pre></div>
<h2 id="callback-ta_error_func">Callback: <code>TA_Error_Func</code></h2>
<p>A callback function to get error information.</p>
<p><em>error</em> is the value <code>TTF_autohint</code> returns. See file <code>ttfautohint-errors.h</code> for a list. Error codes not in this list are directly taken from FreeType; see the FreeType header file <code>fterrdef.h</code> for more.</p>
<p><em>error_string</em>, if non-NULL, is a pointer to an error message that represents <em>error</em>.</p>
<p>The next three parameters help identify the origin of text string parsing errors. <em>linenum</em>, if non-zero, contains the line number. <em>line</em>, if non-NULL, is a pointer to the input line that can’t be processed. <em>errpos</em>, if non-NULL, holds a pointer to the position in <em>line</em> where the problem occurs.</p>
<p><em>error_data</em> is a void pointer to user-supplied data.</p>
<div class="sourceCode"><pre class="sourceCode c"><code class="sourceCode c"><span class="kw">typedef</span> <span class="dt">void</span>
(*TA_Error_Func)(TA_Error error,
                 <span class="dt">const</span> <span class="dt">char</span>* error_string,
                 <span class="dt">unsigned</span> <span class="dt">int</span> linenum,
                 <span class="dt">const</span> <span class="dt">char</span>* line,
                 <span class="dt">const</span> <span class="dt">char</span>* errpos,
                 <span class="dt">void</span>* error_data);</code></pre></div>
<h2 id="callback-ta_info_func">Callback: <code>TA_Info_Func</code></h2>
<p>A callback function to access or modify strings in the <code>name</code> table; it is called in a loop that iterates over all <code>name</code> table entries. If defined, <a href="#callback-ta_info_post_func"><code>TA_Info_Post_Func</code></a> gets executed after this loop so that the collected data can be written back to the <code>name</code> table.</p>
<p><em>platform_id</em>, <em>encoding_id</em>, <em>language_id</em>, and <em>name_id</em> are the identifiers of a <code>name</code> table entry pointed to by <em>str</em> with a length pointed to by <em>str_len</em> (in bytes; the string has no trailing NULL byte). Please refer to the <a href="http://www.microsoft.com/typography/otspec/name.htm">OpenType specification of the <code>name</code> table</a> for a detailed description of the various parameters, in particular which encoding is used for a given platform and encoding ID.</p>
<p>The string <em>str</em> is allocated with <code>malloc</code>; the application should reallocate the data if necessary, ensuring that the string length doesn’t exceed 0xFFFF.</p>
<p><em>info_data</em> is a void pointer to user-supplied data.</p>
<p>If an error occurs, return a non-zero value and don’t modify <em>str</em> and <em>str_len</em> (such errors are handled as non-fatal).</p>
<div class="sourceCode"><pre class="sourceCode c"><code class="sourceCode c"><span class="kw">typedef</span> <span class="dt">int</span>
(*TA_Info_Func)(<span class="dt">unsigned</span> <span class="dt">short</span> platform_id,
                <span class="dt">unsigned</span> <span class="dt">short</span> encoding_id,
                <span class="dt">unsigned</span> <span class="dt">short</span> language_id,
                <span class="dt">unsigned</span> <span class="dt">short</span> name_id,
                <span class="dt">unsigned</span> <span class="dt">short</span>* str_len,
                <span class="dt">unsigned</span> <span class="dt">char</span>** str,
                <span class="dt">void</span>* info_data);</code></pre></div>
<h2 id="callback-ta_info_post_func">Callback: <code>TA_Info_Post_Func</code></h2>
<p>A callback function, giving the application the possibility to access or modify strings in the <code>name</code> table after <a href="#callback-ta_info_func"><code>TA_Info_Func</code></a> has iterated over all <code>name</code> table entries.</p>
<p>It is expected that <code>TA_Info_Func</code> stores pointers to the <code>name</code> table entries it wants to access or modify; the only parameter is thus <em>info_data</em>, which is a void pointer to the user-supplied data already provided to <code>TA_Info_Func</code>. Obviously, calling <code>TA_Info_Post_Func</code> with <code>TA_Info_Func</code> undefined has no effect.</p>
<p>The <code>name</code> table strings are allocated with <code>malloc</code>; the application should reallocate the data if necessary, ensuring that no string length exceeds 0xFFFF.</p>
<p>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).</p>
<div class="sourceCode"><pre class="sourceCode c"><code class="sourceCode c"><span class="kw">typedef</span> <span class="dt">int</span>
(*TA_Info_Post_Func)(<span class="dt">void</span>* info_data);</code></pre></div>
<h2 id="function-ttf_autohint">Function: <code>TTF_autohint</code></h2>
<p>Read a TrueType font, remove existing bytecode (in the SFNT tables <code>prep</code>, <code>fpgm</code>, <code>cvt</code>, and <code>glyf</code>), 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.</p>
<p>It expects a format string <em>options</em> and a variable number of arguments, depending on the fields in <em>options</em>. 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.</p>
<p>Note that fields marked as ‘not implemented yet’ are subject to change.</p>
<h3 id="io">I/O</h3>
<dl>
<dt><code>in-file</code></dt>
<dd>A pointer of type <code>FILE*</code> to the data stream of the input font, opened for binary reading. Mutually exclusive with <code>in-buffer</code>.
</dd>
<dt><code>in-buffer</code></dt>
<dd>A pointer of type <code>const char*</code> to a buffer that contains the input font. Needs <code>in-buffer-len</code>. Mutually exclusive with <code>in-file</code>.
</dd>
<dt><code>in-buffer-len</code></dt>
<dd>A value of type <code>size_t</code>, giving the length of the input buffer. Needs <code>in-buffer</code>.
</dd>
<dt><code>out-file</code></dt>
<dd>A pointer of type <code>FILE*</code> to the data stream of the output font, opened for binary writing. Mutually exclusive with <code>out-buffer</code>.
</dd>
<dt><code>out-buffer</code></dt>
<dd>A pointer of type <code>char**</code> to a buffer that contains the output font. Needs <code>out-buffer-len</code>. Mutually exclusive with <code>out-file</code>. Deallocate the memory with <code>free</code>.
</dd>
<dt><code>out-buffer-len</code></dt>
<dd>A pointer of type <code>size_t*</code> to a value giving the length of the output buffer. Needs <code>out-buffer</code>.
</dd>
<dt><code>control-file</code></dt>
<dd><p>A pointer of type <code>FILE*</code> to the data stream of control instructions. Mutually exclusive with <code>control-buffer</code>.</p>
<p>See ‘<a href="#control-instructions">Control Instructions</a>’ for the syntax used in such a file or buffer.</p>
</dd>
<dt><code>control-buffer</code></dt>
<dd>A pointer of type <code>const char*</code> to a buffer that contains control instructions. Needs <code>control-buffer-len</code>. Mutually exclusive with <code>control-file</code>.
</dd>
<dt><code>control-buffer-len</code></dt>
<dd>A value of type <code>size_t</code>, giving the length of the control instructions buffer. Needs <code>control-buffer</code>.
</dd>
<dt><code>reference-file</code></dt>
<dd>A pointer of type <code>FILE*</code> to the data stream of the reference font, opened for binary reading. Mutually exclusive with <code>reference-buffer</code>.
</dd>
<dt><code>reference-buffer</code></dt>
<dd>A pointer of type <code>const char*</code> to a buffer that contains the reference font. Needs <code>reference-buffer-len</code>. Mutually exclusive with <code>reference-file</code>.
</dd>
<dt><code>reference-buffer-len</code></dt>
<dd>A value of type <code>size_t</code>, giving the length of the reference buffer. Needs <code>reference-buffer</code>.
</dd>
<dt><code>reference-index</code></dt>
<dd>The face index to be used in the reference font. The default value is 0.
</dd>
<dt><code>reference-name</code></dt>
<dd>A string that specifies the name of the reference font. It is only used to emit a sensible value for the <code>TTFA</code> table if <code>TTFA-info</code> is set.
</dd>
</dl>
<h3 id="messages-and-callbacks">Messages and Callbacks</h3>
<dl>
<dt><code>progress-callback</code></dt>
<dd>A pointer of type <a href="#callback-ta_progress_func"><code>TA_Progress_Func</code></a>, 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.
</dd>
<dt><code>progress-callback-data</code></dt>
<dd>A pointer of type <code>void*</code> to user data that is passed to the progress callback function.
</dd>
<dt><code>error-string</code></dt>
<dd>A pointer of type <code>unsigned char**</code> to a string (in UTF-8 encoding) that verbally describes the error code. You must not change the returned value.
</dd>
<dt><code>error-callback</code></dt>
<dd><p>A pointer of type <a href="#callback-ta_error_func"><code>TA_Error_Func</code></a>, specifying a callback function for error messages. This function gets called right before <code>TTF_autohint</code> exits. If this field is not set or set to NULL, no error callback function is used.</p>
<p>Use it as a more sophisticated alternative to <code>error-string</code>.</p>
</dd>
<dt><code>error-callback-data</code></dt>
<dd>A point of type <code>void*</code> to user data that is passed to the error callback function.
</dd>
<dt><code>info-callback</code></dt>
<dd>A pointer of type <a href="#callback-ta_info_func"><code>TA_Info_Func</code></a>, specifying a callback function for manipulating the <code>name</code> table. This function gets called for each <code>name</code> table entry. If not set or set to NULL, <code>TA_Info_Func</code> is not called.
</dd>
<dt><code>info-post-callback</code></dt>
<dd>A pointer of type <a href="#callback-ta_info_post_func"><code>TA_Info_Post_Func</code></a>, specifying a callback function for manipulating the <code>name</code> table. It is called after the function specified with <code>info-callback</code> has iterated over all <code>name</code> table entries. If not set or set to NULL, <code>TA_Info_Post_Func</code> is not called.
</dd>
<dt><code>info-callback-data</code></dt>
<dd>A pointer of type <code>void*</code> to user data that is passed to the info callback functions.
</dd>
<dt><code>debug</code></dt>
<dd>If this integer is set to 1, lots of debugging information is print to stderr. The default value is 0.
</dd>
</dl>
<h3 id="general-hinting-options">General Hinting Options</h3>
<dl>
<dt><code>hinting-range-min</code></dt>
<dd>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 <code>TA_HINTING_RANGE_MIN</code>.
</dd>
<dt><code>hinting-range-max</code></dt>
<dd>An integer (which must be larger than or equal to the value of <code>hinting-range-min</code>) giving the highest PPEM value used for autohinting. If this field is not set, it defaults to <code>TA_HINTING_RANGE_MAX</code>.
</dd>
<dt><code>hinting-limit</code></dt>
<dd>An integer (which must be larger than or equal to the value of <code>hinting-range-max</code>) 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 <code>TA_HINTING_LIMIT</code>. If it is set to 0, no hinting limit is added to the bytecode.
</dd>
<dt><code>hint-composites</code></dt>
<dd>If this integer is set to 1, composite glyphs get separate hints. This implies adding a special glyph to the font called <a href="#the-.ttfautohint-glyph">‘.ttfautohint’</a>. 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.
</dd>
<dt><code>adjust-subglyphs</code></dt>
<dd><p>An integer (1 for ‘on’ and 0 for ‘off’, which is the default) to specify whether native TrueType hinting of the <em>input font</em> 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.</p>
<p><code>pre-hinting</code> is a deprecated alias name for this option.</p>
</dd>
</dl>
<h3 id="hinting-algorithms">Hinting Algorithms</h3>
<dl>
<dt><code>gray-strong-stem-width</code></dt>
<dd>An integer (1 for ‘on’ and 0 for ‘off’, which is the default) that specifies whether horizontal stems should be snapped and positioned to integer pixel values for normal grayscale rendering.
</dd>
<dt><code>gdi-cleartype-strong-stem-width</code></dt>
<dd>An integer (1 for ‘on’, which is the default, and 0 for ‘off’) that specifies whether horizontal stems should be snapped and positioned to integer pixel values for GDI ClearType rendering, this is, the rasterizer version (as returned by the GETINFO bytecode instruction) is in the range 36 &lt;= version &lt; 38 and ClearType is enabled.
</dd>
<dt><code>dw-cleartype-strong-stem-width</code></dt>
<dd>An integer (1 for ‘on’ and 0 for ‘off’, which is the default) that specifies whether horizontal stems should be snapped and positioned to integer pixel values for DW ClearType rendering, this is, the rasterizer version (as returned by the GETINFO bytecode instruction) is &gt;= 38, ClearType is enabled, and subpixel positioning is enabled also.
</dd>
<dt><code>increase-x-height</code></dt>
<dd>An integer. For PPEM values in the range 6 &lt;= PPEM &lt;= <code>increase-x-height</code>, 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 <code>TA_INCREASE_X_HEIGHT</code>. Use this flag to improve the legibility of small font sizes if necessary.
</dd>
<dt><code>x-height-snapping-exceptions</code></dt>
<dd>A pointer of type <code>const char*</code> 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 <em>value</em><sub>1</sub><code>-</code><em>value</em><sub>2</sub>, meaning <em>value</em><sub>1</sub> &lt;= PPEM &lt;= <em>value</em><sub>2</sub>. <em>value</em><sub>1</sub> or <em>value</em><sub>2</sub> (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 <code>&quot;3, 5-7, 9-&quot;</code> means the values 3, 5, 6, 7, 9, 10, 11, 12, etc. Consequently, if the supplied argument is <code>&quot;-&quot;</code>, no x height snapping takes place at all. The default is the empty string (<code>&quot;&quot;</code>), meaning no snapping exceptions.
</dd>
<dt><code>windows-compatibility</code></dt>
<dd>If this integer is set to 1, two artificial blue zones are used, positioned at the <code>usWinAscent</code> and <code>usWinDescent</code> values (from the font’s <code>OS/2</code> 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.
</dd>
</dl>
<h3 id="scripts-1">Scripts</h3>
<dl>
<dt><code>default-script</code></dt>
<dd>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 <code>&quot;latn&quot;</code>; if set to <code>&quot;none&quot;</code>, no script is used. Valid values can be found in the header file <code>ttfautohint-scripts.h</code>.
</dd>
<dt><code>fallback-script</code></dt>
<dd><p>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 <code>fallback-scaling</code> is set, they are scaled only instead. Valid values can be found in the header file <code>ttfautohint-scripts.h</code>.</p>
<p>Default value is <code>&quot;none&quot;</code>, which means hinting without using a script’s blue zones if <code>fallback-scaling</code> isn’t set. If <code>fallback_scaling</code> is set, value <code>&quot;none&quot;</code> implies no hinting for unmapped glyphs.</p>
</dd>
<dt><code>fallback-scaling</code></dt>
<dd>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.
</dd>
<dt><code>symbol</code></dt>
<dd>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.
</dd>
<dt><code>fallback-stem-width</code></dt>
<dd><p>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).</p>
<p>For symbol fonts (i.e., option <code>symbol</code> is given), <code>fallback-stem-width</code> has an effect only if <code>fallback-script</code> is set also.</p>
</dd>
</dl>
<h3 id="miscellaneous-1">Miscellaneous</h3>
<dl>
<dt><code>ignore-restrictions</code></dt>
<dd>If the font has set bit 1 in the ‘fsType’ field of the <code>OS/2</code> 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.
</dd>
<dt><code>TTFA-info</code></dt>
<dd><p>If set to 1, ttfautohint creates an SFNT table called <code>TTFA</code> and fills it with information on the parameters used while calling <code>TTF_autohint</code>. The format of the output data resembles the information at the very beginning of the dump emitted by option <code>debug</code>. The default value is 0.</p>
<p>Main use of this option is for font editing purposes. For example, after a font editor has added some glyphs, a front-end to <code>TTF_autohint</code> can parse <code>TTFA</code> and feed the parameters into another call of <code>TTF_autohint</code>. The new glyphs are then hinted while hints of the old glyphs stay unchanged.</p>
<p>If this option is not set, and the font to be processed contains a <code>TTFA</code> table, it gets removed.</p>
<p>Note that such a <code>TTFA</code> table gets ignored by all font rendering engines. In TrueType Collections, the <code>TTFA</code> table is added to the first subfont.</p>
</dd>
<dt><code>dehint</code></dt>
<dd>If set to 1, remove all hints from the font. All other hinting options are ignored.
</dd>
<dt><code>epoch</code></dt>
<dd>An integer of type <code>unsigned long long</code>, 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 <code>ULLONG_MAX</code>, this epoch gets used instead of the current date and time for the ‘modification time’ field in the TTF header. Use this to get <a href="https://reproducible-builds.org/">reproducible builds</a>.
</dd>
</dl>
<h3 id="remarks">Remarks</h3>
<ul>
<li><p>Obviously, it is necessary to have an input and an output data stream. All other options are optional.</p></li>
<li><p><code>hinting-range-min</code> and <code>hinting-range-max</code> specify the range for which the autohinter generates optimized hinting code. If a PPEM value is smaller than the value of <code>hinting-range-min</code>, hinting still takes place but the configuration created for <code>hinting-range-min</code> is used. The analogous action is taken for <code>hinting-range-max</code>, only limited by the value given with <code>hinting-limit</code>. The font’s <code>gasp</code> 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).</p></li>
<li><p>ttfautohint can process its own output a second time only if option <code>hint-composites</code> is not set (or if the font doesn’t contain composite glyphs at all). This limitation might change in the future.</p></li>
</ul>
<div class="sourceCode"><pre class="sourceCode c"><code class="sourceCode c">TA_Error
TTF_autohint(<span class="dt">const</span> <span class="dt">char</span>* options,
             ...);</code></pre></div>
<h1 id="compilation-and-installation">Compilation and Installation</h1>
<p>Please read the files <a href="http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=doc/INSTALL;hb=HEAD"><code>INSTALL</code></a> and <a href="http://repo.or.cz/w/ttfautohint.git/blob_plain/HEAD:/INSTALL.git"><code>INSTALL.git</code></a> (both part of the source code bundle) for instructions how to compile the ttfautohint library together with its front-ends using a POSIX compatible shell and compiler.</p>
<h2 id="unix-like-platforms">Unix-like Platforms</h2>
<p>The generic instructions should work just fine. Since ttfautohint depends on <a href="http://qt.io">Qt</a> version 4 or newer, <a href="http://freetype.org">FreeType</a> version 2.4.5 or newer, and <a href="http://harfbuzz.org">HarfBuzz</a> version 0.9.19 or newer, you should install packages for these libraries (called ‘libqt4’ or similar, ‘libfreetype6’<a href="#fn3" class="footnoteRef" id="fnref3"><sup>3</sup></a>, and ‘libharfbuzz0’ or similar) together with its development bundles (called ‘libqt4-devel’, ‘freetype2-devel’, and ‘harfbuzz-devel’ or similar) before running ttfautohint’s <code>configure</code> script.</p>
<h2 id="ms-windows">MS Windows</h2>
<p>Precompiled binaries <code>ttfautohint.exe</code> and <code>ttfautohintGUI.exe</code> are available, being statically linked to <a href="http://qt.io">Qt</a>, <a href="http://freetype.org">FreeType</a>, and <a href="http://harfbuzz.org">HarfBuzz</a>. This means that the two programs are not dependent on any other program-specific DLL, and you can move them to any place you like.</p>
<p>Hints for compilation with the <a href="http://mingw.org">MinGW</a> environment are given in <code>INSTALL.git</code>.</p>
<h2 id="mac-os-x">Mac OS X</h2>
<p>Right now, only a precompiled binary <code>ttfautohint</code> is offered; a ready-to-run app bundle for the GUI version is not yet available; however, ttfautohint is part of <a href="http://brew.sh">Homebrew</a>, making compilation and installation very simple.</p>
<p>Detailed instructions to compile both <code>ttfautohint</code> and <code>ttfautohintGUI</code> can be found on <a href="http://freetype.org/ttfautohint/osx.html">ttfautohint’s homepage</a>.</p>
<h1 id="authors">Authors</h1>
<p>Copyright © 2011-2016 by <script type="text/javascript">
<!--
h='&#x67;&#110;&#x75;&#46;&#x6f;&#114;&#x67;';a='&#64;';n='&#x77;&#108;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'&#x57;&#x65;&#114;&#110;&#x65;&#114;&#32;&#76;&#x65;&#x6d;&#98;&#x65;&#114;&#x67;'+'<\/'+'a'+'>');
// -->
</script><noscript>&#x57;&#x65;&#114;&#110;&#x65;&#114;&#32;&#76;&#x65;&#x6d;&#98;&#x65;&#114;&#x67;&#32;&#40;&#x77;&#108;&#32;&#x61;&#116;&#32;&#x67;&#110;&#x75;&#32;&#100;&#x6f;&#116;&#32;&#x6f;&#114;&#x67;&#x29;</noscript>.<br />
Portions Copyright © 2011-2016 by <script type="text/javascript">
<!--
h='&#x75;&#110;&#100;&#x65;&#114;&#x73;&#116;&#x61;&#110;&#100;&#x69;&#110;&#x67;&#102;&#x6f;&#110;&#116;&#x73;&#46;&#x63;&#x6f;&#x6d;';a='&#64;';n='&#100;&#x61;&#118;&#x65;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'&#68;&#x61;&#118;&#x65;&#32;&#x43;&#114;&#x6f;&#x73;&#x73;&#108;&#x61;&#110;&#100;'+'<\/'+'a'+'>');
// -->
</script><noscript>&#68;&#x61;&#118;&#x65;&#32;&#x43;&#114;&#x6f;&#x73;&#x73;&#108;&#x61;&#110;&#100;&#32;&#40;&#100;&#x61;&#118;&#x65;&#32;&#x61;&#116;&#32;&#x75;&#110;&#100;&#x65;&#114;&#x73;&#116;&#x61;&#110;&#100;&#x69;&#110;&#x67;&#102;&#x6f;&#110;&#116;&#x73;&#32;&#100;&#x6f;&#116;&#32;&#x63;&#x6f;&#x6d;&#x29;</noscript>.<br />
Portions Copyright © 2014 by <script type="text/javascript">
<!--
h='&#116;&#x77;&#x61;&#114;&#100;&#x6f;&#x63;&#104;&#46;&#x63;&#x6f;&#x6d;';a='&#64;';n='&#x61;&#100;&#x61;&#x6d;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'&#x41;&#100;&#x61;&#x6d;&#32;&#84;&#x77;&#x61;&#114;&#100;&#x6f;&#x63;&#104;'+'<\/'+'a'+'>');
// -->
</script><noscript>&#x41;&#100;&#x61;&#x6d;&#32;&#84;&#x77;&#x61;&#114;&#100;&#x6f;&#x63;&#104;&#32;&#40;&#x61;&#100;&#x61;&#x6d;&#32;&#x61;&#116;&#32;&#116;&#x77;&#x61;&#114;&#100;&#x6f;&#x63;&#104;&#32;&#100;&#x6f;&#116;&#32;&#x63;&#x6f;&#x6d;&#x29;</noscript>.</p>
<p>This file is part of the ttfautohint library, and may only be used, modified, and distributed under the terms given in <a href="http://repo.or.cz/w/ttfautohint.git/blob_plain/HEAD:/COPYING"><code>COPYING</code></a>. By continuing to use, modify, or distribute this file you indicate that you have read <code>COPYING</code> and understand and accept it fully.</p>
<p>The file <code>COPYING</code> mentioned in the previous paragraph is distributed with the ttfautohint library.</p>
<h1 id="character-ranges">Character Ranges</h1>
<p>For the FreeType auto-hinter (and thus ttfautohint), a ‘non-base character’ is something that should not be affected by blue zones, regardless of whether this is a spacing or no-spacing glyph.</p>
<table>
<caption><code>arab</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0600</code> - <code>0x06FF</code></td>
<td align="left">Arabic</td>
</tr>
<tr class="even">
<td align="center"><code>0x0750</code> - <code>0x07FF</code></td>
<td align="left">Arabic Supplement</td>
</tr>
<tr class="odd">
<td align="center"><code>0x08A0</code> - <code>0x08FF</code></td>
<td align="left">Arabic Extended-A</td>
</tr>
<tr class="even">
<td align="center"><code>0xFB50</code> - <code>0xFDFF</code></td>
<td align="left">Arabic Presentation Forms-A</td>
</tr>
<tr class="odd">
<td align="center"><code>0xFE70</code> - <code>0xFEFF</code></td>
<td align="left">Arabic Presentation Forms-B</td>
</tr>
<tr class="even">
<td align="center"><code>0x1EE00</code> - <code>0x1EEFF</code></td>
<td align="left">Arabic Mathematical Alphabetic Symbols</td>
</tr>
</tbody>
</table>
<table>
<caption><code>arab</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0600</code> - <code>0x0605</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0610</code> - <code>0x061A</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x064B</code> - <code>0x065F</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0670</code> - <code>0x0670</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x06D6</code> - <code>0x06DC</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x06DF</code> - <code>0x06E4</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x06E7</code> - <code>0x06E8</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x06EA</code> - <code>0x06ED</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x08E3</code> - <code>0x08FF</code></td>
</tr>
<tr class="even">
<td align="center"><code>0xFBB2</code> - <code>0xFBC1</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0xFE70</code> - <code>0xFE70</code></td>
</tr>
<tr class="even">
<td align="center"><code>0xFE72</code> - <code>0xFE72</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0xFE74</code> - <code>0xFE74</code></td>
</tr>
<tr class="even">
<td align="center"><code>0xFE76</code> - <code>0xFE76</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0xFE78</code> - <code>0xFE78</code></td>
</tr>
<tr class="even">
<td align="center"><code>0xFE7A</code> - <code>0xFE7A</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0xFE7C</code> - <code>0xFE7C</code></td>
</tr>
<tr class="even">
<td align="center"><code>0xFE7E</code> - <code>0xFE7E</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>armn</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0530</code> - <code>0x058F</code></td>
<td align="left">Armenian</td>
</tr>
<tr class="even">
<td align="center"><code>0xFB13</code> - <code>0xFB17</code></td>
<td align="left">Alphab. Present. Forms (Armenian)</td>
</tr>
</tbody>
</table>
<table>
<caption><code>armn</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0559</code> - <code>0x055F</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>beng</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0980</code> - <code>0x09FF</code></td>
<td align="left">Bengali</td>
</tr>
</tbody>
</table>
<table>
<caption><code>beng</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0981</code> - <code>0x0981</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x09BC</code> - <code>0x09BC</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x09C1</code> - <code>0x09C4</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x09CD</code> - <code>0x09CD</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x09E2</code> - <code>0x09E3</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>cher</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x13A0</code> - <code>0x13FF</code></td>
<td align="left">Cherokee</td>
</tr>
<tr class="even">
<td align="center"><code>0xAB70</code> - <code>0xABBF</code></td>
<td align="left">Cherokee Supplement</td>
</tr>
</tbody>
</table>
<table>
<caption><code>cyrl</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0400</code> - <code>0x04FF</code></td>
<td align="left">Cyrillic</td>
</tr>
<tr class="even">
<td align="center"><code>0x0500</code> - <code>0x052F</code></td>
<td align="left">Cyrillic Supplement</td>
</tr>
<tr class="odd">
<td align="center"><code>0x2DE0</code> - <code>0x2DFF</code></td>
<td align="left">Cyrillic Extended-A</td>
</tr>
<tr class="even">
<td align="center"><code>0xA640</code> - <code>0xA69F</code></td>
<td align="left">Cyrillic Extended-B</td>
</tr>
</tbody>
</table>
<table>
<caption><code>cyrl</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0483</code> - <code>0x0489</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x2DE0</code> - <code>0x2DFF</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0xA66F</code> - <code>0xA67F</code></td>
</tr>
<tr class="even">
<td align="center"><code>0xA69E</code> - <code>0xA69F</code></td>
</tr>
</tbody>
</table>
<p>There are some characters in the Devanagari Unicode block that are generic to Indic scripts; we omit them so that their presence doesn’t trigger Devanagari.</p>
<table>
<caption><code>deva</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0900</code> - <code>0x093B</code></td>
<td align="left">Devanagari</td>
</tr>
<tr class="even">
<td align="center"><code>0x093D</code> - <code>0x0950</code></td>
<td align="left">… continued</td>
</tr>
<tr class="odd">
<td align="center"><code>0x0953</code> - <code>0x0963</code></td>
<td align="left">… continued</td>
</tr>
<tr class="even">
<td align="center"><code>0x0966</code> - <code>0x097F</code></td>
<td align="left">… continued</td>
</tr>
<tr class="odd">
<td align="center"><code>0x20B9</code> - <code>0x20B9</code></td>
<td align="left">(new) Rupee sign</td>
</tr>
<tr class="even">
<td align="center"><code>0xA8E0</code> - <code>0xA8FF</code></td>
<td align="left">Devanagari Extended</td>
</tr>
</tbody>
</table>
<table>
<caption><code>deva</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0900</code> - <code>0x0902</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x093A</code> - <code>0x093A</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0941</code> - <code>0x0948</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x094D</code> - <code>0x094D</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0953</code> - <code>0x0957</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0962</code> - <code>0x0963</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0xA8E0</code> - <code>0xA8F1</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>ethi</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x1200</code> - <code>0x137F</code></td>
<td align="left">Ethiopic</td>
</tr>
<tr class="even">
<td align="center"><code>0x1380</code> - <code>0x139F</code></td>
<td align="left">Ethiopic Supplement</td>
</tr>
<tr class="odd">
<td align="center"><code>0x2D80</code> - <code>0x2DDF</code></td>
<td align="left">Ethiopic Extended</td>
</tr>
<tr class="even">
<td align="center"><code>0xAB00</code> - <code>0xAB2F</code></td>
<td align="left">Ethiopic Extended-A</td>
</tr>
</tbody>
</table>
<table>
<caption><code>ethi</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x135D</code> - <code>0x135F</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>geor</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x10D0</code> - <code>0x10FF</code></td>
<td align="left">Georgian (Mkhedruli)</td>
</tr>
</tbody>
</table>
<table>
<caption><code>geok</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x10A0</code> - <code>0x10CD</code></td>
<td align="left">Georgian (Asomtavruli)</td>
</tr>
<tr class="even">
<td align="center"><code>0x2D00</code> - <code>0x2D2D</code></td>
<td align="left">Georgian (Nuskhuri)</td>
</tr>
</tbody>
</table>
<table>
<caption><code>grek</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0370</code> - <code>0x03FF</code></td>
<td align="left">Greek and Coptic</td>
</tr>
<tr class="even">
<td align="center"><code>0x1F00</code> - <code>0x1FFF</code></td>
<td align="left">Greek Extended</td>
</tr>
</tbody>
</table>
<table>
<caption><code>grek</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x037A</code> - <code>0x037A</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0384</code> - <code>0x0385</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x1FBD</code> - <code>0x1FC1</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x1FCD</code> - <code>0x1FCF</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x1FDD</code> - <code>0x1FDF</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x1FED</code> - <code>0x1FEF</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x1FFD</code> - <code>0x1FFE</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>gujr</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0A80</code> - <code>0x0AFF</code></td>
<td align="left">Gujarati</td>
</tr>
</tbody>
</table>
<table>
<caption><code>gujr</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0A81</code> - <code>0x0A82</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0ABC</code> - <code>0x0ABC</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0AC1</code> - <code>0x0AC8</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0ACD</code> - <code>0x0ACD</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0AE2</code> - <code>0x0AE3</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>guru</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0A00</code> - <code>0x0A7F</code></td>
<td align="left">Gurmukhi</td>
</tr>
</tbody>
</table>
<table>
<caption><code>guru</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0A01</code> - <code>0x0A02</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0A3C</code> - <code>0x0A3C</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0A41</code> - <code>0x0A51</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0A70</code> - <code>0x0A71</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0A75</code> - <code>0x0A75</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>hebr</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0590</code> - <code>0x05FF</code></td>
<td align="left">Hebrew</td>
</tr>
<tr class="even">
<td align="center"><code>0xFB1D</code> - <code>0xFB4F</code></td>
<td align="left">Alphab. Present. Forms (Hebrew)</td>
</tr>
</tbody>
</table>
<table>
<caption><code>hebr</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0591</code> - <code>0x05BF</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x05C1</code> - <code>0x05C2</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x05C4</code> - <code>0x05C5</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x05C7</code> - <code>0x05C7</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0xFB1E</code> - <code>0xFB1E</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>knda</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0C80</code> - <code>0x0CFF</code></td>
<td align="left">Kannada</td>
</tr>
</tbody>
</table>
<table>
<caption><code>knda</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0C81</code> - <code>0x0C81</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0CBC</code> - <code>0x0CBC</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0CBF</code> - <code>0x0CBF</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0CC6</code> - <code>0x0CC6</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0CCC</code> - <code>0x0CCD</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0CE2</code> - <code>0x0CE3</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>khmr</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x1780</code> - <code>0x17FF</code></td>
<td align="left">Khmer</td>
</tr>
</tbody>
</table>
<table>
<caption><code>khmr</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x17B7</code> - <code>0x17BD</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x17C6</code> - <code>0x17C6</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x17C9</code> - <code>0x17D3</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x17DD</code> - <code>0x17DD</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>khms</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x19E0</code> - <code>0x19FF</code></td>
<td align="left">Khmer Symbols</td>
</tr>
</tbody>
</table>
<table>
<caption><code>lao</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0E80</code> - <code>0x0EFF</code></td>
<td align="left">Lao</td>
</tr>
</tbody>
</table>
<table>
<caption><code>lao</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0EB1</code> - <code>0x0EB1</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0EB4</code> - <code>0x0EBC</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0EC8</code> - <code>0x0ECD</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>latn</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0020</code> - <code>0x007F</code></td>
<td align="left">Basic Latin (no control chars)</td>
</tr>
<tr class="even">
<td align="center"><code>0x00A0</code> - <code>0x00A9</code></td>
<td align="left">Latin-1 Supplement (no control chars)</td>
</tr>
<tr class="odd">
<td align="center"><code>0x00AB</code> - <code>0x00B1</code></td>
<td align="left">… continued</td>
</tr>
<tr class="even">
<td align="center"><code>0x00B4</code> - <code>0x00B8</code></td>
<td align="left">… continued</td>
</tr>
<tr class="odd">
<td align="center"><code>0x00BB</code> - <code>0x00FF</code></td>
<td align="left">… continued</td>
</tr>
<tr class="even">
<td align="center"><code>0x0100</code> - <code>0x017F</code></td>
<td align="left">Latin Extended-A</td>
</tr>
<tr class="odd">
<td align="center"><code>0x0180</code> - <code>0x024F</code></td>
<td align="left">Latin Extended-B</td>
</tr>
<tr class="even">
<td align="center"><code>0x0250</code> - <code>0x02AF</code></td>
<td align="left">IPA Extensions</td>
</tr>
<tr class="odd">
<td align="center"><code>0x02B9</code> - <code>0x02DF</code></td>
<td align="left">Spacing Modifier Letters</td>
</tr>
<tr class="even">
<td align="center"><code>0x02E5</code> - <code>0x02FF</code></td>
<td align="left">… continued</td>
</tr>
<tr class="odd">
<td align="center"><code>0x0300</code> - <code>0x036F</code></td>
<td align="left">Combining Diacritical Marks</td>
</tr>
<tr class="even">
<td align="center"><code>0x1AB0</code> - <code>0x1ABE</code></td>
<td align="left">Combining Diacritical Marks Extended</td>
</tr>
<tr class="odd">
<td align="center"><code>0x1D00</code> - <code>0x1D2B</code></td>
<td align="left">Phonetic Extensions</td>
</tr>
<tr class="even">
<td align="center"><code>0x1D6B</code> - <code>0x1D77</code></td>
<td align="left">… continued</td>
</tr>
<tr class="odd">
<td align="center"><code>0x1D79</code> - <code>0x1D7F</code></td>
<td align="left">… continued</td>
</tr>
<tr class="even">
<td align="center"><code>0x1D80</code> - <code>0x1D9A</code></td>
<td align="left">Phonetic Extensions Supplement</td>
</tr>
<tr class="odd">
<td align="center"><code>0x1DC0</code> - <code>0x1DFF</code></td>
<td align="left">Combining Diacritical Marks Supplement</td>
</tr>
<tr class="even">
<td align="center"><code>0x1E00</code> - <code>0x1EFF</code></td>
<td align="left">Latin Extended Additional</td>
</tr>
<tr class="odd">
<td align="center"><code>0x2000</code> - <code>0x206F</code></td>
<td align="left">General Punctuation</td>
</tr>
<tr class="even">
<td align="center"><code>0x20A0</code> - <code>0x20B8</code></td>
<td align="left">Currency Symbols …</td>
</tr>
<tr class="odd">
<td align="center"><code>0x20BA</code> - <code>0x20CF</code></td>
<td align="left">… except new Rupee sign</td>
</tr>
<tr class="even">
<td align="center"><code>0x2150</code> - <code>0x218F</code></td>
<td align="left">Number Forms</td>
</tr>
<tr class="odd">
<td align="center"><code>0x2C60</code> - <code>0x2C7B</code></td>
<td align="left">Latin Extended-C</td>
</tr>
<tr class="even">
<td align="center"><code>0x2C7E</code> - <code>0x2C7F</code></td>
<td align="left">… continued</td>
</tr>
<tr class="odd">
<td align="center"><code>0x2E00</code> - <code>0x2E7F</code></td>
<td align="left">Supplemental Punctuation</td>
</tr>
<tr class="even">
<td align="center"><code>0xA720</code> - <code>0xA76F</code></td>
<td align="left">Latin Extended-D</td>
</tr>
<tr class="odd">
<td align="center"><code>0xA771</code> - <code>0xA7F7</code></td>
<td align="left">… continued</td>
</tr>
<tr class="even">
<td align="center"><code>0xA7FA</code> - <code>0xA7FF</code></td>
<td align="left">… continued</td>
</tr>
<tr class="odd">
<td align="center"><code>0xAB30</code> - <code>0xAB5B</code></td>
<td align="left">Latin Extended-E</td>
</tr>
<tr class="even">
<td align="center"><code>0xAB60</code> - <code>0xAB6F</code></td>
<td align="left">… continued</td>
</tr>
<tr class="odd">
<td align="center"><code>0xFB00</code> - <code>0xFB06</code></td>
<td align="left">Alphab. Present. Forms (Latin Ligs)</td>
</tr>
<tr class="even">
<td align="center"><code>0x1D400</code> - <code>0x1D7FF</code></td>
<td align="left">Mathematical Alphanumeric Symbols</td>
</tr>
</tbody>
</table>
<table>
<caption><code>latn</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x005E</code> - <code>0x0060</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x007E</code> - <code>0x007E</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x00A8</code> - <code>0x00A9</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x00AE</code> - <code>0x00B0</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x00B4</code> - <code>0x00B4</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x00B8</code> - <code>0x00B8</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x00BC</code> - <code>0x00BE</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x02B9</code> - <code>0x02DF</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x02E5</code> - <code>0x02FF</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0300</code> - <code>0x036F</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x1AB0</code> - <code>0x1ABE</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x1DC0</code> - <code>0x1DFF</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x2017</code> - <code>0x2017</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x203E</code> - <code>0x203E</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0xA788</code> - <code>0xA788</code></td>
</tr>
<tr class="even">
<td align="center"><code>0xA7F8</code> - <code>0xA7FA</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>latb</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x1D62</code> - <code>0x1D6A</code></td>
<td align="left">some small subscript letters</td>
</tr>
<tr class="even">
<td align="center"><code>0x2080</code> - <code>0x209C</code></td>
<td align="left">subscript digits and letters</td>
</tr>
<tr class="odd">
<td align="center"><code>0x2C7C</code> - <code>0x2C7C</code></td>
<td align="left">latin subscript small letter j</td>
</tr>
</tbody>
</table>
<table>
<caption><code>latp</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x00AA</code> - <code>0x00AA</code></td>
<td align="left">feminine ordinal indicator</td>
</tr>
<tr class="even">
<td align="center"><code>0x00B2</code> - <code>0x00B3</code></td>
<td align="left">superscript two and three</td>
</tr>
<tr class="odd">
<td align="center"><code>0x00B9</code> - <code>0x00BA</code></td>
<td align="left">superscript one, masc. ord. indic.</td>
</tr>
<tr class="even">
<td align="center"><code>0x02B0</code> - <code>0x02B8</code></td>
<td align="left">some latin superscript mod. letters</td>
</tr>
<tr class="odd">
<td align="center"><code>0x02E0</code> - <code>0x02E4</code></td>
<td align="left">some IPA modifier letters</td>
</tr>
<tr class="even">
<td align="center"><code>0x1D2C</code> - <code>0x1D61</code></td>
<td align="left">latin superscript modifier letters</td>
</tr>
<tr class="odd">
<td align="center"><code>0x1D78</code> - <code>0x1D78</code></td>
<td align="left">modifier letter cyrillic en</td>
</tr>
<tr class="even">
<td align="center"><code>0x1D9B</code> - <code>0x1DBF</code></td>
<td align="left">more modifier letters</td>
</tr>
<tr class="odd">
<td align="center"><code>0x2070</code> - <code>0x207F</code></td>
<td align="left">superscript digits and letters</td>
</tr>
<tr class="even">
<td align="center"><code>0x2C7D</code> - <code>0x2C7D</code></td>
<td align="left">modifier letter capital v</td>
</tr>
<tr class="odd">
<td align="center"><code>0xA770</code> - <code>0xA770</code></td>
<td align="left">modifier letter us</td>
</tr>
<tr class="even">
<td align="center"><code>0xA7F8</code> - <code>0xA7F9</code></td>
<td align="left">more modifier letters</td>
</tr>
<tr class="odd">
<td align="center"><code>0xAB5C</code> - <code>0xAB5F</code></td>
<td align="left">more modifier letters</td>
</tr>
</tbody>
</table>
<table>
<caption><code>mlym</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0D00</code> - <code>0x0D7F</code></td>
<td align="left">Malayalam</td>
</tr>
</tbody>
</table>
<table>
<caption><code>mlym</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0D01</code> - <code>0x0D01</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0D4D</code> - <code>0x0D4E</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0D62</code> - <code>0x0D63</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>mymr</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x1000</code> - <code>0x109F</code></td>
<td align="left">Myanmar</td>
</tr>
<tr class="even">
<td align="center"><code>0xA9E0</code> - <code>0xA9FF</code></td>
<td align="left">Myanmar Extended-B</td>
</tr>
<tr class="odd">
<td align="center"><code>0xAA60</code> - <code>0xAA7F</code></td>
<td align="left">Myanmar Extended-A</td>
</tr>
</tbody>
</table>
<table>
<caption><code>mymr</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x102D</code> - <code>0x1030</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x1032</code> - <code>0x1037</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x103A</code> - <code>0x103A</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x103D</code> - <code>0x103E</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x1058</code> - <code>0x1059</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x105E</code> - <code>0x1060</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x1071</code> - <code>0x1074</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x1082</code> - <code>0x1082</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x1085</code> - <code>0x1086</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x108D</code> - <code>0x108D</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0xA9E5</code> - <code>0xA9E5</code></td>
</tr>
<tr class="even">
<td align="center"><code>0xAA7C</code> - <code>0xAA7C</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>sinh</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0D80</code> - <code>0x0DFF</code></td>
<td align="left">Sinhala</td>
</tr>
</tbody>
</table>
<table>
<caption><code>sinh</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0DCA</code> - <code>0x0DCA</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0DD2</code> - <code>0x0DD6</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>taml</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0B80</code> - <code>0x0BFF</code></td>
<td align="left">Tamil</td>
</tr>
</tbody>
</table>
<table>
<caption><code>taml</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0B82</code> - <code>0x0B82</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0BC0</code> - <code>0x0BC2</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0BCD</code> - <code>0x0BCD</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>telu</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0C00</code> - <code>0x0C7F</code></td>
<td align="left">Telugu</td>
</tr>
</tbody>
</table>
<table>
<caption><code>telu</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0C00</code> - <code>0x0C00</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0C3E</code> - <code>0x0C40</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0C46</code> - <code>0x0C56</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0C62</code> - <code>0x0C63</code></td>
</tr>
</tbody>
</table>
<table>
<caption><code>thai</code> base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0E00</code> - <code>0x0E7F</code></td>
<td align="left">Thai</td>
</tr>
</tbody>
</table>
<table>
<caption><code>thai</code> non-base characters</caption>
<thead>
<tr class="header">
<th align="center">Character range</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="center"><code>0x0E31</code> - <code>0x0E31</code></td>
</tr>
<tr class="even">
<td align="center"><code>0x0E34</code> - <code>0x0E3A</code></td>
</tr>
<tr class="odd">
<td align="center"><code>0x0E47</code> - <code>0x0E4E</code></td>
</tr>
</tbody>
</table>
<h1 id="history">History</h1>
<h2 id="version-1.6-2016-nov-27">Version 1.6 (2016-Nov-27)</h2>
<ul>
<li><p>A new option <code>--reference</code> (and <code>--reference-index</code> to select a font within a TTC) makes ttfautohint use the blue zones from another font. This helps synchronize the ascenders and descenders of font families.</p></li>
<li><p>Support for Armenian, Cherokee, Ethiopic, Georgian, Gujarati, Gurmukhi, Kannada, Malayalam, Sinhala, and Tamil scripts.</p></li>
<li><p>New option <code>--ttfa-info</code> to display a font’s <code>TTFA</code> table (if present).</p></li>
<li><p>Glyphs covered by the fallback script are now hinted by default. Previously, they were scaled only. The default fallback script <code>none</code> now implies hinting without script-specific blue zones (but still aligning stems to the grid if possible).</p></li>
<li><p>The new option <code>--fallback-scaling</code> changes the behaviour of the fallback script from hinting to scaling (as implemented in previous versions).</p></li>
<li><p>ttfautohint (but not ttfautohintGUI) now honours the SOURCE_DATE_EPOCH environment variable for reproducible builds. This corresponds to the new library option <code>epoch</code>.</p></li>
<li><p>Bug fix: Allow dehinting of fonts that contain a <code>.ttfautohint</code> glyph.</p></li>
</ul>
<h2 id="version-1.5-2016-jan-24">Version 1.5 (2016-Jan-24)</h2>
<ul>
<li><p>Support for Khmer, Myanmar, and Bengali scripts.</p></li>
<li><p>Improved Devanagari hinting.</p></li>
<li><p>ttfautohintGUI can now be compiled with Qt5.</p></li>
<li><p>Bug fix: Too many delta control instructions for a single glyph caused a bytecode stack overflow, making the MS rasterizer ignore all hinting instructions for this glyph.</p></li>
<li><p>Bug fix: Don’t create multiple <code>TTFA</code> tables in font.</p></li>
<li><p>Bug fix: Under certain circumstances, glyph indices used in Indic features were incorrectly assigned to the default script.</p></li>
</ul>
<h2 id="version-1.4.1-2015-oct-17">Version 1.4.1 (2015-Oct-17)</h2>
<ul>
<li>A bug in handling control instruction files could cause severe glyph shape distortions of accent-like glyphs. All users should update.</li>
</ul>
<h2 id="version-1.4-2015-oct-04">Version 1.4 (2015-Oct-04)</h2>
<ul>
<li><p>Support for Thai and Lao scripts.</p></li>
<li><p>Support for the Arabic script.</p></li>
<li><p>Better support for scripts that contain superscript-like and subscript-like glyphs, e.g., the International Phonetic Alphabet (IPA).</p></li>
<li><p>Accents and other `non-base’ glyphs are now hinted without snapping to blue zones.</p></li>
<li><p>A new control instruction syntax form was added to adjust the mapping between glyphs and styles. Right now, its usage is quite limited; a forthcoming version will give much more flexibility.</p></li>
<li><p>The <code>touch</code> keyword in a control instructions file was buggy: If used for a point <code>P</code> at a ppem value <code>s</code>, it sometimes led to unwanted movements of <code>P</code> for ppem values unequal to <code>s</code>, thus causing outline distortions.</p></li>
</ul>
<h2 id="version-1.3-2015-jan-06">Version 1.3 (2015-Jan-06)</h2>
<ul>
<li><p>Keywords in control instruction files can be more verbose to increase readability. You can now use <code>left</code>, <code>right</code>, <code>nodir</code>, <code>point</code>, <code>touch</code>, <code>xshift</code>, and <code>yshift</code> for <code>l</code>, <code>r</code>, <code>n</code>, <code>p</code>, <code>t,</code>x<code>, and</code>y`, respectively.</p></li>
<li><p>A new control instruction keyword <code>touch</code> was added to apply delta instructions before the final IUP bytecode commands, also `touching’ the affected points (to use the TrueType instructions terminology). Such deltas <em>do</em> work even with ClearType if applied to the non-ClearType direction.</p></li>
<li><p>Support for the Telugu script.</p></li>
<li><p>The amount of information about ttfautohint and its parameters that gets added to the <code>name</code> table by default has been reduced. A new option <code>--detailed-info</code> restores the previous behaviour.</p></li>
<li><p>ttfautohintGUI crashed if not used with a control instruction file.</p></li>
<li><p>ttfautohintGUI now correctly switches to a horizontal two-column layout if the standard one-column layout would exceed the screen height.</p></li>
<li><p>A new option <code>--family-suffix</code> makes it possible to append a suffix to a font’s family name in the <code>name</code> table. This can be useful during the development process: It helps the operating system to simultaneously display several instances of a font that are processed with different ttfautohint parameters.</p></li>
<li><p>The new library option <code>info-post-callback</code> helps in processing data from the <code>name</code> table.</p></li>
</ul>
<h2 id="version-1.2-2014-oct-06">Version 1.2 (2014-Oct-06)</h2>
<ul>
<li><p>It is now possible to control the hinting process at a very low level using a ‘control instructions’ file. Right now, two modes are supported:</p>
<ul>
<li><p>Adding segments and changing segment directions.</p></li>
<li><p>Applying delta exceptions. Note that this doesn’t really work in ClearType.</p></li>
</ul></li>
</ul>
<p>Please see the documentation for a description and a small tutorial.</p>
<p>In the command-line front-end, use option <code>--control-file</code> to load such a file.</p>
<ul>
<li>Support for input file watching in ttfautohintGUI: If the ‘Watch Input File’ box is checked, the program automatically regenerates the output file as soon as the input font or control instructions file gets modified.</li>
</ul>
<p>The idea is to dock ttfautohintGUI to your favourite font and text editor instead of adding a cheap text editor to ttfautohintGUI itself.</p>
<ul>
<li><p>With the new option <code>--fallback-stem-width</code> it is now possible to set a default stem width for all scripts that lack proper standard characters in the font.</p></li>
<li><p>Add alias <code>--adjust-subglyphs</code> for option <code>--pre-hinting</code> to better describe its functionality. The short form <code>-p</code> stays unchanged.</p></li>
<li><p>New option <code>--ttfa-table</code> to add an SFNT table <code>TTFA</code> to the output font, containing an ASCII dump of all used ttfautohint parameters (including control instructions). Right now, this is mainly for archiving purposes. Forthcoming versions of ttfautohint will be able to re-use this data if a font gets re-processed.</p></li>
<li><p>A harmless buglet was fixed that made the <code>glyf</code> table too large by one byte under some circumstances.</p></li>
<li><p>A bug fix taken from FreeType, correcting a crash for unusual outlines.</p></li>
<li><p>Better handling of TTC files.</p></li>
<li><p>New library options <code>error-callback</code> and <code>error-callback-data</code> for improved diagnostics. [No change in the front-ends except better error messages.]</p></li>
<li><p>Many other, minor fixes and improvements.</p></li>
</ul>
<h2 id="version-1.1-2014-may-05">Version 1.1 (2014-May-05)</h2>
<ul>
<li><p>Support for the Devanagari script.</p></li>
<li><p>Bug fixes in the computation of strong stem widths. GDI hinting now gives much more consistent results.</p></li>
<li><p>Better recognition of script coverage: ttfautohint now properly scans composite glyphs to cover components also.</p></li>
<li><p>Improved glyph shape analysis: Non-flat local extrema are now recognized more reliably, and stem detection works better.</p></li>
</ul>
<h2 id="version-1.00-2014-mar-20">Version 1.00 (2014-Mar-20)</h2>
<ul>
<li><p>Much less memory consumption while handling fonts with complicated glyphs.</p></li>
<li><p>Option <code>-s</code> was partially broken.</p></li>
</ul>
<h2 id="version-1.00rc1-2014-feb-07">Version 1.00rc1 (2014-Feb-07)</h2>
<ul>
<li>OpenType feature support. ttfautohint now uses the HarfBuzz library to analyze data from the <code>GSUB</code> table. This allows the hinting of glyphs that don’t have an entry in a font’s <code>cmap</code> table, for example superscripts or small caps.</li>
</ul>
<p>Related to this, the new option <code>--default-script</code> controls the default (fallback) script used for OpenType features.</p>
<ul>
<li><p>More than a single standard character is used. For example, the ‘latin’ script uses characters ‘o’, ‘O’, and digit ‘0’. This improves the hinting of fonts (and features) that have only a partial coverage of a script’s character repertoire.</p></li>
<li><p>Much better GDI ClearType hinting in the range 30-80ppem (approx.), avoiding overly flat tops and bottoms of round glyphs.</p></li>
<li><p>Better handling of non-square pixels (this is, horizontal and vertical resolutions differ) in the created TrueType bytecode.</p></li>
</ul>
<h2 id="version-0.97-2013-nov-09">Version 0.97 (2013-Nov-09)</h2>
<ul>
<li><p>Improved script support. Besides Cyrillic and Greek, which are now handled separately from Latin, ttfautohint can handle Hebrew.</p></li>
<li><p>Option <code>-f</code> now takes a parameter to specify the fallback script. The corresponding long option name has been renamed from <code>--latin-fallback</code> to <code>--fallback-script</code>.</p></li>
<li><p>Work around a bug in display environments that use FreeType 2.5.0 and earlier for rendering: Sometimes, the ‘strong’ stem width routine was used for DW ClearType (this is, subpixel hinting in FreeType is enabled) even if ‘smooth’ was selected while generating the font with ttfautohint.</p></li>
</ul>
<h2 id="version-0.96-2013-aug-06">Version 0.96 (2013-Aug-06)</h2>
<ul>
<li>Option <code>--components</code> has been replaced with <code>--composites</code>: By default, the components of a composite glyph are now hinted separately, since tests has shown that this gives good results in most cases. If this option is set, however, the composite glyph itself gets hinted (and the hints of the components are ignored).</li>
</ul>
<p>An unfortunate side effect is that ttfautohint’s option <code>-c</code> (which stays as a shorthand for <code>--composites</code>) now does exactly the opposite as in previous releases.</p>
<ul>
<li><p>Older versions of Monotype’s ‘iType’ bytecode interpreter have a serious bug: The DIV instruction rounds the result, while the correct operation is truncation. This caused ‘exploding characters’ with fonts hinted by ttfautohint. Since many printers contain this rasterizer without any possibility to update to a non-buggy version, ttfautohint now contains work-arounds to circumvent the problem.</p></li>
<li><p>Better support for glyphs where some points have almost the same position (for example glyph ‘Oslash’ in font ‘Roboto-Thin’).</p></li>
<li><p>Better support for glyphs that use explicit ‘on’ points around round extrema.</p></li>
</ul>
<h2 id="version-0.95-2013-mar-07">Version 0.95 (2013-Mar-07)</h2>
<ul>
<li><p>New option <code>--dehint</code> to strip off all hints without generating new hints. This option is intended for testing purposes.</p></li>
<li><p>Minor fixes to the created bytecode for compatibility.</p></li>
<li><p>Minor GUI improvements.</p></li>
</ul>
<h2 id="version-0.94-2012-nov-29">Version 0.94 (2012-Nov-29)</h2>
<ul>
<li><p>New option <code>--windows-compatibility</code> that adds two artificial blue zones at vertical positions given by ‘usWinAscent’ and ‘usWinDescent’. This helps ttfautohint’s hinting algorithm reduce the possibility of clipping if those two values are very tight.</p></li>
<li><p>Implement option <code>--x-height-snapping-exceptions</code>, making ttfautohint avoid x-height snapping for selected PPEM values. Useful in combination with <code>--windows-compatibility</code>.</p></li>
<li><p>Minor fixes to the created bytecode for compatibility and robustness.</p></li>
</ul>
<h2 id="version-0.93-2012-oct-09">Version 0.93 (2012-Oct-09)</h2>
<ul>
<li>New option <code>--components</code> to treat components of composite glyphs separately. This greatly reduces the bytecode size.</li>
</ul>
<p>I’m waiting for reports whether this option works for most fonts; in case this is true I’m inverting the option, making it the default (and the old behaviour optional).</p>
<ul>
<li><p>Full support of TTCs, this is, all subfonts get auto-hinted now.</p></li>
<li><p>The upper limit of the <code>--increase-x-height</code> option has been removed.</p></li>
<li><p>Drag-and-drop support in the GUI.</p></li>
<li><p>The command-line version of ttfautohint now acts like a (Unix) filter, this is, it accepts stdin and stdout as input and output, respectively.</p></li>
<li><p>Less memory consumption.</p></li>
</ul>
<h2 id="version-0.92-2012-aug-07">Version 0.92 (2012-Aug-07)</h2>
<ul>
<li>A serious bug in the created bytecode has been fixed, causing incorrect rounding.</li>
</ul>
<h2 id="version-0.91-2012-jul-12">Version 0.91 (2012-Jul-12)</h2>
<ul>
<li><p>A new, ‘strong’ routine to handle stem widths and positions has been added, to be selected with the <code>--strong-stem-width</code> command line option. If it is active, stem widths and positions are snapped to the grid as much as possible. This algorithm is useful for GDI ClearType support.</p></li>
<li><p>A new command line option <code>--debug</code> (not available for ttfautohintGUI) to print very detailed debugging information.</p></li>
</ul>
<h2 id="version-0.9-2012-jun-06">Version 0.9 (2012-Jun-06)</h2>
<ul>
<li><p>The created bytecode has been reduced in size, making it approx. 20% smaller.</p></li>
<li><p>New option <code>--symbol</code> to use standard stem height and width values instead of using character ‘o’ (which may be missing). Use this option for symbol fonts or math glyphs.</p></li>
<li><p>More documentation (in text, HTML, and PDF format). It’s still incomplete, though.</p></li>
<li><p>Option <code>--ignore-permissions</code> has been renamed to <code>--ignore-restrictions</code>. The short form is still <code>-i</code>.</p></li>
<li><p>Defaults for various parameters have been set to more sensible values:</p>
<ul>
<li>hinting-range-max: 50 (was 1000)</li>
<li>hinting-limit: 200 (was 1000)</li>
</ul></li>
<li><p>Option <code>--increase-x-height</code> now has a mandatory argument (in the range 6-20 or value 0 to disable it, default value is 14).</p></li>
</ul>
<h2 id="version-0.8-2012-mar-21">Version 0.8 (2012-Mar-21)</h2>
<ul>
<li><p>Implement option <code>-x</code> to increase the x height of the font for small PPEM values by rounding up far more often then rounding down.</p></li>
<li><p>Add option ‘<code>-G n</code>’ to switch off hinting completely above value <code>n</code>.</p></li>
<li><p>ttfautohint now appends version information and the used parameters to the ‘Version’ field(s) in the ‘name’ table. This can be suppressed with option <code>-n</code>.</p></li>
</ul>
<h2 id="version-0.7-2012-feb-05">Version 0.7 (2012-Feb-05)</h2>
<ul>
<li>A GUI has been added, using the Qt framework. The binary is called ‘ttfautohintGUI’.</li>
</ul>
<h2 id="version-0.6.1-2012-jan-02">Version 0.6.1 (2012-Jan-02)</h2>
<ul>
<li><p>The improved handling of composite glyphs in 0.6 was buggy under certain circumstances, making ttfautohint crash and FontValidator complain.</p></li>
<li><p>Dropout handling has been activated.</p></li>
</ul>
<h2 id="version-0.6-2011-dec-25">Version 0.6 (2011-Dec-25)</h2>
<ul>
<li><p>Improved handling of composite glyphs.</p></li>
<li><p>Implement option <code>-p</code> to pre-hint glyphs with original hints before conversion takes place.</p></li>
<li><p>Don’t add a <code>DSIG</code> table if there is none in the input font.</p></li>
<li><p>Human-readable error messages instead of hexadecimal error codes.</p></li>
<li><p>Better tests (both at runtime and compile time) to reject too old FreeType versions.</p></li>
</ul>
<h2 id="version-0.5-2011-nov-06">Version 0.5 (2011-Nov-06)</h2>
<ul>
<li><p>Rendering on iOS is now expected to give good results.</p></li>
<li><p>No bad rendering at very large PPEM values.</p></li>
</ul>
<h2 id="version-0.4-2011-oct-27">Version 0.4 (2011-Oct-27)</h2>
<ul>
<li>The bytecode has been changed to ‘create’ twilight points. This should avoid rendering artifacts on some platforms.</li>
</ul>
<h2 id="version-0.3-2011-sep-09">Version 0.3 (2011-Sep-09)</h2>
<ul>
<li>Fix font generation; sometimes the <code>glyf</code> table was one byte too short, making the font invalid.</li>
</ul>
<h2 id="version-0.2-2011-jul-19">Version 0.2 (2011-Jul-19)</h2>
<ul>
<li>Fix bytecode bugs that prevented correct rendering on some platforms.</li>
</ul>
<h2 id="version-0.1-2011-jun-30">Version 0.1 (2011-Jun-30)</h2>
<ul>
<li>First release.</li>
</ul>
<div class="footnotes">
<hr />
<ol>
<li id="fn1"><p>To be more precise, the sum of the height and length of a segment must be at least 20 font units, and the height multiplied by 14 must not exceed the length. Thus (19,1) is also a valid minimum (length,height) pair, while (18,2) isn’t. The value 20 is heuristic and hard-coded, as is the value 14 (corresponding to a slope of approx. 4.1°).<a href="#fnref1">↩</a></p></li>
<li id="fn2"><p>Unfortunately, there is a bug in FreeType prior to version 2.5.4 (released in December 2014) that completely disables vertical delta exceptions if subpixel hinting is activated. For this reason you should expect that the <code>touch</code> parameter fails on older GNU/Linux distributions.<a href="#fnref2">↩</a></p></li>
<li id="fn3"><p>The number ‘6’ indicates the version of the shared library of FreeType, which is not directly related to the source code version of FreeType.<a href="#fnref3">↩</a></p></li>
</ol>
</div>
      </div>
    </div>

    <div class="col2">
    </div>
  </div>
</div>

<div id="TOC">
<ul>
<li><a href="#introduction">Introduction</a><ul>
<li><a href="#what-exactly-are-hints">What exactly are hints?</a></li>
<li><a href="#what-problems-can-arise-with-truetype-hinting">What problems can arise with TrueType hinting?</a></li>
<li><a href="#why-ttfautohint">Why ttfautohint?</a></li>
<li><a href="#smooth-hinting">‘Smooth’ hinting</a></li>
</ul></li>
<li><a href="#ttfautohint-and-ttfautohintgui"><code>ttfautohint</code> and <code>ttfautohintGUI</code></a><ul>
<li><a href="#calling-ttfautohint">Calling <code>ttfautohint</code></a></li>
<li><a href="#calling-ttfautohintgui">Calling <code>ttfautohintGUI</code></a></li>
<li><a href="#options">Options</a><ul>
<li><a href="#control-instructions-file">Control Instructions File</a></li>
<li><a href="#blue-zone-reference-font">Blue Zone Reference Font</a></li>
<li><a href="#hint-set-range-minimum-hint-set-range-maximum">Hint Set Range Minimum, Hint Set Range Maximum</a></li>
<li><a href="#default-script">Default Script</a></li>
<li><a href="#fallback-script">Fallback Script</a></li>
<li><a href="#hinting-limit">Hinting Limit</a></li>
<li><a href="#x-height-increase-limit">x Height Increase Limit</a></li>
<li><a href="#x-height-snapping-exceptions">x Height Snapping Exceptions</a></li>
<li><a href="#fallback-stem-width">Fallback Stem Width</a></li>
<li><a href="#windows-compatibility">Windows Compatibility</a></li>
<li><a href="#adjust-subglyphs">Adjust Subglyphs</a></li>
<li><a href="#hint-composites">Hint Composites</a></li>
<li><a href="#symbol-font">Symbol Font</a></li>
<li><a href="#dehint">Dehint</a></li>
<li><a href="#ttfautohint-info">ttfautohint Info</a></li>
<li><a href="#add-ttfa-info-table">Add TTFA Info Table</a></li>
<li><a href="#family-suffix">Family Suffix</a></li>
<li><a href="#reference-face-index">Reference Face Index</a></li>
<li><a href="#strong-stem-width-and-positioning">Strong Stem Width and Positioning</a></li>
<li><a href="#miscellaneous">Miscellaneous</a></li>
</ul></li>
</ul></li>
<li><a href="#background-and-technical-details">Background and Technical Details</a><ul>
<li><a href="#segments-and-edges">Segments and Edges</a></li>
<li><a href="#feature-analysis">Feature Analysis</a></li>
<li><a href="#blue-zones">Blue Zones</a></li>
<li><a href="#grid-fitting">Grid Fitting</a></li>
<li><a href="#hint-sets">Hint Sets</a></li>
<li><a href="#composite-glyphs">Composite Glyphs</a></li>
<li><a href="#the-.ttfautohint-glyph">The ‘.ttfautohint’ Glyph</a></li>
<li><a href="#writing-systems">Writing Systems</a></li>
<li><a href="#scripts">Scripts</a></li>
<li><a href="#opentype-features">OpenType Features</a></li>
<li><a href="#sfnt-tables">SFNT Tables</a></li>
<li><a href="#problems">Problems</a><ul>
<li><a href="#interaction-with-freetype">Interaction With FreeType</a></li>
<li><a href="#incorrect-unicode-character-map">Incorrect Unicode Character Map</a></li>
<li><a href="#irregular-glyph-heights">Irregular Glyph Heights</a></li>
<li><a href="#diagonals">Diagonals</a></li>
</ul></li>
<li><a href="#extending-ttfautohint-with-new-scripts">Extending ttfautohint with new scripts</a></li>
</ul></li>
<li><a href="#control-instructions">Control Instructions</a><ul>
<li><a href="#common-syntax-elements">Common Syntax Elements</a></li>
<li><a href="#style-adjustments">Style Adjustments</a></li>
<li><a href="#glyph-adjustments">Glyph Adjustments</a><ul>
<li><a href="#change-direction-of-points-artificial-segments">Change Direction of Points, Artificial Segments</a></li>
<li><a href="#unset-direction-of-points">Unset Direction of Points</a></li>
<li><a href="#delta-exceptions">Delta Exceptions</a></li>
</ul></li>
</ul></li>
<li><a href="#the-ttfautohint-api">The ttfautohint API</a><ul>
<li><a href="#preprocessor-macros-and-typedefs">Preprocessor Macros and Typedefs</a></li>
<li><a href="#callback-ta_progress_func">Callback: <code>TA_Progress_Func</code></a></li>
<li><a href="#callback-ta_error_func">Callback: <code>TA_Error_Func</code></a></li>
<li><a href="#callback-ta_info_func">Callback: <code>TA_Info_Func</code></a></li>
<li><a href="#callback-ta_info_post_func">Callback: <code>TA_Info_Post_Func</code></a></li>
<li><a href="#function-ttf_autohint">Function: <code>TTF_autohint</code></a><ul>
<li><a href="#io">I/O</a></li>
<li><a href="#messages-and-callbacks">Messages and Callbacks</a></li>
<li><a href="#general-hinting-options">General Hinting Options</a></li>
<li><a href="#hinting-algorithms">Hinting Algorithms</a></li>
<li><a href="#scripts-1">Scripts</a></li>
<li><a href="#miscellaneous-1">Miscellaneous</a></li>
<li><a href="#remarks">Remarks</a></li>
</ul></li>
</ul></li>
<li><a href="#compilation-and-installation">Compilation and Installation</a><ul>
<li><a href="#unix-like-platforms">Unix-like Platforms</a></li>
<li><a href="#ms-windows">MS Windows</a></li>
<li><a href="#mac-os-x">Mac OS X</a></li>
</ul></li>
<li><a href="#authors">Authors</a></li>
<li><a href="#character-ranges">Character Ranges</a></li>
<li><a href="#history">History</a><ul>
<li><a href="#version-1.6-2016-nov-27">Version 1.6 (2016-Nov-27)</a></li>
<li><a href="#version-1.5-2016-jan-24">Version 1.5 (2016-Jan-24)</a></li>
<li><a href="#version-1.4.1-2015-oct-17">Version 1.4.1 (2015-Oct-17)</a></li>
<li><a href="#version-1.4-2015-oct-04">Version 1.4 (2015-Oct-04)</a></li>
<li><a href="#version-1.3-2015-jan-06">Version 1.3 (2015-Jan-06)</a></li>
<li><a href="#version-1.2-2014-oct-06">Version 1.2 (2014-Oct-06)</a></li>
<li><a href="#version-1.1-2014-may-05">Version 1.1 (2014-May-05)</a></li>
<li><a href="#version-1.00-2014-mar-20">Version 1.00 (2014-Mar-20)</a></li>
<li><a href="#version-1.00rc1-2014-feb-07">Version 1.00rc1 (2014-Feb-07)</a></li>
<li><a href="#version-0.97-2013-nov-09">Version 0.97 (2013-Nov-09)</a></li>
<li><a href="#version-0.96-2013-aug-06">Version 0.96 (2013-Aug-06)</a></li>
<li><a href="#version-0.95-2013-mar-07">Version 0.95 (2013-Mar-07)</a></li>
<li><a href="#version-0.94-2012-nov-29">Version 0.94 (2012-Nov-29)</a></li>
<li><a href="#version-0.93-2012-oct-09">Version 0.93 (2012-Oct-09)</a></li>
<li><a href="#version-0.92-2012-aug-07">Version 0.92 (2012-Aug-07)</a></li>
<li><a href="#version-0.91-2012-jul-12">Version 0.91 (2012-Jul-12)</a></li>
<li><a href="#version-0.9-2012-jun-06">Version 0.9 (2012-Jun-06)</a></li>
<li><a href="#version-0.8-2012-mar-21">Version 0.8 (2012-Mar-21)</a></li>
<li><a href="#version-0.7-2012-feb-05">Version 0.7 (2012-Feb-05)</a></li>
<li><a href="#version-0.6.1-2012-jan-02">Version 0.6.1 (2012-Jan-02)</a></li>
<li><a href="#version-0.6-2011-dec-25">Version 0.6 (2011-Dec-25)</a></li>
<li><a href="#version-0.5-2011-nov-06">Version 0.5 (2011-Nov-06)</a></li>
<li><a href="#version-0.4-2011-oct-27">Version 0.4 (2011-Oct-27)</a></li>
<li><a href="#version-0.3-2011-sep-09">Version 0.3 (2011-Sep-09)</a></li>
<li><a href="#version-0.2-2011-jul-19">Version 0.2 (2011-Jul-19)</a></li>
<li><a href="#version-0.1-2011-jun-30">Version 0.1 (2011-Jun-30)</a></li>
</ul></li>
</ul>
</div>

</body>
</html>