char-utf.mkxl /size: 1511 b    last modification: 2025-02-21 11:03
1%D \module
2%D   [       file=char-utf,
3%D        version=2006.12.05,
4%D          title=\CONTEXT\ Character Support,
5%D       subtitle=Unicode UTF,
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\writestatus{loading}{ConTeXt Character Support / Unicode UTF}
15
16%D After a bit of experimenting we reached a clean state where \UTF\ 8, 16 and 32
17%D were supported as well as collapsing (combining sequences). Writing the code was
18%D a relaxed experience, not in the last place because it was accompanied by
19%D listening to those nice Vienna Teng cd's (who decided that making music was more
20%D fun than programming, but then, she may not know \TEX\ and \LUA).
21
22\unprotect
23
24\registerctxluafile{char-def}{}
25\registerctxluafile{char-ini}{}
26\registerctxluafile{char-utf}{}
27\registerctxluafile{char-cjk}{}
28\registerctxluafile{char-ran}{}
29
30%D We enable collapsing (combining characters) by default, but since the source
31%D files are rather simple, we postpone the initialization till runtime.
32
33% \appendtoks
34%     \clf_enableutf % not needed when we create a format so we do it now
35% \to \everyjob
36
37%D The next one influences input parsing.
38%D
39%D \starttyping
40%D \definecomposedutf 318 108 126 % lcaron
41%D \stoptyping
42
43\permanent\protected\def\definecomposedutf#1 #2 #3 {\clf_addgrapheme{#1}{#2}{#3}}
44
45\protect
46