summaryrefslogtreecommitdiff
path: root/tex/context/base/char-utf.mkiv
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-07-04 15:32:09 +0300
committerMarius <mariausol@gmail.com>2010-07-04 15:32:09 +0300
commit85b7bc695629926641c7cb752fd478adfdf374f3 (patch)
tree80293f5aaa7b95a500a78392c39688d8ee7a32fc /tex/context/base/char-utf.mkiv
downloadcontext-85b7bc695629926641c7cb752fd478adfdf374f3.tar.gz
stable 2010-05-24 13:10
Diffstat (limited to 'tex/context/base/char-utf.mkiv')
-rw-r--r--tex/context/base/char-utf.mkiv47
1 files changed, 47 insertions, 0 deletions
diff --git a/tex/context/base/char-utf.mkiv b/tex/context/base/char-utf.mkiv
new file mode 100644
index 000000000..16b4029d8
--- /dev/null
+++ b/tex/context/base/char-utf.mkiv
@@ -0,0 +1,47 @@
+%D \module
+%D [ file=char-utf,
+%D version=2006.12.05,
+%D title=\CONTEXT\ Character Support,
+%D subtitle=Unicode UTF,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Character Support / Unicode UTF}
+
+%D After a bit of experimenting we reached a clean state where \UTF\
+%D 8, 16 and 32 were supported as well as collapsing (combining
+%D sequences). Writing the code was a relaxed experience, not in the
+%D last place because it was accompanied by listening to those nice
+%D Vienna Teng cd's (who decided that making music was more fun than
+%D programming, but then, she may not know \TEX\ and \LUA).
+
+\unprotect
+
+\registerctxluafile{char-utf}{1.001}
+
+%D We enable collapsing (combining characters) by default, but
+%D since the source files are rather simple, we postpone the
+%D initialization till runtime.
+
+\appendtoks
+ \ctxlua {
+ characters.filters.utf.collapsing = true
+ resolvers.install_text_filter('utf',characters.filters.utf.collapse)
+ }%
+\to \everyjob
+
+%D The next one influences input parsing.
+%D
+%D \starttyping
+%D \definecomposedutf 318 108 126 % lcaron
+%D \stoptyping
+
+\unexpanded\def\definecomposedutf#1 #2 #3 %
+ {\ctxlua{characters.filters.utf.add_grapheme("#1","#2","#3")}}
+
+\protect