1
2
3
4
5
6
7
8
9
10
11
12
13
14\startmodule[fontscjk]
15
16\unprotect
17
18\unexpanded\def\ShowChineseCombiChar#1#2#3#4
19 {\blank[small]
20 \dontleavehmode
21 \hbox\bgroup
22 \dontcomplain
23 \setstrut
24 \hbox to 7em{\ruledhbox{\char#1}\hskip.25em\type{}\hskip.25em\ruledhbox{\char#2}\hskip.25em\type{=}\hskip.25em\ruledhbox{\char#1\char#2}\hss}\relax
25 \ruledvtop{\hsize1em\char#1\char#2}\relax
26 \hskip2em
27 \ruledvtop{\hsize.625em\char#1\char#2}\relax
28 \hskip2em
29 \ruledvtop{\hsize1.5em\char#1\char#2}\relax
30 \hskip2em
31 \type{#3 #4}\relax
32 \egroup
33 \blank[small]}
34
35\startluacode
36local example = {
37 korean = 0x0AC00,
38 chinese = 0x04E55,
39 full_width_open = 0x03008,
40 full_width_close = 0x03009,
41 half_width_open = 0x02018,
42 half_width_close = 0x02019,
43 hyphen = 0x02026,
44 non_starter = 0x03005,
45 other = 0x0004D,
46}
47
48function fonts.analyzers.cjktest(first,second)
49 for k, v in next, example do
50 if (not first or first == "") or first == k then
51 for kk, vv in next, example do
52 if (not second or second == "") or second == kk then
53 context.ShowChineseCombiChar(v,vv,k,kk)
54 end
55 end
56 end
57 end
58end
59\stopluacode
60
61\unexpanded\def\ShowCombinationsKorean
62 {\dodoubleempty\doShowCombinationsKorean}
63
64\def\doShowCombinationsKorean[#1][#2]
65 {\startpacked
66 \setscript[hangul]
67 \setupcolors[\c!state=\v!start]
68 \enabletrackers[cjk.analyzing]
69 \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par
70 \disabletrackers[cjk.analyzing]
71 \stoppacked}
72
73\unexpanded\def\ShowCombinationsChinese
74 {\dodoubleempty\doShowCombinationsChinese}
75
76\unexpanded\def\doShowCombinationsChinese[#1][#2]
77 {\startpacked
78 \setscript[hanzi]
79 \setupcolors[\c!state=\v!start]
80 \enabletrackers[cjk.analyzing]
81 \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par
82 \disabletrackers[cjk.analyzing]
83 \stoppacked}
84
85\stopmodule
86
87\protect \endinput
88 |