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
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
|
#!/usr/bin/env perl
#
# cjk-gs-integrate - setup Ghostscript for CID/TTF CJK fonts
#
# Copyright 2015-2017 by Norbert Preining
# Copyright 2016-2017 by Japanese TeX Development Community
#
# Based on research and work by Yusuke Kuroki, Bruno Voisin, Munehiro Yamamoto
# and the TeX Q&A wiki page
#
# This file is licensed under GPL version 3 or any later version.
# For copyright statements see end of file.
#
# For development see
# https://github.com/texjporg/cjk-gs-support
#
# TODO:
# - how to deal with MacTeX pre-shipped configuration files?
# - interoperability with kanji-config-updmap
#
# Note that symlink names should be consistent with ptex-fontmaps!
$^W = 1;
use Getopt::Long qw(:config no_autoabbrev ignore_case_always);
use File::Basename;
use File::Path qw(make_path);
use Cwd 'abs_path';
use strict;
(my $prg = basename($0)) =~ s/\.pl$//;
my $version = '20170624.0';
if (win32()) {
# conversion between internal (utf-8) and console (cp932):
# multibyte characters should be encoded in cp932 at least during
# * kpathsea file search
# * abs_path existence test
# * input/output on console
# * batch file output
# routines. make sure all of these should be restricted to win32 mode!
# TODO: what to do with $opt_fontdef, @opt_aliases and $opt_filelist,
# with regard to encodings?
use utf8;
use Encode;
# some perl functions (symlink, -l test) does not work
print_warning("Sorry, we have only partial support for Windows!\n");
}
my %encode_list = (
Japan => [ qw/
2004-H
2004-V
78-EUC-H
78-EUC-V
78-H
78-RKSJ-H
78-RKSJ-V
78-V
78ms-RKSJ-H
78ms-RKSJ-V
83pv-RKSJ-H
90ms-RKSJ-H
90ms-RKSJ-V
90msp-RKSJ-H
90msp-RKSJ-V
90pv-RKSJ-H
90pv-RKSJ-V
Add-H
Add-RKSJ-H
Add-RKSJ-V
Add-V
Adobe-Japan1-0
Adobe-Japan1-1
Adobe-Japan1-2
Adobe-Japan1-3
Adobe-Japan1-4
Adobe-Japan1-5
Adobe-Japan1-6
EUC-H
EUC-V
Ext-H
Ext-RKSJ-H
Ext-RKSJ-V
Ext-V
H
Hankaku
Hiragana
Identity-H
Identity-V
Katakana
NWP-H
NWP-V
RKSJ-H
RKSJ-V
Roman
UniJIS-UCS2-H
UniJIS-UCS2-HW-H
UniJIS-UCS2-HW-V
UniJIS-UCS2-V
UniJIS-UTF16-H
UniJIS-UTF16-V
UniJIS-UTF32-H
UniJIS-UTF32-V
UniJIS-UTF8-H
UniJIS-UTF8-V
UniJIS2004-UTF16-H
UniJIS2004-UTF16-V
UniJIS2004-UTF32-H
UniJIS2004-UTF32-V
UniJIS2004-UTF8-H
UniJIS2004-UTF8-V
UniJISPro-UCS2-HW-V
UniJISPro-UCS2-V
UniJISPro-UTF8-V
UniJISX0213-UTF32-H
UniJISX0213-UTF32-V
UniJISX02132004-UTF32-H
UniJISX02132004-UTF32-V
V
WP-Symbol/ ],
GB => [ qw/
Adobe-GB1-0
Adobe-GB1-1
Adobe-GB1-2
Adobe-GB1-3
Adobe-GB1-4
Adobe-GB1-5
GB-EUC-H
GB-EUC-V
GB-H
GB-RKSJ-H
GB-V
GBK-EUC-H
GBK-EUC-V
GBK2K-H
GBK2K-V
GBKp-EUC-H
GBKp-EUC-V
GBT-EUC-H
GBT-EUC-V
GBT-H
GBT-RKSJ-H
GBT-V
GBTpc-EUC-H
GBTpc-EUC-V
GBpc-EUC-H
GBpc-EUC-V
Identity-H
Identity-V
UniGB-UCS2-H
UniGB-UCS2-V
UniGB-UTF16-H
UniGB-UTF16-V
UniGB-UTF32-H
UniGB-UTF32-V
UniGB-UTF8-H
UniGB-UTF8-V/ ],
CNS => [ qw/
Adobe-CNS1-0
Adobe-CNS1-1
Adobe-CNS1-2
Adobe-CNS1-3
Adobe-CNS1-4
Adobe-CNS1-5
Adobe-CNS1-6
B5-H
B5-V
B5pc-H
B5pc-V
CNS-EUC-H
CNS-EUC-V
CNS1-H
CNS1-V
CNS2-H
CNS2-V
ETHK-B5-H
ETHK-B5-V
ETen-B5-H
ETen-B5-V
ETenms-B5-H
ETenms-B5-V
HKdla-B5-H
HKdla-B5-V
HKdlb-B5-H
HKdlb-B5-V
HKgccs-B5-H
HKgccs-B5-V
HKm314-B5-H
HKm314-B5-V
HKm471-B5-H
HKm471-B5-V
HKscs-B5-H
HKscs-B5-V
Identity-H
Identity-V
UniCNS-UCS2-H
UniCNS-UCS2-V
UniCNS-UTF16-H
UniCNS-UTF16-V
UniCNS-UTF32-H
UniCNS-UTF32-V
UniCNS-UTF8-H
UniCNS-UTF8-V/ ],
Korea => [ qw/
Adobe-Korea1-0
Adobe-Korea1-1
Adobe-Korea1-2
Identity-H
Identity-V
KSC-EUC-H
KSC-EUC-V
KSC-H
KSC-Johab-H
KSC-Johab-V
KSC-RKSJ-H
KSC-V
KSCms-UHC-H
KSCms-UHC-HW-H
KSCms-UHC-HW-V
KSCms-UHC-V
KSCpc-EUC-H
KSCpc-EUC-V
UniKS-UCS2-H
UniKS-UCS2-V
UniKS-UTF16-H
UniKS-UTF16-V
UniKS-UTF32-H
UniKS-UTF32-V
UniKS-UTF8-H
UniKS-UTF8-V/ ] );
#
# location where links to fonts in texmf are created, relative to TEXMF
my $otf_pathpart = "fonts/opentype/cjk-gs-integrate";
my $ttf_pathpart = "fonts/truetype/cjk-gs-integrate";
# location where cidfmap, cidfmap.local and cidfmap.aliases are placed
# when found gs is tlgs (win32), then files will be placed in lib/ instead of Resource/Init/
my $cidfmap_pathpart = "Init/cidfmap";
my $cidfmap_local_pathpart = "Init/cidfmap.local";
my $cidfmap_aliases_pathpart = "Init/cidfmap.aliases";
# support for ps2otfps by Akira Kakuto
my $akotfps_pathpart = "dvips/ps2otfps";
my $akotfps_datafilename = "psnames-for-otf";
my $akotfps_datacontent = '';
# if windows, we might create batch file for links
my $winbatch = "makefontlinks.bat";
my $winbatch_content = '';
# dump output for data file (for easy editing for users)
my $dump_datafile = "$prg-data.dat";
my $opt_output;
my $opt_fontdef;
my @opt_aliases;
my $opt_filelist;
my $opt_texmflink;
my $opt_akotfps;
my $opt_force = 0;
my $opt_remove = 0;
my $opt_cleanup = 0;
my $opt_hardlink = 0;
my $opt_winbatch;
my $opt_dump_data;
my $opt_only_aliases = 0;
my $opt_listaliases = 0;
my $opt_listallaliases = 0;
my $opt_listfonts = 0;
my $opt_info = 0;
my $opt_machine = 0;
my $dry_run = 0;
my $opt_quiet = 0;
my $opt_debug = 0;
my $opt_help = 0;
my $opt_markdown = 0;
if (! GetOptions(
"o|output=s" => \$opt_output,
"f|fontdef=s" => \$opt_fontdef,
"a|alias=s" => \@opt_aliases,
"filelist=s" => \$opt_filelist,
"link-texmf:s" => \$opt_texmflink,
"otfps:s" => \$opt_akotfps,
"force" => \$opt_force,
"remove" => \$opt_remove,
"cleanup" => \$opt_cleanup,
"hardlink" => \$opt_hardlink,
"winbatch:s" => \$opt_winbatch,
"dump-data:s" => \$opt_dump_data,
"only-aliases" => \$opt_only_aliases,
"list-aliases" => \$opt_listaliases,
"list-all-aliases" => \$opt_listallaliases,
"list-fonts" => \$opt_listfonts,
"info" => \$opt_info,
"machine-readable" => \$opt_machine,
"n|dry-run" => \$dry_run,
"q|quiet" => \$opt_quiet,
"d|debug+" => \$opt_debug,
"h|help" => \$opt_help,
"markdown" => \$opt_markdown,
"v|version" => sub { print &version(); exit(0); }, ) ) {
die "Try \"$0 --help\" for more information.\n";
}
sub win32 { return ($^O=~/^MSWin(32|64)$/i); }
sub macosx { return ($^O=~/^darwin$/i); }
my $nul = (win32() ? 'nul' : '/dev/null') ;
my $sep = (win32() ? ';' : ':');
my %fontdb;
my %aliases;
my %user_aliases;
if ($opt_help || $opt_markdown) {
Usage();
exit 0;
}
if ($opt_debug) {
require Data::Dumper;
$Data::Dumper::Indent = 1;
}
if (defined($opt_texmflink)) {
my $foo;
if ($opt_texmflink eq '') {
# option was passed but didn't receive a value
# -> use TEXMFLOCAL
chomp( $foo = `kpsewhich -var-value=TEXMFLOCAL`);
} else {
# option was passed with an argument
# -> use it
$foo = $opt_texmflink;
}
$opt_texmflink = $foo;
}
if (defined($opt_akotfps)) {
my $foo;
if ($opt_akotfps eq '') {
if (defined($opt_texmflink)) {
$foo = $opt_texmflink;
} else {
chomp( $foo = `kpsewhich -var-value=TEXMFLOCAL`);
}
} else {
$foo = $opt_akotfps;
}
$opt_akotfps = $foo;
}
if (defined($opt_winbatch)) {
if ($opt_winbatch ne '') {
$winbatch = $opt_winbatch;
}
if (win32()) {
$opt_winbatch = 1;
unlink $winbatch if (-f $winbatch);
} else {
print_warning("ignoring --winbatch option due to non-Windows\n");
$opt_winbatch = 0;
}
} else {
$opt_winbatch = 0;
}
if ($opt_hardlink) {
if (win32()) {
$opt_hardlink = 1;
} else {
print_warning("ignoring --hardlink option due to non-Windows\n");
$opt_hardlink = 0;
}
}
if (defined($opt_dump_data)) {
if ($opt_dump_data ne '') {
$dump_datafile = $opt_dump_data;
}
$opt_dump_data = 1;
unlink $dump_datafile if (-f $dump_datafile);
} else {
$opt_dump_data = 0;
}
if ($opt_dump_data && $opt_fontdef) {
print_warning("-f/--fontdef option ignored due to --dump-data\n");
$opt_fontdef = 0;
}
if ($opt_cleanup) {
$opt_remove = 1;
}
if ($opt_info) {
$opt_listfonts = 1;
$opt_listaliases = 1;
}
if ($opt_listallaliases && $opt_listfonts) {
print_error("Options --list-all-aliases and --list-fonts cannot be used at the same time!\n");
exit(1);
}
main(@ARGV);
#
# only sub definitions from here on
#
sub main {
# first, read font database to obtain %fontdb
# if $opt_dump_data is given, exit after dumping <DATA> to $dump_datafile
print_info("reading font database ...\n");
read_font_database();
if ($opt_dump_data) {
if (-f $dump_datafile) {
print_info("*** Data dumped to $dump_datafile ***\n");
exit(0);
} else {
print_error("Failed to dump data to $dump_datafile!\n");
exit(1);
}
}
# second, determine non-otf link name
# this is actually required only by info_found_fonts() and do_nonotf_fonts()
# operations, but it does no harm for other cases too
determine_nonotf_link_name(); # see comments there
# set 'available' flags and 'type' by kpsewhich search
# if $opt_cleanup or $opt_listallaliases is given, treat all files
# in the database as if they were actually available as OTF
if (!$opt_cleanup && !$opt_listallaliases) {
print_info("checking for files ...\n");
check_for_files();
} else {
make_all_available();
}
# obtain %aliases and %user_aliases
compute_aliases();
# informative operations
if ($opt_listfonts) {
info_found_fonts();
}
if ($opt_listaliases || $opt_listallaliases) {
info_list_aliases();
}
exit(0) if ($opt_listfonts || $opt_listaliases || $opt_listallaliases);
# if $opt_machine is still alive after the above exit(0), it's useless
if ($opt_machine) {
print_error("Option --machine-readable should be used with at least one of the followings:\n");
print_error(" --list-aliases, --list-all-aliases, --list-fonts, --info\n");
print_error("terminating.\n");
exit(1);
}
# do actual setup/removing operations
if (! $opt_output) {
print_info("searching for Ghostscript resource\n");
my $gsres = find_gs_resource();
if (!$gsres) {
print_error("Cannot find Ghostscript, terminating!\n");
exit(1);
} else {
$opt_output = $gsres;
}
}
if (! -d $opt_output) {
$dry_run || mkdir($opt_output) ||
die ("Cannot create directory $opt_output: $!");
}
if ($opt_cleanup) {
print_info("going to clean up $opt_output\n");
} else {
print_info("output is going to $opt_output\n");
}
if (!$opt_only_aliases) {
if ($opt_cleanup) {
# all font types are handled at the same time
print_info("cleaning up all links, snippets and cidfmap.local ...\n");
do_all_fonts();
} else {
# OTF and TTF/TTC/OTC must be handled separately, depending on the found files
print_info(($opt_remove ? "removing" : "generating") . " links and snippets for CID fonts ...\n");
do_otf_fonts();
print_info(($opt_remove ? "removing" : "generating") . " links, snippets and cidfmap.local for non-CID fonts ...\n");
do_nonotf_fonts();
}
write_winbatch() if ($opt_winbatch);
}
print_info(($opt_remove ? "removing" : "generating") . " snippets and cidfmap.aliases for font aliases ...\n");
do_aliases();
write_akotfps_datafile() if ($opt_akotfps);
print_info("finished\n");
if ($opt_winbatch) {
if (-f $winbatch) {
print_info("*** Batch file $winbatch created ***\n");
print_info("*** to complete, run it as administrator privilege.***\n");
} else {
print_error("Failed to create $winbatch!\n");
exit(1);
}
}
}
sub do_all_fonts {
# try to clean up all possible links/snippets/cidfmap which could have been
# generated in the previous runs
# previous versions of cjk-gs-integrate included following bugs:
# * the database sometimes identified GB/CNS classes wrongly
# * symlink names were sometimes invalid (some of which contained
# white-spaces, due to the absence of proper database entry) or
# inconsistent with ptex-fontmaps (Name <-> PSName or redundant Filename)
# * confused symlinks between TTF/TTC/OTC (including ttf <-> ttc links)
# also, current version generates OTC links into $otf_pathpart instead of
# $ttf_pathpart, which was not true in the older versions
# we'd like to clean up all such files
my $fontdest = "$opt_output/Font";
my $ciddest = "$opt_output/CIDFont";
my $cidfsubst = "$opt_output/CIDFSubst";
for my $k (sort keys %fontdb) {
#
# remove snippets: note that $class = $fontdb{$k}{'class'} is not enough
# due to previous bugs
for my $class (%encode_list) {
for my $enc (@{$encode_list{$class}}) {
unlink "$fontdest/$k-$enc" if (-f "$fontdest/$k-$enc");
}
}
#
# remove links; borrow link_font operation here for convenience
# since we don't need target in cleanup mode, initialize with stub "none"
#
# for OTF/TTF fonts, first remove both $k[.otf,ttf] and $fontdb{$k}{'origname'}[.otf]
# the links $k.otf and $fontdb{$k}{'origname'} are coming from previous bugs,
# and the links $k.ttf are (sometimes) coming from inconsistency
if ($fontdb{$k}{'origname'}) { # this test skips alias-only fonts (e.g. Ryumin-Light)
link_font("none", $ciddest, $k);
link_font("none", $cidfsubst, "$k.ttf");
link_font("none", "$opt_texmflink/$otf_pathpart", "$k.otf")
if $opt_texmflink;
link_font("none", "$opt_texmflink/$ttf_pathpart", "$k.ttf")
if $opt_texmflink;
link_font("none", $ciddest, $fontdb{$k}{'origname'});
link_font("none", "$opt_texmflink/$otf_pathpart", "$fontdb{$k}{'origname'}.otf")
if $opt_texmflink;
}
# for OTF/TTF/TTC/OTC fonts, loop through all file candidates
for my $f (keys %{$fontdb{$k}{'files'}}) {
# check for subfont extension
my $foo = $f;
$foo =~ s/^(.*)\(\d*\)$/$1/;
link_font("none", $cidfsubst, "$foo");
link_font("none", "$opt_texmflink/$otf_pathpart", "$foo") if $opt_texmflink;
link_font("none", "$opt_texmflink/$ttf_pathpart", "$foo") if $opt_texmflink;
}
}
update_master_cidfmap('cidfmap.local');
# we are in cleanup mode, also remove cidfmap.local itself
if (-f "$opt_output/$cidfmap_local_pathpart") {
unlink "$opt_output/$cidfmap_local_pathpart";
}
}
sub do_otf_fonts {
my $fontdest = "$opt_output/Font";
my $ciddest = "$opt_output/CIDFont";
make_dir($fontdest, "cannot create CID snippets there!");
make_dir($ciddest, "cannot link CID fonts there!");
make_dir("$opt_texmflink/$otf_pathpart",
"cannot link fonts to it!")
if $opt_texmflink;
for my $k (sort keys %fontdb) {
if ($fontdb{$k}{'available'} && $fontdb{$k}{'type'} eq 'OTF') {
generate_font_snippet($fontdest,
$k, $fontdb{$k}{'class'}, $fontdb{$k}{'target'});
link_font($fontdb{$k}{'target'}, $ciddest, $k);
link_font($fontdb{$k}{'target'}, "$opt_texmflink/$otf_pathpart", "$fontdb{$k}{'origname'}.otf")
if $opt_texmflink;
}
}
}
sub do_nonotf_fonts {
my $fontdest = "$opt_output/Font";
my $cidfsubst = "$opt_output/CIDFSubst";
my $outp = '';
make_dir($fontdest, "cannot create CID snippets there!");
make_dir($cidfsubst, "cannot link TTF fonts there!");
make_dir("$opt_texmflink/$ttf_pathpart",
"cannot link fonts to it!")
if $opt_texmflink;
for my $k (sort keys %fontdb) {
if ($fontdb{$k}{'available'} && $fontdb{$k}{'type'} eq 'TTF') {
generate_font_snippet($fontdest,
$k, $fontdb{$k}{'class'}, $fontdb{$k}{'target'});
$outp .= generate_cidfmap_entry($k, $fontdb{$k}{'class'}, $fontdb{$k}{'ttfname'}, $fontdb{$k}{'subfont'});
link_font($fontdb{$k}{'target'}, $cidfsubst, $fontdb{$k}{'ttfname'});
link_font($fontdb{$k}{'target'}, "$opt_texmflink/$ttf_pathpart", $fontdb{$k}{'ttfname'})
if $opt_texmflink;
} elsif ($fontdb{$k}{'available'} && $fontdb{$k}{'type'} eq 'TTC') {
generate_font_snippet($fontdest,
$k, $fontdb{$k}{'class'}, $fontdb{$k}{'target'});
$outp .= generate_cidfmap_entry($k, $fontdb{$k}{'class'}, $fontdb{$k}{'ttcname'}, $fontdb{$k}{'subfont'});
link_font($fontdb{$k}{'target'}, $cidfsubst, $fontdb{$k}{'ttcname'});
link_font($fontdb{$k}{'target'}, "$opt_texmflink/$ttf_pathpart", $fontdb{$k}{'ttcname'})
if $opt_texmflink;
} elsif ($fontdb{$k}{'available'} && $fontdb{$k}{'type'} eq 'OTC') {
# currently Ghostscript does not have OTC support; not creating gs resource
print_debug("gs does not support OTC, not creating gs resource for $k\n");
# generate_font_snippet($fontdest,
# $k, $fontdb{$k}{'class'}, $fontdb{$k}{'target'});
# $outp .= generate_cidfmap_entry($k, $fontdb{$k}{'class'}, $fontdb{$k}{'otcname'}, $fontdb{$k}{'subfont'});
# link_font($fontdb{$k}{'target'}, $cidfsubst, $fontdb{$k}{'otcname'});
link_font($fontdb{$k}{'target'}, "$opt_texmflink/$otf_pathpart", $fontdb{$k}{'otcname'})
if $opt_texmflink;
}
}
return if $dry_run;
if ($outp) {
if (! -d "$opt_output/Init") {
mkdir("$opt_output/Init") ||
die("Cannot create directory $opt_output/Init: $!");
}
open(FOO, ">$opt_output/$cidfmap_local_pathpart") ||
die "Cannot open $opt_output/$cidfmap_local_pathpart: $!";
print FOO $outp;
close(FOO);
}
update_master_cidfmap('cidfmap.local');
}
sub do_aliases {
my $fontdest = "$opt_output/Font";
my $cidfsubst = "$opt_output/CIDFSubst";
my $outp = '';
#
# alias handling
# we use two levels of aliases, one is for the default names that
# are not actual fonts:
# Ryumin-Light, GothicBBB-Medium, FutoMinA101-Bold, FutoGoB101-Bold,
# Jun101-Light which are the original Morisawa names.
#
# the second level of aliases is for Morisawa OTF font names:
# RyuminPro-Light, GothicBBBPro-Medium,
# FutoMinA101Pro-Bold, FutoGoB101Pro-Bold
# Jun101Pro-Light
#
# the order of fonts selected is
# defined in the Provides(Priority): Name in the font definiton
#
$outp .= "\n\n% Aliases\n";
#
my (@jal, @kal, @tal, @sal);
#
for my $al (sort keys %aliases) {
my $target;
my $class;
if ($user_aliases{$al}) {
$target = $user_aliases{$al};
# determine class
if ($fontdb{$target}{'available'}) {
$class = $fontdb{$target}{'class'};
} else {
# must be an aliases, we checked this when initializing %user_aliases
# reset the $al value
# and since $class is still undefined we will use the next code below
$al = $target;
}
}
if (!$class) {
print_warning("Alias candidate for $al is empty!\n") if (!%{$aliases{$al}});
# search lowest number
my @ks = keys(%{$aliases{$al}});
my $first = (sort { $a <=> $b} @ks)[0];
$target = $aliases{$al}{$first};
$class = $fontdb{$target}{'class'};
}
# we also need to create font snippets in Font (or add configuration)
# for the aliases!
generate_font_snippet($fontdest, $al, $class, $target);
if ($class eq 'Japan') {
push @jal, "/$al /$target ;";
} elsif ($class eq 'Korea') {
push @kal, "/$al /$target ;";
} elsif ($class eq 'GB') {
push @sal, "/$al /$target ;";
} elsif ($class eq 'CNS') {
push @tal, "/$al /$target ;";
} else {
print STDERR "unknown class $class for $al\n";
}
}
$outp .= "\n% Japanese fonts\n" . join("\n", @jal) . "\n" if @jal;
$outp .= "\n% Korean fonts\n" . join("\n", @kal) . "\n" if @kal;
$outp .= "\n% Traditional Chinese fonts\n" . join("\n", @tal) . "\n" if @tal;
$outp .= "\n% Simplified Chinese fonts\n" . join("\n", @sal) . "\n" if @sal;
#
return if $dry_run;
if ($outp && !$opt_remove) {
if (! -d "$opt_output/Init") {
mkdir("$opt_output/Init") ||
die("Cannot create directory $opt_output/Init: $!");
}
open(FOO, ">$opt_output/$cidfmap_aliases_pathpart") ||
die "Cannot open $opt_output/$cidfmap_aliases_pathpart: $!";
print FOO $outp;
close(FOO);
}
update_master_cidfmap('cidfmap.aliases');
# if we are in cleanup mode, also remove cidfmap.aliases itself
if (-f "$opt_output/$cidfmap_aliases_pathpart") {
unlink "$opt_output/$cidfmap_aliases_pathpart" if ($opt_cleanup);
}
}
sub update_master_cidfmap {
my $add = shift;
my $cidfmap_master = "$opt_output/$cidfmap_pathpart";
print_info(sprintf("%s $add %s cidfmap file ...\n",
($opt_remove ? "removing" : "adding"), ($opt_remove ? "from" : "to")));
if (-r $cidfmap_master) {
open(FOO, "<", $cidfmap_master) ||
die ("Cannot open $cidfmap_master for reading: $!");
my $found = 0;
my $newmaster = "";
# in add mode: just search for the entry and set $found
# in remove mode: collect all lines that do not match
while(<FOO>) {
if (m/^\s*\(\Q$add\E\)\s\s*\.runlibfile\s*$/) {
$found = 1;
} else {
$newmaster .= $_;
}
}
close(FOO);
# if the master cidfmap has a new line at end of file,
# then $newmaster should end with "\n".
# otherwise we add a new line, since there is a possibility of %EOF comment
# without trailing new line (e.g. TL before r44039)
$newmaster =~ s/\n$//g;
$newmaster =~ s/$/\n/g;
if ($opt_remove) {
if ($found) {
return if $dry_run;
open(FOO, ">", $cidfmap_master) ||
die ("Cannot clean up $cidfmap_master: $!");
print FOO $newmaster;
close FOO;
}
} else {
if ($found) {
print_info("$add already loaded in $cidfmap_master, no changes\n");
} else {
return if $dry_run;
open(FOO, ">", $cidfmap_master) ||
die ("Cannot open $cidfmap_master for appending: $!");
print FOO $newmaster;
print FOO "($add) .runlibfile\n";
close(FOO);
}
}
} else {
return if $dry_run;
return if $opt_remove;
open(FOO, ">", $cidfmap_master) ||
die ("Cannot open $cidfmap_master for writing: $!");
print FOO "($add) .runlibfile\n";
close(FOO);
}
}
sub generate_cidfmap_entry {
my ($n, $c, $f, $sf) = @_;
return "" if $opt_remove;
# $f is already the link target name 'ttfname' (or 'ttcname' or 'otcname')
# as determined by minimal priority number
# extract subfont
my $s = "/$n << /FileType /TrueType
/Path pssystemparams /GenericResourceDir get
(CIDFSubst/$f) concatstrings
/SubfontID $sf
/CSI [($c";
if ($c eq "Japan") {
$s .= "1) 6]";
} elsif ($c eq "GB") {
$s .= "1) 5]";
} elsif ($c eq "CNS") {
$s .= "1) 5]";
} elsif ($c eq "Korea") {
$s .= "1) 2]";
} else {
print_warning("unknown class $c for $n, skipping.\n");
return '';
}
$s .= " >> ;\n";
return $s;
}
sub generate_font_snippet {
my ($fd, $n, $c, $f) = @_;
return if $dry_run;
if ($opt_akotfps) {
add_akotfps_data($n);
return;
}
for my $enc (@{$encode_list{$c}}) {
if ($opt_remove) {
unlink "$fd/$n-$enc" if (-f "$fd/$n-$enc");
next;
}
open(FOO, ">$fd/$n-$enc") ||
die("cannot open $fd/$n-$enc for writing: $!");
print FOO "%!PS-Adobe-3.0 Resource-Font
%%DocumentNeededResources: $enc (CMap)
%%IncludeResource: $enc (CMap)
%%BeginResource: Font ($n-$enc)
($n-$enc)
($enc) /CMap findresource
[($n) /CIDFont findresource]
composefont
pop
%%EndResource
%%EOF
";
close(FOO);
}
}
sub add_akotfps_data {
my ($fn) = @_;
return if $dry_run;
if (! $opt_remove) {
$akotfps_datacontent .= "$fn\n";
}
}
#
# link_font operation
# $opt_force is *not* treated first to warn only
# at really critical cases
# case 1:
# exists, is link, link targets agree
# $opt_force is ignored
# remove or remove+add according to $opt_remove
# case 2:
# exists, is link, dangling symlink
# $opt_force is ignored
# remove or remove+add according to $opt_remove
# case 3:
# exists, is link, link target different
# if $opt_force
# warn, remove or remove+add according to $opt_remove
# else
# error message
# case 4:
# exists, not a link
# if $opt_force
# warn, remove or remove+add according to $opt_remove
# else
# error message
# case 5:
# not exists
# $opt_force is ignored
# do nothing or add according to $opt_remove
#
sub link_font {
my ($f, $cd, $n) = @_;
return if $dry_run;
if (!$n) {
$n = basename($f);
}
my $target = "$cd/$n";
my $do_unlink = 0;
if (-l $target) {
if ($opt_cleanup) {
$do_unlink = 1;
} else {
my $linkt = readlink($target);
if ($linkt) {
if ($linkt eq $f) {
# case 1: exists, link, targets agree
$do_unlink = 1;
} elsif (-r $linkt) {
# case 3: exists, link, targets different
if ($opt_force) {
print_info("Removing link $target due to --force!\n");
$do_unlink = 1;
} else {
print_error("Link $target already existing, but target different from $f, exiting!\n");
exit(1);
}
} else {
# case 2: dangling symlink or link-to-link
print_warning("Removing dangling symlink $target to $linkt\n");
$do_unlink = 1;
}
} else {
print_error("This should not happen, we have a link but cannot read the target?\n");
exit(1);
}
}
} elsif (-r $target) {
# case 4: exists, but not link (NTFS hardlink on win32 falls into this)
if (-s $target) {
if ($opt_force) {
print_info("Removing $target due to --force!\n");
$do_unlink = 1;
} else {
print_error("$target already existing, exiting!\n");
exit(1);
}
} else {
# NTFS symlink on win32 has file size 0, we're safe to remove it
$do_unlink = 1;
}
} # case 5: otherwise it is not existing!
# if we are still here and $do_unlink is set, remove it
maybe_unlink($target) if $do_unlink;
# recreate link if we are not in the remove case
if (! $opt_remove) {
maybe_symlink($f, $target) || die("Cannot link font $f to $target: $!");
}
}
sub make_dir {
my ($d, $w) = @_;
if (-r $d) {
if (! -d $d) {
print_error("$d is not a directory, $w\n");
exit 1;
}
} else {
$dry_run || make_path($d);
}
}
# perl symlink function does not work on windows, so leave it to
# cmd.exe mklink function (or write to batch file).
# if target already exists, do not try to override it. otherwise
# "mklink error: Cannot create a file when that file already exists"
# is thrown many times
sub maybe_symlink {
my ($realname, $targetname) = @_;
if (win32()) {
# hardlink vs. symlink -- HY 2017/04/26
# * readablitiy: hardlink is easier, but it seems that current gs can read
# symlink properly, so it doesn't matter
# * permission: hardlink creation does not require administrator privilege,
# but is likely to fail for c:/windows/fonts/* system files
# due to "Access denied"
# symlink creation requires administrator privilege, but
# it can link to all files in c:/windows/fonts/
# * versatility: symlink can point to a file on a different/remote volume
# for these reasons, we try to create symlink by default.
# if --hardlink option is given, we create hardlink instead.
# also, if --winbatch option is given, we prepare batch file for link generation,
# instead of creating links right away.
$realname =~ s!/!\\!g;
$targetname =~ s!/!\\!g;
if ($opt_winbatch) {
# re-encoding of $winbatch_content is done by write_winbatch()
$winbatch_content .= "if not exist \"$targetname\" mklink ";
$winbatch_content .= "/h " if ($opt_hardlink);
$winbatch_content .= "\"$targetname\" \"$realname\"\n";
} else {
# should be encoded in cp932 for win32 console
$realname = encode_utftocp($realname);
$targetname = encode_utftocp($targetname);
my $cmdl = "cmd.exe /c if not exist \"$targetname\" mklink ";
$cmdl .= "/h " if ($opt_hardlink);
$cmdl .= "\"$targetname\" \"$realname\"";
my @ret = `$cmdl`;
# sometimes hard link creation may fail due to "Access denied"
# (especially when $realname is located in c:/windows/fonts).
# TODO: what should we do to ensure resources, which might be
# different from $realname? -- HY (2017/03/21)
# -- one possibility:
# if (@ret) {
# @ret ="done";
# } else {
# print_info("Hard link creation for $realname failed. I will copy this file instead.\n");
# $cmdl = "cmd.exe /c if not exist \"$targetname\" copy \"$realname\" \"$targetname\"";
# @ret = `$cmdl`;
# }
# -- however, both tlgs (TeX Live) and standalone gswin32/64 (built
# by Akira Kakuto) can search in c:/windows/fonts by default.
# Thus, copying such files is waste of memory
}
} else {
symlink ($realname, $targetname);
}
}
# unlink function actually works also on windows, however,
# leave it to batch file for consistency. otherwise
# option $opt_force may not work as expected
sub maybe_unlink {
my ($targetname) = @_;
if (win32()) {
$targetname =~ s!/!\\!g;
if ($opt_winbatch) {
# re-encoding of $winbatch_content is done by write_winbatch()
$winbatch_content .= "if exist \"$targetname\" del \"$targetname\"\n";
} else {
# should be encoded in cp932 for win32 console
$targetname = encode_utftocp($targetname);
my $cmdl = "cmd.exe /c if exist \"$targetname\" del \"$targetname\"";
my @ret = `$cmdl`;
}
} else {
unlink ($targetname);
}
}
# write batch file (windows only)
sub write_winbatch {
return if $dry_run;
open(FOO, ">$winbatch") ||
die("cannot open $winbatch for writing: $!");
# $winbatch_content may contain multibyte characters, and they
# should be encoded in cp932 in batch file
$winbatch_content = encode_utftocp($winbatch_content);
print FOO "\@echo off\n",
"$winbatch_content",
"\@echo symlink ", ($opt_remove ? "removed\n" : "generated\n"),
"\@pause 1\n";
close(FOO);
}
# write to psnames-for-otfps
sub write_akotfps_datafile {
return if $dry_run;
make_dir("$opt_akotfps/$akotfps_pathpart",
"cannot create $akotfps_datafilename in it!");
open(FOO, ">$opt_akotfps/$akotfps_pathpart/$akotfps_datafilename") ||
die("cannot open $opt_akotfps/$akotfps_pathpart/$akotfps_datafilename for writing: $!");
print FOO "% psnames-for-otf
%
% PostSctipt names for OpenType fonts
%
% This file is used by a program ps2otfps
% in order to add needed information to a ps file
% created by the dvips
%
$akotfps_datacontent";
close(FOO);
}
#
# dump found files
sub info_found_fonts {
print "List of found fonts:\n\n";
for my $k (sort keys %fontdb) {
my @foundfiles;
if ($fontdb{$k}{'available'}) {
print "Font: $k\n";
print "Type: $fontdb{$k}{'type'}\n";
print "Class: $fontdb{$k}{'class'}\n";
my $fn = $fontdb{$k}{'target'};
# cp932 for win32 console
if (win32()) {
$fn = encode_utftocp($fn);
}
if ($fontdb{$k}{'type'} eq 'TTC' || $fontdb{$k}{'type'} eq 'OTC') {
$fn .= "($fontdb{$k}{'subfont'})";
}
print "File: $fn\n";
if ($fontdb{$k}{'type'} eq 'TTF') {
print "Link: $fontdb{$k}{'ttfname'}\n";
} elsif ($fontdb{$k}{'type'} eq 'TTC') {
print "Link: $fontdb{$k}{'ttcname'}\n";
} elsif ($fontdb{$k}{'type'} eq 'OTC') {
print "Link: $fontdb{$k}{'otcname'}\n";
}
my @ks = sort { $fontdb{$k}{'files'}{$a}{'priority'}
<=>
$fontdb{$k}{'files'}{$b}{'priority'} }
keys %{$fontdb{$k}{'files'}};
# remove the top element which is the winner and shown above
shift @ks;
if (@ks) {
print "Other candidates in decreasing order:\n";
for my $f (@ks) {
print " ", $fontdb{$k}{'files'}{$f}{'target'}, "\n";
}
}
print "\n";
}
}
}
#
# dump aliases
sub info_list_aliases {
print "List of ", ($opt_listallaliases ? "all" : "available"), " aliases and their options (in decreasing priority):\n" unless $opt_machine;
my (@jal, @kal, @tal, @sal);
for my $al (sort keys %aliases) {
my $cl;
my @ks = sort { $a <=> $b} keys(%{$aliases{$al}});
my $foo = '';
$foo = "$al:\n" unless $opt_machine;
for my $p (@ks) {
my $t = $aliases{$al}{$p};
my $fn = ($opt_listallaliases ? "-" : $fontdb{$t}{'target'} );
# cp932 for win32 console
if (win32()) {
$fn = encode_utftocp($fn);
}
# should always be the same ;-)
$cl = $fontdb{$t}{'class'};
if (!$opt_listallaliases && ($fontdb{$t}{'type'} eq 'TTC' || $fontdb{$t}{'type'} eq 'OTC')) {
$fn .= "($fontdb{$t}{'subfont'})";
}
if ($opt_machine) {
$foo .= "$al:$p:$aliases{$al}{$p}:$fn\n";
} else {
$foo .= "\t($p) $aliases{$al}{$p} ($fn)\n";
}
}
if ($cl eq 'Japan') {
push @jal, $foo;
} elsif ($cl eq 'Korea') {
push @kal, $foo;
} elsif ($cl eq 'GB') {
push @sal, $foo;
} elsif ($cl eq 'CNS') {
push @tal, $foo;
} else {
print STDERR "unknown class $cl for $al\n";
}
}
if ($opt_machine) {
print @jal if @jal;
print @kal if @kal;
print @sal if @sal;
print @tal if @tal;
} else {
print "Aliases for Japanese fonts:\n", @jal, "\n" if @jal;
print "Aliases for Korean fonts:\n", @kal, "\n" if @kal;
print "Aliases for Simplified Chinese fonts:\n", @sal, "\n" if @sal;
print "Aliases for Traditional Chinese fonts:\n", @tal, "\n" if @tal;
}
}
#
# make all fonts available for listing all aliases
sub make_all_available {
for my $k (keys %fontdb) {
$fontdb{$k}{'available'} = 1;
$fontdb{$k}{'type'} = 'OTF';
delete $fontdb{$k}{'files'} if (!$opt_cleanup);
}
}
#
# checks all file names listed in %fontdb
# and sets
sub check_for_files {
my @foundfiles;
if ($opt_filelist) {
open(FOO, "<", $opt_filelist) || die "Cannot open $opt_filelist: $!";
@foundfiles = <FOO>;
close(FOO) || warn "Cannot close $opt_filelist: $!";
} else {
# first collect all files:
my @fn;
for my $k (keys %fontdb) {
for my $f (keys %{$fontdb{$k}{'files'}}) {
# check for subfont extension
if ($f =~ m/^(.*)\(\d*\)$/) {
push @fn, $1;
} else {
push @fn, $f;
}
}
}
#
# collect extra directories for search
my @extradirs;
if (win32()) {
push @extradirs, "c:/windows/fonts//";
} else {
# other dirs to check, for normal unix?
for my $d (qw!/Library/Fonts /System/Library/Fonts /System/Library/Assets /Network/Library/Fonts /usr/share/fonts!) {
push @extradirs, "$d//" if (-d $d); # recursive search
}
# macosx specific; the path contains white space, so hack required
for my $d (qw!/Applications/Microsoft__Word.app /Applications/Microsoft__Excel.app /Applications/Microsoft__PowerPoint.app!) {
my $sd = $d;
$sd =~ s/__/ /;
push @extradirs, "$sd/Contents/Resources/Fonts/" if (-d "$sd/Contents/Resources/Fonts");
push @extradirs, "$sd/Contents/Resources/DFonts/" if (-d "$sd/Contents/Resources/DFonts");
}
my $home = $ENV{'HOME'};
push @extradirs, "$home/Library/Fonts//" if (-d "$home/Library/Fonts");
}
#
if (@extradirs) {
# TODO: we want that files in OSFONTDIR are found first, before
# links that we have created in TEXMFLOCAL
# Thus, instead of setting OSFONTDIR which is at the *END* of
# the kpsewhich variables OPENTYPEFONTS and TTFONTS, we'd like to
# put all these fonts at the front of them
#
# There are problems with case-insensitive file systems like HFS
# on MacOS, as we might catch different names (batang/Batang)
# and identify them wrongly.
# https://github.com/texjporg/cjk-gs-support/issues/9
# For now until we have dealt with that, do not set the
# two variables (HY 2016/09/27) and think about a different approach.
push @extradirs, $ENV{'OSFONTDIR'} if $ENV{'OSFONTDIR'};
if (@extradirs) {
# comment out -- HY (2016/09/27)
# my $newotf = join($sep, @extradirs) . $sep;
# my $newttf = $newotf;
# $newotf .= $ENV{'OPENTYPEFONTS'} if ($ENV{'OPENTYPEFONTS'});
# $newttf .= $ENV{'TTFONTS'} if ($ENV{'TTFONTS'});
# $ENV{'OPENTYPEFONTS'} = $newotf;
# $ENV{'TTFONTS'} = $newttf;
# new code for uppercase/lowercase workaround -- HY (2016/09/27)
my $extrafontdir = join($sep, @extradirs) . $sep;
$ENV{'OSFONTDIR'} = $extrafontdir;
}
}
# prepare for kpsewhich call, we need to do quoting
# we need as much candidate files as possible, so -all is needed
my $cmdl = 'kpsewhich -all ';
for my $f (@fn) {
$cmdl .= " \"$f\" ";
}
# shoot up kpsewhich
# this call (derived from the database) contains multibyte characters,
# and they should be encoded in cp932 for win32 console
if (win32()) {
$cmdl = encode_utftocp($cmdl);
}
print_ddebug("checking for $cmdl\n");
@foundfiles = `$cmdl`;
}
# at this point, on windows, @foundfiles is encoded in cp932
# which is suitable for the next few lines
chomp(@foundfiles);
print_ddebug("Found files @foundfiles\n");
# map basenames to filenames
my %bntofn;
for my $f (@foundfiles) {
my $realf = abs_path($f);
if (!$realf) {
print_warning("dead link or strange file found: $f - ignored!\n");
next;
}
if (win32()) {
# abs_path cannot read NTFS symlink/hardlink, and it serves as
# identity transformation.
# this might lead to dangling links for multiple runs of cjk-gs-integrate,
# when $opt_texmflink (in the previous run) is contained in the (current)
# kpsewhich search path.
# to avoid this, ignore targets which contain $otf_pathpart or $ttf_pathpart
my $temp_realfdir = "$realf";
$temp_realfdir =~ s!^(.*)/(.*)$!$1!;
next if ($temp_realfdir =~ $otf_pathpart || $temp_realfdir =~ $ttf_pathpart);
}
# decode now on windows! (cp932 -> internal utf-8)
if (win32()) {
$f = encode_cptoutf($f);
$realf = encode_cptoutf($realf);
}
my $bn = basename($f);
# kpsewhich -all might return multiple files with the same basename;
# choose the first one among them
$bntofn{$bn} = $realf if (!$bntofn{$bn});
}
# show the %fontdb before file check
if ($opt_debug > 0) {
print_debug("dumping font database before file check:\n");
print_debug(Data::Dumper::Dumper(\%fontdb));
}
if ($opt_debug > 1) {
print_ddebug("dumping basename to filename list:\n");
print_ddebug(Data::Dumper::Dumper(\%bntofn));
}
# update the %fontdb with the found files
for my $k (keys %fontdb) {
$fontdb{$k}{'available'} = 0;
for my $f (keys %{$fontdb{$k}{'files'}}) {
# check for subfont extension
my $realfile = $f;
$realfile =~ s/^(.*)\(\d*\)$/$1/;
if ($bntofn{$realfile}) {
# we found a representative, make it available
$fontdb{$k}{'files'}{$f}{'target'} = $bntofn{$realfile};
$fontdb{$k}{'available'} = 1;
} else {
# delete the entry for convenience
delete $fontdb{$k}{'files'}{$f};
}
}
}
# second round to determine the winner in case of more targets
for my $k (keys %fontdb) {
if ($fontdb{$k}{'available'}) {
my $mp = 1000000; my $mf;
for my $f (keys %{$fontdb{$k}{'files'}}) {
if ($fontdb{$k}{'files'}{$f}{'priority'} < $mp) {
$mp = $fontdb{$k}{'files'}{$f}{'priority'};
$mf = $f;
}
}
# extract subfont if necessary
my $sf = 0;
if ($mf =~ m/^(.*)\((\d*)\)$/) { $sf = $2; }
$fontdb{$k}{'target'} = $fontdb{$k}{'files'}{$mf}{'target'};
$fontdb{$k}{'type'} = $fontdb{$k}{'files'}{$mf}{'type'};
$fontdb{$k}{'subfont'} = $sf if ($fontdb{$k}{'type'} eq 'TTF' || $fontdb{$k}{'type'} eq 'TTC' || $fontdb{$k}{'type'} eq 'OTC');
}
# not needed anymore
# delete $fontdb{$k}{'files'};
}
if ($opt_debug > 0) {
print_debug("dumping font database:\n");
print_debug(Data::Dumper::Dumper(\%fontdb));
}
}
sub compute_aliases {
# go through fontdb to check for provides
# accumulate all provided fonts in @provides
for my $k (keys %fontdb) {
if ($fontdb{$k}{'available'}) {
for my $p (keys %{$fontdb{$k}{'provides'}}) {
# do not check alias if the real font is available in OTF/TTF/TTC format
if ($fontdb{$p}{'available'}) {
next if ($fontdb{$p}{'type'} ne 'OTC');
}
# use the priority as key
# if priorities are double, this will pick one at chance
if ($aliases{$p}{$fontdb{$k}{'provides'}{$p}}) {
print_warning("duplicate provide levels:\n");
print_warning(" current $p $fontdb{$k}{'provides'}{$p} $aliases{$p}{$fontdb{$k}{'provides'}{$p}}\n");
print_warning(" ignored $p $fontdb{$k}{'provides'}{$p} $k\n");
} else {
# if OTC font is caught, then skip it as Ghostscript doesn't support it (2016/12/12)
if ($fontdb{$k}{'type'} eq 'OTC') {
print_debug("Currently Ghostscript does not support OTC font,\n");
print_debug("not adding $fontdb{$k}{'otcname'} to alias candidates\n");
} else {
$aliases{$p}{$fontdb{$k}{'provides'}{$p}} = $k;
}
}
}
}
}
# check for user supplied aliases
for my $a (@opt_aliases) {
if ($a =~ m/^(.*)=(.*)$/) {
my $ll = $1;
my $rr = $2;
# check for consistency of user provided aliases:
# - ll must not be available
# - rr needs to be available as font or alias
# check whether $rr is available, either as real font or as alias
if ($fontdb{$ll}{'available'}) {
print_error("left side of alias spec is provided by a real font: $a\n");
print_error("stopping here\n");
exit(1);
}
if (!($fontdb{$rr}{'available'} || $aliases{$rr})) {
print_error("right side of alias spec is not available as real font or alias: $a\n");
print_error("stopping here\n");
exit(1);
}
$user_aliases{$ll} = $rr;
}
}
if ($opt_debug > 0) {
print_debug("dumping aliases:\n");
print_debug(Data::Dumper::Dumper(\%aliases));
}
}
# While the OTF link target is determined by the filename itself
# for TTF we can have ttc with several fonts.
# The following routine determines the link target by selecting
# the file name of the ttf candidates with the lowest priority
# as the link target name for TTF
sub determine_nonotf_link_name {
for my $k (keys %fontdb) {
my $ttfname = "";
my $ttcname = "";
my $otcname = "";
my $mpttf = 10000000;
my $mpttc = 10000000;
my $mpotc = 10000000;
for my $f (keys %{$fontdb{$k}{'files'}}) {
if ($fontdb{$k}{'files'}{$f}{'type'} eq 'TTF') {
my $p = $fontdb{$k}{'files'}{$f}{'priority'};
if ($p < $mpttf) {
$ttfname = $f;
$ttfname =~ s/^(.*)\(\d*\)$/$1/;
$mpttf = $p;
}
} elsif ($fontdb{$k}{'files'}{$f}{'type'} eq 'TTC') {
my $p = $fontdb{$k}{'files'}{$f}{'priority'};
if ($p < $mpttc) {
$ttcname = $f;
$ttcname =~ s/^(.*)\(\d*\)$/$1/;
$mpttc = $p;
}
} elsif ($fontdb{$k}{'files'}{$f}{'type'} eq 'OTC') {
my $p = $fontdb{$k}{'files'}{$f}{'priority'};
if ($p < $mpotc) {
$otcname = $f;
$otcname =~ s/^(.*)\(\d*\)$/$1/;
$mpotc = $p;
}
}
}
if ($ttfname) {
$fontdb{$k}{'ttfname'} = $ttfname;
}
if ($ttcname) {
$fontdb{$k}{'ttcname'} = $ttcname;
}
if ($otcname) {
$fontdb{$k}{'otcname'} = $otcname;
}
}
}
sub read_font_database {
my @dbl;
if ($opt_fontdef) {
open (FDB, "<$opt_fontdef") ||
die "Cannot find $opt_fontdef: $!";
@dbl = <FDB>;
close(FDB);
} else {
@dbl = <DATA>;
}
chomp(@dbl);
# add a "final empty line" to easy parsing
push @dbl, "";
if ($opt_dump_data) {
open(FOO, ">$dump_datafile") ||
die("cannot open $dump_datafile for writing: $!");
}
my $fontname = "";
my $fontclass = "";
my %fontprovides = ();
my %fontfiles;
my $psname = "";
my $lineno = 0;
for my $l (@dbl) {
if ($opt_dump_data) {
print FOO "$l\n";
next;
}
$lineno++;
next if ($l =~ m/^\s*#/);
if ($l =~ m/^\s*$/) {
if ($fontname || $fontclass || keys(%fontfiles)) {
if ($fontname && $fontclass && keys(%fontfiles)) {
my $realfontname = ($psname ? $psname : $fontname);
$fontdb{$realfontname}{'origname'} = $fontname;
$fontdb{$realfontname}{'class'} = $fontclass;
$fontdb{$realfontname}{'files'} = { %fontfiles };
$fontdb{$realfontname}{'provides'} = { %fontprovides };
if ($opt_debug > 1) {
print_ddebug("Dumping fontfiles for $realfontname: " . Data::Dumper::Dumper(\%fontfiles));
}
# reset to start
$fontname = $fontclass = $psname = "";
%fontfiles = ();
%fontprovides = ();
} else {
print_warning("incomplete entry above line $lineno for $fontname/$fontclass, skipping!\n");
# reset to start
$fontname = $fontclass = $psname = "";
%fontfiles = ();
%fontprovides = ();
}
} else {
# no term is set, so nothing to warn about
}
next;
}
if ($l =~ m/^Name:\s*(.*)$/) { $fontname = $1; next; }
if ($l =~ m/^PSName:\s*(.*)$/) { $psname = $1; next; }
if ($l =~ m/^Class:\s*(.*)$/) { $fontclass = $1 ; next ; }
# new code: distinguish 4 types (otf, otc, ttf, ttc)
if ($l =~ m/^OTFname(\((\d+)\))?:\s*(.*)$/) {
my $fn = $3;
$fontfiles{$fn}{'priority'} = ($2 ? $2 : 10);
# cp932 for win32 console
my $encoded_fn;
if (win32()) {
$encoded_fn = encode_utftocp($fn);
}
print_ddebug("filename: ", ($encoded_fn ? "$encoded_fn" : "$fn"), "\n");
print_ddebug("type: otf\n");
$fontfiles{$fn}{'type'} = 'OTF';
next;
}
if ($l =~ m/^OTCname(\((\d+)\))?:\s*(.*)$/) {
my $fn = $3;
$fontfiles{$fn}{'priority'} = ($2 ? $2 : 10);
# cp932 for win32 console
my $encoded_fn;
if (win32()) {
$encoded_fn = encode_utftocp($fn);
}
print_ddebug("filename: ", ($encoded_fn ? "$encoded_fn" : "$fn"), "\n");
print_ddebug("type: otc\n");
$fontfiles{$fn}{'type'} = 'OTC';
next;
}
if ($l =~ m/^TTFname(\((\d+)\))?:\s*(.*)$/) {
my $fn = $3;
$fontfiles{$fn}{'priority'} = ($2 ? $2 : 10);
# cp932 for win32 console
my $encoded_fn;
if (win32()) {
$encoded_fn = encode_utftocp($fn);
}
print_ddebug("filename: ", ($encoded_fn ? "$encoded_fn" : "$fn"), "\n");
print_ddebug("type: ttf\n");
$fontfiles{$fn}{'type'} = 'TTF';
next;
}
if ($l =~ m/^TTCname(\((\d+)\))?:\s*(.*)$/) {
my $fn = $3;
$fontfiles{$fn}{'priority'} = ($2 ? $2 : 10);
# cp932 for win32 console
my $encoded_fn;
if (win32()) {
$encoded_fn = encode_utftocp($fn);
}
print_ddebug("filename: ", ($encoded_fn ? "$encoded_fn" : "$fn"), "\n");
print_ddebug("type: ttc\n");
$fontfiles{$fn}{'type'} = 'TTC';
next;
}
# only for backward compatibility; guess type from the file extension
if ($l =~ m/^Filename(\((\d+)\))?:\s*(.*)$/) {
my $fn = $3;
$fontfiles{$fn}{'priority'} = ($2 ? $2 : 10);
# cp932 for win32 console
my $encoded_fn;
if (win32()) {
$encoded_fn = encode_utftocp($fn);
}
print_ddebug("filename: ", ($encoded_fn ? "$encoded_fn" : "$fn"), "\n");
if ($fn =~ m/\.otf$/i) {
print_ddebug("type: otf\n");
$fontfiles{$fn}{'type'} = 'OTF';
} elsif ($fn =~ m/\.otc(\(\d+\))?$/i) {
print_ddebug("type: otc\n");
$fontfiles{$fn}{'type'} = 'OTC';
} elsif ($fn =~ m/\.ttf$/i) {
print_ddebug("type: ttf\n");
$fontfiles{$fn}{'type'} = 'TTF';
} elsif ($fn =~ m/\.ttc(\(\d+\))?$/i) {
print_ddebug("type: ttc\n");
$fontfiles{$fn}{'type'} = 'TTC';
} else {
print_warning("cannot determine font type of $fn at line $lineno, skipping!\n");
delete $fontfiles{$fn};
}
next;
}
if ($l =~ m/^Provides\((\d+)\):\s*(.*)$/) { $fontprovides{$2} = $1; next; }
# we are still here??
print_error("Cannot parse this file at line $lineno, exiting. Strange line: >>>$l<<<\n");
exit (1);
}
if ($opt_dump_data) {
close(FOO);
}
}
sub find_gs_resource {
my $foundres = '';
if (win32()) {
# determine tlgs or native gs
chomp( my $foo = `kpsewhich -var-value=SELFAUTOPARENT`);
if ( -d "$foo/tlpkg/tlgs" ) {
# should be texlive with tlgs
$foundres = "$foo/tlpkg/tlgs/Resource";
# for TL2016, tlgs binary has built-in Resource,
# so we cannot set up CJK fonts correctly.
# the following test forces to exit in such case
if ( ! -d $foundres ) {
print_error("No Resource directory available for tlgs,\n");
print_error("we cannot support such gs, sorry.\n");
$foundres = '';
}
# change output location
$cidfmap_pathpart = "../lib/cidfmap";
$cidfmap_local_pathpart = "../lib/cidfmap.local";
$cidfmap_aliases_pathpart = "../lib/cidfmap.aliases";
} else {
# TODO: we assume gswin32c is in the path
# paths other than c:/gs/gs$gsver/Resource are not considered
chomp( my $gsver = `gswin32c --version 2>$nul` );
$foundres = "c:/gs/gs$gsver/Resource";
if ( ! -d $foundres ) {
$foundres = '';
}
}
} else {
# we assume that gs is in the path
chomp( my $gsver = `gs --version 2>$nul` );
if ($?) {
print_error("Cannot get gs version ...\n");
} else {
# trial 1: assume the relative path
# when /path/to/bin/gs is found, then there should be
# /path/to/share/ghostscript/$(gs --version)/Resource
print_debug("Finding gs resource by assuming relative path ...\n");
chomp( $foundres = `which gs` );
$foundres =~ s!/bin/gs$!/share/ghostscript/$gsver/Resource!;
if ( ! -d $foundres ) {
$foundres = '';
}
if (!$foundres) {
print_debug("Found gs but no resource, try another routine ...\n");
}
}
if (!$foundres) {
chomp( my @ret = `gs --help 2>$nul` );
if ($?) {
print_error("Cannot run gs --help ...\n");
} else {
# trial 2: parse gs help message
print_debug("Finding gs resource by parsing help message ...\n");
$foundres = '';
# try to find resource line
for (@ret) {
if (m!Resource/Font!) {
$foundres = $_;
# extract the first substring of non-space chars
# up to Resource/Font and drop the /Font part
$foundres =~ s!^.*\s(\S*Resource)/Font.*$!$1!;
last;
}
}
if (!$foundres) {
print_error("Found gs but no resource???\n");
}
}
}
}
return $foundres;
}
sub encode_utftocp {
my ($foo) = @_;
$foo = Encode::decode('utf-8', $foo);
$foo = Encode::encode('cp932', $foo);
return $foo;
}
sub encode_cptoutf {
my ($foo) = @_;
$foo = Encode::decode('cp932', $foo);
$foo = Encode::encode('utf-8', $foo);
return $foo;
}
sub version {
my $ret = sprintf "%s version %s\n", $prg, $version;
return $ret;
}
sub Usage {
my $headline = "Configuring Ghostscript for CJK CID/TTF fonts";
my $usage = "[perl] $prg\[.pl\] [OPTIONS]";
my $options = "
-o, --output DIR specifies the base output dir, if not provided,
the Resource directory of an installed Ghostscript
is searched and used.
-f, --fontdef FILE specify alternate set of font definitions, if not
given, the built-in set is used
-a, --alias LL=RR defines an alias, or overrides a given alias;
illegal if LL is provided by a real font, or
RR is neither available as real font or alias;
can be given multiple times
--filelist FILE read list of available font files from FILE
instead of searching with kpathsea
--link-texmf [DIR] link fonts into
DIR/$otf_pathpart
and
DIR/$ttf_pathpart
where DIR defaults to TEXMFLOCAL
--otfps [DIR] generate configuration file (psnames-for-otf) into
DIR/$akotfps_pathpart
which is used by ps2otfps (developed by Akira Kakuto),
instead of generating snippets
--force do not bail out if linked fonts already exist
--remove try to remove instead of create
--cleanup try to clean up all possible links/snippets and
cidfmap.local/cidfmap.aliases, which could have been
generated in the previous runs
-n, --dry-run do not actually output anything
-q, --quiet be less verbose
-d, --debug output debug information, can be given multiple times
-v, --version outputs only the version information
-h, --help this help
";
my $winonlyoptions = "
--hardlink create hardlinks instead of symlinks
--winbatch [FILE] prepare a batch file for link generation, instead of
generating links right away
the batch file name defaults to $winbatch
";
my $commandoptions = "
--dump-data [FILE] dump the built-in set of font definitions; you can
easily modify it, and tell me with -f (or --fontdef)
the data file name defaults to $dump_datafile
--only-aliases regenerate only cidfmap.aliases file, instead of all
--list-aliases lists the available aliases and their options, with the
selected option on top
--list-all-aliases list all possible aliases without searching for
actually present files
--list-fonts lists the fonts found on the system
--info combines the information of --list-aliases and
--list-fonts
--machine-readable output of --list-aliases is machine readable
";
my $shortdesc = "
This script searches a list of directories for CJK fonts, and makes
them available to an installed Ghostscript. In the simplest case with
sufficient privileges, a run without arguments should effect in a
complete setup of Ghostscript.
";
my $operation = "
For each found TrueType (TTF) font it creates a cidfmap entry in
<Resource>/Init/cidfmap.local
-- if you are using tlgs win32, tlpkg/tlgs/lib/cidfmap.local instead
and links the font to
<Resource>/CIDFSubst/
For each CID font it creates a snippet in
<Resource>/Font/
and links the font to
<Resource>/CIDFont/
The `<Resource>` dir is either given by `-o`/`--output`, or otherwise searched
from an installed Ghostscript (binary name is assumed to be 'gs' on unix,
'gswin32c' on win32).
Aliases are added to
<Resource>/Init/cidfmap.aliases
-- if you are using tlgs win32, tlpkg/tlgs/lib/cidfmap.aliases instead
Finally, it tries to add runlib calls to
<Resource>/Init/cidfmap
-- if you are using tlgs win32, tlpkg/tlgs/lib/cidfmap
to load the cidfmap.local and cidfmap.aliases.
";
my $dirsearch = '
Search is done using the kpathsea library, in particular using kpsewhich
program. By default the following directories are searched:
- all TEXMF trees
- `/Library/Fonts`, `/Library/Fonts/Microsoft`, `/System/Library/Fonts`,
`/System/Library/Assets`, `/Network/Library/Fonts`,
`~/Library/Fonts` and `/usr/share/fonts` (all if available)
- `/Applications/Microsoft Word.app/Contents/Resources/{Fonts,DFonts}`,
`/Applications/Microsoft Excel.app/Contents/Resources/{Fonts,DFonts}`,
`/Applications/Microsoft PowerPoint.app/Contents/Resources/{Fonts,DFonts}`
(all if available, meant for Office for Mac 2016)
- `c:/windows/fonts` (on Windows)
- the directories in `OSFONTDIR` environment variable
In case you want to add some directories to the search path, adapt the
`OSFONTDIR` environment variable accordingly: Example:
`````
OSFONTDIR="/usr/local/share/fonts/truetype//:/usr/local/share/fonts/opentype//" $prg
`````
will result in fonts found in the above two given directories to be
searched in addition.
';
my $outputfile = "
If no output option is given, the program searches for a Ghostscript
interpreter 'gs' and determines its Resource directory. This might
fail, in which case one need to pass the output directory manually.
Since the program adds files and link to this directory, sufficient
permissions are necessary.
";
my $aliases = "
Aliases are managed via the Provides values in the font database.
At the moment entries for the basic font names for CJK fonts
are added:
Japanese:
Ryumin-Light GothicBBB-Medium FutoMinA101-Bold FutoGoB101-Bold Jun101-Light
Korean:
HYSMyeongJo-Medium HYGoThic-Medium HYRGoThic-Medium
Simplified Chinese:
STSong-Light STSong-Regular STHeiti-Regular STHeiti-Light
STKaiti-Regular STFangsong-Light STFangsong-Regular
Traditional Chinese:
MSung-Light MSung-Medium MHei-Medium MKai-Medium
In addition, we also include provide entries for the OTF Morisawa names:
RyuminPro-Light GothicBBBPro-Medium FutoMinA101Pro-Bold
FutoGoB101Pro-Bold Jun101Pro-Light
The order is determined by the Provides setting in the font database,
and for the Japanese fonts it is currently:
Morisawa Pr6N, Morisawa, Hiragino ProN, Hiragino,
Kozuka Pr6N, Kozuka ProVI, Kozuka, Yu OSX, Yu Win,
MS, Moga-Mobo-ex, Moga-Mobo, IPAex, IPA, Ume
That is, the first font found in this order will be used to provide the
alias if necessary.
For the Korean fonts:
(Hanyang,) Adobe, Solaris-hanyang, MS, Unfonts, Baekmuk
For the Simplified Chinese:
Adobe, Fandol, Hiragino, Founder, MS, CJKUnifonts, Arphic, CJKUnifonts-ttf
For the Traditional Chinese:
Adobe, MS, CJKUnifonts, Arphic, CJKUnifonts-ttf
#### Overriding aliases ####
Using the command line option `--alias LL=RR` one can add arbitrary aliases,
or override ones selected by the program. For this to work the following
requirements of `LL` and `RR` must be fulfilled:
* `LL` is not provided by a real font
* `RR` is available either as real font, or as alias (indirect alias)
";
my $authors = "
The script and its documentation was written by Norbert Preining, based
on research and work by Yusuke Kuroki, Bruno Voisin, Hironobu Yamashita,
Munehiro Yamamoto and the TeX Q&A wiki page.
The script is licensed under GNU General Public License Version 3 or later.
The contained font data is not copyrightable.
";
if ($opt_markdown) {
print "$headline\n";
print ("=" x length($headline));
print "\n$shortdesc\nUsage\n-----\n\n`````\n$usage\n`````\n\n";
print "#### Options ####\n\n`````";
print_for_out($options, " ");
print "`````\n\n#### Windows only options ####\n\n`````";
print_for_out($winonlyoptions, " ");
print "`````\n\n#### Command like options ####\n\n`````";
print_for_out($commandoptions, " ");
print "`````\n\nOperation\n---------\n$operation\n";
print "How and which directories are searched\n";
print "--------------------------------------\n$dirsearch\n";
print "Output files\n";
print "------------\n$outputfile\n";
print "Aliases\n";
print "-------\n$aliases\n";
print "Authors, Contributors, and Copyright\n";
print "------------------------------------\n$authors\n";
} else {
print "\nUsage: $usage\n\n$headline\n$shortdesc";
print "\nOptions:\n";
print_for_out($options, " ");
if (win32()) {
print "\nWindows only options:\n";
print_for_out($winonlyoptions, " ");
}
print "\nCommand like options:\n";
print_for_out($commandoptions, " ");
print "\nOperation:\n";
print_for_out($operation, " ");
print "\nHow and which directories are searched:\n";
print_for_out($dirsearch, " ");
print "\nOutput files:\n";
print_for_out($outputfile, " ");
print "\nAliases:\n";
print_for_out($aliases, " ");
print "\nAuthors, Contributors, and Copyright:\n";
print_for_out($authors, " ");
print "\n";
}
exit 0;
}
sub print_for_out {
my ($what, $indent) = @_;
for (split /\n/, $what) {
next if m/`````/;
s/\s*####\s*//g;
if ($_ eq '') {
print "\n";
} else {
print "$indent$_\n";
}
}
}
# info/warning can be suppressed
# verbose/error cannot be suppressed
sub print_info {
print STDOUT "$prg: ", @_ if (!$opt_quiet);
}
sub print_verbose {
print STDOUT "$prg: ", @_;
}
sub print_warning {
print STDERR "$prg [WARNING]: ", @_ if (!$opt_quiet)
}
sub print_error {
print STDERR "$prg [ERROR]: ", @_;
}
sub print_debug {
print STDERR "$prg [DEBUG]: ", @_ if ($opt_debug >= 1);
}
sub print_ddebug {
print STDERR "$prg [DEBUG]: ", @_ if ($opt_debug >= 2);
}
__DATA__
#
# CJK FONT DEFINITIONS
#
#
# JAPANESE FONTS
#
# Morisawa
Name: A-OTF-RyuminPr6N-Light
PSName: RyuminPr6N-Light
Class: Japan
Provides(10): Ryumin-Light
Provides(10): RyuminPro-Light
Provides(10): HiraMinProN-W3
Provides(10): HiraMinPro-W3
OTFname: A-OTF-RyuminPr6N-Light.otf
Name: A-OTF-RyuminPro-Light
PSName: RyuminPro-Light
Class: Japan
Provides(20): Ryumin-Light
Provides(20): HiraMinPro-W3
OTFname: A-OTF-RyuminPro-Light.otf
Name: A-OTF-FutoMinA101Pr6N-Bold
PSName: FutoMinA101Pr6N-Bold
Class: Japan
Provides(10): FutoMinA101-Bold
Provides(10): FutoMinA101Pro-Bold
Provides(10): HiraMinProN-W6
Provides(10): HiraMinPro-W6
OTFname: A-OTF-FutoMinA101Pr6N-Bold.otf
Name: A-OTF-FutoMinA101Pro-Bold
PSName: FutoMinA101Pro-Bold
Class: Japan
Provides(20): FutoMinA101-Bold
Provides(20): HiraMinPro-W6
OTFname: A-OTF-FutoMinA101Pro-Bold.otf
Name: A-OTF-GothicBBBPr6N-Medium
PSName: GothicBBBPr6N-Medium
Class: Japan
Provides(10): GothicBBB-Medium
Provides(10): GothicBBBPro-Medium
Provides(10): HiraKakuProN-W3
Provides(10): HiraKakuPro-W3
OTFname: A-OTF-GothicBBBPr6N-Medium.otf
Name: A-OTF-GothicBBBPro-Medium
PSName: GothicBBBPro-Medium
Class: Japan
Provides(20): GothicBBB-Medium
Provides(20): HiraKakuPro-W3
OTFname: A-OTF-GothicBBBPro-Medium.otf
Name: A-OTF-FutoGoB101Pr6N-Bold
PSName: FutoGoB101Pr6N-Bold
Class: Japan
Provides(10): FutoGoB101-Bold
Provides(10): FutoGoB101Pro-Bold
Provides(10): HiraKakuProN-W6
Provides(10): HiraKakuPro-W6
OTFname: A-OTF-FutoGoB101Pr6N-Bold.otf
Name: A-OTF-FutoGoB101Pro-Bold
PSName: FutoGoB101Pro-Bold
Class: Japan
Provides(20): FutoGoB101-Bold
Provides(20): HiraKakuPro-W6
OTFname: A-OTF-FutoGoB101Pro-Bold.otf
Name: A-OTF-MidashiGoPr6N-MB31
PSName: MidashiGoPr6N-MB31
Class: Japan
Provides(10): MidashiGo-MB31
Provides(10): MidashiGoPro-MB31
Provides(10): HiraKakuStdN-W8
Provides(10): HiraKakuStd-W8
OTFname: A-OTF-MidashiGoPr6N-MB31.otf
Name: A-OTF-MidashiGoPro-MB31
PSName: MidashiGoPro-MB31
Class: Japan
Provides(20): MidashiGo-MB31
Provides(20): HiraKakuStd-W8
OTFname: A-OTF-MidashiGoPro-MB31.otf
# A-OTF-Jun101Pr6N-Light has been replaced by A-OTF-ShinMGoPr6N-Light
# in otf-(up-)morisawa-pr6n.map since jfontmaps 20140301.0
# now unnecessary, but reserved for backward compatibility
Name: A-OTF-Jun101Pr6N-Light
PSName: Jun101Pr6N-Light
Class: Japan
Provides(11): Jun101-Light
Provides(11): Jun101Pro-Light
Provides(11): HiraMaruProN-W4
Provides(11): HiraMaruPro-W4
OTFname: A-OTF-Jun101Pr6N-Light.otf
Name: A-OTF-Jun101Pro-Light
PSName: Jun101Pro-Light
Class: Japan
Provides(20): Jun101-Light
Provides(20): HiraMaruPro-W4
OTFname: A-OTF-Jun101Pro-Light.otf
Name: A-OTF-ShinMGoPr6N-Light
PSName: ShinMGoPr6N-Light
Class: Japan
Provides(10): Jun101-Light
Provides(10): Jun101Pro-Light
Provides(10): HiraMaruProN-W4
Provides(10): HiraMaruPro-W4
OTFname: A-OTF-ShinMGoPr6N-Light.otf
# Morisawa others (for moriprop);
# A-OTF-Jun101Pro-Light.otf and A-OTF-RyuminPro-Light.otf already added
Name: A-OTF-Jun201Pro-Regular
PSName: Jun201Pro-Regular
Class: Japan
Provides(20): Jun201-Regular
OTFname: A-OTF-Jun201Pro-Regular.otf
Name: A-OTF-Jun34Pro-Medium
PSName: Jun34Pro-Medium
Class: Japan
Provides(20): Jun34-Medium
OTFname: A-OTF-Jun34Pro-Medium.otf
Name: A-OTF-Jun501Pro-Bold
PSName: Jun501Pro-Bold
Class: Japan
Provides(20): Jun501-Bold
OTFname: A-OTF-Jun501Pro-Bold.otf
Name: A-OTF-RyuminPro-Regular
PSName: RyuminPro-Regular
Class: Japan
Provides(20): Ryumin-Regular
OTFname: A-OTF-RyuminPro-Regular.otf
Name: A-OTF-RyuminPro-Medium
PSName: RyuminPro-Medium
Class: Japan
Provides(20): Ryumin-Medium
OTFname: A-OTF-RyuminPro-Medium.otf
Name: A-OTF-RyuminPro-Bold
PSName: RyuminPro-Bold
Class: Japan
Provides(20): Ryumin-Bold
OTFname: A-OTF-RyuminPro-Bold.otf
Name: A-OTF-RyuminPro-Heavy
PSName: RyuminPro-Heavy
Class: Japan
Provides(20): Ryumin-Heavy
OTFname: A-OTF-RyuminPro-Heavy.otf
Name: A-OTF-RyuminPro-Ultra
PSName: RyuminPro-Ultra
Class: Japan
Provides(20): Ryumin-Ultra
OTFname: A-OTF-RyuminPro-Ultra.otf
Name: A-OTF-ShinGoPro-Light
PSName: ShinGoPro-Light
Class: Japan
Provides(20): ShinGo-Light
OTFname: A-OTF-ShinGoPro-Light.otf
Name: A-OTF-ShinGoPro-Regular
PSName: ShinGoPro-Regular
Class: Japan
Provides(20): ShinGo-Regular
OTFname: A-OTF-ShinGoPro-Regular.otf
Name: A-OTF-ShinGoPro-Medium
PSName: ShinGoPro-Medium
Class: Japan
Provides(20): ShinGo-Medium
OTFname: A-OTF-ShinGoPro-Medium.otf
Name: A-OTF-ShinGoPro-Bold
PSName: ShinGoPro-Bold
Class: Japan
Provides(20): ShinGo-Bold
OTFname: A-OTF-ShinGoPro-Bold.otf
Name: A-OTF-ShinGoPro-Heavy
PSName: ShinGoPro-Heavy
Class: Japan
Provides(20): ShinGo-Heavy
OTFname: A-OTF-ShinGoPro-Heavy.otf
Name: A-OTF-ShinGoPro-Ultra
PSName: ShinGoPro-Ultra
Class: Japan
Provides(20): ShinGo-Ultra
OTFname: A-OTF-ShinGoPro-Ultra.otf
# Hiragino (OS X)
# Note about Mac OS X:
# ヒラギノ角ゴ {Pro,ProN} {W3,W6}.otf
# ヒラギノ角ゴ {Std,StdN} W8.otf
# ヒラギノ丸ゴ {Pro,ProN} W4.otf
# ヒラギノ明朝 {Pro,ProN} {W3,W6}.otf
# are bundled with OS X 10.10.5 Yosemite or earlier versions.
# ヒラギノ角ゴシック {W0,...W9}.ttc
# ヒラギノ丸ゴ ProN W4.ttc
# ヒラギノ明朝 ProN {W3,W6}.ttc
# are bundled with OS X 10.11 El Capitan or later versions.
Name: HiraKakuPro-W3
Class: Japan
Provides(40): GothicBBB-Medium
Provides(40): GothicBBBPro-Medium
# the following two are *not* the same
# one is in decomposed form (for Mac), one is in composed form (for the rest)
OTFname(20): ヒラギノ角ゴ Pro W3.otf
OTFname(19): ヒラギノ角ゴ Pro W3.otf
OTFname(10): HiraKakuPro-W3.otf
OTCname(30): ヒラギノ角ゴシック W3.ttc(3)
OTCname(29): ヒラギノ角ゴシック W3.ttc(3)
OTCname(28): HiraginoSans-W3.ttc(3)
Name: HiraKakuPro-W6
Class: Japan
Provides(40): FutoGoB101-Bold
Provides(40): FutoGoB101Pro-Bold
OTFname(20): ヒラギノ角ゴ Pro W6.otf
OTFname(19): ヒラギノ角ゴ Pro W6.otf
OTFname(10): HiraKakuPro-W6.otf
OTCname(30): ヒラギノ角ゴシック W6.ttc(3)
OTCname(29): ヒラギノ角ゴシック W6.ttc(3)
OTCname(28): HiraginoSans-W6.ttc(3)
Name: HiraKakuProN-W3
Class: Japan
Provides(30): GothicBBB-Medium
Provides(30): GothicBBBPro-Medium
OTFname(20): ヒラギノ角ゴ ProN W3.otf
OTFname(19): ヒラギノ角ゴ ProN W3.otf
OTFname(10): HiraKakuProN-W3.otf
OTCname(30): ヒラギノ角ゴシック W3.ttc(2)
OTCname(29): ヒラギノ角ゴシック W3.ttc(2)
OTCname(28): HiraginoSans-W3.ttc(2)
Name: HiraKakuProN-W6
Class: Japan
Provides(30): FutoGoB101-Bold
Provides(30): FutoGoB101Pro-Bold
OTFname(20): ヒラギノ角ゴ ProN W6.otf
OTFname(19): ヒラギノ角ゴ ProN W6.otf
OTFname(10): HiraKakuProN-W6.otf
OTCname(30): ヒラギノ角ゴシック W6.ttc(2)
OTCname(29): ヒラギノ角ゴシック W6.ttc(2)
OTCname(28): HiraginoSans-W6.ttc(2)
Name: HiraKakuStd-W8
Class: Japan
Provides(40): MidashiGo-MB31
Provides(40): MidashiGoPro-MB31
OTFname(20): ヒラギノ角ゴ Std W8.otf
OTFname(19): ヒラギノ角ゴ Std W8.otf
OTFname(10): HiraKakuStd-W8.otf
OTCname(30): ヒラギノ角ゴシック W8.ttc(2)
OTCname(29): ヒラギノ角ゴシック W8.ttc(2)
OTCname(28): HiraginoSans-W8.ttc(2)
Name: HiraKakuStdN-W8
Class: Japan
Provides(30): MidashiGo-MB31
Provides(30): MidashiGoPro-MB31
OTFname(20): ヒラギノ角ゴ StdN W8.otf
OTFname(19): ヒラギノ角ゴ StdN W8.otf
OTFname(10): HiraKakuStdN-W8.otf
OTCname(30): ヒラギノ角ゴシック W8.ttc(3)
OTCname(29): ヒラギノ角ゴシック W8.ttc(3)
OTCname(28): HiraginoSans-W8.ttc(3)
Name: HiraginoSans-W0
Class: Japan
OTCname(30): ヒラギノ角ゴシック W0.ttc(0)
OTCname(29): ヒラギノ角ゴシック W0.ttc(0)
OTCname(28): HiraginoSans-W0.ttc(0)
Name: HiraginoSans-W1
Class: Japan
OTCname(30): ヒラギノ角ゴシック W1.ttc(0)
OTCname(29): ヒラギノ角ゴシック W1.ttc(0)
OTCname(28): HiraginoSans-W1.ttc(0)
Name: HiraginoSans-W2
Class: Japan
OTCname(30): ヒラギノ角ゴシック W2.ttc(0)
OTCname(29): ヒラギノ角ゴシック W2.ttc(0)
OTCname(28): HiraginoSans-W2.ttc(0)
Name: HiraginoSans-W3
Class: Japan
OTCname(30): ヒラギノ角ゴシック W3.ttc(0)
OTCname(29): ヒラギノ角ゴシック W3.ttc(0)
OTCname(28): HiraginoSans-W3.ttc(0)
Name: HiraginoSans-W4
Class: Japan
OTCname(30): ヒラギノ角ゴシック W4.ttc(0)
OTCname(29): ヒラギノ角ゴシック W4.ttc(0)
OTCname(28): HiraginoSans-W4.ttc(0)
Name: HiraginoSans-W5
Class: Japan
OTCname(30): ヒラギノ角ゴシック W5.ttc(0)
OTCname(29): ヒラギノ角ゴシック W5.ttc(0)
OTCname(28): HiraginoSans-W5.ttc(0)
Name: HiraginoSans-W6
Class: Japan
OTCname(30): ヒラギノ角ゴシック W6.ttc(0)
OTCname(29): ヒラギノ角ゴシック W6.ttc(0)
OTCname(28): HiraginoSans-W6.ttc(0)
Name: HiraginoSans-W7
Class: Japan
OTCname(30): ヒラギノ角ゴシック W7.ttc(0)
OTCname(29): ヒラギノ角ゴシック W7.ttc(0)
OTCname(28): HiraginoSans-W7.ttc(0)
Name: HiraginoSans-W8
Class: Japan
OTCname(30): ヒラギノ角ゴシック W8.ttc(0)
OTCname(29): ヒラギノ角ゴシック W8.ttc(0)
OTCname(28): HiraginoSans-W8.ttc(0)
Name: HiraginoSans-W9
Class: Japan
OTCname(30): ヒラギノ角ゴシック W9.ttc(0)
OTCname(29): ヒラギノ角ゴシック W9.ttc(0)
OTCname(28): HiraginoSans-W9.ttc(0)
Name: HiraMaruPro-W4
Class: Japan
Provides(40): Jun101-Light
Provides(40): Jun101Pro-Light
OTFname(20): ヒラギノ丸ゴ Pro W4.otf
OTFname(19): ヒラギノ丸ゴ Pro W4.otf
OTFname(10): HiraMaruPro-W4.otf
OTCname(30): ヒラギノ丸ゴ ProN W4.ttc(0)
OTCname(29): ヒラギノ丸ゴ ProN W4.ttc(0)
OTCname(28): HiraginoSansR-W4.ttc(0)
Name: HiraMaruProN-W4
Class: Japan
Provides(30): Jun101-Light
Provides(30): Jun101Pro-Light
OTFname(20): ヒラギノ丸ゴ ProN W4.otf
OTFname(19): ヒラギノ丸ゴ ProN W4.otf
OTFname(10): HiraMaruProN-W4.otf
OTCname(30): ヒラギノ丸ゴ ProN W4.ttc(1)
OTCname(29): ヒラギノ丸ゴ ProN W4.ttc(1)
OTCname(28): HiraginoSansR-W4.ttc(1)
Name: HiraMinPro-W3
Class: Japan
Provides(40): Ryumin-Light
Provides(40): RyuminPro-Light
OTFname(20): ヒラギノ明朝 Pro W3.otf
OTFname(19): ヒラギノ明朝 Pro W3.otf
OTFname(10): HiraMinPro-W3.otf
OTCname(30): ヒラギノ明朝 ProN W3.ttc(1)
OTCname(29): ヒラギノ明朝 ProN W3.ttc(1)
OTCname(28): HiraginoSerif-W3.ttc(1)
Name: HiraMinPro-W6
Class: Japan
Provides(40): FutoMinA101-Bold
Provides(40): FutoMinA101Pro-Bold
OTFname(20): ヒラギノ明朝 Pro W6.otf
OTFname(19): ヒラギノ明朝 Pro W6.otf
OTFname(10): HiraMinPro-W6.otf
OTCname(30): ヒラギノ明朝 ProN W6.ttc(1)
OTCname(29): ヒラギノ明朝 ProN W6.ttc(1)
OTCname(28): HiraginoSerif-W6.ttc(1)
Name: HiraMinProN-W3
Class: Japan
Provides(30): Ryumin-Light
Provides(30): RyuminPro-Light
OTFname(20): ヒラギノ明朝 ProN W3.otf
OTFname(19): ヒラギノ明朝 ProN W3.otf
OTFname(10): HiraMinProN-W3.otf
OTCname(30): ヒラギノ明朝 ProN W3.ttc(0)
OTCname(29): ヒラギノ明朝 ProN W3.ttc(0)
OTCname(28): HiraginoSerif-W3.ttc(0)
Name: HiraMinProN-W6
Class: Japan
Provides(30): FutoMinA101-Bold
Provides(30): FutoMinA101Pro-Bold
OTFname(20): ヒラギノ明朝 ProN W6.otf
OTFname(19): ヒラギノ明朝 ProN W6.otf
OTFname(10): HiraMinProN-W6.otf
OTCname(30): ヒラギノ明朝 ProN W6.ttc(0)
OTCname(29): ヒラギノ明朝 ProN W6.ttc(0)
OTCname(28): HiraginoSerif-W6.ttc(0)
# Following Hiragino fonts are not bundled with OS X,
# but used in ptex-fontmaps
Name: HiraMinPro-W2
Class: Japan
OTFname(20): ヒラギノ明朝 Pro W2.otf
OTFname(19): ヒラギノ明朝 Pro W2.otf
OTFname(10): HiraMinPro-W2.otf
Name: HiraMinProN-W2
Class: Japan
OTFname(20): ヒラギノ明朝 ProN W2.otf
OTFname(19): ヒラギノ明朝 ProN W2.otf
OTFname(10): HiraMinProN-W2.otf
# Yu-fonts MacOS version
# Note about Mac OS X:
# Yu Gothic Medium.otf
# Yu Gothic Bold.otf
# are bundled with OS X 10.9 Mavericks or later versions.
# Yu Mincho Medium.otf
# Yu Mincho Demibold.otf
# are bundled with OS X 10.9 Mavericks -- 10.10.5 Yosemite.
# YuMincho.ttc
# index 0: YuMin-Medium
# index 1: YuMin-Demibold
# index 2: YuMin_36pKn-Medium
# index 3: YuMin_36pKn-Demibold
# is bundled with OS X 10.11 -- 10.11.6 El Capitan.
# YuMincho.ttc
# index 0: YuMin-Medium
# index 1: YuMin-Demibold
# index 2: YuMin-Extrabold
# index 3: YuMin_36pKn-Medium
# index 4: YuMin_36pKn-Demibold
# index 5: YuMin_36pKn-Extrabold
# is bundled with macOS 10.12.0 Sierra or later versions.
Name: YuGo-Medium
Class: Japan
Provides(80): GothicBBB-Medium
Provides(80): GothicBBBPro-Medium
OTFname(20): Yu Gothic Medium.otf
OTFname(10): YuGo-Medium.otf
Name: YuGo-Bold
Class: Japan
Provides(80): FutoGoB101-Bold
Provides(80): FutoGoB101Pro-Bold
Provides(80): Jun101-Light
Provides(80): Jun101Pro-Light
Provides(80): MidashiGo-MB31
Provides(80): MidashiGoPro-MB31
OTFname(20): Yu Gothic Bold.otf
OTFname(10): YuGo-Bold.otf
Name: YuMin-Medium
Class: Japan
Provides(80): Ryumin-Light
Provides(80): RyuminPro-Light
OTFname(20): Yu Mincho Medium.otf
OTFname(10): YuMin-Medium.otf
OTCname(30): YuMincho.ttc(0)
Name: YuMin-Demibold
Class: Japan
Provides(80): FutoMinA101-Bold
Provides(80): FutoMinA101Pro-Bold
OTFname(20): Yu Mincho Demibold.otf
OTFname(10): YuMin-Demibold.otf
OTCname(30): YuMincho.ttc(1)
# Following four entries are for macOS 10.12 Sierra
# The index for OS X 10.11.x El Capitan is different!
Name: YuMin-Extrabold
Class: Japan
OTCname(30): YuMincho.ttc(2)
Name: YuMin_36pKn-Medium
Class: Japan
OTCname(30): YuMincho.ttc(3)
Name: YuMin_36pKn-Demibold
Class: Japan
OTCname(30): YuMincho.ttc(4)
Name: YuMin_36pKn-Extrabold
Class: Japan
OTCname(30): YuMincho.ttc(5)
# Yu-fonts Windows version
# Note about Windows:
# yugothi{b,c,l}.ttf
# yumin.ttf, yumin{db,l}.ttf
# are bundled with Windows 8.1.
# YuGoth{B,L,M,R}.ttc
# yumin.ttf, yumin{db,l}.ttf
# are bundled with Windows 10.
# YUGOTH{B,L,M,R}.TTC
# YUMIN.TTF, YUMIN{DB,L}.TTF
# are bundled with Yu Font Pack for MSOffice 2010/2013.
# YuGothic.ttf
# YuGothic-Bold.ttf
# are bundled with VS2013 or later versions.
# YuGoth{B,L,M,R}.ttf
# yumin.ttf, yumin{db,l}.ttf
# are bundled with Office for Mac 2016.
# In the following database, Yu Font Pack entries do not appear
# as separate lines, but they are implied by Windows 10 entries
# since win32 is case-insensitive.
# Currently we don't add VS2013 YuGothic.ttf (YuGothic) and
# YuGothic-Bold.ttf (YuGothic-Bold) on purpose, because these files
# are smaller than Windows 8.1 yugothic.ttf and yugothib.ttf
Name: YuMincho-Regular
Class: Japan
Provides(90): Ryumin-Light
Provides(90): RyuminPro-Light
Provides(90): HiraMinProN-W3
Provides(90): HiraMinPro-W3
TTFname(20): yumin.ttf
#TTFname(50): YuMincho-Regular.ttf # never existed
Name: YuMincho-Light
Class: Japan
TTFname(20): yuminl.ttf
#TTFname(50): YuMincho-Light.ttf # never existed
Name: YuMincho-DemiBold
Class: Japan
Provides(90): FutoMinA101-Bold
Provides(90): FutoMinA101Pro-Bold
Provides(90): HiraMinProN-W6
Provides(90): HiraMinPro-W6
TTFname(20): yumindb.ttf
#TTFname(50): YuMincho-DemiBold.ttf # never existed
Name: YuGothic-Regular
Class: Japan
Provides(90): GothicBBB-Medium
Provides(90): GothicBBBPro-Medium
Provides(90): HiraKakuProN-W3
Provides(90): HiraKakuPro-W3
TTFname(25): yugothic.ttf
TTCname(20): YuGothR.ttc(0)
TTFname(40): YuGothR.ttf
#TTFname(50): YuGothic-Regular.ttf # never existed
Name: YuGothic-Medium
Class: Japan
TTCname(20): YuGothM.ttc(0)
TTFname(40): YuGothM.ttf
Name: YuGothic-Light
Class: Japan
TTFname(25): yugothil.ttf
TTCname(20): YuGothL.ttc(0)
TTFname(40): YuGothL.ttf
#TTFname(50): YuGothic-Light.ttf # never existed
Name: YuGothic-Bold
Class: Japan
Provides(90): FutoGoB101-Bold
Provides(90): FutoGoB101Pro-Bold
Provides(90): HiraKakuProN-W6
Provides(90): HiraKakuPro-W6
Provides(90): Jun101-Light
Provides(90): Jun101Pro-Light
Provides(90): HiraMaruProN-W4
Provides(90): HiraMaruPro-W4
Provides(90): MidashiGo-MB31
Provides(90): MidashiGoPro-MB31
Provides(90): HiraKakuStdN-W8
Provides(90): HiraKakuStd-W8
TTFname(25): yugothib.ttf
TTCname(20): YuGothB.ttc(0)
TTFname(40): YuGothB.ttf
#TTFname(50): YuGothic-Bold.ttf
# Yu-UI-fonts (Windows only)
Name: YuGothicUI-Semilight
Class: Japan
TTCname(20): YuGothR.ttc(1)
Name: YuGothicUI-Regular
Class: Japan
TTCname(20): YuGothM.ttc(1)
Name: YuGothicUI-Light
Class: Japan
TTCname(20): YuGothL.ttc(1)
Name: YuGothicUI-Bold
Class: Japan
TTCname(20): YuGothB.ttc(1)
Name: YuGothicUI-Semibold
Class: Japan
TTCname(20): YuGothB.ttc(2)
# IPA (free)
Name: IPAMincho
Class: Japan
Provides(130): Ryumin-Light
Provides(130): RyuminPro-Light
Provides(130): HiraMinProN-W3
Provides(130): HiraMinPro-W3
Provides(130): FutoMinA101-Bold
Provides(130): FutoMinA101Pro-Bold
Provides(130): HiraMinProN-W6
Provides(130): HiraMinPro-W6
TTFname(20): ipam.ttf
#TTFname(21): IPAMincho.ttf
Name: IPAGothic
Class: Japan
Provides(130): GothicBBB-Medium
Provides(130): GothicBBBPro-Medium
Provides(130): HiraKakuProN-W3
Provides(130): HiraKakuPro-W3
Provides(130): FutoGoB101-Bold
Provides(130): FutoGoB101Pro-Bold
Provides(130): HiraKakuProN-W6
Provides(130): HiraKakuPro-W6
Provides(130): Jun101-Light
Provides(130): Jun101Pro-Light
Provides(130): HiraMaruProN-W4
Provides(130): HiraMaruPro-W4
Provides(130): MidashiGo-MB31
Provides(130): MidashiGoPro-MB31
Provides(130): HiraKakuStdN-W8
Provides(130): HiraKakuStd-W8
TTFname(20): ipag.ttf
#TTFname(21): IPAGothic.ttf
Name: IPAexMincho
Class: Japan
Provides(120): Ryumin-Light
Provides(120): RyuminPro-Light
Provides(120): HiraMinProN-W3
Provides(120): HiraMinPro-W3
Provides(120): FutoMinA101-Bold
Provides(120): FutoMinA101Pro-Bold
Provides(120): HiraMinProN-W6
Provides(120): HiraMinPro-W6
TTFname(20): ipaexm.ttf
#TTFname(21): IPAexMincho.ttf
Name: IPAexGothic
Class: Japan
Provides(120): GothicBBB-Medium
Provides(120): GothicBBBPro-Medium
Provides(120): HiraKakuProN-W3
Provides(120): HiraKakuPro-W3
Provides(120): FutoGoB101-Bold
Provides(120): FutoGoB101Pro-Bold
Provides(120): HiraKakuProN-W6
Provides(120): HiraKakuPro-W6
Provides(120): Jun101-Light
Provides(120): Jun101Pro-Light
Provides(120): HiraMaruProN-W4
Provides(120): HiraMaruPro-W4
Provides(120): MidashiGo-MB31
Provides(120): MidashiGoPro-MB31
Provides(120): HiraKakuStdN-W8
Provides(120): HiraKakuStd-W8
TTFname(20): ipaexg.ttf
#TTFname(21): IPAexGothic.ttf
# IPA proportional (free)
Name: IPAPMincho
Class: Japan
TTFname(20): ipamp.ttf
#TTFname(21): IPAPMincho.ttf
Name: IPAPGothic
Class: Japan
TTFname(20): ipagp.ttf
#TTFname(21): IPAPGothic.ttf
# Moga-Mobo from Y.Oz Vox (free)
Name: MogaMincho-Regular
Class: Japan
Provides(110): Ryumin-Light
Provides(110): RyuminPro-Light
Provides(110): HiraMinProN-W3
Provides(110): HiraMinPro-W3
TTCname: mogam.ttc(0)
Name: MogaExMincho-Regular
Class: Japan
Provides(100): Ryumin-Light
Provides(100): RyuminPro-Light
Provides(100): HiraMinProN-W3
Provides(100): HiraMinPro-W3
TTCname: mogam.ttc(1)
Name: MogaExMincho-Italic
Class: Japan
TTCname: mogam.ttc(2)
Name: Moga90Mincho-Regular
Class: Japan
TTCname: mogam.ttc(3)
Name: MogaEx90Mincho-Regular
Class: Japan
TTCname: mogam.ttc(4)
Name: MogaEx90Mincho-Italic
Class: Japan
TTCname: mogam.ttc(5)
Name: MogaMincho-Bold
Class: Japan
Provides(110): FutoMinA101-Bold
Provides(110): FutoMinA101Pro-Bold
Provides(110): HiraMinProN-W6
Provides(110): HiraMinPro-W6
TTCname: mogamb.ttc(0)
Name: MogaExMincho-Bold
Class: Japan
Provides(100): FutoMinA101-Bold
Provides(100): FutoMinA101Pro-Bold
Provides(100): HiraMinProN-W6
Provides(100): HiraMinPro-W6
TTCname: mogamb.ttc(1)
Name: Moga90Mincho-Bold
Class: Japan
TTCname: mogamb.ttc(2)
Name: MogaEx90Mincho-Bold
Class: Japan
TTCname: mogamb.ttc(3)
Name: MogaHMincho-Regular
Class: Japan
TTCname: mogahm.ttc(0)
Name: MogaExHMincho-Regular
Class: Japan
TTCname: mogahm.ttc(1)
Name: MogaExHMincho-Italic
Class: Japan
TTCname: mogahm.ttc(2)
Name: Moga90HMincho-Regular
Class: Japan
TTCname: mogahm.ttc(3)
Name: MogaEx90HMincho-Regular
Class: Japan
TTCname: mogahm.ttc(4)
Name: MogaEx90HMincho-Italic
Class: Japan
TTCname: mogahm.ttc(5)
Name: MogaHMincho-Bold
Class: Japan
TTCname: mogahmb.ttc(0)
Name: MogaExHMincho-Bold
Class: Japan
TTCname: mogahmb.ttc(1)
Name: Moga90HMincho-Bold
Class: Japan
TTCname: mogahmb.ttc(2)
Name: MogaEx90HMincho-Bold
Class: Japan
TTCname: mogahmb.ttc(3)
Name: MogaGothic-Regular
Class: Japan
Provides(110): GothicBBB-Medium
Provides(110): GothicBBBPro-Medium
Provides(110): HiraKakuProN-W3
Provides(110): HiraKakuPro-W3
TTCname: mogag.ttc(0)
Name: MogaExGothic-Regular
Class: Japan
Provides(100): GothicBBB-Medium
Provides(100): GothicBBBPro-Medium
Provides(100): HiraKakuProN-W3
Provides(100): HiraKakuPro-W3
TTCname: mogag.ttc(1)
Name: Moga90Gothic-Regular
Class: Japan
TTCname: mogag.ttc(2)
Name: MogaEx90Gothic-Regular
Class: Japan
TTCname: mogag.ttc(3)
Name: MogaGothic-Bold
Class: Japan
Provides(110): FutoGoB101-Bold
Provides(110): FutoGoB101Pro-Bold
Provides(110): HiraKakuProN-W6
Provides(110): HiraKakuPro-W6
Provides(110): MidashiGo-MB31
Provides(110): MidashiGoPro-MB31
Provides(110): HiraKakuStdN-W8
Provides(110): HiraKakuStd-W8
TTCname: mogagb.ttc(0)
Name: MogaExGothic-Bold
Class: Japan
Provides(100): FutoGoB101-Bold
Provides(100): FutoGoB101Pro-Bold
Provides(100): HiraKakuProN-W6
Provides(100): HiraKakuPro-W6
Provides(100): MidashiGo-MB31
Provides(100): MidashiGoPro-MB31
Provides(100): HiraKakuStdN-W8
Provides(100): HiraKakuStd-W8
TTCname: mogagb.ttc(1)
Name: Moga90Gothic-Bold
Class: Japan
TTCname: mogagb.ttc(2)
Name: MogaEx90Gothic-Bold
Class: Japan
TTCname: mogagb.ttc(3)
Name: MoboGothic-Regular
Class: Japan
Provides(110): Jun101-Light
Provides(110): Jun101Pro-Light
Provides(110): HiraMaruProN-W4
Provides(110): HiraMaruPro-W4
TTCname: mobog.ttc(0)
Name: MoboExGothic-Regular
Class: Japan
Provides(100): Jun101-Light
Provides(100): Jun101Pro-Light
Provides(100): HiraMaruProN-W4
Provides(100): HiraMaruPro-W4
TTCname: mobog.ttc(1)
Name: Mobo90Gothic-Regular
Class: Japan
TTCname: mobog.ttc(2)
Name: MoboEx90Gothic-Regular
Class: Japan
TTCname: mobog.ttc(3)
Name: MoboGothic-Bold
Class: Japan
TTCname: mobogb.ttc(0)
Name: MoboExGothic-Bold
Class: Japan
TTCname: mobogb.ttc(1)
Name: Mobo90Gothic-Bold
Class: Japan
TTCname: mobogb.ttc(2)
Name: MoboEx90Gothic-Bold
Class: Japan
TTCname: mobogb.ttc(3)
# Ume-font (free)
# note: in the current release (2016-09-03 umefont_660.7z),
# ume-tms.ttf and ume-pms.ttf ("studybook" family) share the same PSName
# as ume-tmo.ttf and ume-pmo.ttf; we don't add these database
# intentionally -- HY (2017/01/17)
Name: Ume-Mincho
Class: Japan
Provides(140): Ryumin-Light
Provides(140): RyuminPro-Light
Provides(140): HiraMinProN-W3
Provides(140): HiraMinPro-W3
Provides(140): FutoMinA101-Bold
Provides(140): FutoMinA101Pro-Bold
Provides(140): HiraMinProN-W6
Provides(140): HiraMinPro-W6
TTFname(10): ume-tmo3.ttf
#TTFname(11): ume-tms3.ttf
Name: Ume-Gothic
Class: Japan
Provides(140): GothicBBB-Medium
Provides(140): GothicBBBPro-Medium
Provides(140): HiraKakuProN-W3
Provides(140): HiraKakuPro-W3
Provides(140): FutoGoB101-Bold
Provides(140): FutoGoB101Pro-Bold
Provides(140): HiraKakuProN-W6
Provides(140): HiraKakuPro-W6
Provides(140): Jun101-Light
Provides(140): Jun101Pro-Light
Provides(140): HiraMaruProN-W4
Provides(140): HiraMaruPro-W4
Provides(140): MidashiGo-MB31
Provides(140): MidashiGoPro-MB31
Provides(140): HiraKakuStdN-W8
Provides(140): HiraKakuStd-W8
TTFname(10): ume-tgo4.ttf
Name: Ume-Gothic-O5
Class: Japan
TTFname(10): ume-tgo5.ttf
Name: Ume-Gothic-C4
Class: Japan
TTFname(10): ume-tgc4.ttf
Name: Ume-Gothic-C5
Class: Japan
TTFname(10): ume-tgc5.ttf
Name: Ume-Gothic-S4
Class: Japan
TTFname(10): ume-tgs4.ttf
Name: Ume-Gothic-S5
Class: Japan
TTFname(10): ume-tgs5.ttf
Name: Ume-P-Mincho
Class: Japan
TTFname(10): ume-pmo3.ttf
#TTFname(11): ume-pms3.ttf
Name: Ume-P-Gothic
Class: Japan
TTFname(10): ume-pgo4.ttf
Name: Ume-P-Gothic-O5
Class: Japan
TTFname(10): ume-pgo5.ttf
Name: Ume-P-Gothic-C4
Class: Japan
TTFname(10): ume-pgc4.ttf
Name: Ume-P-Gothic-C5
Class: Japan
TTFname(10): ume-pgc5.ttf
Name: Ume-P-Gothic-S4
Class: Japan
TTFname(10): ume-pgs4.ttf
Name: Ume-P-Gothic-S5
Class: Japan
TTFname(10): ume-pgs5.ttf
Name: Ume-UI-Gothic
Class: Japan
TTFname(10): ume-ugo4.ttf
Name: Ume-UI-Gothic-O5
Class: Japan
TTFname(10): ume-ugo5.ttf
Name: Ume-Hy-Gothic
Class: Japan
TTFname(10): ume-hgo4.ttf
# Sazanami (free)
Name: Sazanami-Mincho-Regular
Class: Japan
TTFname: sazanami-mincho.ttf
Name: Sazanami-Gothic-Regular
Class: Japan
TTFname: sazanami-gothic.ttf
# Osaka (Apple)
Name: Osaka
Class: Japan
TTFname: Osaka.ttf
Name: Osaka-Mono
Class: Japan
TTFname: OsakaMono.ttf
# Kozuka (Adobe)
Name: KozGoPr6N-Bold
Class: Japan
Provides(50): FutoGoB101-Bold
Provides(50): FutoGoB101Pro-Bold
Provides(50): HiraKakuProN-W6
Provides(50): HiraKakuPro-W6
OTFname: KozGoPr6N-Bold.otf
Name: KozGoPr6N-Heavy
Class: Japan
Provides(50): Jun101-Light
Provides(50): Jun101Pro-Light
Provides(50): HiraMaruProN-W4
Provides(50): HiraMaruPro-W4
Provides(50): MidashiGo-MB31
Provides(50): MidashiGoPro-MB31
Provides(50): HiraKakuStdN-W8
Provides(50): HiraKakuStd-W8
OTFname: KozGoPr6N-Heavy.otf
Name: KozGoPr6N-Medium
Class: Japan
Provides(50): GothicBBB-Medium
Provides(50): GothicBBBPro-Medium
Provides(50): HiraKakuProN-W3
Provides(50): HiraKakuPro-W3
OTFname: KozGoPr6N-Medium.otf
Name: KozGoPr6N-Regular
Class: Japan
OTFname: KozGoPr6N-Regular.otf
Name: KozGoPr6N-ExtraLight
Class: Japan
OTFname: KozGoPr6N-ExtraLight.otf
Name: KozGoPr6N-Light
Class: Japan
OTFname: KozGoPr6N-Light.otf
Name: KozGoPro-Bold
Class: Japan
Provides(70): FutoGoB101-Bold
Provides(70): FutoGoB101Pro-Bold
Provides(70): HiraKakuProN-W6
Provides(70): HiraKakuPro-W6
OTFname: KozGoPro-Bold.otf
Name: KozGoPro-Heavy
Class: Japan
Provides(70): Jun101-Light
Provides(70): Jun101Pro-Light
Provides(70): HiraMaruProN-W4
Provides(70): HiraMaruPro-W4
Provides(70): MidashiGo-MB31
Provides(70): MidashiGoPro-MB31
Provides(70): HiraKakuStdN-W8
Provides(70): HiraKakuStd-W8
OTFname: KozGoPro-Heavy.otf
Name: KozGoPro-Medium
Class: Japan
Provides(70): GothicBBB-Medium
Provides(70): GothicBBBPro-Medium
Provides(70): HiraKakuProN-W3
Provides(70): HiraKakuPro-W3
OTFname: KozGoPro-Medium.otf
Name: KozGoPro-Regular
Class: Japan
OTFname: KozGoPro-Regular.otf
Name: KozGoPro-ExtraLight
Class: Japan
OTFname: KozGoPro-ExtraLight.otf
Name: KozGoPro-Light
Class: Japan
OTFname: KozGoPro-Light.otf
Name: KozGoProVI-Bold
Class: Japan
Provides(60): FutoGoB101-Bold
Provides(60): FutoGoB101Pro-Bold
Provides(60): HiraKakuProN-W6
Provides(60): HiraKakuPro-W6
OTFname: KozGoProVI-Bold.otf
Name: KozGoProVI-Heavy
Class: Japan
Provides(60): Jun101-Light
Provides(60): Jun101Pro-Light
Provides(60): HiraMaruProN-W4
Provides(60): HiraMaruPro-W4
Provides(60): MidashiGo-MB31
Provides(60): MidashiGoPro-MB31
Provides(60): HiraKakuStdN-W8
Provides(60): HiraKakuStd-W8
OTFname: KozGoProVI-Heavy.otf
Name: KozGoProVI-Medium
Class: Japan
Provides(60): GothicBBB-Medium
Provides(60): GothicBBBPro-Medium
Provides(60): HiraKakuProN-W3
Provides(60): HiraKakuPro-W3
OTFname: KozGoProVI-Medium.otf
Name: KozGoProVI-Regular
Class: Japan
OTFname: KozGoProVI-Regular.otf
Name: KozMinPr6N-Bold
Class: Japan
Provides(50): FutoMinA101-Bold
Provides(50): FutoMinA101Pro-Bold
Provides(50): HiraMinProN-W6
Provides(50): HiraMinPro-W6
OTFname: KozMinPr6N-Bold.otf
Name: KozMinPr6N-Heavy
Class: Japan
OTFname: KozMinPr6N-Heavy.otf
Name: KozMinPr6N-Medium
Class: Japan
OTFname: KozMinPr6N-Medium.otf
Name: KozMinPr6N-Regular
Class: Japan
Provides(50): Ryumin-Light
Provides(50): RyuminPro-Light
Provides(50): HiraMinProN-W3
Provides(50): HiraMinPro-W3
OTFname: KozMinPr6N-Regular.otf
Name: KozMinPr6N-ExtraLight
Class: Japan
OTFname: KozMinPr6N-ExtraLight.otf
Name: KozMinPr6N-Light
Class: Japan
OTFname: KozMinPr6N-Light.otf
Name: KozMinPro-Bold
Class: Japan
Provides(70): FutoMinA101-Bold
Provides(70): FutoMinA101Pro-Bold
Provides(70): HiraMinProN-W6
Provides(70): HiraMinPro-W6
OTFname: KozMinPro-Bold.otf
Name: KozMinPro-Heavy
Class: Japan
OTFname: KozMinPro-Heavy.otf
Name: KozMinPro-Medium
Class: Japan
OTFname: KozMinPro-Medium.otf
Name: KozMinPro-Regular
Class: Japan
Provides(70): Ryumin-Light
Provides(70): RyuminPro-Light
Provides(70): HiraMinProN-W3
Provides(70): HiraMinPro-W3
OTFname: KozMinPro-Regular.otf
Name: KozMinPro-ExtraLight
Class: Japan
OTFname: KozMinPro-ExtraLight.otf
Name: KozMinPro-Light
Class: Japan
OTFname: KozMinPro-Light.otf
Name: KozMinProVI-Bold
Class: Japan
Provides(60): FutoMinA101-Bold
Provides(60): FutoMinA101Pro-Bold
Provides(60): HiraMinProN-W6
Provides(60): HiraMinPro-W6
OTFname: KozMinProVI-Bold.otf
Name: KozMinProVI-Regular
Class: Japan
Provides(60): Ryumin-Light
Provides(60): RyuminPro-Light
Provides(60): HiraMinProN-W3
Provides(60): HiraMinPro-W3
OTFname: KozMinProVI-Regular.otf
Name: KozMinProVI-Light
Class: Japan
OTFname: KozMinProVI-Light.otf
# other Mac OS X fonts
# Note about Mac OS X:
# Klee.ttc
# Tsukushi{A,B}MaruGothic.ttc
# are bundled with OS X 10.11 El Capitan or later versions.
# Kyokasho.ttc
# ToppanBunkyuMincho-Regular.otf
# ToppanBunkyuGothic.ttc
# ToppanBunkyuMidashiMincho-ExtraBold.otf
# ToppanBunkyuMidashiGothic-ExtraBold.otf
# are bundled with macOS 10.12 Sierra or later versions.
Name: TsukuARdGothic-Regular
Class: Japan
OTCname: TsukushiAMaruGothic.ttc(0)
Name: TsukuARdGothic-Bold
Class: Japan
OTCname: TsukushiAMaruGothic.ttc(1)
Name: TsukuBRdGothic-Regular
Class: Japan
OTCname: TsukushiBMaruGothic.ttc(0)
Name: TsukuBRdGothic-Bold
Class: Japan
OTCname: TsukushiBMaruGothic.ttc(1)
Name: Klee-Medium
Class: Japan
OTCname: Klee.ttc(1)
Name: Klee-Demibold
Class: Japan
OTCname: Klee.ttc(0)
Name: YuKyo_Yoko-Medium
Class: Japan
OTCname: Kyokasho.ttc(0)
Name: YuKyo_Yoko-Bold
Class: Japan
OTCname: Kyokasho.ttc(1)
Name: YuKyo-Medium
Class: Japan
OTCname: Kyokasho.ttc(2)
Name: YuKyo-Bold
Class: Japan
OTCname: Kyokasho.ttc(3)
Name: ToppanBunkyuMincho-Regular
PSName: ToppanBunkyuMinchoPr6N-Regular
Class: Japan
OTFname: ToppanBunkyuMincho-Regular.otf
Name: ToppanBunkyuGothicPr6N-DB
Class: Japan
OTCname: ToppanBunkyuGothic.ttc(0)
Name: ToppanBunkyuGothicPr6N-Regular
Class: Japan
OTCname: ToppanBunkyuGothic.ttc(1)
Name: ToppanBunkyuMidashiMincho-ExtraBold
PSName: ToppanBunkyuMidashiMinchoStdN-ExtraBold
Class: Japan
OTFname: ToppanBunkyuMidashiMincho-ExtraBold.otf
Name: ToppanBunkyuMidashiGothic-ExtraBold
PSName: ToppanBunkyuMidashiGothicStdN-ExtraBold
Class: Japan
OTFname: ToppanBunkyuMidashiGothic-ExtraBold.otf
#
# CHINESE FONTS
#
# Hiragino chinese (OS X)
Name: HiraginoSansGB-W3
Class: GB
Provides(50): STHeiti-Light
OTFname(20): Hiragino Sans GB W3.otf
OTFname(10): HiraginoSansGB-W3.otf
OTCname(30): Hiragino Sans GB W3.ttc(0)
OTCname(28): HiraginoSansGB-W3.ttc(0)
Name: HiraginoSansGB-W6
Class: GB
Provides(50): STHeiti-Regular
OTFname(20): Hiragino Sans GB W6.otf
OTFname(10): HiraginoSansGB-W6.otf
OTCname(30): Hiragino Sans GB W6.ttc(0)
OTCname(28): HiraginoSansGB-W6.ttc(0)
Name: HiraginoSansCNS-W3
Class: CNS
OTCname(30): Hiragino Sans CNS.ttc(0)
OTCname(28): HiraginoSansCNS.ttc(0)
Name: HiraginoSansCNS-W6
Class: CNS
OTCname(30): Hiragino Sans CNS.ttc(1)
OTCname(28): HiraginoSansCNS.ttc(1)
# DynaComware (OS X)
Name: LiHeiPro
Class: CNS
#Provides(??): MHei-Medium # fails
TTFname(20): 儷黑 Pro.ttf
TTFname(10): LiHeiPro.ttf
Name: LiSongPro
Class: CNS
#Provides(??): MSung-Medium # fails
#Provides(??): MSung-Light # fails
TTFname(20): 儷宋 Pro.ttf
TTFname(10): LiSongPro.ttf
Name: PingFangTC-Regular
Class: CNS
OTCname: PingFang.ttc(1)
Name: PingFangSC-Regular
Class: GB
OTCname: PingFang.ttc(2)
Name: PingFangTC-Medium
Class: CNS
OTCname: PingFang.ttc(4)
Name: PingFangSC-Medium
Class: GB
OTCname: PingFang.ttc(5)
Name: PingFangTC-Semibold
Class: CNS
OTCname: PingFang.ttc(7)
Name: PingFangSC-Semibold
Class: GB
OTCname: PingFang.ttc(8)
Name: PingFangTC-Light
Class: CNS
OTCname: PingFang.ttc(10)
Name: PingFangSC-Light
Class: GB
OTCname: PingFang.ttc(11)
Name: PingFangTC-Thin
Class: CNS
OTCname: PingFang.ttc(13)
Name: PingFangSC-Thin
Class: GB
OTCname: PingFang.ttc(14)
Name: PingFangTC-Ultralight
Class: CNS
OTCname: PingFang.ttc(16)
Name: PingFangSC-Ultralight
Class: GB
OTCname: PingFang.ttc(17)
# Changzhou SinoType (OS X)
Name: STXihei
Class: GB
#Provides(??): STHeiti-Light # fails
TTFname(20): 华文细黑.ttf
TTFname(10): STXihei.ttf
Name: STHeiti
Class: GB
#Provides(??): STHeiti-Regular # fails
TTFname(20): 华文黑体.ttf
TTFname(10): STHeiti.ttf
Name: STHeitiSC-Light
Class: GB
#Provides(??): STHeiti-Light # fails
TTCname(10): STHeiti-Light.ttc(1)
TTCname(20): STHeiti Light.ttc(1)
#TTFname(30): STHeitiSC-Light.ttf
Name: STHeitiSC-Medium
Class: GB
#Provides(??): STHeiti-Regular # fails
TTCname(10): STHeiti-Medium.ttc(1)
TTCname(20): STHeiti Medium.ttc(1)
#TTFname(30): STHeitiSC-Medium.ttf
Name: STHeitiTC-Light
Class: CNS
TTCname(10): STHeiti-Light.ttc(0)
TTCname(20): STHeiti Light.ttc(0)
#TTFname(30): STHeitiTC-Light.ttf
Name: STHeitiTC-Medium
Class: CNS
#Provides(??): MHei-Medium # fails
TTCname(10): STHeiti-Medium.ttc(0)
TTCname(20): STHeiti Medium.ttc(0)
#TTFname(30): STHeitiTC-Medium.ttf
Name: STFangsong
Class: GB
#Provides(??): STFangsong-Light # fails
#Provides(??): STFangsong-Regular # fails
TTFname(20): 华文仿宋.ttf
TTFname(10): STFangsong.ttf
# TTC entry for Mountain Lion (10.8) or later
# TTF entry for Lion (10.7) or earlier
Name: STSong
Class: GB
#Provides(??): STSong-Light # fails
#Provides(??): STSong-Regular # fails
TTCname(10): Songti.ttc(4)
TTCname(20): 宋体.ttc(3)
TTFname(30): STSong.ttf
TTFname(40): 华文宋体.ttf
Name: STSongti-SC-Light
Class: GB
#Provides(??): STSong-Light # fails
#Provides(??): STSong-Regular # fails
TTCname(10): Songti.ttc(3)
TTCname(20): 宋体.ttc(2)
#TTFname(30): STSongti-SC-Light.ttf
Name: STSongti-SC-Regular
Class: GB
TTCname(10): Songti.ttc(6)
TTCname(20): 宋体.ttc(4)
#TTFname(30): STSongti-SC-Regular.ttf
Name: STSongti-SC-Bold
Class: GB
TTCname(10): Songti.ttc(1)
TTCname(20): 宋体.ttc(1)
#TTFname(30): STSongti-SC-Bold.ttf
Name: STSongti-SC-Black
Class: GB
TTCname(10): Songti.ttc(0)
TTCname(20): 宋体.ttc(0)
#TTFname(30): STSongti-SC-Black.ttf
Name: STSongti-TC-Light
Class: CNS
#Provides(??): MSung-Light # fails
TTCname(10): Songti.ttc(5)
#TTFname(20): STSongti-TC-Light.ttf
Name: STSongti-TC-Regular
Class: CNS
#Provides(??): MSung-Medium # fails
TTCname(10): Songti.ttc(7)
#TTFname(20): STSongti-TC-Regular.ttf
Name: STSongti-TC-Bold
Class: CNS
TTCname(10): Songti.ttc(2)
#TTFname(20): STSongti-TC-Bold.ttf
# Note about Mac OS X:
# Kaiti.ttc
# contained 6 fonts before OS X 10.11.6 El Capitan.
# After macOS 10.12 Sierra, it contains 7 fonts and
# the order of ttc index has completely changed.
# TTF entry for Lion (10.7) or earlier
# TTC entry for Mountain Lion (10.8) or later
Name: STKaiti
Class: GB
#Provides(??): STKaiti-Regular # fails
## for Sierra (10.12) or later
TTCname(10): Kaiti.ttc(1)
## for El Capitan (10.11.6) or earlier
#TTCname(10): Kaiti.ttc(4)
TTCname(20): 楷体.ttc(3)
TTFname(30): STKaiti.ttf
TTFname(40): 华文楷体.ttf
# TTF entry for Lion (10.7) or earlier
# TTC entry for Mountain Lion (10.8) or later
Name: STKaiti-Adobe-CNS1
Class: CNS
#Provides(??): MKai-Medium # fails
## for Sierra (10.12) or later
TTCname(10): Kaiti.ttc(1)
## for El Capitan (10.11.6) or earlier
#TTCname(10): Kaiti.ttc(4)
TTCname(20): 楷体.ttc(3)
TTFname(30): STKaiti.ttf
TTFname(40): 华文楷体.ttf
# for El Capitan (10.11.6) or earlier
Name: STKaiti-SC-Regular
Class: GB
#Provides(??): STKaiti-Regular # fails
TTCname(10): Kaiti.ttc(3)
TTCname(20): 楷体.ttc(2)
#TTFname(30): STKaiti-SC-Regular.ttf
# for Sierra (10.12) or later
Name: STKaitiSC-Regular
Class: GB
#Provides(??): STKaiti-Regular # fails
TTCname(10): Kaiti.ttc(0)
# for El Capitan (10.11.6) or earlier
Name: STKaiti-SC-Bold
Class: GB
TTCname(10): Kaiti.ttc(1)
TTCname(20): 楷体.ttc(1)
#TTFname(30): STKaiti-SC-Bold.ttf
# for Sierra (10.12) or later
Name: STKaitiSC-Bold
Class: GB
TTCname(10): Kaiti.ttc(3)
# for El Capitan (10.11.6) or earlier
Name: STKaiti-SC-Black
Class: GB
TTCname(10): Kaiti.ttc(0)
TTCname(20): 楷体.ttc(0)
#TTFname(30): STKaiti-SC-Black.ttf
# for Sierra (10.12) or later
Name: STKaitiSC-Black
Class: GB
TTCname(10): Kaiti.ttc(5)
# for El Capitan (10.11.6) or earlier
Name: STKaiTi-TC-Regular
Class: CNS
#Provides(??): MKai-Medium # fails
TTCname(10): Kaiti.ttc(5)
#TTFname(20): STKaiTi-TC-Regular.ttf
# for Sierra (10.12) or later
Name: STKaitiTC-Regular
Class: CNS
#Provides(??): MKai-Medium # fails
TTCname(10): Kaiti.ttc(2)
# for El Capitan (10.11.6) or earlier
Name: STKaiTi-TC-Bold
Class: CNS
TTCname(10): Kaiti.ttc(2)
#TTFname(20): STKaiTi-TC-Bold.ttf
# for Sierra (10.12) or later
Name: STKaitiTC-Bold
Class: CNS
TTCname(10): Kaiti.ttc(4)
# for Sierra (10.12) or later (New!)
Name: STKaitiTC-Black
Class: CNS
TTCname(10): Kaiti.ttc(6)
Name: STBaoliSC-Regular
Class: GB
TTCname: Baoli.ttc(0)
Name: STBaoliTC-Regular
Class: CNS
TTCname: Baoli.ttc(1)
Name: STLibianSC-Regular
Class: GB
TTCname: Libian.ttc(0)
Name: STLibianTC-Regular
Class: CNS
TTCname: Libian.ttc(1)
Name: STXingkaiSC-Bold
Class: GB
TTCname: Xingkai.ttc(0)
Name: STXingkaiTC-Bold
Class: CNS
TTCname: Xingkai.ttc(1)
Name: STXingkaiSC-Light
Class: GB
TTCname: Xingkai.ttc(2)
Name: STXingkaiTC-Light
Class: CNS
TTCname: Xingkai.ttc(3)
Name: STYuanti-SC-Regular
Class: GB
TTCname: Yuanti.ttc(0)
Name: STYuanti-TC-Regular
Class: CNS
TTCname: Yuanti.ttc(1)
Name: STYuanti-SC-Bold
Class: GB
TTCname: Yuanti.ttc(2)
Name: STYuanti-TC-Bold
Class: CNS
TTCname: Yuanti.ttc(3)
Name: STYuanti-SC-Light
Class: GB
TTCname: Yuanti.ttc(4)
Name: STYuanti-TC-Light
Class: CNS
TTCname: Yuanti.ttc(5)
# Beijing Founder Electronics
# note:
# FZ****.TTF (13 files)
# are bundled with with WPS Office (formerly Kingsoft Office) Linux.
# Lantinghei.ttc
# is bundled with OS X 10.9 Mavericks or later versions.
# FZShuSong-Z01
Name: FZSSK--GBK1-0
Class: GB
Provides(55): STSong-Light
TTFname: FZSSK.TTF
# FZXiaoBiaoSong-B05
Name: FZXBSK--GBK1-0
Class: GB
Provides(55): STSong-Regular
TTFname: FZXBSK.TTF
# FZXiHeiI-Z08
Name: FZXH1K--GBK1-0
Class: GB
Provides(55): STHeiti-Light
TTFname: FZXH1K.TTF
# FZHei-B01
Name: FZHTK--GBK1-0
Class: GB
Provides(55): STHeiti-Regular
TTFname: FZHTK.TTF
# FZKai-Z03
Name: FZKTK--GBK1-0
Class: GB
Provides(55): STKaiti-Regular
TTFname: FZKTK.TTF
# FZFangSong-Z02
Name: FZFSK--GBK1-0
Class: GB
Provides(55): STFangsong-Light
Provides(55): STFangsong-Regular
TTFname: FZFSK.TTF
# FZXingKai-S04
Name: FZXKK--GBK1-0
Class: GB
TTFname: FZXKK.TTF
# FZWeiBei-S03
Name: FZWBK--GBK1-0
Class: GB
TTFname: FZWBK.TTF
# FZChaoCuHei-M10
Name: FZCCHK--GBK1-0
Class: GB
TTFname: FZCCHK.TTF
# FZLiShu-S01
Name: FZLSK--GBK1-0
Class: GB
TTFname: FZLSK.TTF
# FZYaoTi-M06
Name: FZYTK--GBK1-0
Class: GB
TTFname: FZYTK.TTF
# FZSongS-Extended
Name: FZSONGS--GB1-5
Class: GB
TTFname: FZSongS_20100603.TTF
# FZSongS-Extended(SIP)
Name: FZSONGS_SIP--GB1-5
Class: GB
TTFname: FZSongS(SIP)_2010603.TTF
# Lantinghei SC Demibold
Name: FZLTZHK--GBK1-0
Class: GB
TTCname: Lantinghei.ttc(0)
# Lantinghei SC Extralight
Name: FZLTXHK--GBK1-0
Class: GB
TTCname: Lantinghei.ttc(1)
# Lantinghei SC Heavy
Name: FZLTTHK--GBK1-0
Class: GB
TTCname: Lantinghei.ttc(2)
# Lantinghei TC Demibold
Name: FZLTZHB--B51-0
Class: CNS
TTCname: Lantinghei.ttc(3)
# Lantinghei TC Extralight
Name: FZLTXHB--B51-0
Class: CNS
TTCname: Lantinghei.ttc(4)
# Lantinghei TC Heavy
Name: FZLTTHB--B51-0
Class: CNS
TTCname: Lantinghei.ttc(5)
# Arphic Font Design Team (OS X)
Name: WeibeiSC-Bold
PSName: Weibei-SC-Bold
Class: GB
OTFname: WeibeiSC-Bold.otf
Name: WeibeiTC-Bold
PSName: Weibei-TC-Bold
Class: CNS
OTFname: WeibeiTC-Bold.otf
# Monotype Imaging (OS X)
Name: YuppySC-Regular
Class: GB
OTFname: YuppySC-Regular.otf
Name: YuppyTC-Regular
Class: CNS
OTFname: YuppyTC-Regular.otf
# Monotype Hong Kong (OS X)
Name: LingWaiSC-Medium
PSName: MLingWaiMedium-SC
Class: GB
OTFname: LingWaiSC-Medium.otf
Name: LingWaiTC-Medium
PSName: MLingWaiMedium-TC
Class: CNS
OTFname: LingWaiTC-Medium.otf
# DynaComware Taiwan (OS X)
Name: WawaSC-Regular
PSName: DFWaWaSC-W5
Class: GB
OTFname: WawaSC-Regular.otf
Name: WawaTC-Regular
PSName: DFWaWaTC-W5
Class: CNS
OTFname: WawaTC-Regular.otf
Name: HannotateSC-W5
Class: GB
OTCname: Hannotate.ttc(0)
Name: HannotateTC-W5
Class: CNS
OTCname: Hannotate.ttc(1)
Name: HannotateSC-W7
Class: GB
OTCname: Hannotate.ttc(2)
Name: HannotateTC-W7
Class: CNS
OTCname: Hannotate.ttc(3)
Name: HanziPenSC-W3
Class: GB
OTCname: Hanzipen.ttc(0)
Name: HanziPenTC-W3
Class: CNS
OTCname: Hanzipen.ttc(1)
Name: HanziPenSC-W5
Class: GB
OTCname: Hanzipen.ttc(2)
Name: HanziPenTC-W5
Class: CNS
OTCname: Hanzipen.ttc(3)
# Shanghai Ikarus Ltd./URW Software & Type GmbH
Name: SIL-Hei-Med-Jian
Class: GB
TTFname: Hei.ttf
Name: SIL-Kai-Reg-Jian
Class: GB
TTFname: Kai.ttf
# Apple
Name: LiSungLight
Class: CNS
TTFname(20): Apple LiSung Light.ttf
TTFname(10): LiSungLight.ttf
Name: LiGothicMed
Class: CNS
TTFname(20): Apple LiGothic Medium.ttf
TTFname(10): LiGothicMed.ttf
# Adobe chinese fonts
# simplified chinese
Name: AdobeSongStd-Light
Class: GB
Provides(30): STSong-Light
Provides(30): STSong-Regular
OTFname(10): AdobeSongStd-Light.otf
Name: AdobeHeitiStd-Regular
Class: GB
Provides(30): STHeiti-Regular
Provides(30): STHeiti-Light
OTFname(20): AdobeHeitiStd-Regular.otf
Name: AdobeKaitiStd-Regular
Class: GB
Provides(30): STKaiti-Regular
OTFname(20): AdobeKaitiStd-Regular.otf
Name: AdobeFangsongStd-Regular
Class: GB
Provides(30): STFangsong-Light
Provides(30): STFangsong-Regular
OTFname(20): AdobeFangsongStd-Regular.otf
# traditional chinese
Name: AdobeMingStd-Light
Class: CNS
Provides(30): MSung-Light
Provides(30): MSung-Medium
OTFname(20): AdobeMingStd-Light.otf
Name: AdobeFanHeitiStd-Bold
Class: CNS
Provides(30): MHei-Medium
Provides(30): MKai-Medium
OTFname(20): AdobeFanHeitiStd-Bold.otf
# Fandol (free)
Name: FandolSong-Regular
Class: GB
Provides(40): STSong-Light
OTFname(10): FandolSong-Regular.otf
Name: FandolSong-Bold
Provides(40): STSong-Regular
Class: GB
OTFname(10): FandolSong-Bold.otf
Name: FandolKai-Regular
Class: GB
Provides(40): STKaiti-Regular
OTFname(10): FandolKai-Regular.otf
Name: FandolHei-Regular
Class: GB
Provides(40): STHeiti-Regular
Provides(40): STHeiti-Light
OTFname(10): FandolHei-Regular.otf
Name: FandolHei-Bold
Class: GB
OTFname(10): FandolHei-Bold.otf
Name: FandolFang-Regular
Class: GB
Provides(40): STFangsong-Light
Provides(40): STFangsong-Regular
OTFname(10): FandolFang-Regular.otf
# Arphic (free)
Name: BousungEG-Light-GB
Class: GB
Provides(80): STSong-Light
Provides(80): STSong-Regular
Provides(80): STFangsong-Light
Provides(80): STFangsong-Regular
TTFname: gbsn00lp.ttf
Name: GBZenKai-Medium
Class: GB
Provides(80): STKaiti-Regular
Provides(80): STHeiti-Regular
Provides(80): STHeiti-Light
TTFname: gkai00mp.ttf
Name: ShanHeiSun-Light
Class: CNS
Provides(80): MSung-Light
Provides(80): MSung-Medium
TTFname: bsmi00lp.ttf
Name: ZenKai-Medium
Class: CNS
Provides(80): MKai-Medium
Provides(80): MHei-Medium
TTFname: bkai00mp.ttf
# CJK-Unifonts new ttc edition (free)
Name: UMingCN
Class: GB
Provides(70): STSong-Light
Provides(70): STSong-Regular
Provides(70): STFangsong-Light
Provides(70): STFangsong-Regular
TTCname: uming.ttc(0)
Name: UMingTW
Class: CNS
Provides(70): MSung-Light
Provides(70): MSung-Medium
TTCname: uming.ttc(2)
Name: UKaiCN
Class: GB
Provides(70): STKaiti-Regular
Provides(70): STHeiti-Regular
Provides(70): STHeiti-Light
TTCname: ukai.ttc(0)
Name: UKaiTW
Class: CNS
Provides(70): MKai-Medium
Provides(70): MHei-Medium
TTCname: ukai.ttc(2)
# CJK-Unifonts old ttf edition (free)
# CNS
Name: ShanHeiSun-Uni
Class: CNS
Provides(90): MSung-Light
Provides(90): MSung-Medium
TTFname: uming.ttf
# GB
Name: ShanHeiSun-Uni-Adobe-GB1
Class: GB
Provides(90): STSong-Light
Provides(90): STSong-Regular
Provides(90): STFangsong-Light
Provides(90): STFangsong-Regular
TTFname: uming.ttf
# CNS
Name: ZenKai-Uni
Class: CNS
Provides(90): MKai-Medium
Provides(90): MHei-Medium
TTFname: ukai.ttf
# GB
Name: ZenKai-Uni-Adobe-GB1
Class: GB
Provides(90): STKaiti-Regular
Provides(90): STHeiti-Regular
Provides(90): STHeiti-Light
TTFname: ukai.ttf
# WenQuanYi (free)
# GB
Name: WenQuanYiMicroHei
Class: GB
TTCname(10): wqy-microhei.ttc(0)
# CNS
Name: WenQuanYiMicroHei-Adobe-CNS1
Class: CNS
TTCname(10): wqy-microhei.ttc(0)
# GB
Name: WenQuanYiMicroHeiMono
Class: GB
TTCname(10): wqy-microhei.ttc(1)
# CNS
Name: WenQuanYiMicroHeiMono-Adobe-CNS1
Class: CNS
TTCname(10): wqy-microhei.ttc(1)
# GB
Name: WenQuanYiZenHei
Class: GB
TTCname(10): wqy-zenhei.ttc(0)
TTFname(20): wqy-zenhei.ttf
# CNS
Name: WenQuanYiZenHei-Adobe-CNS1
Class: CNS
TTCname(10): wqy-zenhei.ttc(0)
TTFname(20): wqy-zenhei.ttf
# GB
Name: WenQuanYiZenHeiMono
Class: GB
TTCname(10): wqy-zenhei.ttc(1)
# CNS:
Name: WenQuanYiZenHeiMono-Adobe-CNS1
Class: CNS
TTCname(10): wqy-zenhei.ttc(1)
# GB
Name: WenQuanYiZenHeiSharp
Class: GB
TTCname(10): wqy-zenhei.ttc(2)
# CNS
Name: WenQuanYiZenHeiSharp-Adobe-CNS1
Class: CNS
TTCname(10): wqy-zenhei.ttc(2)
# cwTeX (free)
Name: cwTeXMing
Class: CNS
TTFname: cwming.ttf
Name: cwTeXHeiBold
Class: CNS
TTFname: cwheib.ttf
Name: cwTeXKai
Class: CNS
TTFname: cwkai.ttf
Name: cwTeXYen
Class: CNS
TTFname: cwyen.ttf
Name: cwTeXFangSong
Class: CNS
TTFname: cwfs.ttf
#
# KOREAN FONTS
#
# Solaris-hanyang (Solaris 10, 11)
Name: Myeongjo
Class: Korea
Provides(40): HYSMyeongJo-Medium
TTFname: h2mjsm.ttf
Name: Gothic
Class: Korea
Provides(40): HYGoThic-Medium
TTFname: h2gtrm.ttf
Name: RoundedGothic
Class: Korea
Provides(40): HYRGoThic-Medium
TTFname: h2drrm.ttf
Name: Haeseo
Class: Korea
TTFname: h2hsrm.ttf
Name: SunDotum
Class: Korea
TTFname: sundotump.ttf
Name: SunDotumChe
Class: Korea
TTFname: sundotumf.ttf
# Baekmuk (free)
# This is a special case, because "batang.ttf" in baekmuk and
# "Batang.ttf" in Microsoft Mac Office font share the same filename;
# symlink name should be "Baekmuk-Batang.ttf"
# similar for "Gulim.ttf" -- HY (2016/09/29)
Name: Baekmuk-Batang
Class: Korea
Provides(70): HYSMyeongJo-Medium
TTFname(20): batang.ttf
TTFname(10): Baekmuk-Batang.ttf
Name: Baekmuk-Dotum
Class: Korea
Provides(70): HYGoThic-Medium
TTFname(20): dotum.ttf
TTFname(10): Baekmuk-Dotum.ttf
Name: Baekmuk-Gulim
Class: Korea
Provides(70): HYRGoThic-Medium
TTFname(20): gulim.ttf
TTFname(10): Baekmuk-Gulim.ttf
Name: Baekmuk-Headline
Class: Korea
TTFname(20): hline.ttf
TTFname(10): Baekmuk-Headline.ttf
# Unfonts-core (free)
Name: UnBatang
Class: Korea
Provides(60): HYSMyeongJo-Medium
TTFname: UnBatang.ttf
Name: UnBatang-Bold
Class: Korea
TTFname: UnBatangBold.ttf
Name: UnDotum
Class: Korea
Provides(60): HYGoThic-Medium
TTFname: UnDotum.ttf
Name: UnDotum-Bold
Class: Korea
TTFname: UnDotumBold.ttf
Name: UnDinaru
Class: Korea
Provides(60): HYRGoThic-Medium
TTFname: UnDinaru.ttf
Name: UnDinaru-Bold
Class: Korea
TTFname: UnDinaruBold.ttf
Name: UnDinaru-Light
Class: Korea
TTFname: UnDinaruLight.ttf
Name: UnGraphic
Class: Korea
TTFname: UnGraphic.ttf
Name: UnGraphic-Bold
Class: Korea
TTFname: UnGraphicBold.ttf
Name: UnGungseo
Class: Korea
TTFname: UnGungseo.ttf
Name: UnPilgi
Class: Korea
TTFname: UnPilgi.ttf
Name: UnPilgi-Bold
Class: Korea
TTFname: UnPilgiBold.ttf
# Unfonts-extra (free)
Name: UnBom
Class: Korea
TTFname: UnBom.ttf
Name: UnPen
Class: Korea
TTFname: UnPen.ttf
Name: UnPenheulim
Class: Korea
TTFname: UnPenheulim.ttf
Name: UnPilgia
Class: Korea
TTFname: UnPilgia.ttf
Name: UnShinmun
Class: Korea
TTFname: UnShinmun.ttf
Name: UnVada
Class: Korea
TTFname: UnVada.ttf
Name: UnYetgul
Class: Korea
TTFname: UnYetgul.ttf
Name: UnTaza
Class: Korea
TTFname: UnTaza.ttf
# UnJamo... family has proportional metrics
Name: UnJamoBatang
Class: Korea
TTFname: UnJamoBatang.ttf
Name: UnJamoDotum
Class: Korea
TTFname: UnJamoDotum.ttf
Name: UnJamoNovel
Class: Korea
TTFname: UnJamoNovel.ttf
Name: UnJamoSora
Class: Korea
TTFname: UnJamoSora.ttf
# Nanum (free - TTF files) and Nanum OS X (free - TTC files)
# note that all fonts have narrow metrics
Name: NanumMyeongjo
Class: Korea
TTFname(10): NanumMyeongjo.ttf
TTCname(20): NanumMyeongjo.ttc(0)
Name: NanumMyeongjoBold
Class: Korea
TTFname(10): NanumMyeongjoBold.ttf
TTCname(20): NanumMyeongjo.ttc(1)
Name: NanumMyeongjoExtraBold
Class: Korea
TTFname(10): NanumMyeongjoExtraBold.ttf
TTCname(20): NanumMyeongjo.ttc(2)
Name: NanumGothic
Class: Korea
TTFname(10): NanumGothic.ttf
TTCname(20): NanumGothic.ttc(0)
Name: NanumGothicBold
Class: Korea
TTFname(10): NanumGothicBold.ttf
TTCname(20): NanumGothic.ttc(1)
Name: NanumGothicExtraBold
Class: Korea
TTFname(10): NanumGothicExtraBold.ttf
TTCname(20): NanumGothic.ttc(2)
Name: NanumGothicLight
Class: Korea
TTFname(10): NanumGothicLight.ttf
Name: NanumBarunGothic
Class: Korea
TTFname(10): NanumBarunGothic.ttf
Name: NanumBarunGothicBold
Class: Korea
TTFname(10): NanumBarunGothicBold.ttf
Name: NanumBarunGothicLight
Class: Korea
TTFname(10): NanumBarunGothicLight.ttf
Name: NanumBarunGothicUltraLight
Class: Korea
TTFname(10): NanumBarunGothicUltraLight.ttf
Name: NanumBarunpen
Class: Korea
TTFname(10): NanumBarunpenR.ttf
Name: NanumBarunpen-Bold
Class: Korea
TTFname(10): NanumBarunpenB.ttf
Name: NanumBrush
Class: Korea
TTFname(10): NanumBrush.ttf
TTCname(20): NanumScript.ttc(0)
Name: NanumPen
Class: Korea
TTFname(10): NanumPen.ttf
TTCname(20): NanumScript.ttc(1)
# Design font by Ho-Seok Ee, aka. "ALee's font" (free)
Name: Bandal
Class: Korea
TTFname: Bandal.ttf
Name: Bangwool
Class: Korea
TTFname: Bangwool.ttf
Name: Eunjin
Class: Korea
TTFname: Eunjin.ttf
Name: EunjinNakseo
Class: Korea
TTFname: EunjinNakseo.ttf
Name: Guseul
Class: Korea
TTFname: Guseul.ttf
# Woowa Brothers (free)
Name: BMHANNA
Class: Korea
TTFname: BM-HANNA.ttf
# Hancom HCR (free)
# note that all fonts have narrow metrics
Name: HCRBatang
Class: Korea
TTFname: HANBatang.ttf
Name: HCRBatang-Bold
Class: Korea
TTFname: HANBatangB.ttf
Name: HCRDotum
Class: Korea
TTFname: HANDotum.ttf
Name: HCRDotum-Bold
Class: Korea
TTFname: HANDotumB.ttf
# Apple
Name: AppleMyungjo
Class: Korea
#Provides(??): HYSMyeongJo-Medium # fails
TTFname: AppleMyungjo.ttf
Name: AppleGothic
Class: Korea
#Provides(??): HYGoThic-Medium # fails
#Provides(??): HYRGoThic-Medium # fails
TTFname: AppleGothic.ttf
Name: AppleSDGothicNeo-Regular
Class: Korea
OTFname(10): AppleSDGothicNeo-Regular.otf
OTCname(20): AppleSDGothicNeo.ttc(0)
Name: AppleSDGothicNeo-Medium
Class: Korea
OTFname(10): AppleSDGothicNeo-Medium.otf
OTCname(20): AppleSDGothicNeo.ttc(2)
Name: AppleSDGothicNeo-SemiBold
Class: Korea
OTFname(10): AppleSDGothicNeo-SemiBold.otf
OTCname(20): AppleSDGothicNeo.ttc(4)
Name: AppleSDGothicNeo-Bold
Class: Korea
OTFname(10): AppleSDGothicNeo-Bold.otf
OTCname(20): AppleSDGothicNeo.ttc(6)
Name: AppleSDGothicNeo-Light
Class: Korea
OTFname(10): AppleSDGothicNeo-Light.otf
OTCname(20): AppleSDGothicNeo.ttc(8)
Name: AppleSDGothicNeo-Thin
Class: Korea
OTFname(10): AppleSDGothicNeo-Thin.otf
OTCname(20): AppleSDGothicNeo.ttc(10)
Name: AppleSDGothicNeo-UltraLight
Class: Korea
OTFname(10): AppleSDGothicNeo-UltraLight.otf
OTCname(20): AppleSDGothicNeo.ttc(12)
Name: AppleSDGothicNeo-ExtraBold
Class: Korea
OTFname(10): AppleSDGothicNeo-ExtraBold.otf
OTCname(20): AppleSDGothicNeo.ttc(14)
Name: AppleSDGothicNeo-Heavy
Class: Korea
OTFname(10): AppleSDGothicNeo-Heavy.otf
OTCname(20): AppleSDGothicNeo.ttc(16)
Name: JCsmPC
Class: Korea
TTFname: PCmyoungjo.ttf
Name: JCfg
Class: Korea
TTFname: Pilgiche.ttf
Name: JCkg
Class: Korea
TTFname: Gungseouche.ttf
Name: JCHEadA
Class: Korea
TTFname: HeadlineA.ttf
# Adobe korean fonts
Name: AdobeMyungjoStd-Medium
Class: Korea
Provides(30): HYSMyeongJo-Medium
OTFname: AdobeMyungjoStd-Medium.otf
Name: AdobeGothicStd-Bold
Class: Korea
Provides(30): HYGoThic-Medium
Provides(80): HYRGoThic-Medium
OTFname: AdobeGothicStd-Bold.otf
Name: AdobeGothicStd-Light
Class: Korea
OTFname: AdobeGothicStd-Light.otf
#
# Microsoft Windows, Windows/Mac Office fonts
#
# korea
Name: Batang
Class: Korea
TTFname(50): Batang.ttf
TTCname(20): batang.ttc(0)
Name: BatangChe
Class: Korea
Provides(50): HYSMyeongJo-Medium
TTCname(20): batang.ttc(1)
Name: Dotum
Class: Korea
TTCname(20): gulim.ttc(2)
Name: DotumChe
Class: Korea
Provides(50): HYGoThic-Medium
TTCname(20): gulim.ttc(3)
Name: Gulim
Class: Korea
TTFname(50): Gulim.ttf
TTCname(20): gulim.ttc(0)
Name: GulimChe
Class: Korea
Provides(50): HYRGoThic-Medium
Provides(90): HYGoThic-Medium
TTCname(20): gulim.ttc(1)
Name: Gungsuh
Class: Korea
TTCname(20): batang.ttc(2)
Name: GungsuhChe
Class: Korea
TTCname(20): batang.ttc(3)
Name: MalgunGothicRegular
Class: Korea
TTFname: malgun.ttf
Name: MalgunGothicBold
Class: Korea
TTFname: malgunbd.ttf
Name: MalgunGothic-Semilight
Class: Korea
TTFname: malgunsl.ttf
# simplified chinese
Name: SimHei
Class: GB
Provides(60): STHeiti-Regular
Provides(60): STHeiti-Light
TTFname(50): SimHei.ttf
TTFname(20): simhei.ttf
Name: SimSun
Class: GB
Provides(60): STSong-Light
Provides(60): STSong-Regular
TTFname(50): SimSun.ttf
TTCname(20): simsun.ttc(0)
Name: NSimSun
Class: GB
TTCname(20): simsun.ttc(1)
Name: KaiTi
Class: GB
Provides(60): STKaiti-Regular
TTFname(40): Kaiti.ttf
TTFname(20): simkai.ttf
Name: FangSong
Class: GB
Provides(60): STFangsong-Light
Provides(60): STFangsong-Regular
TTFname(40): Fangsong.ttf
TTFname(20): simfang.ttf
Name: MicrosoftYaHei
Class: GB
TTFname(20): msyh.ttf
TTCname(30): msyh.ttc(0)
Name: MicrosoftYaHei-Bold
Class: GB
TTFname(20): msyhbd.ttf
TTCname(30): msyhbd.ttc(0)
Name: MicrosoftYaHeiLight
Class: GB
TTFname(20): msyhl.ttf
TTCname(30): msyhl.ttc(0)
Name: DengXian-Regular
Class: GB
TTFname: Deng.ttf
Name: DengXian-Bold
Class: GB
TTFname: Dengb.ttf
Name: DengXian-Light
Class: GB
TTFname: Dengl.ttf
Name: STZhongsong
Class: GB
TTFname: STZHONGS.ttf
Name: STXinwei
Class: GB
TTFname: STXINWEI.ttf
Name: STXingkai
Class: GB
TTFname: STXINGKA.ttf
Name: STLiti
Class: GB
TTFname: STLITI.ttf
Name: STHupo
Class: GB
TTFname: STHUPO.ttf
# traditional chinese
Name: MingLiU
Class: CNS
Provides(60): MSung-Medium
Provides(60): MSung-Light
TTFname(50): MingLiU.ttf
TTCname(20): mingliu.ttc(0)
Name: PMingLiU
Class: CNS
TTFname(50): PMingLiU.ttf
TTCname(20): mingliu.ttc(1)
Name: DFKaiShu-SB-Estd-BF
Class: CNS
Provides(60): MKai-Medium
TTFname(50): BiauKai.ttf
TTFname(20): kaiu.ttf
Name: MicrosoftJhengHeiRegular
Class: CNS
Provides(60): MHei-Medium
TTFname(40): MSJH.ttf
TTFname(20): msjh.ttf
TTCname(30): msjh.ttc(0)
Name: MicrosoftJhengHeiBold
Class: CNS
TTFname(40): MSJHBD.ttf
TTFname(20): msjhbd.ttf
TTCname(30): msjhbd.ttc(0)
Name: MicrosoftJhengHeiLight
Class: CNS
TTCname(30): msjhl.ttc(0)
Name: MicrosoftMHei
Class: CNS
Provides(65): MHei-Medium
TTFname(10): MSMHei.ttf
Name: MicrosoftMHei-Bold
Class: CNS
TTFname(10): MSMHei-Bold.ttf
# japanese
Name: MS-Gothic
Class: Japan
Provides(95): GothicBBB-Medium
Provides(95): GothicBBBPro-Medium
Provides(95): HiraKakuProN-W3
Provides(95): HiraKakuPro-W3
Provides(95): FutoGoB101-Bold
Provides(95): FutoGoB101Pro-Bold
Provides(95): HiraKakuProN-W6
Provides(95): HiraKakuPro-W6
Provides(95): MidashiGo-MB31
Provides(95): MidashiGoPro-MB31
Provides(95): HiraKakuStdN-W8
Provides(95): HiraKakuStd-W8
Provides(95): Jun101-Light
Provides(95): Jun101Pro-Light
Provides(95): HiraMaruProN-W4
Provides(95): HiraMaruPro-W4
TTFname(50): MS Gothic.ttf
TTFname(30): MS-Gothic.ttf
TTCname(20): msgothic.ttc(0)
Name: MS-Mincho
Class: Japan
Provides(95): Ryumin-Light
Provides(95): RyuminPro-Light
Provides(95): HiraMinProN-W3
Provides(95): HiraMinPro-W3
Provides(95): FutoMinA101-Bold
Provides(95): FutoMinA101Pro-Bold
Provides(95): HiraMinProN-W6
Provides(95): HiraMinPro-W6
TTFname(50): MS Mincho.ttf
TTFname(30): MS-Mincho.ttf
TTCname(20): msmincho.ttc(0)
Name: MS-PGothic
Class: Japan
TTFname(50): MS PGothic.ttf
TTFname(30): MS-PGothic.ttf
TTCname(20): msgothic.ttc(1)
Name: MS-PMincho
Class: Japan
TTFname(50): MS PMincho.ttf
TTFname(30): MS-PMincho.ttf
TTCname(20): msmincho.ttc(1)
Name: MS-UIGothic
Class: Japan
TTCname(20): msgothic.ttc(2)
Name: Meiryo
Class: Japan
TTFname(50): Meiryo.ttf
TTCname(20): meiryo.ttc(0)
Name: Meiryo-Bold
Class: Japan
TTFname(50): Meiryo Bold.ttf
TTFname(40): MeiryoBold.ttf
TTFname(30): Meiryo-Bold.ttf
TTCname(20): meiryob.ttc(0)
Name: Meiryo-BoldItalic
Class: Japan
TTFname(50): Meiryo Bold Italic.ttf
TTFname(40): MeiryoBoldItalic.ttf
TTFname(30): Meiryo-BoldItalic.ttf
TTCname(20): meiryob.ttc(1)
Name: Meiryo-Italic
Class: Japan
TTFname(50): Meiryo Italic.ttf
TTFname(40): MeiryoItalic.ttf
TTFname(30): Meiryo-Italic.ttf
TTCname(20): meiryo.ttc(1)
Name: MeiryoUI
Class: Japan
TTCname(20): meiryo.ttc(2)
Name: MeiryoUI-Bold
Class: Japan
TTCname(20): meiryob.ttc(2)
Name: MeiryoUI-BoldItalic
Class: Japan
TTCname(20): meiryob.ttc(3)
Name: MeiryoUI-Italic
Class: Japan
TTCname(20): meiryo.ttc(3)
Name: HGGothicE
Class: Japan
TTCname(50): HGRGE.ttc(0)
TTCname(20): HGRGE.TTC(0)
Name: HGPGothicE
Class: Japan
TTCname(50): HGRGE.ttc(1)
TTCname(20): HGRGE.TTC(1)
Name: HGSGothicE
Class: Japan
TTCname(50): HGRGE.ttc(2)
TTCname(20): HGRGE.TTC(2)
Name: HGGothicM
Class: Japan
TTCname(20): HGRGM.TTC(0)
Name: HGPGothicM
Class: Japan
TTCname(20): HGRGM.TTC(1)
Name: HGSGothicM
Class: Japan
TTCname(20): HGRGM.TTC(2)
Name: HGMinchoE
Class: Japan
TTCname(50): HGRME.ttc(0)
TTCname(20): HGRME.TTC(0)
Name: HGPMinchoE
Class: Japan
TTCname(50): HGRME.ttc(1)
TTCname(20): HGRME.TTC(2)
Name: HGSMinchoE
Class: Japan
TTCname(50): HGRME.ttc(2)
TTCname(20): HGRME.TTC(2)
Name: HGMinchoB
Class: Japan
TTCname(20): HGRMB.TTC(0)
Name: HGPMinchoB
Class: Japan
TTCname(20): HGRMB.TTC(1)
Name: HGPMinchoB
Class: Japan
TTCname(20): HGRMB.TTC(2)
Name: HGSoeiKakugothicUB
Class: Japan
TTCname(50): HGRSGU.ttc(0)
TTCname(20): HGRSGU.TTC(0)
Name: HGPSoeiKakugothicUB
Class: Japan
TTCname(50): HGRSGU.ttc(1)
TTCname(20): HGRSGU.TTC(1)
Name: HGSSoeiKakugothicUB
Class: Japan
TTCname(50): HGRSGU.ttc(2)
TTCname(20): HGRSGU.TTC(2)
Name: HGSoeiKakupoptai
Class: Japan
TTCname(20): HGRPP1.TTC(0)
Name: HGPSoeiKakupoptai
Class: Japan
TTCname(20): HGRPP1.TTC(1)
Name: HGSSoeiKakupoptai
Class: Japan
TTCname(20): HGRPP1.TTC(2)
Name: HGSoeiPresenceEB
Class: Japan
TTCname(20): HGRPRE.TTC(0)
Name: HGPSoeiPresenceEB
Class: Japan
TTCname(20): HGRPRE.TTC(1)
Name: HGSSoeiPresenceEB
Class: Japan
TTCname(20): HGRPRE.TTC(2)
Name: HGKyokashotai
Class: Japan
TTCname(20): HGRKK.TTC(0)
Name: HGPKyokashotai
Class: Japan
TTCname(20): HGRKK.TTC(1)
Name: HGSKyokashotai
Class: Japan
TTCname(20): HGRKK.TTC(2)
Name: HGGyoshotai
Class: Japan
TTCname(20): HGRGY.TTC(0)
Name: HGPGyoshotai
Class: Japan
TTCname(20): HGRGY.TTC(1)
Name: HGSGyoshotai
Class: Japan
TTCname(20): HGRGY.TTC(2)
Name: HGMaruGothicMPRO
Class: Japan
TTFname(40): HGRSMP.ttf
TTFname(20): HGRSMP.TTF
Name: HGSeikaishotaiPRO
Class: Japan
TTFname(20): HGRSKP.TTF
### Local Variables:
### perl-indent-level: 2
### tab-width: 2
### indent-tabs-mode: nil
### End:
# vim: set tabstop=2 expandtab autoindent:
|