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
|
/* See LICENSE file for copyright and license details. */
#ifndef LIBPARSESFNT_H
#define LIBPARSESFNT_H
#include <stddef.h>
#include <stdint.h>
#define LIBPARSESFNT_UNIX_EPOCH ((time_t)-2082844800L) /* 1904-01-01 00:00:00 */
#define LIBPARSESFNT_TO_UNIX_EPOCH(TIME) ((time_t)(TIME) + LIBPARSESFNT_UNIX_EPOCH)
enum libparsesfnt_platform_id {
LIBPARSESFNT_PLATFORM_ID_UNICODE = 0,
LIBPARSESFNT_PLATFORM_ID_MACHINTOSH = 1,
LIBPARSESFNT_PLATFORM_ID_WINDOWS = 3
};
enum libparsesfnt_unicode_encoding_id {
LIBPARSESFNT_UNICODE_ENCODING_ID_VERSION_1_0 = 0,
LIBPARSESFNT_UNICODE_ENCODING_ID_VERSION_1_1 = 1,
LIBPARSESFNT_UNICODE_ENCODING_ID_ISO_10646_1993 = 2,
LIBPARSESFNT_UNICODE_ENCODING_ID_VERSION_2_0_BMP_ONLY = 3,
LIBPARSESFNT_UNICODE_ENCODING_ID_VERSION_2_0 = 4,
/* the following are using in 'cmap' but not 'name' */
LIBPARSESFNT_UNICODE_ENCODING_ID_UNICODE_VARIATION_SEQUENCES = 5,
LIBPARSESFNT_UNICODE_ENCODING_ID_LAST_RESORT = 6
};
enum libparsesfnt_macintosh_encoding_id {
LIBPARSESFNT_MACINTOSH_ENCODING_ID_ROMAN = 0,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_JAPANESE = 1,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_TRADITIONAL_CHINESE = 2,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_KOREAN = 3,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_ARABIC = 4,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_HEBREW = 5,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_GREEK = 6,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_RUSSIAN = 7,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_RSYMBOL = 8,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_DEVANAGARI = 9,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_GURMUKHI = 10,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_GUJARATI = 11,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_ORIYA = 12,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_BENGALI = 13,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_TAMIL = 14,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_TELUGU = 15,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_KANNADA = 16,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_MALAYALAM = 17,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_SINHALESE = 18,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_BURMESE = 19,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_KHMER = 20,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_THAI = 21,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_LAOTIAN = 22,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_GEORGIAN = 23,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_ARMENIAN = 24,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_SIMPLIFIED_CHINESE = 25,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_TIBETAN = 26,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_MONGOLIAN = 27,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_GEEZ = 28,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_SLAVIC = 29,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_VIETNAMESE = 30,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_SINDHI = 31,
LIBPARSESFNT_MACINTOSH_ENCODING_ID_UNINTERPRETED = 32
};
enum libparsesfnt_macintosh_language_id {
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ENGLISH = 0,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_FRENCH = 1,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_GERMAN = 2,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ITALIAN = 3,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_DUTCH = 4,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SWEDISH = 5,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SPANISH = 6,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_DANISH = 7,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_PORTUGUESE = 8,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_NORWEGIAN = 9,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_HEBREW = 10,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_JAPANESE = 11,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ARABIC = 12,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_FINNISH = 13,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_GREEK = 14,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ICELANDIC = 15,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_MALTESE = 16,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TURKISH = 17,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_CROATIAN = 18,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TRADITIONAL_CHINESE = 19,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_URDU = 20,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_HINDI = 21,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_THAI = 22,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_KOREAN = 23,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_LITHUANIAN = 24,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_POLISH = 25,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_HUNGARIAN = 26,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ESTONIAN = 27,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_LATVIAN = 28,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SAMI = 29,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_FAROESE = 30,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_FARSI = 31, /* Persian */
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_RUSSIAN = 32,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SIMPLIFIED_CHINESE = 33,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_FLEMISH = 34,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_IRISH_GAELIC = 35,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ALBANIAN = 36,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ROMANIAN = 37,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_CZECH = 38,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SLOVAK = 39,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SLOVENIAN = 40,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_YIDDISH = 41,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SERBIAN = 42,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_MACEDONIAN = 43,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_BULGARIAN = 44,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_UKRAINIAN = 45,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_BYELORUSSIAN = 46,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_UZBEK = 47,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_KAZAKH = 48,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_CYRILLIC_AZERBAIJANI = 49,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ARABIC_AZERBAIJANI = 50,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ARMENIAN = 51,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_GEORGIAN = 52,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_MOLDAVIAN = 53,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_KIRGHIZ = 54,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TAJIKI = 55,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TURKMEN = 56,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_MONGOLIAN = 57,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_CYRILLIC_MONGOLIAN = 58,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_PASHTO = 59,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_KURDISH = 60,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_KASHMIRI = 61,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SINDHI = 62,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TIBETAN = 63,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_NEPALI = 64,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SANSKRIT = 65,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_MARATHI = 66,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_BENGALI = 67,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ASSAMESE = 68,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_GUJARATI = 69,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_PUNJABI = 70,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ORIYA = 71,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_MALAYALAM = 72,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_KANNADA = 73,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TAMIL = 74,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TELUGU = 75,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SINHALESE = 76,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_BURMESE = 77,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_KHMER = 78,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_LAO = 79,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_VIETNAMESE = 80,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_INDONESIAN = 81,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TAGALOG = 82,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ROMAN_MALAY = 83,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ARABIC_MALAY = 84,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_AMHARIC = 85,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TIGRINYA = 86,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_GALLA = 87,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SOMALI = 88,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SWAHILI = 89,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_KINYARWANDA = 90, /* Ruanda */
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_RUNDI = 91,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_NYANJA = 92, /* Chewa */
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_MALAGASY = 93,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ESPERANTO = 94,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_WELSH = 128,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_BASQUE = 129,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_CATALAN = 130,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_LATIN = 131,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_QUECHUA = 132,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_GUARANI = 133,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_AYMARA = 134,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TATAR = 135,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_UIGHUR = 136,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_DZONGKHA = 137,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ROMAN_JAVANESE = 138,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ROMAN_SUNDANESE = 139,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_GALICIAN = 140,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_AFRIKAANS = 141,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_BRETON = 142,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_INUKTITUT = 143,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_SCOTTISH_GAELIC = 144,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_MANX_GAELIC = 145,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_IRISH_GAELIC_WITH_DOT_ABOVE = 146,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_TONGAN = 147,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_POLYTONIC_GREEK = 148,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_GREENLANDIC = 149,
LIBPARSESFNT_MACINTOSH_LANGUAGE_ID_ROMAN_AZERBAIJANI = 150
};
enum libparsesfnt_windows_encoding_id {
LIBPARSESFNT_WINDOWS_ENCODING_ID_SYMBOL = 0,
LIBPARSESFNT_WINDOWS_ENCODING_ID_UNICODE_BMP = 1,
LIBPARSESFNT_WINDOWS_ENCODING_ID_SHIFT_JIS = 2,
LIBPARSESFNT_WINDOWS_ENCODING_ID_PRC = 3,
LIBPARSESFNT_WINDOWS_ENCODING_ID_BIG5 = 4,
LIBPARSESFNT_WINDOWS_ENCODING_ID_WANSUNG = 5,
LIBPARSESFNT_WINDOWS_ENCODING_ID_JOHAB = 6,
/* According to Microsoft's documentation Wansung is 5 and Johab is 6,
* but according to Apple's documentation Johab is 5 and Wansung is missing */
LIBPARSESFNT_WINDOWS_ENCODING_ID_FULL_UNICODE = 10
};
enum libparsesfnt_windows_language_id {
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_AFRIKAANS_SOUTH_AFRICA = 0x0436,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ALBANIAN_ALBANIA = 0x041C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ALSATIAN_FRANCE = 0x0484,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_AMHARIC_ETHIOPIA = 0x045E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_ALGERIA = 0x1401,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_BAHRAIN = 0x3C01,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_EGYPT = 0x0C01,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_IRAQ = 0x0801,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_JORDAN = 0x2C01,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_KUWAIT = 0x3401,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_LEBANON = 0x3001,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_LIBYA = 0x1001,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_MOROCCO = 0x1801,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_OMAN = 0x2001,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_QATAR = 0x4001,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_SAUDI_ARABIA = 0x0401,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_SYRIA = 0x2801,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_TUNISIA = 0x1C01,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_UAE = 0x3801,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARABIC_YEMEN = 0x2401,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ARMENIAN_ARMENIA = 0x042B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ASSAMESE_INDIA = 0x044D,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CYRILLIC_AZERI_AZERBAIJAN = 0x082C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATIN_AZERI_AZERBAIJAN = 0x042C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_BASHKIR_RUSSIA = 0x046D,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_BASQUE_BASQUE = 0x042D,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_BELARUSIAN_BELARUS = 0x0423,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_BENGALI_BANGLADESH = 0x0845,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_BENGALI_INDIA = 0x0445,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CYRILLIC_BOSNIAN_BOSNIA_AND_HERZEGOVINA = 0x201A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATIN_BOSNIAN_BOSNIA_AND_HERZEGOVINA = 0x141A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_BRETON_FRANCE = 0x047E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_BULGARIAN_BULGARIA = 0x0402,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CATALAN_CATALAN = 0x0403,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CHINESE_HONG_KONG = 0x0C04,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CHINESE_MACAO = 0x1404,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CHINESE_CHINA = 0x0804,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CHINESE_SINGAPORE = 0x1004,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CHINESE_TAIWAN = 0x0404,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CORSICAN_FRANCE = 0x0483,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CROATIAN_CROATIA = 0x041A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATIN_CROATIAN_BOSNIA_AND_HERZEGOVINA = 0x101A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CZECH_CZECH_REPUBLIC = 0x0405,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_DANISH_DENMARK = 0x0406,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_DARI_AFGHANISTAN = 0x048C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_DIVEHI_MALDIVES = 0x0465,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_DUTCH_BELGIUM = 0x0813,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_DUTCH_NETHERLANDS = 0x0413,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_AUSTRALIA = 0x0C09,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_BELIZE = 0x2809,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_CANADA = 0x1009,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_CARIBBEAN = 0x2409,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_INDIA = 0x4009,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_IRELAND = 0x1809,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_JAMAICA = 0x2009,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_MALAYSIA = 0x4409,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_NEW_ZEALAND = 0x1409,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_PHILIPPINES = 0x3409,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_SINGAPORE = 0x4809,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_SOUTH_AFRICA = 0x1C09,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_TRINIDAD_AND_TOBAGO = 0x2C09,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_UNITED_KINGDOM = 0x0809,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_UNITED_STATES = 0x0409,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ENGLISH_ZIMBABWE = 0x3009,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ESTONIAN_ESTONIA = 0x0425,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FAROESE_FAROE_ISLANDS = 0x0438,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FILIPINO_PHILIPPINES = 0x0464,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FINNISH_FINLAND = 0x040B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FRENCH_BELGIUM = 0x080C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FRENCH_CANADA = 0x0C0C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FRENCH_FRANCE = 0x040C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FRENCH_LUXEMBOURG = 0x140C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FRENCH_MONACO = 0x180C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FRENCH_SWITZERLAND = 0x100C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_FRISIAN_NETHERLANDS = 0x0462,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GALICIAN_GALICIAN = 0x0456,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GEORGIAN_GEORGIA = 0x0437,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GERMAN_AUSTRIA = 0x0C07,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GERMAN_GERMANY = 0x0407,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GERMAN_LIECHTENSTEIN = 0x1407,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GERMAN_LUXEMBOURG = 0x1007,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GERMAN_SWITZERLAND = 0x0807,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GREEK_GREECE = 0x0408,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GREENLANDIC_GREENLAND = 0x046F,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_GUJARATI_INDIA = 0x0447,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATIN_HAUSA_NIGERIA = 0x0468,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_HEBREW_ISRAEL = 0x040D,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_HINDI_INDIA = 0x0439,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_HUNGARIAN_HUNGARY = 0x040E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ICELANDIC_ICELAND = 0x040F,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_IGBO_NIGERIA = 0x0470,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_INDONESIAN_INDONESIA = 0x0421,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_INUKTITUT_CANADA = 0x045D,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATIN_INUKTITUT_CANADA = 0x085D,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_IRISH_IRELAND = 0x083C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ISIXHOSA_SOUTH_AFRICA = 0x0434,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ISIZULU_SOUTH_AFRICA = 0x0435,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ITALIAN_ITALY = 0x0410,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ITALIAN_SWITZERLAND = 0x0810,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_JAPANESE_JAPAN = 0x0411,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_KANNADA_INDIA = 0x044B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_KAZAKH_KAZAKHSTAN = 0x043F,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_KHMER_CAMBODIA = 0x0453,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_KICHE_GUATEMALA = 0x0486,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_KINYARWANDA_RWANDA = 0x0487,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_KISWAHILI_KENYA = 0x0441,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_KONKANI_INDIA = 0x0457,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_KOREAN_KOREA = 0x0412,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_KYRGYZ_KYRGYZSTAN = 0x0440,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LAO_LAO = 0x0454,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATVIAN_LATVIA = 0x0426,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LITHUANIAN_LITHUANIA = 0x0427,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LOWER_SORBIAN_GERMANY = 0x082E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LUXEMBOURGISH_LUXEMBOURG = 0x046E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MACEDONIAN_NORTH_MACEDONIA = 0x042F,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MALAY_BRUNEI_DARUSSALAM = 0x083E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MALAY_MALAYSIA = 0x043E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MALAYALAM_INDIA = 0x044C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MALTESE_MALTA = 0x043A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MAORI_NEW_ZEALAND = 0x0481,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MAPUDUNGUN_CHILE = 0x047A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MARATHI_INDIA = 0x044E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MOHAWK_MOHAWK = 0x047C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CYRILLIC_MONGOLIAN_MONGOLIA = 0x0450,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_TRADITIONAL_MONGOLIAN_CHINA = 0x0850,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_NEPALI_NEPAL = 0x0461,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_BOKMAAL_NORWEGIAN_NORWAY = 0x0414,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_NYNORSK_NORWEGIAN_NORWAY = 0x0814,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_OCCITAN_FRANCE = 0x0482,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ODIA_INDIA = 0x0448,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_PASHTO_AFGHANISTAN = 0x0463,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_POLISH_POLAND = 0x0415,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_PORTUGUESE_BRAZIL = 0x0416,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_PORTUGUESE_PORTUGAL = 0x0816,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_PUNJABI_INDIA = 0x0446,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_QUECHUA_BOLIVIA = 0x046B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_QUECHUA_ECUADOR = 0x086B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_QUECHUA_PERU = 0x0C6B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ROMANIAN_ROMANIA = 0x0418,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_ROMANSH_SWITZERLAND = 0x0417,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_RUSSIAN_RUSSIA = 0x0419,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_INARI_SAMI_FINLAND = 0x243B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LULE_SAMI_NORWAY = 0x103B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LULE_SAMI_SWEDEN = 0x143B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_NORTHERN_SAMI_FINLAND = 0x0C3B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_NORTHERN_SAMI_NORWAY = 0x043B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_NORTHERN_SAMI_SWEDEN = 0x083B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SKOLT_SAMI_FINLAND = 0x203B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SOUTHERN_SAMI_NORWAY = 0x183B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SOUTHERN_SAMI_SWEDEN = 0x1C3B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SANSKRIT_INDIA = 0x044F,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CYRILLIC_SERBIAN_BOSNIA_AND_HERZEGOVINA = 0x1C1A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CYRILLIC_SERBIAN_SERBIA = 0x0C1A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATIN_SERBIAN_BOSNIA_AND_HERZEGOVINA = 0x181A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATIN_SERBIAN_SERBIA = 0x081A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SESOTHO_SA_LEBOA_SOUTH_AFRICA = 0x046C,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SETSWANA_SOUTH_AFRICA = 0x0432,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SINHALA_SRI_LANKA = 0x045B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SLOVAK_SLOVAKIA = 0x041B,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SLOVENIAN_SLOVENIA = 0x0424,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_ARGENTINA = 0x2C0A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_BOLIVIA = 0x400A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_CHILE = 0x340A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_COLOMBIA = 0x240A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_COSTA_RICA = 0x140A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_DOMINICAN_REPUBLIC = 0x1C0A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_ECUADOR = 0x300A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_EL_SALVADOR = 0x440A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_GUATEMALA = 0x100A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_HONDURAS = 0x480A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_MEXICO = 0x080A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_NICARAGUA = 0x4C0A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_PANAMA = 0x180A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_PARAGUAY = 0x3C0A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_PERU = 0x280A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_PUERTO_RICO = 0x500A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_MODERN_SORT_SPANISH_SPAIN = 0x0C0A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_TRADITIONAL_SORT_SPANISH_SPAIN = 0x040A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_UNITED_STATES = 0x540A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_URUGUAY = 0x380A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SPANISH_VENEZUELA = 0x200A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SWEDISH_FINLAND = 0x081D,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SWEDISH_SWEDEN = 0x041D,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_SYRIAC_SYRIA = 0x045A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CYRILLIC_TAJIK_TAJIKISTAN = 0x0428,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATIN_TAMAZIGHT_ALGERIA = 0x085F,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_TAMIL_INDIA = 0x0449,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_TATAR_RUSSIA = 0x0444,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_TELUGU_INDIA = 0x044A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_THAI_THAILAND = 0x041E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_TIBETAN_PRC = 0x0451,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_TURKISH_TURKEY = 0x041F,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_TURKMEN_TURKMENISTAN = 0x0442,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_UIGHUR_PRC = 0x0480,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_UKRAINIAN_UKRAINE = 0x0422,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_UPPER_SORBIAN_GERMANY = 0x042E,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_URDU_PAKISTAN = 0x0420,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_CYRILLIC_UZBEK_UZBEKISTAN = 0x0843,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_LATIN_UZBEK_UZBEKISTAN = 0x0443,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_VIETNAMESE_VIETNAM = 0x042A,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_WELSH_UNITED_KINGDOM = 0x0452,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_WOLOF_SENEGAL = 0x0488,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_YAKUT_RUSSIA = 0x0485,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_YI_PRC = 0x0478,
LIBPARSESFNT_WINDOWS_LANGUAGE_ID_YORUBA_NIGERIA = 0x046A
};
/* === font directory === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html */
struct libparsesfnt_fontdir {
char scaler_type[4];
uint16_t num_tables;
uint16_t search_range; /* use to determine how to bsearch(3) the table directory */
uint16_t entry_selector; /* use to determine whether to bsearch(3) the table directory */
uint16_t range_shift; /* use to determine how to bsearch(3) the table directory */
};
#define LIBPARSESFNT_FONTDIR__ "11112222"
int libparsesfnt_parse_fontdir(
const char *data, size_t size,
struct libparsesfnt_fontdir *infop);
/* === table directory === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html */
struct libparsesfnt_tabdir_entry {
char tab[4];
uint32_t checksum;
uint32_t offset;
uint32_t length;
};
#define LIBPARSESFNT_TABDIR_ENTRY__ "1111444"
int libparsesfnt_parse_tabdir(
const char *data, size_t size,
struct libparsesfnt_tabdir_entry *infop,
size_t first, size_t count);
/* === 'head' (font header) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6head.html */
struct libparsesfnt_head {
uint32_t version;
uint32_t font_revision;
uint32_t checksum_adjustment;
uint32_t magic_number;
#define LIBPARSESFNT_HEAD_MAGIC_NUMBER_EXPECTED UINT32_C(0x5f0f3cf5)
uint16_t flags;
uint16_t units_per_em;
#define LIBPARSESFNT_HEAD_UNITS_PER_EM_MIN 64
#define LIBPARSESFNT_HEAD_UNITS_PER_EM_MAX 16384
uint32_t __padding1;
uint64_t created;
uint64_t modified;
int16_t x_min;
int16_t y_min;
int16_t x_max;
int16_t y_max;
uint16_t style_flags;
uint16_t lowest_ppem; /* smallest readable size in pixels (per em) */
int16_t font_direction_hint;
int16_t loca_table_format; /* 0 = "short" offsets, 1 = "long" offsets */
int16_t glyph_data_format;
uint16_t __padding2[3];
};
#define LIBPARSESFNT_HEAD__ "444422pppp88-2222+22-222pppppp"
int libparsesfnt_parse_head(
const char *data, size_t size,
struct libparsesfnt_head *infop,
const struct libparsesfnt_tabdir_entry *tag);
/* === 'bhed' (bitmap font header) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bhed.html */
struct libparsesfnt_bhed {
uint32_t version;
uint32_t font_revision;
uint32_t checksum_adjustment;
uint32_t magic_number;
#define LIBPARSESFNT_BHED_MAGIC_NUMBER_EXPECTED HEAD_MAGIC_NUMBER_EXPECTED
uint16_t flags;
uint16_t units_per_em;
#define LIBPARSESFNT_BHED_UNITS_PER_EM_MIN LIBPARSESFNT_HEAD_UNITS_PER_EM_MIN
#define LIBPARSESFNT_BHED_UNITS_PER_EM_MAX LIBPARSESFNT_HEAD_UNITS_PER_EM_MAX
uint32_t __padding1;
uint64_t created;
uint64_t modified;
int16_t x_min;
int16_t y_min;
int16_t x_max;
int16_t y_max;
uint16_t style_flags;
uint16_t lowest_ppem; /* smallest readable size in pixels (per em) */
int16_t font_direction_hint;
int16_t bloc_table_format; /* 0 = "short" offsets, 1 = "long" offsets */
int16_t glyph_data_format;
uint16_t __padding2[3];
};
#define LIBPARSESFNT_BHED__ "444422pppp88-2222+22-222pppppp"
int libparsesfnt_parse_bhed(
const char *data, size_t size,
struct libparsesfnt_bhed *infop,
const struct libparsesfnt_tabdir_entry *tag);
/* === 'hhea' (horizontal header) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6hhea.html */
struct libparsesfnt_hhea {
uint32_t version;
int16_t max_ascent;
int16_t max_descent;
int16_t line_gap;
uint16_t max_advance;
int16_t min_left_side_bearing;
int16_t max_left_side_bearing;
int16_t x_max_extent;
int16_t caret_slope_rise;
int16_t caret_slope_run;
int16_t caret_offset;
uint8_t ___reserved1[8];
int16_t metric_data_format;
uint16_t num_advances_in_hmtx_table;
};
#define LIBPARSESFNT_HHEA__ "4-222+2-222222........2+2"
int libparsesfnt_parse_hhea(
const char *data, size_t size,
struct libparsesfnt_hhea *infop,
const struct libparsesfnt_tabdir_entry *tag);
/* === 'hmtx' (horizontal metrics) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6hmtx.html */
struct libparsesfnt_hmtx_entry {
uint16_t advance;
int16_t left_side_bearing;
};
#define LIBPARSESFNT_HMTX_ENTRY__ "2-2"
struct libparsesfnt_hmtx_lsb_subtable_entry {
int16_t left_side_bearing2;
};
#define LIBPARSESFNT_HMTX_LSB_SUBTABLE_ENTRY__ "-2"
int libparsesfnt_parse_hmtx(
const char *data, size_t size,
struct libparsesfnt_hmtx_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_get_hmtx_lsb_subtable_length(
size_t *lengthp,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_hhea *hhea);
int libparsesfnt_parse_hmtx_lsb_subtable(
const char *data, size_t size,
struct libparsesfnt_hmtx_lsb_subtable_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_hhea *hhea,
size_t first, size_t count);
/* === 'vhea' (vertical header) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6vhea.html */
struct libparsesfnt_vhea {
int32_t version;
int16_t max_ascent;
int16_t max_descent;
int16_t line_gap;
uint16_t max_advance;
int16_t min_top_side_bearing;
int16_t min_bottom_side_bearing;
int16_t y_max_extent;
int16_t caret_slope_rise;
int16_t caret_slope_run;
int16_t caret_offset;
uint8_t ___reserved1[8];
int16_t metric_data_format;
uint16_t num_advances_in_vmtx_table;
};
#define LIBPARSESFNT_VHEA__ "4-222+2-222222........2+2"
int libparsesfnt_parse_vhea(
const char *data, size_t size,
struct libparsesfnt_vhea *infop,
const struct libparsesfnt_tabdir_entry *tag);
/* === 'vmtx' (vertical metrics) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6vmtx.html */
struct libparsesfnt_vmtx_entry {
uint16_t advance;
int16_t top_side_bearing;
};
#define LIBPARSESFNT_VMTX_ENTRY__ "2-2"
struct libparsesfnt_vmtx_tsb_subtable_entry {
int16_t top_side_bearing2;
};
#define LIBPARSESFNT_VMTX_TSB_SUBTABLE_ENTRY__ "-2"
int libparsesfnt_parse_vmtx(
const char *data, size_t size,
struct libparsesfnt_vmtx_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_get_vmtx_tsb_subtable_length(
size_t *lengthp,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_vhea *vhea);
int libparsesfnt_parse_vmtx_tsb_subtable(
const char *data, size_t size,
struct libparsesfnt_vmtx_tsb_subtable_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_vhea *vhea,
size_t first, size_t count);
/* === 'maxp' (maximum profile) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6maxp.html */
struct libparsesfnt_maxp_0_5 {
uint16_t num_glyphs;
};
#define LIBPARSESFNT_MAXP_0_5__ "2"
struct libparsesfnt_maxp_1_0 {
uint16_t num_glyphs;
uint16_t max_points_noncompound;
uint16_t max_contours_noncompound;
uint16_t max_points_compound;
uint16_t max_contours_compound;
uint16_t max_zones; /* should be 2 */
uint16_t max_twilight_points;
uint16_t max_storage_areas;
uint16_t max_fdefs;
uint16_t max_odefs;
uint16_t max_stack_depth;
uint16_t max_size_of_instructions;
uint16_t max_top_level_glyphs;
uint16_t max_recursion;
};
#define LIBPARSESFNT_MAXP_1_0__ "{14}2"
struct libparsesfnt_maxp {
uint32_t version;
union {
struct libparsesfnt_maxp_0_5 v0_5;
struct libparsesfnt_maxp_1_0 v1_0; /* extends .v0_5 */
} v;
};
#define LIBPARSESFNT_MAXP__ "4"
int libparsesfnt_parse_maxp(
const char *data, size_t size,
struct libparsesfnt_maxp *infop,
const struct libparsesfnt_tabdir_entry *tag);
/* === 'loca' (glyph locations) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6loca.html */
/* There is one extra entry at the end, so that (entry[i + 1].offset - entry[i].offset)
* calculates the size of entry i. */
struct libparsesfnt_loca_short_entry {
uint16_t offset; /* divided by 2 */
};
#define LIBPARSESFNT_LOCA_SHORT_ENTRY__ "2"
struct libparsesfnt_loca_long_entry {
uint32_t offset;
};
#define LIBPARSESFNT_LOCA_LONG_ENTRY__ "4"
int libparsesfnt_parse_loca_short(
const char *data, size_t size,
struct libparsesfnt_loca_short_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_parse_loca_long(
const char *data, size_t size,
struct libparsesfnt_loca_long_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
/* === 'name' (name) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html */
struct libparsesfnt_name {
uint16_t format;
uint16_t count;
uint16_t string_offset;
};
#define LIBPARSESFNT_NAME__ "222"
struct libparsesfnt_name_entry {
uint16_t platform_id;
uint16_t encoding_id;
uint16_t language_id;
uint16_t name_id;
uint16_t name_length;
uint16_t name_offset;
};
#define LIBPARSESFNT_NAME_ENTRY__ "222222"
enum libparsesfnt_name_id {
LIBPARSESFNT_NAME_ID_COPYRIGHT_NOTICE = 0,
LIBPARSESFNT_NAME_ID_FONT_FAMILY = 1,
LIBPARSESFNT_NAME_ID_FONT_SUBFAMILY = 2,
LIBPARSESFNT_NAME_ID_UNIQUE_SUBFAMILY_IDENTIFICATION = 3,
LIBPARSESFNT_NAME_ID_FULL_NAME_OF_THE_FONT = 4,
LIBPARSESFNT_NAME_ID_VERSION_OF_THE_NAME_TABLE = 5,
LIBPARSESFNT_NAME_ID_POSTSCRIPT_NAME_OF_THE_FONT = 6,
LIBPARSESFNT_NAME_ID_TRADEMARK_NOTICE = 7,
LIBPARSESFNT_NAME_ID_MANUFACTURER = 8,
LIBPARSESFNT_NAME_ID_DESIGNER = 9,
LIBPARSESFNT_NAME_ID_DESCRIPTION = 10,
LIBPARSESFNT_NAME_ID_VENDOR_URL = 11,
LIBPARSESFNT_NAME_ID_DESIGNER_URL = 12,
LIBPARSESFNT_NAME_ID_LICENSE_DESCRIPTION = 13,
LIBPARSESFNT_NAME_ID_LICENSE_INFORMATION_URL = 14,
/* 15 is reserved */
LIBPARSESFNT_NAME_ID_PREFERRED_FAMILY = 16,
LIBPARSESFNT_NAME_ID_PREFERRED_SUBFAMILY = 17,
LIBPARSESFNT_NAME_ID_COMPATIBLE_FULL = 18,
LIBPARSESFNT_NAME_ID_SAMPLE_TEXT = 19
/* 20–22 are defined by OpenType */
/* 23–255 are reserved for future expansions*/
/* 256–32767 are for font-specific names */
};
int libparsesfnt_parse_name(
const char *data, size_t size,
struct libparsesfnt_name *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_name_entries(
const char *data, size_t size,
struct libparsesfnt_name_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
/* === 'fmtx' (font metrics) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fmtx.html */
struct libparsesfnt_fmtx {
uint32_t version;
uint32_t glyph_index;
uint8_t horizontal_before;
uint8_t horizontal_after;
uint8_t horizontal_caret_head;
uint8_t horizontal_caret_base;
uint8_t vertical_before;
uint8_t vertical_after;
uint8_t vertical_caret_head;
uint8_t vertical_caret_base;
};
#define LIBPARSESFNT_FMTX__ "44{8}1"
int libparsesfnt_parse_fmtx(
const char *data, size_t size,
struct libparsesfnt_fmtx *infop,
const struct libparsesfnt_tabdir_entry *tag);
/* === 'ltag' (language tag) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ltag.html */
struct libparsesfnt_ltag {
uint32_t version;
uint32_t flags; /* unused, should be 0 */
uint32_t num_tags;
};
#define LIBPARSESFNT_LTAG__ "444"
struct libparsesfnt_ltag_entry {
uint16_t offset; /* relative to the beginning of the 'ltag' table */
uint16_t length;
};
#define LIBPARSESFNT_LTAG_ENTRY__ "22"
int libparsesfnt_parse_ltag(
const char *data, size_t size,
struct libparsesfnt_ltag *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_ltag_entries(
const char *data, size_t size,
struct libparsesfnt_ltag_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_get_ltag_offset(
size_t size,
size_t *offsetp,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_ltag_entry *entry);
/* === 'xref' (cross-reference) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6xref.html */
struct libparsesfnt_xref {
uint32_t version;
uint32_t flags; /* unused, should be 0 */
uint32_t num_entries;
uint32_t string_offset; /* position of the string table: relative to the beginning of this table */
};
#define LIBPARSESFNT_XREF__ "4444"
struct libparsesfnt_xref_entry {
char table_tab[4];
int16_t chain_index;
int16_t subtable_index;
int16_t table_type;
uint16_t string_offset; /* relative to the beginning of the string table */
uint16_t string_length;
};
#define LIBPARSESFNT_XREF_ENTRY__ "1111-2222+22"
enum libparsesfnt_xref_table_type {
LIBPARSESFNT_XREF_CLASS_NAME_TABLE = 0,
LIBPARSESFNT_XREF_STATE_NAME_TABLE = 1,
LIBPARSESFNT_XREF_ENTRY_TRANSITION_NAME_TABLE = 2,
LIBPARSESFNT_XREF_ACTION_NAME_TABLE = 3,
LIBPARSESFNT_XREF_COLUMN_CLASS_NAME_TABLE = 4,
LIBPARSESFNT_XREF_ROW_CLASS_NAME_TABLE = 5
};
int libparsesfnt_parse_xref(
const char *data, size_t size,
struct libparsesfnt_xref *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_xref_entries(
const char *data, size_t size,
struct libparsesfnt_xref_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_get_xref_offset(
size_t size,
size_t *offsetp,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_xref *xref,
const struct libparsesfnt_xref_entry *entry);
/* === 'trak' (tracking) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6trak.html */
struct libparsesfnt_trak {
uint32_t version;
uint16_t format;
uint16_t horiz_offset; /* relative to the beginning of this table, 0 if missing */
uint16_t vert_offset; /* relative to the beginning of this table, 0 if missing */
uint8_t __reserved1[2];
};
#define LIBPARSESFNT_TRAK__ "4222.."
struct libparsesfnt_trak_data {
uint16_t n_tracks;
uint16_t n_sizes;
uint32_t size_table_offset; /* position of the size subtable: relative to the beginning of the 'trak' tabletable */
};
#define LIBPARSESFNT_TRAK_DATA__ "224"
struct libparsesfnt_trak_track_entry {
int32_t track;
uint16_t name_index; /* should be > 255 */
uint16_t offset; /* position of this track's per-size tracking values: relative to the beginning of the 'trak' table */
};
#define LIBPARSESFNT_TRAK_TRACK_ENTRY__ "-4+22"
struct libparsesfnt_trak_size_entry {
int32_t size;
};
#define LIBPARSESFNT_TRAK_SIZE_ENTRY__ "-4"
int libparsesfnt_parse_trak(
const char *data, size_t size,
struct libparsesfnt_trak *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_trak_horiz(
const char *data, size_t size,
struct libparsesfnt_trak_data *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_trak *trak);
int libparsesfnt_parse_trak_vert(
const char *data, size_t size,
struct libparsesfnt_trak_data *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_trak *trak);
int libparsesfnt_parse_trak_horiz_track_entries(
const char *data, size_t size,
struct libparsesfnt_trak_track_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_trak *trak,
size_t first, size_t count);
int libparsesfnt_parse_trak_vert_track_entries(
const char *data, size_t size,
struct libparsesfnt_trak_track_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_trak *trak,
size_t first, size_t count);
int libparsesfnt_parse_trak_size_entries(
const char *data, size_t size,
struct libparsesfnt_trak_size_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_trak_data *trak_data,
size_t first, size_t count);
int libparsesfnt_parse_trak_track_size_entries(
const char *data, size_t size,
struct libparsesfnt_trak_size_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_trak_track_entry *track,
size_t first, size_t count);
/* === 'cvt ' (control value) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6cvt.html */
struct libparsesfnt_cvt_entry {
int16_t control_value;
};
/* TODO it is documented that entry count is table length divided by 4,
* however the element type (FWord) is 2 bytes wide */
/* === 'gcid' (glyph to CID mapping) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gcid.html */
struct libparsesfnt_gcid {
uint16_t version;
uint16_t format;
uint32_t size;
uint16_t registry;
char registry_name[64];
uint16_t order;
char order_name[64];
uint16_t supplement_version;
uint16_t count;
};
#define LIBPARSESFNT_GCID__ "2242{64}12{64}122"
struct libparsesfnt_gcid_entry {
uint16_t cid;
#define LIBPARSESFNT_GCID_NO_CID UINT16_C(0xFFFF)
};
#define LIBPARSESFNT_GCID_ENTRY__ "2"
int libparsesfnt_parse_gcid(
const char *data, size_t size,
struct libparsesfnt_gcid *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_gcid_entries(
const char *data, size_t size,
struct libparsesfnt_gcid_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
/* === 'fpgm' (font program) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fpgm.html */
int libparsesfnt_parse_fpgm(
const char *data, size_t size,
uint8_t *programp,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
/* === 'prep' (control value program) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6prep.html */
#define libparsesfnt_parse_prep libparsesfnt_parse_fpgm
/* === 'fdsc' (font descriptors) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6fdsc.html */
struct libparsesfnt_fdsc {
uint32_t version;
uint32_t descriptor_count;
};
#define LIBPARSESFNT_FDSC__ "44"
struct libparsesfnt_fdsc_entry {
char tag[4];
int32_t value;
};
#define LIBPARSESFNT_FDSC_ENTRY__ "1111-4"
enum libparsesfnt_fdsc_nalf {
LIBPARSESFNT_FDSC_NALF_ALPHABETIC = 0,
LIBPARSESFNT_FDSC_NALF_DINGBATS = 1,
LIBPARSESFNT_FDSC_NALF_PI_CHARACTERS = 2,
LIBPARSESFNT_FDSC_NALF_FLEURONS = 3,
LIBPARSESFNT_FDSC_NALF_DECORATIVE_BORDERS = 4,
LIBPARSESFNT_FDSC_NALF_INTERNATIONAL_SYMBOLS = 5,
LIBPARSESFNT_FDSC_NALF_MATH_SYMBOLS = 6
};
int libparsesfnt_parse_fdsc(
const char *data, size_t size,
struct libparsesfnt_fdsc *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_fdsc_entries(
const char *data, size_t size,
struct libparsesfnt_fdsc_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
/* === 'gasp' (grid-fitting and scan-conversion procedure) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gasp.html */
struct libparsesfnt_gasp {
uint16_t version;
uint16_t num_ranges;
};
#define LIBPARSESFNT_GASP__ "22"
struct libparsesfnt_gasp_entry {
uint16_t range_max_ppem;
uint16_t range_gasp_behaviour;
};
#define LIBPARSESFNT_GASP_ENTRY__ "22"
enum libparsesfnt_gasp_behaviour {
LIBPARSESFNT_GASP_BEHAVIOUR_GRID_FIT = 0x0001,
LIBPARSESFNT_GASP_BEHAVIOUR_DO_GREY = 0x0002
};
int libparsesfnt_parse_gasp(
const char *data, size_t size,
struct libparsesfnt_gasp *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_gasp_entries(
const char *data, size_t size,
struct libparsesfnt_gasp_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
/* === 'avar' (axis variation) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6avar.html */
struct libparsesfnt_avar {
uint32_t name;
uint32_t axis_count;
};
#define LIBPARSESFNT_AVAR__ "44"
struct libparsesfnt_avar_entry {
uint16_t pair_count;
char __padding1[sizeof(size_t) - sizeof(uint16_t)]; /* using sizeof for simplicity (may have same alignment) */
size_t libparsesfnt_subentry_location;
};
#define LIBPARSESFNT_AVAR_ENTRY__ "2"
struct libparsesfnt_avar_subentry {
int16_t from_coord;
int16_t to_coord;
};
#define LIBPARSESFNT_AVAR_SUBENTRY__ "22"
int libparsesfnt_parse_avar(
const char *data, size_t size,
struct libparsesfnt_avar *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_avar_entries(
const char *data, size_t size,
struct libparsesfnt_avar_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t *offsetp /* start at 0 */, size_t count);
int libparsesfnt_parse_avar_subentries(
const char *data, size_t size,
struct libparsesfnt_avar_subentry *infop,
const struct libparsesfnt_avar_entry *entry,
size_t first, size_t count);
/* === 'meta' (metadata) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6meta.html */
struct libparsesfnt_meta {
uint32_t version;
uint32_t flags;
uint32_t data_offset; /* relative to the beginning of this table */
uint32_t num_data_maps;
};
#define LIBPARSESFNT_META__ "4444"
struct libparsesfnt_meta_entry {
char tag[4];
uint32_t data_offset; /* relative to the beginning of the 'meta' table */
uint32_t data_length;
};
#define LIBPARSESFNT_META_ENTRY__ "111144"
int libparsesfnt_parse_meta(
const char *data, size_t size,
struct libparsesfnt_meta *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_meta_entries(
const char *data, size_t size,
struct libparsesfnt_meta_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_meta *meta,
size_t first, size_t count);
/* === 'hdmx' (horizontal device metrics) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6hdmx.html */
struct libparsesfnt_hdmx {
uint16_t version;
uint16_t num_records;
uint32_t record_size; /* includes alignment */
};
#define LIBPARSESFNT_HDMX__ "224"
struct libparsesfnt_hdmx_v0_entry {
uint8_t pixel_size;
uint8_t maximum_width;
};
#define LIBPARSESFNT_HDMX_V0_ENTRY__ "11"
int libparsesfnt_parse_hdmx(
const char *data, size_t size,
struct libparsesfnt_hdmx *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_hdmx_v0_entries(
const char *data, size_t size,
struct libparsesfnt_hdmx_v0_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_hdmx *hdmx,
size_t first, size_t count);
int libparsesfnt_parse_hdmx_v0_subentries(
const char *data, size_t size,
uint8_t *widthp,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_hdmx *hdmx, size_t record,
size_t first, size_t count);
/* === 'post' (glyph name and PostScript compatibility) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6post.html */
struct libparsesfnt_post_format2_subtable {
uint16_t number_of_glyphs;
uint16_t __padding1;
};
#define LIBPARSESFNT_POST_FORMAT2__ "2pp"
struct libparsesfnt_post {
uint32_t format;
int32_t italic_angle;
int16_t underline_position;
int16_t underline_thickness;
uint32_t is_fixed_pitch;
uint32_t min_mem_type_42;
uint32_t max_mem_type_42;
uint32_t min_mem_type_1;
uint32_t max_mem_type_1;
union {
struct libparsesfnt_post_format2_subtable v2; /* 2.x */
} subtable;
};
#define LIBPARSESFNT_POST__ "4-422+44444"
int libparsesfnt_parse_post(
const char *data, size_t size,
struct libparsesfnt_post *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_post_format_2_0_indices(
const char *data, size_t size,
uint16_t *indexp,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_parse_post_format_2_0_name(
const char *data, size_t size,
char namep[256],
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_post *post,
size_t *offsetp /* start at 0 */);
int libparsesfnt_parse_post_format_2_5_offsets(
const char *data, size_t size,
int16_t *offsetp,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_parse_post_format_4_0_indices(
const char *data, size_t size,
uint16_t *indexp,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
/* === 'cmap' (character code mapping) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6cmap.html */
struct libparsesfnt_cmap {
uint16_t version;
uint16_t num_subtables;
};
#define LIBPARSESFNT_CMAP__ "22"
struct libparsesfnt_cmap_entry {
uint16_t platform_id;
uint16_t encoding_id;
uint32_t offset;
};
#define LIBPARSESFNT_CMAP_ENTRY__ "224"
struct libparsesfnt_cmap_entry_subtable_0 {
uint16_t format;
uint16_t length;
uint16_t language_id;
uint8_t glyph_index_array[256];
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_0__ "222{256}1"
struct libparsesfnt_cmap_entry_subtable_2 {
uint16_t format;
uint16_t length;
uint16_t language_id;
uint16_t subheader_keys[256];
uint16_t libparsesfnt_subheader_keys_max;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_2__ "222{256}2"
struct libparsesfnt_cmap_entry_subtable_2_subheader {
uint16_t first_code;
uint16_t entry_count;
int16_t id_delta;
uint16_t id_range_offset;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_2_SUBHEADER__ "22-2+2"
struct libparsesfnt_cmap_entry_subtable_4 {
uint16_t format;
uint16_t length;
uint16_t language_id;
uint16_t seg_count_x2;
uint16_t search_range;
uint16_t entry_selector;
uint16_t range_shift;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_4__ "2222222"
struct libparsesfnt_cmap_entry_subtable_6 {
uint16_t format;
uint16_t length;
uint16_t language_id;
uint16_t first_code;
uint16_t entry_count;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_6__ "22222"
struct libparsesfnt_cmap_entry_subtable_8 {
uint16_t format;
uint16_t __reserved1;
uint32_t length;
uint32_t language_id;
uint8_t is32[8192];
uint32_t n_groups;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_8__ "2244{8192}14"
struct libparsesfnt_cmap_entry_subtable_8_entry {
uint32_t start_char_code;
uint32_t end_char_code;
uint32_t start_glyph_code;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_8_ENTRY__ "444"
struct libparsesfnt_cmap_entry_subtable_10 {
uint16_t format;
uint16_t __reserved1;
uint32_t length;
uint32_t language_id;
uint32_t start_char_code;
uint32_t num_chars;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_10__ "224444"
struct libparsesfnt_cmap_entry_subtable_12 {
uint16_t format;
uint16_t __reserved1;
uint32_t length;
uint32_t language_id;
uint32_t n_groups;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_12__ "22444"
struct libparsesfnt_cmap_entry_subtable_12_entry {
uint32_t start_char_code;
uint32_t end_char_code;
uint32_t start_glyph_code;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_12_ENTRY__ "444"
struct libparsesfnt_cmap_entry_subtable_13 {
uint16_t format;
uint16_t __reserved1;
uint32_t length;
uint32_t language_id;
uint32_t n_groups;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_13__ "22444"
struct libparsesfnt_cmap_entry_subtable_13_entry {
uint32_t start_char_code;
uint32_t end_char_code;
uint32_t glyph_code;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_13_ENTRY__ "444"
struct libparsesfnt_cmap_entry_subtable_14 {
uint16_t format;
uint16_t __padding1;
uint32_t length;
uint32_t num_var_selector_records;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_14__ "2pp44"
struct libparsesfnt_cmap_entry_subtable_14_entry {
uint32_t var_selector;
uint32_t default_uvs_offset; /* relative to the beginning of the `libparsesfnt_cmap_entry_subtable_14` */
uint32_t non_default_uvs_offset; /* relative to the beginning of the `libparsesfnt_cmap_entry_subtable_14` */
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_14_ENTRY__ "p1244"
struct libparsesfnt_cmap_entry_subtable_14_default_uvs {
uint32_t num_unicode_value_ranges;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_14_DEFAULT_UVS__ "4"
struct libparsesfnt_cmap_entry_subtable_14_default_uvs_entry {
uint32_t start_unicode_value;
uint8_t additional_count;
uint8_t __padding1[3];
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_14_DEFAULT_UVS_ENTRY__ "p121ppp"
struct libparsesfnt_cmap_entry_subtable_14_non_default_uvs {
uint32_t num_uvs_mappings;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_14_NON_DEFAULT_UVS__ "4"
struct libparsesfnt_cmap_entry_subtable_14_non_default_uvs_entry {
uint32_t start_unicode_value;
uint16_t glyph_id;
uint16_t __padding1;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE_14_NON_DEFAULT_UVS_ENTRY__ "p122pp"
union libparsesfnt_cmap_entry_subtable {
uint16_t format;
struct libparsesfnt_cmap_entry_subtable_0 f0;
struct libparsesfnt_cmap_entry_subtable_2 f2;
struct libparsesfnt_cmap_entry_subtable_4 f4;
struct libparsesfnt_cmap_entry_subtable_6 f6;
struct libparsesfnt_cmap_entry_subtable_8 f8;
struct libparsesfnt_cmap_entry_subtable_10 f10;
struct libparsesfnt_cmap_entry_subtable_12 f12;
struct libparsesfnt_cmap_entry_subtable_13 f13;
struct libparsesfnt_cmap_entry_subtable_14 f14;
};
#define LIBPARSESFNT_CMAP_ENTRY_SUBTABLE__ "2"
int libparsesfnt_parse_cmap(
const char *data, size_t size,
struct libparsesfnt_cmap *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_cmap_entries(
const char *data, size_t size,
struct libparsesfnt_cmap_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable(
const char *data, size_t size,
union libparsesfnt_cmap_entry_subtable *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_cmap_entry *entry);
int libparsesfnt_parse_cmap_entry_subtable_2_subheader_entries(
const char *data, size_t size,
struct libparsesfnt_cmap_entry_subtable_2_subheader *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_cmap_entry *entry,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_2_glyph_index_entries(
const char *data, size_t size,
uint16_t *glyph_indexp,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_2 *subtable,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_4_end_code_entries(
const char *data, size_t size,
uint16_t *end_codep,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_4_start_code_entries(
const char *data, size_t size,
uint16_t *start_codep,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_4 *subtable,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_4_id_delta_entries(
const char *data, size_t size,
uint16_t *id_deltap,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_4 *subtable,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_4_id_range_offset_entries(
const char *data, size_t size,
uint16_t *id_range_offsetp,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_4 *subtable,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_4_glyph_index_entries(
const char *data, size_t size,
uint16_t *glyph_indexp,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_4 *subtable,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_6_entries(
const char *data, size_t size,
uint16_t *glyphp,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_cmap_entry *entry,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_8_entries(
const char *data, size_t size,
struct libparsesfnt_cmap_entry_subtable_8_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_cmap_entry *entry,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_10_entries(
const char *data, size_t size,
uint16_t *glyphp,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_cmap_entry *entry,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_12_entries(
const char *data, size_t size,
struct libparsesfnt_cmap_entry_subtable_12_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_cmap_entry *entry,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_13_entries(
const char *data, size_t size,
struct libparsesfnt_cmap_entry_subtable_13_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, const struct libparsesfnt_cmap_entry *entry,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_14_entries(
const char *data, size_t size,
struct libparsesfnt_cmap_entry_subtable_14_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_14 *subtable,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_14_default_uvs(
const char *data, size_t size,
struct libparsesfnt_cmap_entry_subtable_14_default_uvs *infop,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_14 *subtable,
const struct libparsesfnt_cmap_entry_subtable_14_entry *subentry);
int libparsesfnt_parse_cmap_entry_subtable_14_default_uvs_entries(
const char *data, size_t size,
struct libparsesfnt_cmap_entry_subtable_14_default_uvs_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_14_entry *subentry,
size_t first, size_t count);
int libparsesfnt_parse_cmap_entry_subtable_14_non_default_uvs(
const char *data, size_t size,
struct libparsesfnt_cmap_entry_subtable_14_non_default_uvs *infop,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_14 *subtable,
const struct libparsesfnt_cmap_entry_subtable_14_entry *subentry);
int libparsesfnt_parse_cmap_entry_subtable_14_non_default_uvs_entries(
const char *data, size_t size,
struct libparsesfnt_cmap_entry_subtable_14_non_default_uvs_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_cmap_entry *entry,
const struct libparsesfnt_cmap_entry_subtable_14_entry *subentry,
size_t first, size_t count);
/* === 'bdat' (bitmap data) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bdat.html */
struct libparsesfnt_bdat {
uint32_t version;
};
#define LIBPARSESFNT_BDAT__ "4"
struct libparsesfnt_bdat_v2_0_big_glyph_metrics { /* used as header for image formats 6 and 7 */
uint8_t height;
uint8_t width;
int8_t hori_bearing_x;
int8_t hori_bearing_y;
uint8_t hori_advance;
int8_t vert_bearing_x;
int8_t vert_bearing_y;
uint8_t vert_advance;
};
#define LIBPARSESFNT_BDAT_V2_0_BIG_GLYPH_METRICS__ "11-11+1-11+1"
struct libparsesfnt_bdat_v2_0_small_glyph_metrics { /* used as header for image formats 1 and 2 */
uint8_t height;
uint8_t width;
int8_t bearing_x;
int8_t bearing_y;
uint8_t advance;
};
#define LIBPARSESFNT_BDAT_V2_0_SMALL_GLYPH_METRICS__ "11-11+1"
struct libparsesfnt_bdat_v2_0_format_4_glyph_data { /* TODO how should these be intepreted? */
uint32_t white_tree_offset;
uint32_t black_tree_offset;
uint32_t glyph_data_offset;
};
#define LIBPARSESFNT_BDAT_V2_0_FORMAT_4_GLYPH_DATA__ "444"
int libparsesfnt_parse_bdat(
const char *data, size_t size,
struct libparsesfnt_bdat *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_bdat_v2_0_big_glyph_metrics_entry(
const char *data, size_t size,
struct libparsesfnt_bdat_v2_0_big_glyph_metrics *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t offset);
int libparsesfnt_parse_bdat_v2_0_small_glyph_metrics_entry(
const char *data, size_t size,
struct libparsesfnt_bdat_v2_0_small_glyph_metrics *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t offset);
int libparsesfnt_parse_bdat_v2_0_format_4_glyph_data_entry(
const char *data, size_t size,
struct libparsesfnt_bdat_v2_0_format_4_glyph_data *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t offset);
int libparsesfnt_get_bdat_v2_0_format_1_image_data_offset(
size_t size,
size_t *offsetp,
const struct libparsesfnt_tabdir_entry *tag,
size_t offset, size_t image_size_or_zero);
#define libparsesfnt_get_bdat_v2_0_format_2_image_data_offset\
libparsesfnt_get_bdat_v2_0_format_1_image_data_offset
int libparsesfnt_get_bdat_v2_0_format_4_image_data_offset(
size_t size,
size_t *offsetp,
const struct libparsesfnt_tabdir_entry *tag,
size_t offset, size_t image_size_or_zero);
int libparsesfnt_get_bdat_v2_0_format_5_image_data_offset(
size_t size,
size_t *offsetp,
const struct libparsesfnt_tabdir_entry *tag,
size_t offset, size_t image_size_or_zero);
int libparsesfnt_get_bdat_v2_0_format_6_image_data_offset(
size_t size,
size_t *offsetp,
const struct libparsesfnt_tabdir_entry *tag,
size_t offset, size_t image_size_or_zero);
#define libparsesfnt_get_bdat_v2_0_format_7_image_data_offset\
libparsesfnt_get_bdat_v2_0_format_6_image_data_offset
/* === 'bloc' (bitmap location) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bloc.html */
struct libparsesfnt_bloc {
uint32_t version;
uint32_t num_sizes;
};
#define LIBPARSESFNT_BLOC__ "44"
struct libparsesfnt_bloc_v2_0_line_metrics {
int8_t ascender;
int8_t descender;
uint8_t width_max;
int8_t caret_slope_numerator;
int8_t caret_slope_denominator;
int8_t caret_offset;
int8_t min_origin_sb;
int8_t min_advance_sb;
int8_t max_before_bl;
int8_t min_after_bl;
uint8_t __reserved1[2]; /* padding included in the file */
};
#define LIBPARSESFNT_BLOC_V2_0_LINE_METRICS__ "-11+1-{7}1+.."
struct libparsesfnt_bloc_v2_0_size_entry {
uint32_t index_subtable_array_offset; /* relative to the beginning of 'bloc' */
uint32_t index_table_size;
uint32_t number_of_index_subtables;
uint32_t color_ref;
struct libparsesfnt_bloc_v2_0_line_metrics hori;
struct libparsesfnt_bloc_v2_0_line_metrics vert;
uint16_t start_glyph_index;
uint16_t end_glyph_index;
uint8_t ppem_x;
uint8_t ppem_y;
uint8_t bit_depth;
uint8_t flags;
};
#define LIBPARSESFNT_BLOC_V2_0_SIZE_ENTRY__ "4444"LIBPARSESFNT_BLOC_V2_0_LINE_METRICS__\
LIBPARSESFNT_BLOC_V2_0_LINE_METRICS__"2211111"
enum libparsesfnt_bloc_v2_0_size_flag {
LIBPARSESFNT_BLOC_V2_0_SIZE_FLAG_HORIZONTAL = 0x01,
LIBPARSESFNT_BLOC_V2_0_SIZE_FLAG_VERTICAL = 0x02
};
struct libparsesfnt_bloc_v2_0_index_entry {
uint16_t first_glyph_index;
uint16_t last_glyph_index;
uint32_t additional_offset_to_index_subtable;
};
#define LIBPARSESFNT_BLOC_V2_0_INDEX_ENTRY__ "224"
struct libparsesfnt_bloc_v2_0_index_subentry {
uint16_t index_format; /* format in 'bloc' */
uint16_t image_format; /* format in 'bdat' */
uint32_t image_data_offset;
};
#define LIBPARSESFNT_BLOC_V2_0_INDEX_SUBENTRY__ "224"
struct libparsesfnt_bloc_v2_0_index_subentry_format_2_header {
uint32_t image_size;
struct libparsesfnt_bdat_v2_0_big_glyph_metrics big_metrics;
};
#define LIBPARSESFNT_BLOC_V2_0_INDEX_SUBENTRY_FORMAT_2_HEADER__ "4"LIBPARSESFNT_BDAT_V2_0_BIG_GLYPH_METRICS__
enum libparsesfnt_bloc_v2_0_index_format {
LIBPARSESFNT_BLOC_V2_0_INDEX_FORMAT_PROPORTIONAL_WITH_4_BYTE_OFFSET_DELTAS = 1,
LIBPARSESFNT_BLOC_V2_0_INDEX_FORMAT_MONOSPACED = 2,
LIBPARSESFNT_BLOC_V2_0_INDEX_FORMAT_PROPORTIONAL_WITH_2_BYTE_OFFSET_DELTAS = 3,
};
enum libparsesfnt_bloc_v2_0_image_format {
LIBPARSESFNT_BLOC_V2_0_IMAGE_FORMAT_PROPORTIONAL_SMALL_METRICS_BYTE_ALIGNED = 1,
LIBPARSESFNT_BLOC_V2_0_IMAGE_FORMAT_PROPORTIONAL_SMALL_METRICS_BIT_ALIGNED = 2,
LIBPARSESFNT_BLOC_V2_0_IMAGE_FORMAT_MONOSPACED_COMPRESSED = 4,
LIBPARSESFNT_BLOC_V2_0_IMAGE_FORMAT_MONOSPACED_BIT_ALIGNED = 5,
LIBPARSESFNT_BLOC_V2_0_IMAGE_FORMAT_PROPORTIONAL_BIG_METRICS_BYTE_ALIGNED = 6,
LIBPARSESFNT_BLOC_V2_0_IMAGE_FORMAT_PROPORTIONAL_BIG_METRICS_BIT_ALIGNED = 7
};
int libparsesfnt_parse_bloc(
const char *data, size_t size,
struct libparsesfnt_bloc *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_bloc_v2_0_size_entries(
const char *data, size_t size,
struct libparsesfnt_bloc_v2_0_size_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_parse_bloc_v2_0_index_entries(
const char *data, size_t size,
struct libparsesfnt_bloc_v2_0_index_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_bloc_v2_0_size_entry *size_entry,
size_t first, size_t count);
int libparsesfnt_parse_bloc_v2_0_index_subentry(
const char *data, size_t size,
struct libparsesfnt_bloc_v2_0_index_subentry *infop,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_bloc_v2_0_size_entry *size_entry,
const struct libparsesfnt_bloc_v2_0_index_entry *index_entry);
/* image_size[glyph_index] = offsets[glyph_index + 1] - offsets[glyph_index] */
int libparsesfnt_parse_bloc_v2_0_format_1_offset_entries(
const char *data, size_t size,
uint32_t *offsets,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_bloc_v2_0_size_entry *size_entry,
const struct libparsesfnt_bloc_v2_0_index_entry *index_entry,
size_t first, size_t count);
int libparsesfnt_parse_bloc_v2_0_format_2_header(
const char *data, size_t size,
struct libparsesfnt_bloc_v2_0_index_subentry_format_2_header *infop,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_bloc_v2_0_size_entry *size_entry,
const struct libparsesfnt_bloc_v2_0_index_entry *index_entry);
/* image_size[glyph_index] = offsets[glyph_index + 1] - offsets[glyph_index] */
int libparsesfnt_parse_bloc_v2_0_format_3_offset_entries(
const char *data, size_t size,
uint16_t *offsets,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_bloc_v2_0_size_entry *size_entry,
const struct libparsesfnt_bloc_v2_0_index_entry *index_entry,
size_t first, size_t count);
int libparsesfnt_get_bloc_v2_0_format_1_offset(
size_t *offsetp,
const uint32_t offset,
const struct libparsesfnt_bloc_v2_0_index_subentry *subentry);
int libparsesfnt_get_bloc_v2_0_format_2_offset(
size_t *offsetp,
size_t glyph_index,
const struct libparsesfnt_bloc_v2_0_index_entry *entry,
const struct libparsesfnt_bloc_v2_0_index_subentry *subentry,
struct libparsesfnt_bloc_v2_0_index_subentry_format_2_header *header);
int libparsesfnt_get_bloc_v2_0_format_3_offset(
size_t *offsetp,
const uint16_t offset,
const struct libparsesfnt_bloc_v2_0_index_subentry *subentry);
/* === 'sbix' (extended bitmaps) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6sbix.html */
struct libparsesfnt_sbix {
uint16_t version;
uint16_t flags;
uint32_t num_strikes;
};
#define LIBPARSESFNT_SBIX__ "224"
enum libparsesfnt_sbix_v1_flag {
LIBPARSESFNT_SBIX_V1_FLAG_REQUIRED_BITS = 0x01, /* Must be set for the font to be valid */
LIBPARSESFNT_SBIX_V1_FLAG_DRAW_OUTLINES = 0x02
};
struct libparsesfnt_sbix_v1_strike_entry {
uint16_t ppem;
uint16_t resolution;
};
#define LIBPARSESFNT_SBIX_V1_STRIKE_ENTRY__ "22"
struct libparsesfnt_sbix_v1_glyph_data_entry {
int16_t origin_offset_x;
int16_t origin_offset_y;
char graphic_type[4]; /* 'jpg ', 'pdf ', 'png ', or 'tiff'; or 'dupe' or 'mask' */
size_t libparsesfnt_image_data_offset; /* Relative to the beginning of the file */
size_t libparsesfnt_image_data_length;
};
#define LIBPARSESFNT_SBIX_V1_GLYPH_DATA_ENTRY__ "-22+...."
struct libparsesfnt_sbix_v1_image_data_dupe {
uint16_t glyph_index;
};
#define LIBPARSESFNT_SBIX_V1_IMAGE_DATA_DUPE__ "2"
struct libparsesfnt_sbix_v1_image_data_mask {
uint32_t mask_offset;
char graphic_type[4]; /* 'jpg ', 'pdf ', 'png ', or 'tiff' */
size_t libparsesfnt_image_data_offset; /* Relative to the beginning of the file */
size_t libparsesfnt_image_data_length;
};
#define LIBPARSESFNT_SBIX_V1_IMAGE_DATA_MASK__ "4...."
struct libparsesfnt_sbix_v1_mask {
uint32_t mask_length;
uint16_t __reserved1;
uint16_t blending_mode;
int16_t origin_offset_x;
int16_t origin_offset_y;
char graphic_type[4]; /* 'jpg ', 'png ', or 'tiff' */
size_t libparsesfnt_mask_offset; /* Relative to the beginning of the file */
};
#define LIBPARSESFNT_SBIX_V1_MASK__ "4pp2-22+...."
enum libparsesfnt_sbix_v1_mask_blending_mode {
LIBPARSESFNT_SBIX_V1_MASK_BLENDING_MODE_MULTIPLY = 0,
LIBPARSESFNT_SBIX_V1_MASK_BLENDING_MODE_DARKEN = 1,
LIBPARSESFNT_SBIX_V1_MASK_BLENDING_MODE_HARD_LIGHT = 2,
LIBPARSESFNT_SBIX_V1_MASK_BLENDING_MODE_SOURCE_ATOP = 3,
LIBPARSESFNT_SBIX_V1_MASK_BLENDING_MODE_XOR = 4
};
int libparsesfnt_parse_sbix(
const char *data, size_t size,
struct libparsesfnt_sbix *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_sbix_v1_strike_offset_entries(
const char *data, size_t size,
uint32_t *offsetp,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
int libparsesfnt_parse_sbix_v1_strike_entry(
const char *data, size_t size,
struct libparsesfnt_sbix_v1_strike_entry *infop,
const struct libparsesfnt_tabdir_entry *tag, size_t strike_offset);
/* There is one extra, so that
* glyph_data_size[i] = glyph_data_offset[i + 1] - glyph_data_offset[i];
* if the glyph data size is 0, there is no bitmap, but the outline shall be drawn
* (this is the case for white space characters). */
int libparsesfnt_parse_sbix_v1_glyph_data_offset_entries(
const char *data, size_t size,
uint32_t *offsetp,
const struct libparsesfnt_tabdir_entry *tag, size_t strike_offset,
size_t first, size_t count);
int libparsesfnt_parse_sbix_v1_glyph_data_entry(
const char *data, size_t size,
struct libparsesfnt_sbix_v1_glyph_data_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t strike_offset, size_t glyph_data_offset, size_t next_glyphs_data_offset);
int libparsesfnt_parse_sbix_v1_image_data_dupe(
const char *data, size_t size,
struct libparsesfnt_sbix_v1_image_data_dupe *infop,
const struct libparsesfnt_sbix_v1_glyph_data_entry *glyph_data);
int libparsesfnt_parse_sbix_v1_image_data_mask(
const char *data, size_t size,
struct libparsesfnt_sbix_v1_image_data_mask *infop,
const struct libparsesfnt_sbix_v1_glyph_data_entry *glyph_data);
int libparsesfnt_parse_sbix_v1_mask(
const char *data, size_t size,
struct libparsesfnt_sbix_v1_mask *infop,
const struct libparsesfnt_tabdir_entry *tag,
const struct libparsesfnt_sbix_v1_image_data_mask *image_data);
/* === 'EBSC' (embedded bitmap scaling control) === */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6EBSC.html */
struct libparsesfnt_ebsc {
uint32_t version;
uint32_t num_sizes;
};
#define LIBPARSESFNT_EBSC__ "44"
struct libparsesfnt_ebsc_v2_0_entry {
struct libparsesfnt_bloc_v2_0_line_metrics hori;
struct libparsesfnt_bloc_v2_0_line_metrics vert;
uint8_t ppem_x;
uint8_t ppem_y;
uint8_t substitute_ppem_x;
uint8_t substitute_ppem_y;
};
#define LIBPARSESFNT_EBSC_V2_0_ENTRY__ LIBPARSESFNT_BLOC_V2_0_LINE_METRICS__""\
LIBPARSESFNT_BLOC_V2_0_LINE_METRICS__"1111"
int libparsesfnt_parse_ebsc(
const char *data, size_t size,
struct libparsesfnt_ebsc *infop,
const struct libparsesfnt_tabdir_entry *tag);
int libparsesfnt_parse_ebsc_v2_0_entries(
const char *data, size_t size,
struct libparsesfnt_ebsc_v2_0_entry *infop,
const struct libparsesfnt_tabdir_entry *tag,
size_t first, size_t count);
#endif
|