summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/lttextcomp.dtx
blob: c67bac00dd83656694e5b5be675b24e553beec81 (plain)
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
% \iffalse meta-comment
%
% Copyright (C) 2019-2024
% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
% -------------------------------------------
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
%    https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% This file has the LPPL maintenance status "maintained".
%
% The list of all files belonging to the LaTeX base distribution is
% given in the file `manifest.txt'. See also `legal.txt' for additional
% information.
%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
%
%%% From File: lttextcomp.dtx
%
% \fi
%
%
% \iffalse
%
%<*driver>
% \fi
%
%
\ProvidesFile{lttextcomp.dtx}
             [2024/02/08 v1.1a LaTeX Kernel (text companion symbols)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
\DocInput{lttextcomp.dtx}
\end{document}
%</driver>
% \fi
%
%
%
%
% \GetFileInfo{lttextcomp.dtx}
% \title{Providing additional text symbols\\
%        (previously available through the \texttt{textcomp} package)\thanks
%       {This file has version number
%       \fileversion\ dated \filedate}}
%
% \author{Frank Mittelbach}
%
% \MaintainedByLaTeXTeam{latex}
% \maketitle
%
% This file contains the implementation for accessing the glyphs
% provided by the \texttt{TS1} encoding (Text Companion
% Encoding). This is now offered as part of the kernel and so the
% \texttt{textcomp} package which used to provide the definitions is
% now mainly needed for compatibility reasons (and doesn't do much any
% more).
%
%
%
% \MaybeStop{}
%
% \changes{v1.0e}{2021/03/19}
%         {Use \cs{NewModuleRelease}}
%    \begin{macrocode}
%<*2ekernel|latexrelease>
%<latexrelease>\NewModuleRelease{2020/02/02}{lttextcomp}
%<latexrelease>                 {Text Companion symbols}
%    \end{macrocode}
%
%  \begin{macro}{\oldstylenums}
%  \begin{macro}{\legacyoldstylenums}
%
%    Preserve the old definition of \cs{oldstylenums} under a different name.
%
%    This macro implements old style numerals but only works if we
%    assume that the standard math fonts are used. Thus it needs
%    changing in case other math encodings are used.
%    \begin{macrocode}
\DeclareRobustCommand\legacyoldstylenums[1]{%
   \begingroup
%    \end{macrocode}
%    Provide spacing using the interword space of the current font.
%    \begin{macrocode}
    \spaceskip\fontdimen\tw@\font
%    \end{macrocode}
%    Then switch to the math italic font. We don't change the current
%    value of |\f@series| which means that you can use bold numerals
%    if |\bfseries| is in force. As family we use |\rmdefault| which
%    means that this only works if there exist an |OML| encoded
%    version of that font or rather a corresponding |.fd| file (which
%    is the case for standard \LaTeX{} fonts even though they only
%    contain substitutions).
% \changes{v3.0j}{1999/02/12}{Use \cs{rmdefault} instead of \texttt{cmm}
%                 (pr/2954)}
%    \begin{macrocode}
    \usefont{OML}{\rmdefault}{\f@series}{it}%
    \mathgroup\symletters #1%
   \endgroup
}
%    \end{macrocode}
%
%    And here is the improved one that adjusts depending on surroundings.
%    \begin{macrocode}
\DeclareRobustCommand\oldstylenums[1]{%
 \begingroup
 \ifmmode
   \mathgroup\symletters #1%
  \else
%    \end{macrocode}
%    The \cs{CheckEncodingSubset} is discussed below.
%    \begin{macrocode}
   \CheckEncodingSubset\@use@text@encoding{TS1}\tc@oldstylesubst2{{#1}}%
 \fi
 \endgroup
}
%    \end{macrocode}
%    The helper to select the substitution if needed.
%    \begin{macrocode}
\def\tc@oldstylesubst#1{%
   \tc@errorwarn
          {Oldstyle digits unavailable for
           family \f@family.\MessageBreak
           Default oldstyle digits used instead}\@eha
  \bgroup
      \expand@font@defaults
%    \end{macrocode}
%    The substitution defaults are provided in the file \texttt{fonttext.ltx}.
%    \begin{macrocode}
      \ifx\f@family\rmdef@ult
         \fontfamily\rmsubstdefault
      \else\ifx\f@family\sfdef@ult
         \fontfamily\sfsubstdefault
      \else\ifx\f@family\ttdef@ult
         \fontfamily\ttsubstdefault
      \else
        \fontfamily\textcompsubstdefault
      \fi\fi\fi
      \fontencoding{TS1}\selectfont#1%
  \egroup
}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
% \begin{macro}{\textcompsubstdefault}
%    Here is the default for the ``unknown'' case:
%    \begin{macrocode}
\def\textcompsubstdefault{\rmsubstdefault}
%    \end{macrocode}
% \end{macro}
%
%  \begin{macro}{\DeclareEncodingSubset}
%
%    The declaration takes 3 mandatory arguments: an \emph{encoding}
%    for which a subsetting is wanted (currently always \texttt{TS1},
%    and most likely forever), the \emph{font family} for which we
%    declare the subset and finally the \emph{subset} number, with a value between
%    \texttt{0} (all of the encoding is supported) and \texttt{9} (many
%    glyphs are missing).
%
%    For \texttt{TS1} the numbers have been chosen in a way that most
%    fonts can be fairly correctly categorized, but the default
%    settings are always conservative, that is they may claim that
%    less glyphs are supported than there actually are.
%
%    As these days many font families are set up to end in \texttt{-LF}
%    (lining figures), \texttt{-OsF} (oldstyle figures), etc.\ the
%    declaration supports a shortcut: if the \emph{font family} name
%    ends in \texttt{-*} then the star gets replaced by these common
%    ending, e.g.,
%\begin{verbatim}
% \DeclareEncodingSubset{TS1}{Alegreya-*}{2}
%\end{verbatim}
%    is the same as writing
%\begin{verbatim}
% \DeclareEncodingSubset{TS1}{Alegreya-LF}{2}
% \DeclareEncodingSubset{TS1}{Alegreya-OsF}{2}
% \DeclareEncodingSubset{TS1}{Alegreya-TLF}{2}
% \DeclareEncodingSubset{TS1}{Alegreya-TOsF}{2}
%\end{verbatim}
%    If only some are needed then one can define them individually but
%    in many cases all four are wanted, hence the shortcut.
%
%
%    The coding of the declaration has no error checking as it is
%    mostly for internal use.
%    \begin{macrocode}
\def\DeclareEncodingSubset#1#2{%
  \DeclareEncodingSubset@aux{#1}#2*\DeclareEncodingSubset@aux
}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\DeclareEncodingSubset@aux#1#2*#3\DeclareEncodingSubset@aux#4{%
%    \end{macrocode}
%    if \verb=#3= is empty then there was no star, otherwise we
%    define all four variants.
%    \begin{macrocode}
  \expandafter\ifx\expandafter X\detokenize{#3}X%
    \@DeclareEncodingSubset{#1}{#2}{#4}%
  \else
    \@DeclareEncodingSubset{#1}{#2LF}{#4}%
    \@DeclareEncodingSubset{#1}{#2TLF}{#4}%
    \@DeclareEncodingSubset{#1}{#2OsF}{#4}%
    \@DeclareEncodingSubset{#1}{#2TOsF}{#4}%
  \fi
}
%    \end{macrocode}
%
%    The subset info is stored in a command with the name
%    \texttt{\bslash}\emph{family}\texttt{:}\emph{subset} so if that
%    already exists we change otherwise declare a subset.
%    \begin{macrocode}
\def\@DeclareEncodingSubset#1#2#3{%
   \@ifundefined{#1:#2}%
     {\@font@info{Setting #2 sub-encoding to #1/#3}}%
     {\@font@info{Changing #2 sub-encoding to #1/#3}}%
%    \end{macrocode}
%    This declaration should be usable in \texttt{.fd} files and
%    therefore has to make its definition globally, because such files
%    can get loaded in random places.
% \changes{v1.0g}{2022/08/07}{Make  global declaration (gh/905)}
%    \begin{macrocode}
     \global\@namedef{#1:#2}{#3}}
%    \end{macrocode}
%
%    Any reason to allow those in the middle of documents?
%    \begin{macrocode}
\@onlypreamble\DeclareEncodingSubset
\@onlypreamble\DeclareEncodingSubset@aux
\@onlypreamble\@DeclareEncodingSubset
%    \end{macrocode}
%  \end{macro}


% \begin{macro}{\CheckEncodingSubset}
%    The command |\CheckEncodingSubset| will check if the current font
%    family has the right encoding subset to typeset a certain
%    command. It takes five arguments as follows:
%    first argument is either |\UseTextSymbol|, |\UseTextAccent|
%    depending on whether or not the symbol is a text symbol or a text
%    accent.

%    The second argument is the encoding from which this symbol should
%    be fetched.
%
%    The third argument is either a fake accessor command or an error
%    message. the code in that argument (if ever executed) receives
%    two arguments: |#2| and |#5| of |\CheckEncodingSubset|.
%
%    Argument four is the subset encoding id to test against: if this
%    value is higher than the subset id of the current font family
%    then we typeset the symbol, i.e., execute |#1{#2}#5| otherwise
%    it runs |#3#5|, e.g., to produce an error message or fake the
%    glyph somehow.
%
%    Argument five is the symbol or accent command that is being
%    checked.
%
%    For usage examples see definitions below.
%
%    \begin{macrocode}
\def\CheckEncodingSubset#1#2#3#4#5{%
    \ifnum #4>%
      \expandafter\ifx\csname #2:\f@family\endcsname\relax
        0\csname #2:?\endcsname
      \else
        \csname #2:\f@family\endcsname
      \fi
   \relax
   \expandafter\@firstoftwo
  \else
   \expandafter\@secondoftwo
 \fi
  {#1{#2}}{#3}%
  #5%
}
%    \end{macrocode}
% \end{macro}





% To set up the glyphs for the subsets we need a number helpers.
%
%  \begin{macro}{\tc@errorwarn}
%    To we produce errors, warnings, or only info in the transcripts
%    if glyphs require substitutions? By default it is ``info''
%    only. With the \texttt{textcomp} package that can be changed.
%    \begin{macrocode}
\def\tc@errorwarn#1#2{\@latex@info{#1}}
%    \end{macrocode}
%  \end{macro}


%  \begin{macro}{\tc@subst}
%
% \changes{v1.0b}{2020/01/22}{The overall default is \cs{textcompsubstdefault}
%      not \cs{substdefault}}
%    \begin{macrocode}
\def\tc@subst#1{%
   \tc@errorwarn
    {Symbol \string#1 not provided by\MessageBreak
     font family \f@family\space
     in TS1 encoding.\MessageBreak Default family used instead}\@eha
  \bgroup
      \expand@font@defaults
      \ifx\f@family\rmdef@ult
         \fontfamily\rmsubstdefault
      \else\ifx\f@family\sfdef@ult
         \fontfamily\sfsubstdefault
      \else\ifx\f@family\ttdef@ult
         \fontfamily\ttsubstdefault
      \else
         \fontfamily\textcompsubstdefault
      \fi\fi\fi
%    \end{macrocode}
%    Whatever default was chosen, we claim now (locally hopefully)
%    that it  can handle all slots (even if not true) to avoid looping
%    in certain situations, e.g., when something was set up incorrectly.
%    \begin{macrocode}
      \@namedef{TS1:\f@family}{0}%
      \selectfont#1%
  \egroup
}
%    \end{macrocode}
%  \end{macro}
%
%
%
%
%
% \begin{macro}{\tc@fake@euro}
%    |\tc@fake@euro|  is an example of a ``fake'' definition to use in  arg |#3| of
%    the command |\CheckEncodingSubset| when a symbol is not available in a
%    certain font family. Here we produce a poor man's Euro symbol by combining
%    a ``C'' with a ``=''.
%    \begin{macrocode}
\def\tc@fake@euro#1{%
   \leavevmode
   \@font@info{Faking \noexpand#1for font family
                          \f@family\MessageBreak in TS1 encoding}%
   \valign{##\cr
      \vfil\hbox to 0.07em{\dimen@\f@size\p@
                           \math@fontsfalse
                           \fontsize{.7\dimen@}\z@\selectfont=\hss}%
      \vfil\cr%
      \hbox{C}\crcr
   }%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
% \begin{macro}{\tc@check@symbol}
% \begin{macro}{\tc@check@accent}
%    These are two abbreviations that we use below to check symbols
%    and accents in TS1. Only there to save some space, e.g., we can
%    then write
%\begin{verbatim}
%\DeclareTextCommandDefault{\textcurrency}{\tc@check@symbol3\textcurrency}
%\end{verbatim}
%    to ensure that |\textcurrency| is only typeset if the current
%    font has a \texttt{TS1} subset id of less than 3. Otherwise
%    |\tc@error| is called telling the user that for this font family
%    |\textcurrency| is not available.
%    \begin{macrocode}
\def\tc@check@symbol{\CheckEncodingSubset\UseTextSymbol{TS1}\tc@subst}
%    \end{macrocode}
%
%    Accents have been made an error in the \texttt{textcomp} package when
%    not available. Now that we provide the functionality in the
%    kernel we avoid the error by swapping in a \texttt{T1} accent if
%    the \texttt{TS1} accent is not available.
%    \begin{macrocode}
%\def\tc@check@accent{\CheckEncodingSubset\UseTextAccent{TS1}\tc@error}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\tc@check@accent#1{\CheckEncodingSubset\UseTextAccent
                                           {TS1}{\tc@swap@accent#1}}
\def\tc@swap@accent#1#2{\UseTextAccent{T1}#1}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%

% \section{Sub-encodings}
%
%    Here are the default definitions for the \texttt{TS1} symbols.
%    First those that we assume are always available if a font
%    implements \texttt{TS1}.
%
%    \begin{macrocode}
\DeclareTextSymbolDefault{\textdollar}{TS1}
\UndeclareTextCommand{\textdollar}{OT1}  % don't use the OT1 def any longer
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareTextSymbolDefault{\textsterling}{TS1}
\UndeclareTextCommand{\textsterling}{OT1}% don't use the OT1 def any longer
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareTextSymbolDefault{\textperthousand}{TS1}
\UndeclareTextCommand{\textperthousand}{T1} % don't use the T1 def
%    \end{macrocode}
%    Using \cs{UndeclareTextCommand} above is enough only if the
%    encoding definition files are not reloaded afterwards. In the
%    past that happened if \texttt{fontenc} was used in the document
%    preamble (not any longer). So in some sense it is better to fully remove
%    them from the encoding files, but for rollbacks it is easier to
%    keep them in for now.
%
%    These are the standard \texttt{itemize} and footnote symbols
%    originally taken from \texttt{OMS} and now from \texttt{TS1}:
%    \begin{macrocode}
\DeclareTextSymbolDefault{\textasteriskcentered}{TS1}
\DeclareTextSymbolDefault{\textbullet}{TS1}
\DeclareTextSymbolDefault{\textdaggerdbl}{TS1}
\DeclareTextSymbolDefault{\textdagger}{TS1}
\DeclareTextSymbolDefault{\textparagraph}{TS1}
\DeclareTextSymbolDefault{\textperiodcentered}{TS1}
\DeclareTextSymbolDefault{\textsection}{TS1}
%    \end{macrocode}
%
%    And here are the other \texttt{TS1} glyphs that are implemented
%    by every font (or nearly every)---a few are commented out and
%    moved to sub-encoding 9,
%    because they aren't around in some fonts.
%    \begin{macrocode}
%%\DeclareTextSymbolDefault{\textbardbl}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textbrokenbar}{TS1}
%%\DeclareTextSymbolDefault{\textcelsius}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textcent}{TS1}
\DeclareTextSymbolDefault{\textcopyright}{TS1}
\DeclareTextSymbolDefault{\textdegree}{TS1}
\DeclareTextSymbolDefault{\textdiv}{TS1}
\DeclareTextSymbolDefault{\textlnot}{TS1}
\DeclareTextSymbolDefault{\textonehalf}{TS1}
\DeclareTextSymbolDefault{\textonequarter}{TS1}
%%\DeclareTextSymbolDefault{\textonesuperior}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textordfeminine}{TS1}
\DeclareTextSymbolDefault{\textordmasculine}{TS1}
\DeclareTextSymbolDefault{\textpm}{TS1}
\DeclareTextSymbolDefault{\textquotesingle}{TS1}
\DeclareTextSymbolDefault{\textquotestraightbase}{TS1}
\DeclareTextSymbolDefault{\textquotestraightdblbase}{TS1}
\DeclareTextSymbolDefault{\textregistered}{TS1}
%%\DeclareTextSymbolDefault{\textthreequartersemdash}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textthreequarters}{TS1}
%%\DeclareTextSymbolDefault{\textthreesuperior}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\texttimes}{TS1}
\DeclareTextSymbolDefault{\texttrademark}{TS1}
%%\DeclareTextSymbolDefault{\texttwelveudash}{TS1} % subst in sub-enc 9 above
%%\DeclareTextSymbolDefault{\texttwosuperior}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textyen}{TS1}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareTextSymbolDefault{\textcapitalcompwordmark}{TS1}
\DeclareTextSymbolDefault{\textascendercompwordmark}{TS1}
%    \end{macrocode}
%
%
%    In the following sections the remaining default definitions are
%    ordered by sub-encoding in which they are become
%    \textbf{unavailable}, i.e., they are not provided in the
%    sub-encoding with that number and all sub-encodings with higher
%    numbers.
%
%    Thus the symbols that are available in sub-encoding $x$ are the
%    symbols above (always available) and the symbols listed as becoming
%    unavailable in sub-encodings $x+1$ and higher.
%
% \subsection{Unavailable in sub-encoding \texttt{1} and higher (drop symbols not working in
%    Latin Modern)}
%
%    The \cs{textcircled} is available but the glyph is simply too
%    small so we keep using the \texttt{OMS} glyph.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textcircled}
  {\CheckEncodingSubset\UseTextAccent{TS1}{\UseTextAccent{OMS}}1\textcircled}
%    \end{macrocode}
%
%
%
%
%
% \subsection{Unavailable in sub-encoding \texttt{2}  (majority of new OTF fonts via autoinst) and higher}
%
%    \begin{macrocode}
\DeclareTextCommandDefault{\t}
  {\CheckEncodingSubset\UseTextAccent{TS1}{\UseTextAccent{OML}}2\t}
%    \end{macrocode}
%
%    Capital  accents are really only very seldom implemented, so from
%    sub-encoding \texttt{2} onwards we use the normal \texttt{T1}
%    accents if they are asked for in the document.
%
%    In Unicode engines we don't implement them at all but always use
%    the basic accents instead. whether that works or not really
%    depends on the font, something like \verb=\"X= usually comes out
%    wrong in Unicode engines.
%
%    \begin{macrocode}
\ifx\Umathcode\@undefined
  \DeclareTextCommandDefault{\capitalacute}
                            {\tc@check@accent{\'}2\capitalacute}
  \DeclareTextCommandDefault{\capitalbreve}
                            {\tc@check@accent{\u}2\capitalbreve}
  \DeclareTextCommandDefault{\capitalcaron}
                            {\tc@check@accent{\v}2\capitalcaron}
  \DeclareTextCommandDefault{\capitalcedilla}
                            {\tc@check@accent{\c}2\capitalcedilla}
  \DeclareTextCommandDefault{\capitalcircumflex}
                            {\tc@check@accent{\^}2\capitalcircumflex}
  \DeclareTextCommandDefault{\capitaldieresis}
                            {\tc@check@accent{\"}2\capitaldieresis}
  \DeclareTextCommandDefault{\capitaldotaccent}
                            {\tc@check@accent{\.}2\capitaldotaccent}
  \DeclareTextCommandDefault{\capitalgrave}
                            {\tc@check@accent{\`}2\capitalgrave}
  \DeclareTextCommandDefault{\capitalhungarumlaut}
                            {\tc@check@accent{\H}2\capitalhungarumlaut}
  \DeclareTextCommandDefault{\capitalmacron}
                            {\tc@check@accent{\=}2\capitalmacron}
  \DeclareTextCommandDefault{\capitalogonek}
                            {\tc@check@accent{\k}2\capitalogonek}
  \DeclareTextCommandDefault{\capitalring}
                            {\tc@check@accent{\r}2\capitalring}
  \DeclareTextCommandDefault{\capitaltie}
                            {\tc@check@accent{\t}2\capitaltie}
  \DeclareTextCommandDefault{\capitaltilde}
                            {\tc@check@accent{\~}2\capitaltilde}
%    \end{macrocode}
%    For \cs{newtie} and \cs{capitalnewtie} this is actually wrong, they should pick up
%    the accent from the substitution font (not done yet).
%    \begin{macrocode}
  \DeclareTextCommandDefault{\newtie}
                            {\tc@check@accent{\t}2\newtie}
  \DeclareTextCommandDefault{\capitalnewtie}
                            {\tc@check@accent{\t}2\capitalnewtie}
%    \end{macrocode}
%
%    In Unicode engines we just execute the simple accents:
% \changes{v1.0c}{2020/02/10}{Use \cs{@tabacckludge} for
%      tabbing where necessary (gh/271)}
% \changes{v1.0d}{2020/04/29}{Make all capital accents text
%      commands for hyperref (gh/332)}
%    \begin{macrocode}
\else
  \DeclareTextCommandDefault\capitalacute{\@tabacckludge'}
  \DeclareTextCommandDefault\capitalbreve{\u}
  \DeclareTextCommandDefault\capitalcaron{\v}
  \DeclareTextCommandDefault\capitalcedilla{\c}
  \DeclareTextCommandDefault\capitalcircumflex{\^}
  \DeclareTextCommandDefault\capitaldieresis{\"}
  \DeclareTextCommandDefault\capitaldotaccent{\.}
  \DeclareTextCommandDefault\capitalgrave{\@tabacckludge`}
  \DeclareTextCommandDefault\capitalhungarumlaut{\H}
  \DeclareTextCommandDefault\capitalmacron{\@tabacckludge=}
  \DeclareTextCommandDefault\capitalnewtie{\t}
  \DeclareTextCommandDefault\capitalogonek{\k}
  \DeclareTextCommandDefault\capitalring{\r}
  \DeclareTextCommandDefault\capitaltie{\t}
  \DeclareTextCommandDefault\capitaltilde{\~}
  \DeclareTextCommandDefault\newtie{\t}
\fi
%    \end{macrocode}
%
%
%
%
%    The next two symbols exist in some fonts (faked?), but we ignore
%    that to keep the subsets reasonable compact and most important linear.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textlbrackdbl}
                          {\tc@check@symbol2\textlbrackdbl}
\DeclareTextCommandDefault{\textrbrackdbl}
                          {\tc@check@symbol2\textrbrackdbl}
%    \end{macrocode}
%
%
%    Old style numerals are again in some fonts but using
%    \texttt{-OsF}, etc.\ is the better approach to get them, so we
%    claim they aren't in sub-encoding 2 as that's true for most
%    fonts.
%    \begin{macrocode}
\DeclareTextCommandDefault{\texteightoldstyle}
                          {\tc@check@symbol2\texteightoldstyle}
\DeclareTextCommandDefault{\textfiveoldstyle}
                          {\tc@check@symbol2\textfiveoldstyle}
\DeclareTextCommandDefault{\textfouroldstyle}
                          {\tc@check@symbol2\textfouroldstyle}
\DeclareTextCommandDefault{\textnineoldstyle}
                          {\tc@check@symbol2\textnineoldstyle}
\DeclareTextCommandDefault{\textoneoldstyle}
                          {\tc@check@symbol2\textoneoldstyle}
\DeclareTextCommandDefault{\textsevenoldstyle}
                          {\tc@check@symbol2\textsevenoldstyle}
\DeclareTextCommandDefault{\textsixoldstyle}
                          {\tc@check@symbol2\textsixoldstyle}
\DeclareTextCommandDefault{\textthreeoldstyle}
                          {\tc@check@symbol2\textthreeoldstyle}
\DeclareTextCommandDefault{\texttwooldstyle}
                          {\tc@check@symbol2\texttwooldstyle}
\DeclareTextCommandDefault{\textzerooldstyle}
                          {\tc@check@symbol2\textzerooldstyle}
%    \end{macrocode}
%
%
%
%    The next set of glyphs is special to \TeX{} fonts (and available
%    with a few older PS fonts supported through virtual fonts), but
%    not any longer in the majority of fonts provided through
%    autoinst, so we pretend there aren't available in sub-encoding 2
%    and below.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textacutedbl}
                          {\tc@check@symbol2\textacutedbl}
\DeclareTextCommandDefault{\textasciiacute}
                          {\tc@check@symbol2\textasciiacute}
\DeclareTextCommandDefault{\textasciibreve}
                          {\tc@check@symbol2\textasciibreve}
\DeclareTextCommandDefault{\textasciicaron}
                          {\tc@check@symbol2\textasciicaron}
\DeclareTextCommandDefault{\textasciidieresis}
                          {\tc@check@symbol2\textasciidieresis}
\DeclareTextCommandDefault{\textasciigrave}
                          {\tc@check@symbol2\textasciigrave}
\DeclareTextCommandDefault{\textasciimacron}
                          {\tc@check@symbol2\textasciimacron}
\DeclareTextCommandDefault{\textgravedbl}
                          {\tc@check@symbol2\textgravedbl}
\DeclareTextCommandDefault{\texttildelow}
                          {\tc@check@symbol2\texttildelow}
%    \end{macrocode}
%
%
%    Finally those below are only available in CM-based fonts but in
%    no font that has its origin outside of the \TeX{} world.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textbaht}
                          {\tc@check@symbol2\textbaht}
\DeclareTextCommandDefault{\textbigcircle}
                          {\tc@check@symbol2\textbigcircle}
\DeclareTextCommandDefault{\textborn}
                          {\tc@check@symbol2\textborn}
\DeclareTextCommandDefault{\textcentoldstyle}
                          {\tc@check@symbol2\textcentoldstyle}
\DeclareTextCommandDefault{\textcircledP}
                          {\tc@check@symbol2\textcircledP}
\DeclareTextCommandDefault{\textcopyleft}
                          {\tc@check@symbol2\textcopyleft}
\DeclareTextCommandDefault{\textdblhyphenchar}
                          {\tc@check@symbol2\textdblhyphenchar}
\DeclareTextCommandDefault{\textdblhyphen}
                          {\tc@check@symbol2\textdblhyphen}
\DeclareTextCommandDefault{\textdied}
                          {\tc@check@symbol2\textdied}
\DeclareTextCommandDefault{\textdiscount}
                          {\tc@check@symbol2\textdiscount}
\DeclareTextCommandDefault{\textdivorced}
                          {\tc@check@symbol2\textdivorced}
\DeclareTextCommandDefault{\textdollaroldstyle}
                          {\tc@check@symbol2\textdollaroldstyle}
\DeclareTextCommandDefault{\textguarani}
                          {\tc@check@symbol2\textguarani}
\DeclareTextCommandDefault{\textleaf}
                          {\tc@check@symbol2\textleaf}
\DeclareTextCommandDefault{\textlquill}
                          {\tc@check@symbol2\textlquill}
\DeclareTextCommandDefault{\textmarried}
                          {\tc@check@symbol2\textmarried}
\DeclareTextCommandDefault{\textmho}
                          {\tc@check@symbol2\textmho}
\DeclareTextCommandDefault{\textmusicalnote}
                          {\tc@check@symbol2\textmusicalnote}
\DeclareTextCommandDefault{\textnaira}
                          {\tc@check@symbol2\textnaira}
\DeclareTextCommandDefault{\textopenbullet}
                          {\tc@check@symbol2\textopenbullet}
\DeclareTextCommandDefault{\textpeso}
                          {\tc@check@symbol2\textpeso}
\DeclareTextCommandDefault{\textpilcrow}
                          {\tc@check@symbol2\textpilcrow}
\DeclareTextCommandDefault{\textrecipe}
                          {\tc@check@symbol2\textrecipe}
\DeclareTextCommandDefault{\textreferencemark}
                          {\tc@check@symbol2\textreferencemark}
\DeclareTextCommandDefault{\textrquill}
                          {\tc@check@symbol2\textrquill}
\DeclareTextCommandDefault{\textservicemark}
                          {\tc@check@symbol2\textservicemark}
\DeclareTextCommandDefault{\textsurd}
                          {\tc@check@symbol2\textsurd}
%    \end{macrocode}
%
%    The \cs{textpertenthousand} also belongs in this group but here
%    we have a choice: in T1 there is a definition for
%    \cs{textpertenthousand} making the symbol up from \% and
%    \verb=\char 24= (twice) but in many fonts that char doesn't exist
%    and the slot is reused for random ligatures. So better not use it
%    because often it is wrong.  But pointing to TS1 is also not great
%    as only a few fonts have it as a real symbol, so we get a
%    substitution to CM or LM.
%
%    Alternatively we could just state that the symbol is unavailable in
%    those fonts. For now I substitute.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textpertenthousand}
                          {\tc@check@symbol2\textpertenthousand}
\UndeclareTextCommand{\textpertenthousand}{T1}
%    \end{macrocode}
%
%
%
% \subsection{Unavailable in sub-encoding \texttt{3} and higher}
%
%    Sub-encoding \texttt{2} is the one where we loose many
%    symbols. In the higher-numbered sub-encodings we see only a few
%    dropped additionally.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textlangle}
                          {\tc@check@symbol3\textlangle}
\DeclareTextCommandDefault{\textrangle}
                          {\tc@check@symbol3\textrangle}
%    \end{macrocode}
%
%
%
%
%
% \subsection{Unavailable in sub-encoding \texttt{4} and higher}
%
%    \begin{macrocode}
\DeclareTextCommandDefault{\textcolonmonetary}
                          {\tc@check@symbol4\textcolonmonetary}
\DeclareTextCommandDefault{\textdong}
                          {\tc@check@symbol4\textdong}
\DeclareTextCommandDefault{\textdownarrow}
                          {\tc@check@symbol4\textdownarrow}
\DeclareTextCommandDefault{\textleftarrow}
                          {\tc@check@symbol4\textleftarrow}
\DeclareTextCommandDefault{\textlira}
                          {\tc@check@symbol4\textlira}
\DeclareTextCommandDefault{\textrightarrow}
                          {\tc@check@symbol4\textrightarrow}
\DeclareTextCommandDefault{\textuparrow}
                          {\tc@check@symbol4\textuparrow}
\DeclareTextCommandDefault{\textwon}
                          {\tc@check@symbol4\textwon}
%    \end{macrocode}
%
%
%
%
%
% \subsection{Unavailable in sub-encoding \texttt{5} (most older PS fonts) and higher}
%
%    Most older PS fonts (supported in \TeX{} since the early nineties
%    when virtual fonts became available) are sorted under this
%    sub-encoding. But in reality, many of them don't have all glyphs
%    that should be available in sub-encoding \texttt{5}. Instead they
%    show little squares, i.e., they produce ``tofu'' if you are
%    unlucky.
%
%    But the coverage is so random that it is impossible to sort them
%    properly and if we tried to ensure that they only typeset those
%    glyphs that are really  always available, we would have to put them all into
%    sub-encoding \texttt{9}; so putting them into 5 is really a compromise.
%
%    Modern fonts usually don't typeset a tofu character if a glyph is
%    missing. They are therefore only classified as sub-encoding \texttt{5} if they
%    really support its glyph set completely.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textestimated}
                          {\tc@check@symbol5\textestimated}
\DeclareTextCommandDefault{\textnumero}
                          {\tc@check@symbol5\textnumero}
%    \end{macrocode}
%
%
%
%
% \subsection{Unavailable in sub-encoding \texttt{6} and higher}
%
%    \begin{macrocode}
\DeclareTextCommandDefault{\textflorin}
                          {\tc@check@symbol6\textflorin}
\DeclareTextCommandDefault{\textcurrency}
                          {\tc@check@symbol6\textcurrency}
%    \end{macrocode}
%
%
%
% \subsection{Unavailable in sub-encoding \texttt{7} and higher}
%
%    \begin{macrocode}
\DeclareTextCommandDefault{\textfractionsolidus}
                          {\tc@check@symbol7\textfractionsolidus}
\DeclareTextCommandDefault{\textohm}
                          {\tc@check@symbol7\textohm}
\DeclareTextCommandDefault{\textmu}
                          {\tc@check@symbol7\textmu}
\DeclareTextCommandDefault{\textminus}
                          {\tc@check@symbol7\textminus}
%    \end{macrocode}
%
%
%
% \subsection{Unavailable in sub-encoding \texttt{8} and higher}
%
%    \begin{macrocode}
\DeclareTextCommandDefault{\textblank}
                          {\tc@check@symbol{8}\textblank}
\DeclareTextCommandDefault{\textinterrobangdown}
                          {\tc@check@symbol{8}\textinterrobangdown}
\DeclareTextCommandDefault{\textinterrobang}
                          {\tc@check@symbol{8}\textinterrobang}
%    \end{macrocode}
%
%    Fonts with this sub-encoding don't have a Euro symbol, but
%    instead of substituting we fake it.
%    \begin{macrocode}
\DeclareTextCommandDefault{\texteuro}
  {\CheckEncodingSubset\UseTextSymbol{TS1}\tc@fake@euro{8}\texteuro}
%    \end{macrocode}
%
%
%
%
% \subsection{Unavailable in Sub-encoding \texttt{9} (most missing)}
%
%    \begin{macrocode}
\DeclareTextCommandDefault{\textcelsius}
                          {\tc@check@symbol{9}\textcelsius}
\DeclareTextCommandDefault{\textonesuperior}
                          {\tc@check@symbol{9}\textonesuperior}
\DeclareTextCommandDefault{\textthreequartersemdash}
                          {\tc@check@symbol{9}\textthreequartersemdash}
\DeclareTextCommandDefault{\textthreesuperior}
                          {\tc@check@symbol{9}\textthreesuperior}
\DeclareTextCommandDefault{\texttwelveudash}
                          {\tc@check@symbol{9}\texttwelveudash}
\DeclareTextCommandDefault{\texttwosuperior}
                          {\tc@check@symbol{9}\texttwosuperior}
\DeclareTextCommandDefault{\textbardbl}
                          {\tc@check@symbol{9}\textbardbl}
%    \end{macrocode}
%
%
%
%
% \section{Unicode engine specials}
%
%    If we are using a unicode engine we handle some glyphs differently,
%    so this here are the definitions for the Unicode encoding
%    (overwriting the defaults above).

%    \begin{macrocode}
\ifx \Umathcode\@undefined  \else
%    \end{macrocode}
%
%    This set should be taken from \texttt{TS1} encoding even if it
%    means you get it from the default font for that encoding.
%    \begin{macrocode}
%\DeclareTextSymbol{\textcopyleft}{TS1}{171}
%\DeclareTextSymbol{\textdblhyphen}{TS1}{45}
%\DeclareTextSymbol{\textdblhyphenchar}{TS1}{127}
%\DeclareTextSymbol{\textquotestraightbase}{TS1}{13}
%\DeclareTextSymbol{\textquotestraightdblbase}{TS1}{18}
%\DeclareTextSymbol{\textleaf}{TS1}{108}
%\DeclareTextSymbol{\texttwelveudash}{TS1}{21}
%\DeclareTextSymbol{\textthreequartersemdash}{TS1}{22}
%    \end{macrocode}
%
%    If oldstyle numerals are asked for we just use \cs{oldstylenums}.
%    \begin{macrocode}
\DeclareTextCommand{\textzerooldstyle} \UnicodeEncodingName{\oldstylenums{0}}
\DeclareTextCommand{\textoneoldstyle}  \UnicodeEncodingName{\oldstylenums{1}}
\DeclareTextCommand{\texttwooldstyle}  \UnicodeEncodingName{\oldstylenums{2}}
\DeclareTextCommand{\textthreeoldstyle}\UnicodeEncodingName{\oldstylenums{3}}
\DeclareTextCommand{\textfouroldstyle} \UnicodeEncodingName{\oldstylenums{4}}
\DeclareTextCommand{\textfiveoldstyle} \UnicodeEncodingName{\oldstylenums{5}}
\DeclareTextCommand{\textsixoldstyle}  \UnicodeEncodingName{\oldstylenums{6}}
\DeclareTextCommand{\textsevenoldstyle}\UnicodeEncodingName{\oldstylenums{7}}
\DeclareTextCommand{\texteightoldstyle}\UnicodeEncodingName{\oldstylenums{8}}
\DeclareTextCommand{\textnineoldstyle} \UnicodeEncodingName{\oldstylenums{9}}
%    \end{macrocode}
%    These have Unicode slots so this should be integrated into TU explicitly
%    \begin{macrocode}
\DeclareTextSymbol{\textpilcrow}        \UnicodeEncodingName{"00B6}
\DeclareTextSymbol{\textborn}           \UnicodeEncodingName{"002A}
\DeclareTextSymbol{\textdied}           \UnicodeEncodingName{"2020}
\DeclareTextSymbol{\textlbrackdbl}      \UnicodeEncodingName{"27E6}
\DeclareTextSymbol{\textrbrackdbl}      \UnicodeEncodingName{"27E7}
\DeclareTextSymbol{\textguarani}        \UnicodeEncodingName{"20B2}
%    \end{macrocode}
%    We could make \cs{textcentoldstyle} and \cs{textdollaroldstyle}
%    point to dollar and cent in the Unicode encoding
%    \begin{macrocode}
%\DeclareTextSymbol{\textcentoldstyle}  \UnicodeEncodingName{"00A2}
%\DeclareTextSymbol{\textdollaroldstyle}\UnicodeEncodingName{"0024}
%    \end{macrocode}
%    but I think it is better to pick them up from TS1 even if that
%    usually means LMR fonts
%    \begin{macrocode}
\DeclareTextSymbol{\textdollaroldstyle}{TS1}{138}
\DeclareTextSymbol{\textcentoldstyle}  {TS1}{139}
%    \end{macrocode}
%
%
%    \begin{macrocode}
\fi               % --- END of Unicode engines specials
%    \end{macrocode}
%
% \section{Font family sub-encodings setup}
%
%    We declare the subsets for a good number of fonts in the kernel
%    \ldots
%
%    But first the default for anything that is not declared.  We use
%    \texttt{9} which is most likely much too conservative, but with the
%    advantage that we aren't getting missing glyphs (or at least that
%    this is very unlikely).
%    For nearly all font in the \TeX{} Live distribution of 2019
%    ``correct'' classifications are given below, so that this default
%    is only used for new font families, and over time the right
%    classifications can be added here too.
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{?}{9}
%    \end{macrocode}
%
%    This first block contains the fonts that have been already
%    supported by the \texttt{textcomp} package way back, i.e., the
%    font families that have \TeX{} support since the mid-nineties.
% \changes{v1.1a}{2024/01/27}{Adjusted/corrected TS1 sub-encoding
%    declarations for various families (gh/1257)}
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{ccr}     {0}
\DeclareEncodingSubset{TS1}{cmbr}    {0}
\DeclareEncodingSubset{TS1}{cmr}     {0}
\DeclareEncodingSubset{TS1}{cmss}    {0}
\DeclareEncodingSubset{TS1}{cmtl}    {0}
\DeclareEncodingSubset{TS1}{cmtt}    {0}
\DeclareEncodingSubset{TS1}{cmvtt}   {0}
\DeclareEncodingSubset{TS1}{pxr}     {0}
\DeclareEncodingSubset{TS1}{pxss}    {0}
\DeclareEncodingSubset{TS1}{pxtt}    {0}
\DeclareEncodingSubset{TS1}{qag}     {0}
\DeclareEncodingSubset{TS1}{qbk}     {0}
\DeclareEncodingSubset{TS1}{qcr}     {0}
\DeclareEncodingSubset{TS1}{qcs}     {0}
\DeclareEncodingSubset{TS1}{qhvc}    {0}
\DeclareEncodingSubset{TS1}{qhv}     {0}
\DeclareEncodingSubset{TS1}{qpl}     {0}
\DeclareEncodingSubset{TS1}{qtm}     {0}
\DeclareEncodingSubset{TS1}{qzc}     {0}
\DeclareEncodingSubset{TS1}{txr}     {0}
\DeclareEncodingSubset{TS1}{txss}    {0}
\DeclareEncodingSubset{TS1}{txtt}    {0}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{lmr}     {1}
\DeclareEncodingSubset{TS1}{lmdh}    {1}
\DeclareEncodingSubset{TS1}{lmss}    {1}
\DeclareEncodingSubset{TS1}{lmssq}   {1}
\DeclareEncodingSubset{TS1}{lmvtt}   {1}
%    \end{macrocode}
%    The lmtt family is missing TM, SM, and perthousand for some
%    reason, so the first safe sub-encoding would be 2, but that is
%    then missing out a huge number of glyphs that are available, so
%    we claim it is sub-encoding 1 even if this can lead to missing glyphs.
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{lmtt}    {1} % missing TM, SM and pertenthousand
%    \end{macrocode}
%
%    The next three families have been removed from TeX Live, but we
%    keep the definitions
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{ptmx}    {2}
\DeclareEncodingSubset{TS1}{ptmj}    {2}
\DeclareEncodingSubset{TS1}{ul8}     {2}
%    \end{macrocode}
%
%    The next set are the early PostScript font implementations, these
%    days there are better alternatives, but \ldots. Note that, their
%    virtual fonts contain a lot of ``tofu'' in form of black squares,
%    thus they don't even give a missing character warning if you
%    select such a glyph. This is why they are set as sub-encoding 5.
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{bch} {5} % tofu for blank, ohm
\DeclareEncodingSubset{TS1}{futj}{5} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{futs}{5} % tofu for blank, ohm
\DeclareEncodingSubset{TS1}{futx}{5} % probably (currently broken distrib)
\DeclareEncodingSubset{TS1}{pag} {5} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{pbk} {5} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{pcr} {5} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{phv} {5} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{pnc} {5} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{pplj}{5} % tofu for blank
\DeclareEncodingSubset{TS1}{pplx}{5} % tofu for blank
\DeclareEncodingSubset{TS1}{ppl} {5} % tofu for blank interrobang/down
\DeclareEncodingSubset{TS1}{ptm} {5} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{pzc} {5} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{ul9} {5} % tofu for blank, interrobang/down, ohm
%    \end{macrocode}
%
%    The next set suffers from the same problem and they contain even
%    fewer real glyphs.
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{dayroms}{6} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{dayrom} {6} % tofu for blank, interrobang/down, ohm
\DeclareEncodingSubset{TS1}{augie}{8} % really only missing euro
\DeclareEncodingSubset{TS1}{put}  {8}
\DeclareEncodingSubset{TS1}{uag}  {8} % probably (currently broken distrib)
\DeclareEncodingSubset{TS1}{ugq}  {8}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{zi4}     {9}
%    \end{macrocode}
%
%    LucidaBright (sold through TUG) probably not quite correct, I
%    guess as I have the older fonts \ldots
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{hls}     {5}
\DeclareEncodingSubset{TS1}{hlst}    {5}
\DeclareEncodingSubset{TS1}{hlct}    {5}
\DeclareEncodingSubset{TS1}{hlh}     {5}
\DeclareEncodingSubset{TS1}{hlx}     {8}
\DeclareEncodingSubset{TS1}{hlce}    {8}
\DeclareEncodingSubset{TS1}{hlcn}    {8}
\DeclareEncodingSubset{TS1}{hlcw}    {8}
\DeclareEncodingSubset{TS1}{hlcf}    {8}
%    \end{macrocode}
%
%    Below are the newer fonts that have support files for
%    \LaTeX{}. With very few exceptions the classifications are done
%    so that all characters are correctly produced (either being
%    available in the font or substituted).
%
%    There are a few fonts that contain ``tofu'' squares in places
%    (instead of a real glyph) and in a few cases some really seldom
%    needed chars are unavailable, i.e., produce missing glyphs (to
%    avoid that a large number of available chars are unnecessarily
%    substituted).
%
%    Encoding declarations for these font families shouldn't really be
%    in the kernel, but part of the \texttt{.fd} files for the
%    family. When we introduced the concept in 2021 we had some hope
%    that this would happen over time and that we could take the
%    declarations out---after all it is nearly impossible to maintain
%    it correctly in the kernel, given that fonts may get new glyphs
%    added (happened for several of them in the recent year) which is
%    something we wouldn't notice. However, so far this hasn't
%    happened, so in 2024, I went through the current set and adjusted
%    the declarations in several places.
%
%    Next four are wrong and still need adjustment:
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{lato-*}       {0}  % with a bunch of tofu inside
\DeclareEncodingSubset{TS1}{opensans-*}   {0}  % with a bunch of tofu inside
\DeclareEncodingSubset{TS1}{cantarell-*}  {0}  % with a bunch of tofu inside
\DeclareEncodingSubset{TS1}{tli}          {1}  % with lots of tofu inside
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{fbb-*}        {2}  % missing centoldstyle
%    \end{macrocode}
%
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{Alegreya-*}               {2}
\DeclareEncodingSubset{TS1}{AlegreyaSans-*}           {2}
\DeclareEncodingSubset{TS1}{BaskervilleF-*}           {2}
\DeclareEncodingSubset{TS1}{DejaVuSans-TLF}           {2}
\DeclareEncodingSubset{TS1}{DejaVuSansCondensed-TLF}  {2}
%    \end{macrocode}
%    Next one is missing \cs{textfractionsolidus} but is otherwise
%    completely sub-encoding 2 so we use that sub-encoding.
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{DejaVuSansMono-TLF}       {2}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{EBGaramond-*}             {2}
\DeclareEncodingSubset{TS1}{Merriwthr-OsF}            {2}
\DeclareEncodingSubset{TS1}{MerriwthrSans-OsF}        {2}
\DeclareEncodingSubset{TS1}{Montserrat-*}             {2}
\DeclareEncodingSubset{TS1}{MontserratAlternates-*}   {2}
\DeclareEncodingSubset{TS1}{NotoSansMono-TLF}         {2}
\DeclareEncodingSubset{TS1}{NotoSansMono-TOsF}        {2}
\DeclareEncodingSubset{TS1}{Tempora-TLF}              {2}
\DeclareEncodingSubset{TS1}{Tempora-TOsF}             {2}
\DeclareEncodingSubset{TS1}{XCharter-TLF}             {2}
\DeclareEncodingSubset{TS1}{XCharter-TOsF}            {2}
\DeclareEncodingSubset{TS1}{erewhon-*}                {2}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{Arimo-TLF}                {3}
\DeclareEncodingSubset{TS1}{Crlt-*}                   {3}
\DeclareEncodingSubset{TS1}{IBMPlexMono-TLF}          {3}
\DeclareEncodingSubset{TS1}{IBMPlexSans-TLF}          {3}
\DeclareEncodingSubset{TS1}{IBMPlexSerif-TLF}         {3}
\DeclareEncodingSubset{TS1}{SourceCodePro-TLF}        {3}
\DeclareEncodingSubset{TS1}{SourceCodePro-TOsF}       {3}
\DeclareEncodingSubset{TS1}{SourceSansPro-*}          {3}
\DeclareEncodingSubset{TS1}{SourceSerifPro-*}         {3}
\DeclareEncodingSubset{TS1}{Tinos-TLF}                {3}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{AccanthisADFStdNoThree-LF}{4}
\DeclareEncodingSubset{TS1}{Cabin-TLF}                {4}
\DeclareEncodingSubset{TS1}{Caladea-TLF}              {4}
\DeclareEncodingSubset{TS1}{Chivo-*}                  {4}
\DeclareEncodingSubset{TS1}{ClearSans-TLF}            {4}
\DeclareEncodingSubset{TS1}{Coelacanth-LF}            {4}
\DeclareEncodingSubset{TS1}{CrimsonPro-*}             {4}
\DeclareEncodingSubset{TS1}{FiraMono-TLF}             {4}
\DeclareEncodingSubset{TS1}{FiraMono-TOsF}            {4}
\DeclareEncodingSubset{TS1}{FiraSans-*}               {4}
\DeclareEncodingSubset{TS1}{Go-TLF}                   {4}
\DeclareEncodingSubset{TS1}{GoMono-TLF}               {4}
\DeclareEncodingSubset{TS1}{InriaSans-*}              {4}
\DeclareEncodingSubset{TS1}{InriaSerif-*}             {4}
\DeclareEncodingSubset{TS1}{LibertinusSans-*}         {4}
\DeclareEncodingSubset{TS1}{LibertinusSerif-*}        {4}
\DeclareEncodingSubset{TS1}{LibreBodoni-TLF}          {4}
\DeclareEncodingSubset{TS1}{LibreFranklin-TLF}        {4}
\DeclareEncodingSubset{TS1}{LinguisticsPro-LF}        {4}
\DeclareEncodingSubset{TS1}{LinguisticsPro-OsF}       {4}
\DeclareEncodingSubset{TS1}{LinuxBiolinumT-*}         {4}
\DeclareEncodingSubset{TS1}{LinuxLibertineT-*}        {4}
\DeclareEncodingSubset{TS1}{MintSpirit-*}             {4}
\DeclareEncodingSubset{TS1}{MintSpiritNoTwo-*}        {4}
\DeclareEncodingSubset{TS1}{PTMono-TLF}               {4}
\DeclareEncodingSubset{TS1}{PTSans-TLF}               {4}
\DeclareEncodingSubset{TS1}{PTSansCaption-TLF}        {4}
\DeclareEncodingSubset{TS1}{PTSansNarrow-TLF}         {4}
\DeclareEncodingSubset{TS1}{PTSerif-TLF}              {4}
\DeclareEncodingSubset{TS1}{PTSerifCaption-TLF}       {4}
\DeclareEncodingSubset{TS1}{Raleway-TLF}              {4}
\DeclareEncodingSubset{TS1}{Raleway-TOsF}             {4}
\DeclareEncodingSubset{TS1}{Roboto-*}                 {4}
\DeclareEncodingSubset{TS1}{RobotoMono-TLF}           {4}
\DeclareEncodingSubset{TS1}{RobotoSlab-TLF}           {4}
\DeclareEncodingSubset{TS1}{Rosario-*}                {4}
\DeclareEncodingSubset{TS1}{SticksTooText-*}          {4}
\DeclareEncodingSubset{TS1}{UniversalisADFStd-LF}     {4}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{Almndr-OsF}               {5}
\DeclareEncodingSubset{TS1}{Baskervaldx-*}            {5}
\DeclareEncodingSubset{TS1}{Bttr-TLF}                 {5}
\DeclareEncodingSubset{TS1}{Cinzel-LF}                {5}
\DeclareEncodingSubset{TS1}{CinzelDecorative-LF}      {5}
\DeclareEncodingSubset{TS1}{Cochineal-*}              {5}
\DeclareEncodingSubset{TS1}{DejaVuSerif-TLF}          {5}
\DeclareEncodingSubset{TS1}{DejaVuSerifCondensed-TLF} {5}
\DeclareEncodingSubset{TS1}{GilliusADF-LF}            {5}
\DeclareEncodingSubset{TS1}{GilliusADFCond-LF}        {5}
\DeclareEncodingSubset{TS1}{GilliusADFNoTwo-LF}       {5}
\DeclareEncodingSubset{TS1}{GilliusADFNoTwoCond-LF}   {5}
\DeclareEncodingSubset{TS1}{OldStandard-TLF}          {5}
\DeclareEncodingSubset{TS1}{PlyfrDisplay-TLF}         {5}
\DeclareEncodingSubset{TS1}{PlyfrDisplay-TOsF}        {5}
\DeclareEncodingSubset{TS1}{TheanoDidot-TLF}          {5}
\DeclareEncodingSubset{TS1}{TheanoDidot-TOsF}         {5}
\DeclareEncodingSubset{TS1}{TheanoModern-TLF}         {5}
\DeclareEncodingSubset{TS1}{TheanoModern-TOsF}        {5}
\DeclareEncodingSubset{TS1}{TheanoOldStyle-TLF}       {5}
\DeclareEncodingSubset{TS1}{TheanoOldStyle-TOsF}      {5}
\DeclareEncodingSubset{TS1}{charssil-TLF}             {5}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{Crimson-TLF}              {6}
\DeclareEncodingSubset{TS1}{LibertinusSerifDisplay-LF}{6}
\DeclareEncodingSubset{TS1}{LinuxLibertineDisplayT-*} {6}
\DeclareEncodingSubset{TS1}{LinuxLibertineMonoT-LF}   {6}
\DeclareEncodingSubset{TS1}{LinuxLibertineMonoT-TLF}  {6}
\DeclareEncodingSubset{TS1}{Ovrlck-LF}                {6}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{ComicNeue-TLF}            {7}
\DeclareEncodingSubset{TS1}{ComicNeueAngular-TLF}     {7}
\DeclareEncodingSubset{TS1}{CormorantGaramond-*}      {7}
\DeclareEncodingSubset{TS1}{Heuristica-TLF}           {7}
\DeclareEncodingSubset{TS1}{Heuristica-TOsF}          {7}
\DeclareEncodingSubset{TS1}{IMFELLEnglish-TLF}        {7}
\DeclareEncodingSubset{TS1}{LibreBskrvl-TLF}          {7}
\DeclareEncodingSubset{TS1}{LibreCsln-*}              {7}
\DeclareEncodingSubset{TS1}{Lbstr-LF}                 {7}
\DeclareEncodingSubset{TS1}{Mrcls-LF}                 {7}
%    \end{macrocode}
%    Strangely enough NotoSerif and NotoSans are sub-encoding 7 as
%    they are missing \cs{textminus} and several other glyphs. In
%    contrast the NotoSansMono is far more complete.
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{NotoSans-*}               {7}
\DeclareEncodingSubset{TS1}{NotoSerif-*}              {7}
\DeclareEncodingSubset{TS1}{Quattro-LF}               {7}
\DeclareEncodingSubset{TS1}{QuattroSans-LF}           {7}
\DeclareEncodingSubset{TS1}{Frm-LF}                   {7}  % the superiors are missing
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{LibertinusMono-TLF}       {8}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{AlgolRevived-TLF}         {9}
%    \end{macrocode}
%
%
%
%
% \section{Legacy symbol support for lists and footnote symbols}
%
%  \begin{macro}{\UseLegacyTextSymbols}
%
%    \begin{macrocode}
\def\UseLegacyTextSymbols{%
  \DeclareTextSymbolDefault{\textasteriskcentered}{OMS}%
  \DeclareTextSymbolDefault{\textbardbl}{OMS}%
  \DeclareTextSymbolDefault{\textbullet}{OMS}%
  \DeclareTextSymbolDefault{\textdaggerdbl}{OMS}%
  \DeclareTextSymbolDefault{\textdagger}{OMS}%
  \DeclareTextSymbolDefault{\textparagraph}{OMS}%
  \DeclareTextSymbolDefault{\textperiodcentered}{OMS}%
  \DeclareTextSymbolDefault{\textsection}{OMS}%
  \UndeclareTextCommand{\textsection}{T1}%
  \expandafter\let\csname oldstylenums \expandafter\endcsname
                  \csname legacyoldstylenums \endcsname
}
%    \end{macrocode}
%  \end{macro}



%  \begin{macro}{\textlegacyasteriskcentered}
%  \begin{macro}{\textlegacybardbl}
%  \begin{macro}{\textlegacybullet}
%  \begin{macro}{\textlegacydaggerdbl}
%  \begin{macro}{\textlegacydagger}
%  \begin{macro}{\textlegacyparagraph}
%  \begin{macro}{\textlegacyperiodcentered}
%  \begin{macro}{\textlegacysection}
%
%    Here are new names for the legacy symbols that \LaTeX{} used to
%    pick up from the \texttt{OMS} encoded fonts (and used for itemize
%    lists or footnote symbols).
%
%    We go the roundabout way via separate OMS declarations so that
%\begin{verbatim}
%   \renewcommand\textbullet{\textlegacybullet}
%\end{verbatim}
% doesn't produce an endless loop.
%    \begin{macrocode}
\DeclareTextSymbol{\textlegacyasteriskcentered}{OMS}{3}   % "03
\DeclareTextSymbol{\textlegacybardbl}{OMS}{107}           % "6B
\DeclareTextSymbol{\textlegacybullet}{OMS}{15}            % "0F
\DeclareTextSymbol{\textlegacydaggerdbl}{OMS}{122}        % "7A
\DeclareTextSymbol{\textlegacydagger}{OMS}{121}           % "79
\DeclareTextSymbol{\textlegacyparagraph}{OMS}{123}        % "7B
\DeclareTextSymbol{\textlegacyperiodcentered}{OMS}{1}     % "01
\DeclareTextSymbol{\textlegacysection}{OMS}{120}          % "78
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareTextSymbolDefault{\textlegacyasteriskcentered}{OMS}
\DeclareTextSymbolDefault{\textlegacybardbl}{OMS}
\DeclareTextSymbolDefault{\textlegacybullet}{OMS}
\DeclareTextSymbolDefault{\textlegacydaggerdbl}{OMS}
\DeclareTextSymbolDefault{\textlegacydagger}{OMS}
\DeclareTextSymbolDefault{\textlegacyparagraph}{OMS}
\DeclareTextSymbolDefault{\textlegacyperiodcentered}{OMS}
\DeclareTextSymbolDefault{\textlegacysection}{OMS}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}

%
%
% Supporting rollback \ldots
%    \begin{macrocode}
%</2ekernel|latexrelease>
%<latexrelease>
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease>     {lttextcomp}{Undefine text companion symbols}%
%<latexrelease>
%<latexrelease>\DeclareRobustCommand\oldstylenums[1]{%
%<latexrelease>   \begingroup
%<latexrelease>    \spaceskip\fontdimen\tw@\font
%<latexrelease>    \usefont{OML}{\rmdefault}{\f@series}{it}%
%<latexrelease>    \mathgroup\symletters #1%
%<latexrelease>   \endgroup
%<latexrelease>}
%<latexrelease>\let\legacyoldstylenums\@undefined
%<latexrelease>\def\textcompsubstdefault{cmr}
%<latexrelease>
%<latexrelease>\let\DeclareEncodingSubset\@undefined
%<latexrelease>\let\CheckEncodingSubset\@undefined
%<latexrelease>
%<latexrelease>\DeclareTextSymbolDefault{\textdollar}{OT1}
%<latexrelease>\DeclareTextSymbolDefault{\textsterling}{OT1}
%<latexrelease>\DeclareTextCommand{\textdollar}{OT1}{\hmode@bgroup
%<latexrelease>   \ifdim \fontdimen\@ne\font >\z@
%<latexrelease>      \slshape
%<latexrelease>   \else
%<latexrelease>      \upshape
%<latexrelease>   \fi
%<latexrelease>   \char`\$\egroup}
%<latexrelease>\DeclareTextCommand{\textsterling}{OT1}{\hmode@bgroup
%<latexrelease>   \ifdim \fontdimen\@ne\font >\z@
%<latexrelease>      \itshape
%<latexrelease>   \else
%<latexrelease>      \fontshape{ui}\selectfont
%<latexrelease>   \fi
%<latexrelease>   \char`\$\egroup}
%<latexrelease>\DeclareTextCommand{\textperthousand}{T1}
%<latexrelease>   {\%\char 24 }
%<latexrelease>
%<latexrelease>\DeclareTextSymbolDefault{\textasteriskcentered}{OMS}
%<latexrelease>\DeclareTextSymbolDefault{\textbullet}{OMS}
%<latexrelease>\DeclareTextSymbolDefault{\textdaggerdbl}{OMS}
%<latexrelease>\DeclareTextSymbolDefault{\textdagger}{OMS}
%<latexrelease>\DeclareTextSymbolDefault{\textparagraph}{OMS}
%<latexrelease>\DeclareTextSymbolDefault{\textperiodcentered}{OMS}
%<latexrelease>\DeclareTextSymbolDefault{\textsection}{OMS}
%<latexrelease>
%<latexrelease>\DeclareTextSymbolDefault{\textbardbl}{OMS}
%<latexrelease>\let\textbrokenbar\@undefined
%<latexrelease>\let\textcelsius\@undefined
%<latexrelease>\let\textcent\@undefined
%<latexrelease>\DeclareTextCommandDefault{\textcopyright}
%<latexrelease>                          {\textcircled{c}}
%<latexrelease>\let\textdegree\@undefined
%<latexrelease>\let\textdiv\@undefined
%<latexrelease>\let\textlnot\@undefined
%<latexrelease>\let\textonehalf\@undefined
%<latexrelease>\let\textonequarter\@undefined
%<latexrelease>\let\textonesuperior\@undefined
%<latexrelease>\DeclareTextCommandDefault{\textordfeminine}
%<latexrelease>                          {\textsuperscript{a}}
%<latexrelease>\DeclareTextCommandDefault{\textordmasculine}
%<latexrelease>                          {\textsuperscript{o}}
%<latexrelease>\let\textpm\@undefined
%<latexrelease>\let\textquotesingle\@undefined
%<latexrelease>\let\textquotestraightbase\@undefined
%<latexrelease>\let\textquotestraightdblbase\@undefined
%<latexrelease>\DeclareTextCommandDefault{\textregistered}
%<latexrelease>    {\textcircled{%
%<latexrelease>        \check@mathfonts\fontsize\sf@size\z@
%<latexrelease>        \math@fontsfalse\selectfont R}}
%<latexrelease>\let\textthreequartersemdash\@undefined
%<latexrelease>\let\textthreequarters\@undefined
%<latexrelease>\let\textthreesuperior\@undefined
%<latexrelease>\let\texttimes\@undefined
%<latexrelease>\DeclareTextCommandDefault{\texttrademark}
%<latexrelease>                          {\textsuperscript{TM}}
%<latexrelease>\let\texttwelveudash\@undefined
%<latexrelease>\let\texttwosuperior\@undefined
%<latexrelease>\let\textyen\@undefined
%<latexrelease>
%<latexrelease>\let\textcapitalcompwordmark\@undefined
%<latexrelease>\let\textascendercompwordmark\@undefined
%<latexrelease>
%<latexrelease>\DeclareTextAccentDefault{\textcircled}{OMS}
%<latexrelease>\DeclareTextAccentDefault{\t}{OML}
%<latexrelease>
%<latexrelease>\let\capitalacute\@undefined
%<latexrelease>\let\capitalbreve\@undefined
%<latexrelease>\let\capitalcaron\@undefined
%<latexrelease>\let\capitalcedilla\@undefined
%<latexrelease>\let\capitalcircumflex\@undefined
%<latexrelease>\let\capitaldieresis\@undefined
%<latexrelease>\let\capitaldotaccent\@undefined
%<latexrelease>\let\capitalgrave\@undefined
%<latexrelease>\let\capitalhungarumlaut\@undefined
%<latexrelease>\let\capitalmacron\@undefined
%<latexrelease>\let\capitalnewtie\@undefined
%<latexrelease>\let\capitalogonek\@undefined
%<latexrelease>\let\capitalring\@undefined
%<latexrelease>\let\capitaltie\@undefined
%<latexrelease>\let\capitaltilde\@undefined
%<latexrelease>\let\newtie\@undefined
%<latexrelease>
%<latexrelease>\let\textlbrackdbl\@undefined
%<latexrelease>\let\textrbrackdbl\@undefined
%<latexrelease>
%<latexrelease>\let\texteightoldstyle\@undefined
%<latexrelease>\let\textfiveoldstyle\@undefined
%<latexrelease>\let\textfouroldstyle\@undefined
%<latexrelease>\let\textnineoldstyle\@undefined
%<latexrelease>\let\textoneoldstyle\@undefined
%<latexrelease>\let\textsevenoldstyle\@undefined
%<latexrelease>\let\textsixoldstyle\@undefined
%<latexrelease>\let\textthreeoldstyle\@undefined
%<latexrelease>\let\texttwooldstyle\@undefined
%<latexrelease>\let\textzerooldstyle\@undefined
%<latexrelease>
%<latexrelease>\let\textacutedbl\@undefined
%<latexrelease>\let\textasciiacute\@undefined
%<latexrelease>\let\textasciibreve\@undefined
%<latexrelease>\let\textasciicaron\@undefined
%<latexrelease>\let\textasciidieresis\@undefined
%<latexrelease>\let\textasciigrave\@undefined
%<latexrelease>\let\textasciimacron\@undefined
%<latexrelease>\let\textgravedbl\@undefined
%<latexrelease>\let\texttildelow\@undefined
%<latexrelease>
%<latexrelease>\let\textbaht\@undefined
%<latexrelease>\let\textbigcircle\@undefined
%<latexrelease>\let\textborn\@undefined
%<latexrelease>\let\textcentoldstyle\@undefined
%<latexrelease>\let\textcircledP\@undefined
%<latexrelease>\let\textcopyleft\@undefined
%<latexrelease>\let\textdblhyphenchar\@undefined
%<latexrelease>\let\textdblhyphen\@undefined
%<latexrelease>\let\textdied\@undefined
%<latexrelease>\let\textdiscount\@undefined
%<latexrelease>\let\textdivorced\@undefined
%<latexrelease>\let\textdollaroldstyle\@undefined
%<latexrelease>\let\textguarani\@undefined
%<latexrelease>\let\textleaf\@undefined
%<latexrelease>\let\textlquill\@undefined
%<latexrelease>\let\textmarried\@undefined
%<latexrelease>\let\textmho\@undefined
%<latexrelease>\let\textmusicalnote\@undefined
%<latexrelease>\let\textnaira\@undefined
%<latexrelease>\let\textopenbullet\@undefined
%<latexrelease>\let\textpeso\@undefined
%<latexrelease>\let\textpilcrow\@undefined
%<latexrelease>\let\textrecipe\@undefined
%<latexrelease>\let\textreferencemark\@undefined
%<latexrelease>\let\textrquill\@undefined
%<latexrelease>\let\textservicemark\@undefined
%<latexrelease>\let\textsurd\@undefined
%<latexrelease>
%<latexrelease>\DeclareTextCommand{\textpertenthousand}{T1}
%<latexrelease>                   {\%\char 24\char 24 }
%<latexrelease>
%<latexrelease>\let\textlangle\@undefined
%<latexrelease>\let\textrangle\@undefined
%<latexrelease>
%<latexrelease>\let\textcolonmonetary\@undefined
%<latexrelease>\let\textdong\@undefined
%<latexrelease>\let\textdownarrow\@undefined
%<latexrelease>\let\textleftarrow\@undefined
%<latexrelease>\let\textlira\@undefined
%<latexrelease>\let\textrightarrow\@undefined
%<latexrelease>\let\textuparrow\@undefined
%<latexrelease>\let\textwon\@undefined
%<latexrelease>
%<latexrelease>\let\textestimated\@undefined
%<latexrelease>\let\textnumero\@undefined
%<latexrelease>
%<latexrelease>\let\textflorin\@undefined
%<latexrelease>\let\textcurrency\@undefined
%<latexrelease>
%<latexrelease>\let\textfractionsolidus\@undefined
%<latexrelease>\let\textohm\@undefined
%<latexrelease>\let\textmu\@undefined
%<latexrelease>\let\textminus\@undefined
%<latexrelease>
%<latexrelease>\let\textblank\@undefined
%<latexrelease>\let\textinterrobangdown\@undefined
%<latexrelease>\let\textinterrobang\@undefined
%<latexrelease>
%<latexrelease>\let\texteuro\@undefined
%<latexrelease>
%<latexrelease>\let\textcelsius\@undefined
%<latexrelease>\let\textonesuperior\@undefined
%<latexrelease>\let\textthreequartersemdash\@undefined
%<latexrelease>\let\textthreesuperior\@undefined
%<latexrelease>\let\texttwelveudash\@undefined
%<latexrelease>\let\texttwosuperior\@undefined
%<latexrelease>\let\textbardbl\@undefined
%<latexrelease>
%<latexrelease>\let\UseLegacyTextSymbols\@undefined
%<latexrelease>\let\textlegacyasteriskcentered\@undefined
%<latexrelease>\let\textlegacybardbl\@undefined
%<latexrelease>\let\textlegacybullet\@undefined
%<latexrelease>\let\textlegacydaggerdbl\@undefined
%<latexrelease>\let\textlegacydagger\@undefined
%<latexrelease>\let\textlegacyparagraph\@undefined
%<latexrelease>\let\textlegacyperiodcentered\@undefined
%<latexrelease>\let\textlegacysection\@undefined
%<latexrelease>
%<latexrelease>\EndModuleRelease
%    \end{macrocode}
%
%
%
% \section{The \texttt{textcomp} package}
%
%
%    \begin{macrocode}
%<*TS1sty>
\providecommand\DeclareRelease[3]{}
\providecommand\DeclareCurrentRelease[2]{}

\DeclareRelease{}{2018-08-11}{textcomp-2018-08-11.sty}
\DeclareCurrentRelease{}{2020-02-02}

\ProvidesPackage{textcomp}
 [2020/02/02 v2.0n Standard LaTeX package]
%    \end{macrocode}
%
%    A precaution in case this is used without rebuilding the format.
% \changes{v2.0n}{2020/02/05}{Ensure we are on a new format (gh/260)}
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[2020/02/02]
%    \end{macrocode}
%
%    This is implemented by defining the default subset:
%    \begin{macrocode}
\DeclareOption{full}{\DeclareEncodingSubset{TS1}{?}{0}}
\DeclareOption{almostfull}{\DeclareEncodingSubset{TS1}{?}{1}}
\DeclareOption{euro}{\DeclareEncodingSubset{TS1}{?}{8}}
\DeclareOption{safe}{\DeclareEncodingSubset{TS1}{?}{9}}
%    \end{macrocode}
%    The default is set up in the kernel is  ``safe'' these days for
%    unknown fonts but LaTeX has definitions for most families so it
%    seldom applies.
%
%    If a different default is used then one needs to check the
%    results to ensure that there aren't ``missing glyphs''.
%
%    The next set of options define the warning level (default in the
%    kernel is info only). Using the package options you can change this behavior.
% \changes{v2.0n}{2020/02/05}{Changed the package default to info (gh/262)}
%    \begin{macrocode}
\DeclareOption{error}
              {\gdef\tc@errorwarn{\PackageError{textcomp}}}
\DeclareOption{warn}
              {\gdef\tc@errorwarn#1#2{\PackageWarning{textcomp}{#1}}}
\DeclareOption{info}
              {\gdef\tc@errorwarn#1#2{\PackageInfo{textcomp}{#1}}}
\DeclareOption{quiet}{\gdef\tc@errorwarn#1#2{}}
%    \end{macrocode}
%
%    The ``force'' option basically changes the sub-encoding  to that
%    of the default (which, unless changes, is 9 these days), i.e., it
%    no longer depends on the font in use. This is mainly there
%    because it might have been used in older documents, but not
%    something that is recommended.
%    \begin{macrocode}
\DeclareOption{force}{%
    \def\CheckEncodingSubset#1#2#3#4#5{%
      \ifnum #4>%
           0\csname #2:?\endcsname
           \relax
      \expandafter\@firstoftwo
     \else
      \expandafter\@secondoftwo
    \fi
     {#1{#2}}{#3}%
     #5}%
}
%    \end{macrocode}
%
%    \begin{macrocode}
\ExecuteOptions{info}
\ProcessOptions\relax
%    \end{macrocode}
%
%    There is not much else to do nowadays, because everything is
%    already set up in the \LaTeX{} kernel.
%
%    \begin{macrocode}
\InputIfFileExists{textcomp.cfg}
  {\PackageInfo{textcomp}{Local configuration file used}}{}
%    \end{macrocode}
%
%    \begin{macrocode}
%</TS1sty>
%    \end{macrocode}
%
%
%
% \subsection{The old textcomp package code}
%
%    This section contains the old code for the textcomp package and
%    its documentation. It is only used if we roll back prior to 2020.
%    Thus all the rest is mainly for historians. Note that the old
%    code categorized in the sub-encodings only into 6 classes not 10.
%
%    \begin{macrocode}
%<*TS1oldsty>
\ProvidesPackage{textcomp}
   [2018/08/11 v2.0j Standard LaTeX package]
%    \end{macrocode}
%
%    This one is for the |TS1| encoding which contains text symbols
%    for use with the |T1|-encoded text fonts.  It therefore first
%    inputs the file |TS1enc.def| and then sets (or resets) the
%    defaults for the symbols it contains.  The result of this is that
%    when one of these symbols is accessed and the current encoding
%    does not provide it, the symbol will be supplied by a silent,
%    local change to this encoding.
%
%    Since many PostScript fonts only implement a subset of |TS1| many
%    commands only produce black blobs of ink. To resolve the
%    resulting problems a number of options have been introduced and
%    some code  has been developed to distinguish sub-encodings.
%
%    The sub-encodings have a numerical id and are defined as follows
%    for \texttt{TS1}:
% \begin{description}
%
% \item[\#5] those \texttt{TS1} symbols that are also in the ISO-Adobe
%       character set; without \verb=textcurrency=, which is often
%       misused for the Euro.  Older Type1 fonts from the non-\TeX{}
%       world provide only this subset.
%
% \item[\#4] = \#5 + \verb=\texteuro=.  Most newer fonts provide this.
%
% \item[\#3] = \#4 + \verb=\textomega=.  Can also be described as
%       $\texttt{TS1} \cap (\texttt{ISO-Adobe} \cup
%       \texttt{MacRoman})$.  (Except for the missing "currency".)

%
% \item[\#2] = \#3 + \verb=\textestimated= + \verb=\textcurrency=.  Can
%       also be described as $\texttt{TS1} \cap
%       \texttt{Adobe-Western-2}$.  This may be relevant for OpenType
%       fonts, which usually show the Adobe-Western-2 character set.
%
%    \item[\#1] = \texttt{TS1} without \verb=\textcircled= and \verb=\t=.
%       These two glyphs are often not implemented and if their kernel
%       defaults are changed commands like \verb=\copyright=
%       unnecessarily fail.
%
%    \item[\#0] = full \texttt{TS1}
% \end{description}
%
%    And here a summary to go in the transcript file:
%    \begin{macrocode}
\PackageInfo{textcomp}{Sub-encoding information:\MessageBreak
    \space\space 5 = only ISO-Adobe without
                              \string\textcurrency\MessageBreak
    \space\space 4 = 5 + \string\texteuro\MessageBreak
    \space\space 3 = 4 + \string\textohm\MessageBreak
    \space\space 2 = 3 + \noexpand\textestimated+
                                \string\textcurrency\MessageBreak
    \space\space 1 = TS1 - \noexpand\textcircled-
                                            \string\t\MessageBreak
    \space\space 0 = TS1 (full)\MessageBreak
    Font families with sub-encoding setting implement\MessageBreak
    only a restricted character set as indicated.\MessageBreak
    Family '?' is the default used for unknown fonts.\MessageBreak
    See the documentation for details\@gobble}
%    \end{macrocode}
%
% \begin{macro}{\DeclareEncodingSubset}
%    An encoding subset to which a font family belongs is declared by
%    the command |\DeclareEncodingSubset| that takes the major encoding as the
%    first argument (e.g., |TS1|), the family name as the second
%    argument (e.g., |cmr|), and the subset encoding id as a third,
%    (e.g., |0| for |cmr|).
%
%    The default encoding subset to use when nothing is known about
%    the current font family is named |?|.
%    \begin{macrocode}
\def\DeclareEncodingSubset#1#2#3{%
   \@ifundefined{#1:#2}%
     {\PackageInfo{textcomp}{Setting #2 sub-encoding to #1/#3}}%
     {\PackageInfo{textcomp}{Changing #2 sub-encoding to #1/#3}}%
   \@namedef{#1:#2}{#3}}
\@onlypreamble\DeclareEncodingSubset
%    \end{macrocode}
% \end{macro}
%
%
%  The options for the package are the following:
%    \begin{description}
%    \item[safe]
%       for unknown font families enables only symbols that are also
%       in the ISO-Adobe character set; without "currency", which is
%       often misused for the Euro.  Older Type1 fonts from the
%       non-TeX world provide only this subset.
%
%    \item[euro]
%       enables the ``safe'' symbols plus the |\texteuro|
%       command. Most newer fonts provide this.
%
%    \item[full] enables all |TS1| commands; useful only with fonts
%       like EC or CM bright.
%
%    \item[almostfull]
%       same as ``full'', except that |\textcircled|
%       and |\t| are \emph{not} redefined from their defaults to avoid
%       that commands like |\copyright| suddenly no longer work.
%
%    \item[force]
%       ignore all subset encoding definitions stored in the package
%       itself or in the configuration file and always use the default
%       subset as specified by one of the other options (seldom useful,
%       only dangerous).
%    \end{description}
%
% \begin{macro}{\iftc@forced}
%    Switch used to implement the \texttt{force} option
%    \begin{macrocode}
\newif\iftc@forced   \tc@forcedfalse
%    \end{macrocode}
% \end{macro}

%    This is implemented by defining the default subset:
%    \begin{macrocode}
\DeclareOption{full}{\DeclareEncodingSubset{TS1}{?}{0}}
\DeclareOption{almostfull}{\DeclareEncodingSubset{TS1}{?}{1}}
\DeclareOption{euro}{\DeclareEncodingSubset{TS1}{?}{4}}
\DeclareOption{safe}{\DeclareEncodingSubset{TS1}{?}{5}}
%    \end{macrocode}
%    The default is ``almostfull'' which means that old documents will
%    work except that |\textcircled| and |\t| will use the kernel
%    defaults (with the advantage that this also works if the current
%    font, as often the case, doesn't implement these glyphs).
%
%    The ``force'' option simply sets the switch to true.
%    \begin{macrocode}
\DeclareOption{force}{\tc@forcedtrue}
%    \end{macrocode}
%
%    The suggestions to user is to use the ``safe'' option always
%    unless that balks in which case they could switch to
%    ``almostfull'' but then better check their output manually.
%
%    \begin{macrocode}
\def\tc@errorwarn{\PackageError}
\DeclareOption{warn}{\gdef\tc@errorwarn#1#2#3{\PackageWarning{#1}{#2}}}
\DeclareOption{quiet}{\gdef\tc@errorwarn#1#2#3{}}
%    \end{macrocode}
%
%    \begin{macrocode}
\ExecuteOptions{almostfull}
\ProcessOptions\relax
%    \end{macrocode}
%
%
%
%
% \begin{macro}{\CheckEncodingSubset}
%    The command |\CheckEncodingSubset| will check if the current font
%    family has the right encoding subset to typeset a certain
%    command. It takes five arguments as follows:
%    first argument is either |\UseTextSymbol|, |\UseTextAccent|
%    depending on whether or not the symbol is a text symbol or a text
%    accent.

%    The second argument is the encoding from which this symbol should
%    be fetched.
%
%    The third argument is either a fake accessor command or an error
%    message. the code in that argument (if ever executed) receives
%    two arguments: |#2| and |#5| of |\CheckEncodingSubset|.
%
%    Argument four is the subset encoding id to test against: if this
%    value is higher than the subset id of the current font family
%    then we typeset the symbol, i.e., execute |#1{#2}#5| otherwise
%    it runs |#3#5|, e.g., to produce an error message or fake the
%    glyph somehow.
%
%    Argument five is the symbol or accent command that is being
%    checked.
%
%    For usage examples see definitions below.
%    \begin{macrocode}
\iftc@forced
%    \end{macrocode}
%    If the ``force'' option was given we always use the default for
%    testing against.
%    \begin{macrocode}
\def\CheckEncodingSubset#1#2#3#4#5{%
    \ifnum #4>%
        0\csname #2:?\endcsname
        \relax
   \expandafter\@firstoftwo
  \else
   \expandafter\@secondoftwo
 \fi
  {#1{#2}}{#3}%
  #5%
}
%    \end{macrocode}
%
%    In normal circumstances the test is a bit more complicated: first
%    check if there exists a macro
%    |\|\meta{arg2}|:|\meta{current-family} and if so use that value
%    to test against, otherwise use the default to test against.
%    \begin{macrocode}
\else
\def\CheckEncodingSubset#1#2#3#4#5{%
    \ifnum #4>%
      \expandafter\ifx\csname #2:\f@family\endcsname\relax
        0\csname #2:?\endcsname
      \else
        \csname #2:\f@family\endcsname
      \fi
   \relax
   \expandafter\@firstoftwo
  \else
   \expandafter\@secondoftwo
 \fi
  {#1{#2}}{#3}%
  #5%
}
\fi
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tc@subst}
%    \begin{macrocode}
\def\tc@subst#1{%
   \tc@errorwarn{textcomp}%
    {Symbol \string#1 not provided by\MessageBreak
     font family \f@family\space
     in TS1 encoding.\MessageBreak Default family used instead}\@eha
  \bgroup\fontfamily\textcompsubstdefault\selectfont#1\egroup
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tc@error}
%    |\tc@error| is going to be used in arg |#3| of
%    |\CheckEncodingSubset| when a symbol is not available in a
%    certain font family. It gets pass the encoding it normally lives
%    in (arg one) and the name of the symbol or accent that has a
%    problem.
%
%    \begin{macrocode}
% error commands take argument:
% #1 symbol to be used
\def\tc@error#1{%
   \PackageError{textcomp}%  % should be latex error if general
    {Accent \string#1 not provided by\MessageBreak
     font family \f@family\space
     in TS1 encoding}\@eha
}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\tc@fake@euro}
%    |\tc@fake@euro|  is an example of a ``fake'' definition to use in  arg |#3| of
%    |\CheckEncodingSubset| when a symbol is not available in a
%    certain font family. Here we produce an Euro symbol by combining
%    a ``C'' with a ``=''.
%    \begin{macrocode}
\def\tc@fake@euro#1{%
   \leavevmode
   \PackageInfo{textcomp}{Faking \noexpand#1for font family
                          \f@family\MessageBreak in TS1 encoding}%
   \valign{##\cr
      \vfil\hbox to 0.07em{\dimen@\f@size\p@
                           \math@fontsfalse
                           \fontsize{.7\dimen@}\z@\selectfont=\hss}%
      \vfil\cr%
      \hbox{C}\crcr
   }%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tc@check@symbol}
% \begin{macro}{\tc@check@accent}
%    These are two abbreviations that we use below to check symbols
%    and accents in TS1. Only there to save some space, e.g., we can
%    then write
%\begin{verbatim}
%\DeclareTextCommandDefault{\textcurrency}{\tc@check@symbol3\textcurrency}
%\end{verbatim}
%    to ensure that |\textcurrency| is only typeset if the current
%    font has a \texttt{TS1} subset id of less than 3. Otherwise
%    |\tc@error| is called telling the user that for this font family
%    |\textcurrency| is not available.
%    \begin{macrocode}
\def\tc@check@symbol{\CheckEncodingSubset\UseTextSymbol{TS1}\tc@subst}
\def\tc@check@accent{\CheckEncodingSubset\UseTextAccent{TS1}\tc@error}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%    We start with the commands that are ``safe'' and which can be
%    unconditionally set up, first the accents\ldots
%    \begin{macrocode}
\DeclareTextAccentDefault{\capitalcedilla}{TS1}
\DeclareTextAccentDefault{\capitalogonek}{TS1}
\DeclareTextAccentDefault{\capitalgrave}{TS1}
\DeclareTextAccentDefault{\capitalacute}{TS1}
\DeclareTextAccentDefault{\capitalcircumflex}{TS1}
\DeclareTextAccentDefault{\capitaltilde}{TS1}
\DeclareTextAccentDefault{\capitaldieresis}{TS1}
\DeclareTextAccentDefault{\capitalhungarumlaut}{TS1}
\DeclareTextAccentDefault{\capitalring}{TS1}
\DeclareTextAccentDefault{\capitalcaron}{TS1}
\DeclareTextAccentDefault{\capitalbreve}{TS1}
\DeclareTextAccentDefault{\capitalmacron}{TS1}
\DeclareTextAccentDefault{\capitaldotaccent}{TS1}
%    \end{macrocode}
%    \ldots and then the other glyphs.
% \changes{v1.9p}{1998/06/12}{Renamed \cs{textmacron} pr/2840}
%    \begin{macrocode}
\DeclareTextSymbolDefault{\textcapitalcompwordmark}{TS1}
\DeclareTextSymbolDefault{\textascendercompwordmark}{TS1}
\DeclareTextSymbolDefault{\textquotestraightbase}{TS1}
\DeclareTextSymbolDefault{\textquotestraightdblbase}{TS1}
\DeclareTextSymbolDefault{\texttwelveudash}{TS1}
\DeclareTextSymbolDefault{\textthreequartersemdash}{TS1}
\DeclareTextSymbolDefault{\textdollar}{TS1}
\DeclareTextSymbolDefault{\textquotesingle}{TS1}
\DeclareTextSymbolDefault{\textasteriskcentered}{TS1}
\DeclareTextSymbolDefault{\textfractionsolidus}{TS1}
\DeclareTextSymbolDefault{\textminus}{TS1}
\DeclareTextSymbolDefault{\textlbrackdbl}{TS1}
\DeclareTextSymbolDefault{\textrbrackdbl}{TS1}
\DeclareTextSymbolDefault{\textasciigrave}{TS1}
\DeclareTextSymbolDefault{\texttildelow}{TS1}
\DeclareTextSymbolDefault{\textasciibreve}{TS1}
\DeclareTextSymbolDefault{\textasciicaron}{TS1}
\DeclareTextSymbolDefault{\textgravedbl}{TS1}
\DeclareTextSymbolDefault{\textacutedbl}{TS1}
\DeclareTextSymbolDefault{\textdagger}{TS1}
\DeclareTextSymbolDefault{\textdaggerdbl}{TS1}
\DeclareTextSymbolDefault{\textbardbl}{TS1}
\DeclareTextSymbolDefault{\textperthousand}{TS1}
\DeclareTextSymbolDefault{\textbullet}{TS1}
\DeclareTextSymbolDefault{\textcelsius}{TS1}
\DeclareTextSymbolDefault{\textflorin}{TS1}
\DeclareTextSymbolDefault{\texttrademark}{TS1}
\DeclareTextSymbolDefault{\textcent}{TS1}
\DeclareTextSymbolDefault{\textsterling}{TS1}
\DeclareTextSymbolDefault{\textyen}{TS1}
\DeclareTextSymbolDefault{\textbrokenbar}{TS1}
\DeclareTextSymbolDefault{\textsection}{TS1}
\DeclareTextSymbolDefault{\textasciidieresis}{TS1}
\DeclareTextSymbolDefault{\textcopyright}{TS1}
\DeclareTextSymbolDefault{\textordfeminine}{TS1}
\DeclareTextSymbolDefault{\textlnot}{TS1}
\DeclareTextSymbolDefault{\textregistered}{TS1}
\DeclareTextSymbolDefault{\textasciimacron}{TS1}
\DeclareTextSymbolDefault{\textdegree}{TS1}
\DeclareTextSymbolDefault{\textpm}{TS1}
\DeclareTextSymbolDefault{\texttwosuperior}{TS1}
\DeclareTextSymbolDefault{\textthreesuperior}{TS1}
\DeclareTextSymbolDefault{\textasciiacute}{TS1}
\DeclareTextSymbolDefault{\textmu}{TS1}
\DeclareTextSymbolDefault{\textparagraph}{TS1}
\DeclareTextSymbolDefault{\textperiodcentered}{TS1}
\DeclareTextSymbolDefault{\textonesuperior}{TS1}
\DeclareTextSymbolDefault{\textordmasculine}{TS1}
\DeclareTextSymbolDefault{\textonequarter}{TS1}
\DeclareTextSymbolDefault{\textonehalf}{TS1}
\DeclareTextSymbolDefault{\textthreequarters}{TS1}
\DeclareTextSymbolDefault{\texttimes}{TS1}
\DeclareTextSymbolDefault{\textdiv}{TS1}
%    \end{macrocode}
%
%    The |\texteuro| is only available for subsets with id 4 or
%    less. Otherwise we fake the glyph using |\tc@fake@euro|
%    \begin{macrocode}
\DeclareTextCommandDefault{\texteuro}
   {\CheckEncodingSubset\UseTextSymbol{TS1}\tc@fake@euro5\texteuro}
%    \end{macrocode}
%
%    The |\textohm| is only available for subsets with id 3 or
%    less. Otherwise we produce an error.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textohm}{\tc@check@symbol4\textohm}
%    \end{macrocode}
%    The |\textestimated| and |\textcurrency| are only provided for
%    fonts with subset encoding with id 2 or less.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textestimated}%
    {\tc@check@symbol3\textestimated}
\DeclareTextCommandDefault{\textcurrency}%
    {\tc@check@symbol3\textcurrency}
%    \end{macrocode}
%    Nearly all of the remaining glyphs are provided only with fonts
%    with id 1 or 0, i.e., are essentially complete.
%    \begin{macrocode}
\DeclareTextCommandDefault{\capitaltie}%
    {\tc@check@accent2\capitaltie}
\DeclareTextCommandDefault{\newtie}%
    {\tc@check@accent2\newtie}
\DeclareTextCommandDefault{\capitalnewtie}%
    {\tc@check@accent2\capitalnewtie}
\DeclareTextCommandDefault{\textleftarrow}%
    {\tc@check@symbol2\textleftarrow}
\DeclareTextCommandDefault{\textrightarrow}%
    {\tc@check@symbol2\textrightarrow}
\DeclareTextCommandDefault{\textblank}%
    {\tc@check@symbol2\textblank}
\DeclareTextCommandDefault{\textdblhyphen}%
    {\tc@check@symbol2\textdblhyphen}
\DeclareTextCommandDefault{\textzerooldstyle}%
    {\tc@check@symbol2\textzerooldstyle}
\DeclareTextCommandDefault{\textoneoldstyle}%
    {\tc@check@symbol2\textoneoldstyle}
\DeclareTextCommandDefault{\texttwooldstyle}%
    {\tc@check@symbol2\texttwooldstyle}
\DeclareTextCommandDefault{\textthreeoldstyle}%
    {\tc@check@symbol2\textthreeoldstyle}
\DeclareTextCommandDefault{\textfouroldstyle}%
    {\tc@check@symbol2\textfouroldstyle}
\DeclareTextCommandDefault{\textfiveoldstyle}%
    {\tc@check@symbol2\textfiveoldstyle}
\DeclareTextCommandDefault{\textsixoldstyle}%
    {\tc@check@symbol2\textsixoldstyle}
\DeclareTextCommandDefault{\textsevenoldstyle}%
    {\tc@check@symbol2\textsevenoldstyle}
\DeclareTextCommandDefault{\texteightoldstyle}%
    {\tc@check@symbol2\texteightoldstyle}
\DeclareTextCommandDefault{\textnineoldstyle}%
    {\tc@check@symbol2\textnineoldstyle}
\DeclareTextCommandDefault{\textlangle}%
    {\tc@check@symbol2\textlangle}
\DeclareTextCommandDefault{\textrangle}%
    {\tc@check@symbol2\textrangle}
\DeclareTextCommandDefault{\textmho}%
    {\tc@check@symbol2\textmho}
\DeclareTextCommandDefault{\textbigcircle}%
    {\tc@check@symbol2\textbigcircle}
\DeclareTextCommandDefault{\textuparrow}%
    {\tc@check@symbol2\textuparrow}
\DeclareTextCommandDefault{\textdownarrow}%
    {\tc@check@symbol2\textdownarrow}
\DeclareTextCommandDefault{\textborn}%
    {\tc@check@symbol2\textborn}
\DeclareTextCommandDefault{\textdivorced}%
    {\tc@check@symbol2\textdivorced}
\DeclareTextCommandDefault{\textdied}%
    {\tc@check@symbol2\textdied}
\DeclareTextCommandDefault{\textleaf}%
    {\tc@check@symbol2\textleaf}
\DeclareTextCommandDefault{\textmarried}%
    {\tc@check@symbol2\textmarried}
\DeclareTextCommandDefault{\textmusicalnote}%
    {\tc@check@symbol2\textmusicalnote}
\DeclareTextCommandDefault{\textdblhyphenchar}%
    {\tc@check@symbol2\textdblhyphenchar}
\DeclareTextCommandDefault{\textdollaroldstyle}%
    {\tc@check@symbol2\textdollaroldstyle}
\DeclareTextCommandDefault{\textcentoldstyle}%
    {\tc@check@symbol2\textcentoldstyle}
\DeclareTextCommandDefault{\textcolonmonetary}%
    {\tc@check@symbol2\textcolonmonetary}
\DeclareTextCommandDefault{\textwon}%
    {\tc@check@symbol2\textwon}
\DeclareTextCommandDefault{\textnaira}%
    {\tc@check@symbol2\textnaira}
\DeclareTextCommandDefault{\textguarani}%
    {\tc@check@symbol2\textguarani}
\DeclareTextCommandDefault{\textpeso}%
    {\tc@check@symbol2\textpeso}
\DeclareTextCommandDefault{\textlira}%
    {\tc@check@symbol2\textlira}
\DeclareTextCommandDefault{\textrecipe}%
    {\tc@check@symbol2\textrecipe}
\DeclareTextCommandDefault{\textinterrobang}%
    {\tc@check@symbol2\textinterrobang}
\DeclareTextCommandDefault{\textinterrobangdown}%
    {\tc@check@symbol2\textinterrobangdown}
\DeclareTextCommandDefault{\textdong}%
    {\tc@check@symbol2\textdong}
\DeclareTextCommandDefault{\textpertenthousand}%
    {\tc@check@symbol2\textpertenthousand}
\DeclareTextCommandDefault{\textpilcrow}%
    {\tc@check@symbol2\textpilcrow}
\DeclareTextCommandDefault{\textbaht}%
    {\tc@check@symbol2\textbaht}
\DeclareTextCommandDefault{\textnumero}%
    {\tc@check@symbol2\textnumero}
\DeclareTextCommandDefault{\textdiscount}%
    {\tc@check@symbol2\textdiscount}
\DeclareTextCommandDefault{\textopenbullet}%
    {\tc@check@symbol2\textopenbullet}
\DeclareTextCommandDefault{\textservicemark}%
    {\tc@check@symbol2\textservicemark}
\DeclareTextCommandDefault{\textlquill}%
    {\tc@check@symbol2\textlquill}
\DeclareTextCommandDefault{\textrquill}%
    {\tc@check@symbol2\textrquill}
\DeclareTextCommandDefault{\textcopyleft}%
    {\tc@check@symbol2\textcopyleft}
\DeclareTextCommandDefault{\textcircledP}%
    {\tc@check@symbol2\textcircledP}
\DeclareTextCommandDefault{\textreferencemark}%
    {\tc@check@symbol2\textreferencemark}
\DeclareTextCommandDefault{\textsurd}%
    {\tc@check@symbol2\textsurd}
%    \end{macrocode}
%    The |\textcircled| and |\t| are handled specially, unless the
%    current font has a subset id of 0 (i.e. full \texttt{TS1}) we
%    pick the symbols up from the math font encodings, i.e., the
%    third argument to |\CheckEncodingSubset| uses |\UseTextAccent| to
%    get them from there.
%    \begin{macrocode}
\DeclareTextCommandDefault{\textcircled}
  {\CheckEncodingSubset\UseTextAccent{TS1}%
    {\UseTextAccent{OMS}}1\textcircled}
\DeclareTextCommandDefault{\t}
  {\CheckEncodingSubset\UseTextAccent{TS1}%
    {\UseTextAccent{OML}}1\t}
%    \end{macrocode}


%
%    Finally input the encoding-specific definitions for
%    \texttt{TS1} thus making the top-level definitions
%    optimized for this encoding (and not for the default
%    encoding).
% \changes{v1.9o}{1998/03/20}{Load decls after defaults for speed.}
%    \begin{macrocode}
\input{ts1enc.def}
%    \end{macrocode}
%    Now having the new glyphs available we also want to make sure
%    that they are used. For most cases this will automatically happen
%    but for some glyphs there are inferior definitions already known
%    to \LaTeX{} which will prevent the usage of the \texttt{TS1}
%    versions. So we better
%    get rid of them:
% \changes{v1.9o}{1998/03/20}{Added various \cs{UndeclareTextCommand}
%    declarations for pr/2783}
%    \begin{macrocode}
\UndeclareTextCommand{\textsterling}{OT1}
\UndeclareTextCommand{\textdollar}  {OT1}
%    \end{macrocode}
%    Similar declarations should probably be made for other encodings
%    like \texttt{OT4} if they are in use.
%    \begin{macrocode}
%\UndeclareTextCommand{\textsterling}{OT4}
%\UndeclareTextCommand{\textdollar}  {OT4}
%    \end{macrocode}
%    From the \texttt{T1} encoding there are two candidates for removal:
%    \textperthousand{} and \textpertenthousand{} since these are both
%    constructed from \% followed by a tiny
%    `{\fontencoding{T1}\selectfont \char 24}'
%    rather than being a single glyph. The problem with this
%    approach is that in PostScript fonts this small zero is usually not
%    available resulting in \%\rule{3pt}{3pt} rather than
%    \textperthousand{} while the real glyph (at least for
%    |\textperthousand|) is available in the PostScript version of
%    \texttt{TS1}.  So for the moment we compromise by removing the
%    \texttt{T1} declaration for |\textperthousand| but keeping the one
%    for |\textpertenthousand|. This will have the effect that with
%    Computer Modern fonts everything will come out (although
%    \textperthousand{} and \textpertenthousand{} are not taken from the
%    same physical font) and with PostScript fonts \textperthousand{}
%    will come out correctly while \textpertenthousand{} will most
%    likely look like \%\rule{6pt}{3pt} --- which is probably an
%    improvement over just getting a single `\rule{3pt}{3pt}' to
%    indicate a completely missing glyph, which would happen if we
%    also `undeclared' |\textpertenthousand|.
%    \begin{macrocode}
\UndeclareTextCommand{\textperthousand}{T1}
%\UndeclareTextCommand{\textpertenthousand}{T1}
%    \end{macrocode}
%
%
%  \subsubsection{Supporting oldstyle digits}
%
%    \begin{macrocode}
\DeclareRobustCommand\oldstylenums[1]{%
 \begingroup
  \ifmmode
   \mathgroup\symletters #1%
  \else
   \CheckEncodingSubset\@use@text@encoding{TS1}%
       {\PackageWarning{textcomp}%
          {Oldstyle digits unavailable for
           family \f@family.\MessageBreak
           Lining digits used instead}}%
       \tw@{#1}%
   \fi
 \endgroup
}
%    \end{macrocode}
%
%  \subsubsection{Subset encoding defaults}
%
%    For many font families commonly used in the \TeX{} world we
%    provide the subset encoding data here. Users can add additional
%    font families in the file \texttt{textcomp.cfg} if they own other
%    fonts.
%
%    However, if the option ``forced'' was given then all subset
%    encoding specifications are ignored, so there is no point in
%    setting any of them up:
%    \begin{macrocode}
\iftc@forced \else
%    \end{macrocode}
%
%    Computer modern based fonts (e.g., CM, CM-Bright, Concrete):
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{cmr}     {0}
\DeclareEncodingSubset{TS1}{cmss}    {0}
\DeclareEncodingSubset{TS1}{cmtt}    {0}
\DeclareEncodingSubset{TS1}{cmvtt}   {0}
\DeclareEncodingSubset{TS1}{cmbr}    {0}
\DeclareEncodingSubset{TS1}{cmtl}    {0}
\DeclareEncodingSubset{TS1}{ccr}     {0}
%    \end{macrocode}
%
%    PSNFSS fonts:
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{ptm}     {4}
\DeclareEncodingSubset{TS1}{pcr}     {4}
\DeclareEncodingSubset{TS1}{phv}     {4}
\DeclareEncodingSubset{TS1}{ppl}     {3}
\DeclareEncodingSubset{TS1}{pag}     {4}
\DeclareEncodingSubset{TS1}{pbk}     {4}
\DeclareEncodingSubset{TS1}{pnc}     {4}
\DeclareEncodingSubset{TS1}{pzc}     {4}
\DeclareEncodingSubset{TS1}{bch}     {4}
\DeclareEncodingSubset{TS1}{put}     {5}
%    \end{macrocode}
%
%    Other CTAN fonts (probably not complete):
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{uag}     {5}
\DeclareEncodingSubset{TS1}{ugq}     {5}
\DeclareEncodingSubset{TS1}{ul8}     {4}
\DeclareEncodingSubset{TS1}{ul9}     {4}  % (LuxiSans, one day)
\DeclareEncodingSubset{TS1}{augie}   {5}
\DeclareEncodingSubset{TS1}{dayrom}  {3}
\DeclareEncodingSubset{TS1}{dayroms} {3}
\DeclareEncodingSubset{TS1}{pxr}     {0}
\DeclareEncodingSubset{TS1}{pxss}    {0}
\DeclareEncodingSubset{TS1}{pxtt}    {0}
\DeclareEncodingSubset{TS1}{txr}     {0}
\DeclareEncodingSubset{TS1}{txss}    {0}
\DeclareEncodingSubset{TS1}{txtt}    {0}
%    \end{macrocode}
%
%    Latin Modern and TeX Gyre:
% \changes{v1.99k}{2009/10/28}{Added Latin Modern and TeX Gyre subsets}
% \changes{v1.99l}{2009/11/04}{Added more Latin Modern and TeX Gyre subsets}
% \changes{v1.99m}{2015/02/16}{Added lmtt (Heiko Oberdiek) latex/4415}
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{lmr}     {0}
\DeclareEncodingSubset{TS1}{lmdh}    {0}
\DeclareEncodingSubset{TS1}{lmss}    {0}
\DeclareEncodingSubset{TS1}{lmssq}   {0}
\DeclareEncodingSubset{TS1}{lmvtt}   {0}
\DeclareEncodingSubset{TS1}{lmtt}    {0}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{qhv}     {0}
\DeclareEncodingSubset{TS1}{qag}     {0}
\DeclareEncodingSubset{TS1}{qbk}     {0}
\DeclareEncodingSubset{TS1}{qcr}     {0}
\DeclareEncodingSubset{TS1}{qcs}     {0}
\DeclareEncodingSubset{TS1}{qpl}     {0}
\DeclareEncodingSubset{TS1}{qtm}     {0}
\DeclareEncodingSubset{TS1}{qzc}     {0}
\DeclareEncodingSubset{TS1}{qhvc}    {0}
%    \end{macrocode}
%
%    Fourier-GUTenberg:
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{futs}    {4}
\DeclareEncodingSubset{TS1}{futx}    {4}
\DeclareEncodingSubset{TS1}{futj}    {4}
%    \end{macrocode}
%
%  Y\&Y's Lucida Bright
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{hlh}     {3}
\DeclareEncodingSubset{TS1}{hls}     {3}
\DeclareEncodingSubset{TS1}{hlst}    {3}
%    \end{macrocode}
%    The remaining settings for Lucida are conservative: the following
%    fonts contain the |\textohm| character but not the |\texteuro|,
%    i.e., belong to neither subset~4 nor subset~3. If you want to
%    use the |\textohm| with these fonts copy these definition to
%    \texttt{textcomp.cfg} and change the subset to~3. However in that
%    case make sure that you do not use the |\texteuro|.
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{hlct}    {5}
\DeclareEncodingSubset{TS1}{hlx}     {5}
\DeclareEncodingSubset{TS1}{hlce}    {5}
\DeclareEncodingSubset{TS1}{hlcn}    {5}
\DeclareEncodingSubset{TS1}{hlcw}    {5}
\DeclareEncodingSubset{TS1}{hlcf}    {5}
%    \end{macrocode}
%
%    Other commercial families\ldots
%    \begin{macrocode}
\DeclareEncodingSubset{TS1}{pplx}    {3}
\DeclareEncodingSubset{TS1}{pplj}    {3}
\DeclareEncodingSubset{TS1}{ptmx}    {4}
\DeclareEncodingSubset{TS1}{ptmj}    {4}
%    \end{macrocode}
%
%    If the file \texttt{textcomp.cfg} exists it will be loaded at
%    this point. This allows to define further subset encodings for
%    font families not covered by default.
%
%    \begin{macrocode}
\InputIfFileExists{textcomp.cfg}
  {\PackageInfo{textcomp}{Local configuration file used}}{}
%    \end{macrocode}
%
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
%    \begin{macrocode}
%</TS1oldsty>
%    \end{macrocode}
%
%
%
%
% \section{The \texttt{checkencodingsubset.tex} file}
%
%    This is a simple file that asks for a name of a font family and
%    then displays information about the TS1 encoding for this family
%    and recommends the right encoding subset (to be used with
%    \cs{DeclareEncodingsubset}) for this family.
% \changes{v1.1a}{2024/01/27}{Added check file for encoding subset}
%    \begin{macrocode}
%<*TS1check>
\Providesfile{checkencodingsubset.tex}
 [2024/01/27 v0.5a Figure out safe TS1 encoding subsets]
%    \end{macrocode}
%
%    \begin{macrocode}
\let\typeoutdetails\typeout
%\def\typeoutdetails#1{}     % alternative definition used below
%    \end{macrocode}
%
%    For the purpose of this check a glyph exists if the font slot is
%    occupied---too bad if that contains the wrong glyph or some tofu.
%    If it ``exists'' we return 0 otherwise 1. This way we can call
%    this macro several times in a row and obtain a number that is 0
%    if all glyphs are existing or greater than 0 if any of them is
%    missing.
%
%    The second argument (holding the command name for a symbol) is
%    not used during these tests.
%    \begin{macrocode}
\def\doesglyphexist#1#2{\iffontchar\testFont #1 0\else 1\relax \fi}
%    \end{macrocode}
%
%    This macro also tests and outputs some information about the
%    symbol if it is missing. This time we make use of the second
%    argument.
%    \begin{macrocode}
\def\glyphmissingdetails#1#2{\iffontchar\testFont #1 \else
  \typeoutdetails{\space\space\space ==> \string#2 (#1) is missing}\fi}
%    \end{macrocode}
%    
%    \begin{macrocode}
\newif\ifsafesubencodingfound
\newif\ifcoremisses
%    \end{macrocode}
%
%    Testing a group of symbols that belong to one sub-encoding. More
%    precisely, the symbols that become unavailable if you change from
%    sub-encoding $x$ (\texttt{\#2}) to $x+1$ (\texttt{\#3}). As far
%    as the code is concerned, the
%    symbols that are supposed to be always available (the core)
%    become available if we test the group \texttt{-1} and \texttt{0}.
%
%    The first argument contains the testing code and is supposed to
%    return a single number greater or equal to zero.
%    \begin{macrocode}
\def\testgroup#1#2#3{%
  \ifnum 0 = #1%
    \ifnum #2<0
    \typeoutdetails{All glyphs in core exist}%
    \else
    \typeoutdetails{All glyphs between sub-encoding #2 and #3  exist}%
    \fi
  \else
    \ifnum #2<0
      \typeoutdetails{**********************************}%
      \typeoutdetails{Some glyphs are missing from core:}%
      \coremissestrue
      \ifsafesubencodingfound \else
        \def\subencodingresult{#2}%        
      \fi
    \else
      \typeoutdetails{Some glyphs are missing from sub-encoding #2:}%
      \ifsafesubencodingfound \else
        \def\subencodingresult{#3}%        
      \fi
    \fi
%    \end{macrocode}
%    If some glyphs are missing, we rerun the test code but this time
%    using \cs{glyphmissingdetails}.
%    \begin{macrocode}
    {\let\doesglyphexist \glyphmissingdetails #1}%
%    \end{macrocode}
%    And because we had misses we have definitely found the subset.
%    \begin{macrocode}
    \safesubencodingfoundtrue
  \fi
}   
%    \end{macrocode}
%
%    The currently defined subset for the family is either stored in
%    \cs{TS1:\meta{family}} if it was declared, or it is the default
%    subset which is stored in \cs{TS1:?}.
%    \begin{macrocode}
\def\currsubencoding#1{\csname TS1:\ifcsname TS1:#1\endcsname #1\else ?\fi\endcsname}
%    \end{macrocode}
%
%    If a font family is not found when declaring it with
%    \cs{DeclareFixedFont} we end up with the following font. This can
%    then be used as a simple test if we failed loading the TS1 font.
%    \begin{macrocode}
\DeclareFixedFont\cmrFont{TS1}{cmr}{m}{n}{10pt}
%    \end{macrocode}
%
%    Check for all glyphs in all encoding subsets \ldots
%    \begin{macrocode}
\def\testallgroups#1{%
  \DeclareFixedFont\testFont{TS1}{#1}{m}{n}{10pt}%
  \ifx\testFont\cmrFont
    \typeout{***** Font family #1 not found ****}%
  \else
%    \end{macrocode}
%    We haven't checked anything yet.
%    \begin{macrocode}
    \safesubencodingfoundfalse
    \coremissesfalse
    \typeoutdetails{^^J-----------------------------------------}%
    \typeoutdetails{Testing font family #1^^J(currently TS1-sub-encoding
      \currsubencoding{#1})}%
    \typeout{-----------------------------------------}%
%    \end{macrocode}
%    Then we start testing the groups beginning with the glyphs
%    between sub-encoding 8 and 9. If any of them is missing (checked
%    with \cs{doesglyphexist}) then we already know that 9 is the
%    correct answer.
%    \begin{macrocode}
    \testgroup{%
       \doesglyphexist{21}{\texttwelveudash}%
       \doesglyphexist{22}{\textthreequartersemdash}%
       \doesglyphexist{134}{\textbardbl}%
       \doesglyphexist{137}{\textcelsius}%
       \doesglyphexist{178}{\texttwosuperior}%
       \doesglyphexist{179}{\textthreesuperior}%
       \doesglyphexist{185}{\textonesuperior}%
    }{8}{9}%
%    \end{macrocode}
%    Nevertheless we go on with further groups so that the output
%    lists all missing glyphs.
%    \begin{macrocode}
    \testgroup{%
       \doesglyphexist{32}{\textblank}%
       \doesglyphexist{148}{\textinterrobang}%
       \doesglyphexist{149}{\textinterrobangdown}%
       \doesglyphexist{191}{\texteuro}%
    }{7}{8}%
    \testgroup{%
       \doesglyphexist{47}{\textfractionsolidus}%
       \doesglyphexist{61}{\textminus}%
       \doesglyphexist{87}{\textohm}%
       \doesglyphexist{181}{\textmu}%
    }{6}{7}%
    \testgroup{%
       \doesglyphexist{140}{\textflorin}%
       \doesglyphexist{164}{\textcurrency}%
    }{5}{6}%
    \testgroup{%
       \doesglyphexist{155}{\textnumero}%
       \doesglyphexist{157}{\textestimated}%
    }{4}{5}%
    \testgroup{%
       \doesglyphexist{24}{\textleftarrow}%
       \doesglyphexist{25}{\textrightarrow}%
       \doesglyphexist{94}{\textuparrow}%
       \doesglyphexist{95}{\textdownarrow}%
       \doesglyphexist{141}{\textcolonmonetary}%
       \doesglyphexist{142}{\textwon}%
       \doesglyphexist{146}{\textlira}%
       \doesglyphexist{150}{\textdong}%
    }{3}{4}%
    \testgroup{%
       \doesglyphexist{60}{\textlangle}%
       \doesglyphexist{62}{\textrangle}%
    }{2}{3}%
    \testgroup{%
       \doesglyphexist{0}{\capitalgrave}%
       \doesglyphexist{1}{\capitalacute}%
       \doesglyphexist{2}{\capitalcircumflex}%
       \doesglyphexist{3}{\capitaltilde}%
       \doesglyphexist{4}{\capitaldieresis}%
       \doesglyphexist{5}{\capitalhungarumlaut}%
       \doesglyphexist{6}{\capitalring}%
       \doesglyphexist{7}{\capitalcaron}%
       \doesglyphexist{8}{\capitalbreve}%
       \doesglyphexist{9}{\capitalmacron}%
       \doesglyphexist{10}{\capitaldotaccent}%
       \doesglyphexist{11}{\capitalcedilla}%
       \doesglyphexist{12}{\capitalogonek}%
       \doesglyphexist{26}{\t}%
       \doesglyphexist{27}{\capitaltie}%
       \doesglyphexist{28}{\newtie}%
       \doesglyphexist{29}{\capitalnewtie}%
       \doesglyphexist{45}{\textdblhyphen}%
       \doesglyphexist{48}{\textzerooldstyle}%
       \doesglyphexist{49}{\textoneoldstyle}%
       \doesglyphexist{50}{\texttwooldstyle}%
       \doesglyphexist{51}{\textthreeoldstyle}%
       \doesglyphexist{52}{\textfouroldstyle}%
       \doesglyphexist{53}{\textfiveoldstyle}%
       \doesglyphexist{54}{\textsixoldstyle}%
       \doesglyphexist{55}{\textsevenoldstyle}%
       \doesglyphexist{56}{\texteightoldstyle}%
       \doesglyphexist{57}{\textnineoldstyle}%
       \doesglyphexist{77}{\textmho}%
       \doesglyphexist{79}{\textbigcircle}%
       \doesglyphexist{91}{\textlbrackdbl}%
       \doesglyphexist{93}{\textrbrackdbl}%
       \doesglyphexist{96}{\textasciigrave}%
       \doesglyphexist{98}{\textborn}%
       \doesglyphexist{99}{\textdivorced}%
       \doesglyphexist{100}{\textdied}%
       \doesglyphexist{108}{\textleaf}%
       \doesglyphexist{109}{\textmarried}%
       \doesglyphexist{110}{\textmusicalnote}%
       \doesglyphexist{126}{\texttildelow}%
       \doesglyphexist{127}{\textdblhyphenchar}%
       \doesglyphexist{128}{\textasciibreve}%
       \doesglyphexist{129}{\textasciicaron}%
       \doesglyphexist{175}{\textasciimacron}%
       \doesglyphexist{130}{\textacutedbl}%
       \doesglyphexist{131}{\textgravedbl}%
       \doesglyphexist{138}{\textdollaroldstyle}%
       \doesglyphexist{139}{\textcentoldstyle}%
       \doesglyphexist{143}{\textnaira}%
       \doesglyphexist{144}{\textguarani}%
       \doesglyphexist{145}{\textpeso}%
       \doesglyphexist{147}{\textrecipe}%
       \doesglyphexist{152}{\textpertenthousand}%
       \doesglyphexist{153}{\textpilcrow}%
       \doesglyphexist{154}{\textbaht}%
       \doesglyphexist{156}{\textdiscount}%
       \doesglyphexist{158}{\textopenbullet}%
       \doesglyphexist{159}{\textservicemark}%
       \doesglyphexist{160}{\textlquill}%
       \doesglyphexist{161}{\textrquill}%
       \doesglyphexist{168}{\textasciidieresis}%
       \doesglyphexist{171}{\textcopyleft}%
       \doesglyphexist{173}{\textcircledP}%
       \doesglyphexist{180}{\textasciiacute}%
       \doesglyphexist{184}{\textreferencemark}%
       \doesglyphexist{187}{\textsurd}%
    }{1}{2}%
%    \end{macrocode}
%    All fonts (up to now) that belong to sub-encoding 1 do have the
%    \cs{textcircled} glyph, but it is too small to be usable. So this
%    test for this group currently doesn't do much good---but who
%    knows maybe one day a font shows up in which this glyph is
%    actually missing.
%    \begin{macrocode}
    \testgroup{%
      \doesglyphexist{79}{\textcircled}%  this is not a proper test because the symbol is
                                       %  usually available but not usable
    }{0}{1}%
    \testgroup{%
       \doesglyphexist{13}{\textquotestraightbase}%
       \doesglyphexist{18}{\textquotestraightdblbase}%
       \doesglyphexist{23}{\textcapitalcompwordmark}%
       \doesglyphexist{31}{\textascendercompwordmark}%
       \doesglyphexist{36}{\textdollar}%
       \doesglyphexist{39}{\textquotesingle}%
       \doesglyphexist{42}{\textasteriskcentered}%
       \doesglyphexist{132}{\textdagger}%
       \doesglyphexist{133}{\textdaggerdbl}%
       \doesglyphexist{135}{\textperthousand}%
       \doesglyphexist{136}{\textbullet}%
       \doesglyphexist{151}{\texttrademark}%
       \doesglyphexist{162}{\textcent}%
       \doesglyphexist{163}{\textsterling}%
       \doesglyphexist{165}{\textyen}%
       \doesglyphexist{166}{\textbrokenbar}%
       \doesglyphexist{167}{\textsection}%
       \doesglyphexist{169}{\textcopyright}%
       \doesglyphexist{170}{\textordfeminine}%
       \doesglyphexist{172}{\textlnot}%
       \doesglyphexist{174}{\textregistered}%
       \doesglyphexist{176}{\textdegree}%
       \doesglyphexist{177}{\textpm}%
       \doesglyphexist{182}{\textparagraph}%
       \doesglyphexist{183}{\textperiodcentered}%
       \doesglyphexist{186}{\textordmasculine}%
       \doesglyphexist{188}{\textonequarter}%
       \doesglyphexist{189}{\textonehalf}%
       \doesglyphexist{190}{\textthreequarters}%
       \doesglyphexist{214}{\texttimes}%
       \doesglyphexist{246}{\textdiv}%
    }{-1}{0}%
%    \end{macrocode}
%    If all groups have all glyphs then we have the full encoding
%    (subset 0).
%    \begin{macrocode}
    \ifsafesubencodingfound\else
      \def\subencodingresult{0}%
    \fi
%    \end{macrocode}
%    If the font is missing some of the core glyphs we make a remark
%    about this, because they will never display.
%    \begin{macrocode}
    \typeoutdetails{-----------------------------------------}%
    \typeout{TS1 encoding subset for #1\ifcoremisses \space(ignoring core misses)\fi
      \space (\ifnum\subencodingresult =
      \currsubencoding{#1} ok\else bad\fi)}%
    \typeout{Use sub-encoding \subencodingresult
      \ifnum\subencodingresult = \currsubencoding{#1}\else
        \space (not \currsubencoding{#1})\fi}
    \typeout{-----------------------------------------^^J}%
  \fi
}
%    \end{macrocode}
%
%    This tests all declarations (or most of them) that have been
%    added to the kernel. It is called if no family is given interactively.
%    \begin{macrocode}
\long\def\testallkerneldefinedfamilies{%
\testallgroups{ccr}%     {0}
\testallgroups{cmbr}%    {0}
%%\testallgroups{cmr}%   {0}  % don't test this one as it is the fallback
                              % thus reports that the family is not found
\testallgroups{cmss}%    {0}
\testallgroups{cmtl}%    {0}
\testallgroups{cmtt}%    {0}
\testallgroups{cmvtt}%   {0}
\testallgroups{pxr}%     {0}
\testallgroups{pxss}%    {0}
\testallgroups{pxtt}%    {0}
\testallgroups{qag}%     {0}
\testallgroups{qbk}%     {0}
\testallgroups{qcr}%     {0}
\testallgroups{qcs}%     {0}
\testallgroups{qhvc}%    {0}
\testallgroups{qhv}%     {0}
\testallgroups{qpl}%     {0}
\testallgroups{qtm}%     {0}
\testallgroups{qzc}%     {0}
\testallgroups{txr}%     {0}
\testallgroups{txss}%    {0}
\testallgroups{txtt}%    {0}
%
% Next would claim to be 0 (or 2)
%
%\testallgroups{lmr}%     {1}
%\testallgroups{lmdh}%    {1}
%\testallgroups{lmss}%    {1}
%\testallgroups{lmssq}%   {1}
%\testallgroups{lmvtt}%   {1}
%\testallgroups{lmtt}%    {1} % missing TM, SM and pertenthousand so really 2
%
% these are no longer in TeX Live
%
%\testallgroups{ptmx}%    {2} % gone for a long time it seems
%\testallgroups{ptmj}%    {2} % ditto
%\testallgroups{ul8}%     {2} % ditto
%
% next block has tofu chars so results are wrong
%
%\testallgroups{bch}% {5} % tofu for blank, ohm
%\testallgroups{futj}%{5} % tofu for blank, interrobang/down, ohm
%\testallgroups{futs}%{5} % tofu for blank, ohm
%\testallgroups{futx}%{5} % probably (currently broken distrib)
%\testallgroups{pag}% {5} % tofu for blank, interrobang/down, ohm
%\testallgroups{pbk}% {5} % tofu for blank, interrobang/down, ohm
%\testallgroups{pcr}% {5} % tofu for blank, interrobang/down, ohm
%\testallgroups{phv}% {5} % tofu for blank, interrobang/down, ohm
%\testallgroups{pnc}% {5} % tofu for blank, interrobang/down, ohm
%\testallgroups{pplj}%{5} % tofu for blank
%\testallgroups{pplx}%{5} % tofu for blank
%\testallgroups{ppl}% {5} % tofu for blank interrobang/down
%\testallgroups{ptm}% {5} % tofu for blank, interrobang/down, ohm
%\testallgroups{pzc}% {5} % tofu for blank, interrobang/down, ohm
%\testallgroups{ul9}% {5} % tofu for blank, interrobang/down, ohm
%\testallgroups{dayroms}%{6} % tofu for blank, interrobang/down, ohm
%\testallgroups{dayrom}% {6} % tofu for blank, interrobang/down, ohm
%\testallgroups{augie}%{8} % really only missing euro and full of tofu
%\testallgroups{put}%  {8}
%\testallgroups{uag}%  {8} % probably (currently broken distrib)
%\testallgroups{ugq}%  {8}
%
\testallgroups{zi4}%  {9}
%
%% not installed normally
%
%\testallgroups{hls}%  {5}
%\testallgroups{hlst}% {5}
%\testallgroups{hlct}% {5}
%\testallgroups{hlh}%  {5}
%\testallgroups{hlx}%  {8}
%\testallgroups{hlce}% {8}
%\testallgroups{hlcn}% {8}
%\testallgroups{hlcw}% {8}
%\testallgroups{hlcf}% {8}

\testallgroups{lato-LF}%   {0}  % with a bunch of tofu inside --- should probably be changed
\testallgroups{opensans-TLF}%{0}  % with a bunch of tofu inside --- should probably be changed
\testallgroups{cantarell-TLF}%  {0}  % with a bunch of tofu inside --- should probably be changed
\testallgroups{fbb-LF}%     {0}  % missing centoldstyle ---> 2
\testallgroups{tli}%       {1}  % with lots of tofu inside --- should probably be changed
\testallgroups{Alegreya-OsF}%       {2}
\testallgroups{AlegreyaSans-OsF}%   {2}
\testallgroups{DejaVuSans-TLF}%     {2}
\testallgroups{DejaVuSansCondensed-TLF}%  {2}
\testallgroups{DejaVuSansMono-TLF}% {2} this is missing \textfractionsolidus which makes it 7 really
\testallgroups{EBGaramond-LF}%      {2}
\testallgroups{Tempora-TLF}%        {2}
\testallgroups{Tempora-TOsF}%       {2}
\testallgroups{Arimo-TLF}%          {3}
\testallgroups{Crlt-TLF}%           {3}       changed from Carlito-
\testallgroups{FiraSans-LF}%        {3}     should be 4
\testallgroups{IBMPlexSans-TLF}%    {3}
\testallgroups{Merriwthr-OsF}%   {3}         changed from Merriweather- and should be 2
\testallgroups{Montserrat-LF}%      {3}     now 2
\testallgroups{MontserratAlternates-LF}%{3}     now 2
\testallgroups{SourceCodePro-TLF}%  {3}
\testallgroups{SourceCodePro-TOsF}% {3}
\testallgroups{SourceSansPro-OsF}%  {3}
\testallgroups{SourceSerifPro-LF}%  {3}
\testallgroups{Tinos-TLF}%          {3}
\testallgroups{AccanthisADFStdNoThree-LF}%{4}
\testallgroups{Cabin-TLF}%          {4}
\testallgroups{Caladea-TLF}%        {4}
\testallgroups{Chivo-LF}%           {4}
\testallgroups{ClearSans-TLF}%      {4}
\testallgroups{Coelacanth-LF}%      {4}
\testallgroups{CrimsonPro-LF}%      {4}
\testallgroups{FiraMono-TLF}%       {4}
\testallgroups{FiraMono-TOsF}%      {4}
\testallgroups{Go-TLF}%             {4}
\testallgroups{GoMono-TLF}%         {4}
\testallgroups{InriaSans-LF}%       {4}
\testallgroups{InriaSerif-LF}%      {4}
\testallgroups{LibertinusSans-LF}%  {4}
\testallgroups{LibertinusSerif-LF}% {4}
\testallgroups{LibreBodoni-TLF}%    {4}
\testallgroups{LibreFranklin-TLF}%  {4}
\testallgroups{LinguisticsPro-LF}%  {4}
\testallgroups{LinguisticsPro-OsF}% {4}
\testallgroups{LinuxBiolinumT-LF}%  {4}
\testallgroups{LinuxLibertineT-LF}% {4}
\testallgroups{MerriwthrSans-OsF}%  {4}          name change and now 2
\testallgroups{MintSpirit-LF}%      {4}
\testallgroups{MintSpiritNoTwo-LF}% {4}
\testallgroups{PTMono-TLF}%         {4}
\testallgroups{PTSans-TLF}%         {4}
\testallgroups{PTSansCaption-TLF}%  {4}
\testallgroups{PTSansNarrow-TLF}%   {4}
\testallgroups{PTSerif-TLF}%        {4}
\testallgroups{PTSerifCaption-TLF}% {4}
\testallgroups{Raleway-TLF}%        {4}
\testallgroups{Raleway-TOsF}%       {4}
\testallgroups{Roboto-LF}%          {4}
\testallgroups{RobotoMono-TLF}%     {4}
\testallgroups{RobotoSlab-TLF}%     {4}
\testallgroups{Rosario-LF}%         {4}
\testallgroups{SticksTooText-LF}%   {4}
\testallgroups{UniversalisADFStd-LF}%{4}
\testallgroups{Almndr-OsF}%       {5}     name change
\testallgroups{Baskervaldx-LF}%   {5}
\testallgroups{BaskervilleF-LF}%  {5}   now 2
\testallgroups{Bttr-TLF}%         {5}   name changed from Bitter-...
\testallgroups{Cinzel-LF}%        {5}
\testallgroups{CinzelDecorative-LF}%{5}
\testallgroups{DejaVuSerif-TLF}%  {5}
\testallgroups{DejaVuSerifCondensed-TLF}% {5}
\testallgroups{GilliusADF-LF}%    {5}
\testallgroups{charssil-TLF} %%  missing should be 5
\testallgroups{GilliusADFCond-LF}%{5}
\testallgroups{GilliusADFNoTwo-LF}%{5}
\testallgroups{GilliusADFNoTwoCond-LF}%{5}
\testallgroups{Lbstr-LF}%      {5}      name change  and should be 7
\testallgroups{OldStandard-TLF}%  {5}
\testallgroups{PlyfrDisplay-LF}%{5}       name change
\testallgroups{PlyfrDisplay-OsF}% {5}       name change
\testallgroups{TheanoDidot-TLF}%  {5}
\testallgroups{TheanoDidot-TOsF}% {5}
\testallgroups{TheanoModern-TLF}% {5}
\testallgroups{TheanoModern-TOsF}%{5}
\testallgroups{TheanoOldStyle-TLF}%{5}
\testallgroups{TheanoOldStyle-TOsF}%{5}
\testallgroups{Crimson-TLF}%      {6}
\testallgroups{IBMPlexMono-TLF}%  {6}  now 3
\testallgroups{IBMPlexSerif-TLF}% {6}  now 3
\testallgroups{LibertinusMono-TLF}%{6}  should be 8
\testallgroups{LibertinusSerifDisplay-LF}%{6}
\testallgroups{LinuxLibertineDisplayT-LF}%{6}
\testallgroups{LinuxLibertineMonoT-LF}%{6}
\testallgroups{LinuxLibertineMonoT-TLF}%{6}
\testallgroups{Ovrlck-LF}%       {6}     name changed
\testallgroups{CormorantGaramond-LF}%{7}
\testallgroups{Heuristica-TLF}%  {7}
\testallgroups{Heuristica-TOsF}% {7}
\testallgroups{IMFELLEnglish-TLF}%{7}
\testallgroups{LibreBskvl-LF}%   {7}  %%  wrong name LibreBaskerville-TLF
\testallgroups{LibreCsln-LF}%    {7}  changed from LibreCaslon-
\testallgroups{Mrcls-LF}%        {7}       %%  wrong name Marcellus-LF
\testallgroups{NotoSans-LF}%     {7}
\testallgroups{NotoSansMono-TLF}%{7}  now 2
\testallgroups{NotoSansMono-TOsF}%{7}  now 2
\testallgroups{NotoSerif-LF}%    {7}
\testallgroups{Quattro-LF}%      {7}  changed from Quattrocento-
\testallgroups{QuattroSans-LF}%  {7}  changed from QuattrocentoSans-
\testallgroups{XCharter-TLF}%    {7}  now 2
\testallgroups{XCharter-TOsF}%   {7}  now 2
\testallgroups{erewhon-LF}%      {7}  now 2
\testallgroups{ComicNeue-TLF}%   {7}
\testallgroups{ComicNeueAngular-TLF}%{7}
\testallgroups{Frm-LF}%{7}  % the superiors are missing; name changed from Forum-LF
\testallgroups{Cochineal-TLF}%   {8} now 5
\testallgroups{AlgolRevived-TLF}%{9}
}
%    \end{macrocode}
%
%    There interaction with the user.
%    \begin{macrocode}
\typeout{^^J=====================================================================}
\typeout{| Enter font family to check (or <enter> for kernel defined families)}
\typeout{=====================================================================}
\typein[\FontFamilyToCheck]{}
%    \end{macrocode}
%
%    \begin{macrocode}
\if!\FontFamilyToCheck!
  \typeout{=====================================================================}
  \typeout{| Detailed output? (default no)}
  \typeout{=====================================================================}
  \typein[\Details]{}
  \if!\Details!
    \def\typeoutdetails#1{}
  \else
    \let\typeoutdetails\typeout
  \fi
  \testallkerneldefinedfamilies
\else
  \let\typeoutdetails\typeout
  \testallgroups\FontFamilyToCheck
\fi
%    \end{macrocode}
%    
%    \begin{macrocode}
\stop
%</TS1check>
%    \end{macrocode}
%
% \Finale
%




\endinput