1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19\startmodule[regimeslist]
20
21\startluacode
22
23moduledata.regimes = moduledata.regimes or { }
24moduledata.regimes.charts = moduledata.regimes.charts or { }
25
26local byte = string.byte
27
28function moduledata.regimes.charts.show(regime)
29 if regime and regime ~= "" then
30 local r = regimes.mapping[regime]
31 if r then
32 local chardata = characters.data
33 context.starttabulate { "|rT|rT|rT|cT|lT|lT|pT|" }
34 for k, v in table.sortedhash(r) do
35 local chr = chardata[v]
36 local num = byte(k)
37 local uni = utf.byte(v)
38 if chr then
39 context.NC() context(num)
40 context.NC() context("0x%02X",num)
41 context.NC() context("%U",uni)
42 context.NC() context.char(uni)
43 context.NC() context(chr.contextname)
44 context.NC() context(chr.category)
45 context.NC() context(chr.description)
46 context.NC() context.NR()
47 else
48
49 end
50 end
51 context.stoptabulate()
52 else
53 context("unknown regime %s",regime)
54 end
55 else
56 context("available regimes: %, t",regimes.list())
57 end
58end
59
60\stopluacode
61
62\installmodulecommandluasingle \showregime {moduledata.regimes.charts.show}
63
64\stopmodule
65
66\continueifinputfile{sregimeslist.mkiv}
67
68\usemodule[art01]
69
70\starttext
71
72 \showregime[88591]
73
74\stoptext
75 |