1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16\usemodule[article]
17
18\setupbodyfont[9pt]
19
20\starttext
21
22\definefontfeature
23 [boundingbox]
24 [boundingbox=yes]
25
26\definefont
27 [TestFont]
28 [file:arialuni.ttf*boundingbox]
29
30\startluacode
31
32local data = characters.data
33
34local indicscripts = table.sorted {
35 "devanagari",
36 "kannada",
37 "malayalam",
38 "tamil",
39 "bengali",
40 "gurmukhi",
41 "gujarati",
42 "oriya",
43 "telugu",
44}
45
46local arabicscripts = table.sorted {
47 "arabic",
48 "syriac",
49 "mandiac",
50 "nko",
51}
52
53local allindic = true
54local allarabic = true
55local dotted = utf.char(0x25CC)
56
57local left = table.setmetatableindex (
58 { r = dotted, b = dotted, t = dotted, s = dotted },
59 function(t,k) local v = "" if k then t[k] = v end return v end
60)
61
62local right = table.setmetatableindex (
63 { l = dotted },
64 function(t,k) local v = "" if k then t[k] = v end return v end
65)
66
67for i=1,#indicscripts do
68 local script = indicscripts[i]
69 local first, last = characters.blockrange(script)
70 context.starttitle { title = script }
71 context.starttabulate { "|Tc|Tc|Tc|Tc|Tc|Tc|Tc|Tp|" }
72 context.FL()
73 context.BC() context("unicode")
74 context.BC() context("glyph")
75 context.BC() context("category")
76 context.BC() context("indic")
77 context.BC() context("mark")
78 context.BC() context("class")
79 context.BC() context("order")
80 context.BC() context("description")
81 context.NC() context.NR()
82 context.ML()
83 for i=first,last do
84 local d = data[i]
85 if d and d.unicodeslot then
86 local indic = d.indic
87 local category = d.category or "?"
88 local description = d.description
89 if not indic then
90 context.NC() context("\\red %U",i)
91 context.NC() context("\\red\\showstruts\\strut\\TestFont %c",i)
92 context.NC() context("\\red %s",category)
93 context.NC()
94 context.NC()
95 context.NC()
96 context.NC()
97 context.NC() context(description)
98 context.NC() context.NR()
99 else
100 local indicclass = d.indicclass
101 local indicmark = d.indicmark
102 local indicorder = d.indicorder
103 if allindic or indic == "d" or indicmark or indicclass or indicorder then
104 local l = left [indicmark]
105 local r = right[indicmark]
106 context.NC() context("%U",i)
107 context.NC() context("\\showstruts\\strut\\TestFont %s%c%s",l,i,r)
108 context.NC() context(category)
109 context.NC() context(indic or "?")
110 context.NC() context(indicmark or "")
111 context.NC() context(indicclass or "")
112 context.NC() context(indicorder or "")
113 context.NC() context(description)
114 context.NC() context.NR()
115 end
116 end
117 end
118 end
119 context.LL()
120 context.stoptabulate()
121 context.stoptitle()
122end
123
124for i=1,#arabicscripts do
125 local script = arabicscripts[i]
126 local first, last = characters.blockrange(script)
127 context.starttitle { title = script }
128 context.starttabulate { "|Tc|Tc|Tc|Tc|Tp|" }
129 context.FL()
130 context.BC() context("unicode")
131 context.BC() context("glyph")
132 context.BC() context("category")
133 context.BC() context("arabic")
134 context.BC() context("description")
135 context.NC() context.NR()
136 context.ML()
137 for i=first,last do
138 local d = data[i]
139 if d and d.unicodeslot then
140 local arabic = d.arabic
141 local category = d.category or ""
142 local description = d.description or ""
143 if arabic then
144 context.NC() context("%U",i)
145 context.NC() context("\\showstruts\\strut\\TestFont %c",i)
146 context.NC() context(category)
147 context.NC() context(arabic)
148 context.NC() context(description)
149 context.NC() context.NR()
150 elseif allarabic then
151 context.NC() context("\\red %U",i)
152 context.NC() context("\\red\\showstruts\\strut\\TestFont %c",i)
153 context.NC() context("\\red %s",category)
154 context.NC()
155 context.NC() context("\\red %s",description)
156 context.NC() context.NR()
157 end
158 end
159 end
160 context.LL()
161 context.stoptabulate()
162 context.stoptitle()
163end
164
165
166
167
168
169
170
171
172
173\stopluacode
174
175\stoptext
176 |