s-languages-hyphenation.mkiv /size: 2796 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [      file=s-languages-hyphenation, % s-lan-04,
3%D        version=2011.05.01,
4%D          title=\CONTEXT\ Style File,
5%D       subtitle=Language Hyphenation,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D For Mojca.
15
16\startmodule[languages-hyphenation]
17
18\registerctxluafile{s-languages-hyphenation}{}
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 % \language\zerocount
29 % \setupalign[\v!nothyphenated]%
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 % global
39\to \everylanguage
40
41\clf_storelanguagestate % initialize
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{s-languages-hyphenation.mkiv}
62
63\usemodule[art-01]
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