1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16\startmodule[languageshyphenation]
17
18\registerctxluafile{slanguageshyphenation}{}
19
20\unprotect
21
22\unexpanded\def\startcomparepatterns
23 {\dosingleempty\module_languages_hyphenation_start}
24
25\unexpanded\def\module_languages_hyphenation_start[#1]
26 {\begingroup
27 \par
28
29
30 \ctxlua{moduledata.languages.hyphenation.startcomparepatterns("#1")}}
31
32\unexpanded\def\stopcomparepatterns
33 {\par
34 \ctxlua{moduledata.languages.hyphenation.stopcomparepatterns()}
35 \endgroup}
36
37\appendtoks
38 \clf_storelanguagestate
39\to \everylanguage
40
41\clf_storelanguagestate
42
43\installmodulecommandluasingle \showcomparepatternslegend {moduledata.languages.hyphenation.showcomparelegend}
44
45\protect
46
47\definecolor[hyphenation:1] [r=.8]
48\definecolor[hyphenation:2] [g=.8]
49\definecolor[hyphenation:3] [b=.8]
50\definecolor[hyphenation:4] [r=.4,g=.4]
51\definecolor[hyphenation:5] [r=.4,b=.4]
52
53\definecolor[hyphenation:en] [hyphenation:1]
54\definecolor[hyphenation:de] [hyphenation:2]
55\definecolor[hyphenation:nl] [hyphenation:3]
56\definecolor[hyphenation:fr] [hyphenation:4]
57\definecolor[hyphenation:sl] [hyphenation:5]
58
59\stopmodule
60
61\continueifinputfile{slanguageshyphenation.mkiv}
62
63\usemodule[art01]
64
65\starttext
66
67 \startcomparepatterns[en,sl]
68 {For Mojca Miklavec}
69 {For Mojca Miklavec}
70 \stopcomparepatterns
71
72 \startcomparepatterns[en]
73 {For Mojca Miklavec}
74 {For Mojca Miklavec}
75 \stopcomparepatterns
76
77 \startcomparepatterns[sl]
78 {For Mojca Miklavec}
79 {For Mojca Miklavec}
80 \stopcomparepatterns
81
82 \startcomparepatterns[en,sl]
83 {For Mojca Miklavec}\crlf
84 {For Mojca Miklavec}\crlf
85 {\de For Mojca Miklavec}\crlf
86 {For Mojca Miklavec}\crlf
87 {\fr For Mojca Miklavec}
88 \stopcomparepatterns
89
90 \page
91
92 \startsubject{Normal text}
93 \input tufte
94 \stopsubject
95
96 \startsubject{Compare hyphenation points of \showcomparepatternslegend[en,de]}
97 \startcomparepatterns
98 \input tufte \quad (\showcomparepatternslegend)
99 \stopcomparepatterns
100 \stopsubject
101
102 \startsubject{Compare hyphenation points}
103 \startcomparepatterns[de,nl,en,fr]
104 \input tufte \quad (\showcomparepatternslegend)
105 \stopcomparepatterns
106 \stopsubject
107
108\stoptext
109 |