summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/plain/kotex-plain/kotexutf-core.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/plain/kotex-plain/kotexutf-core.tex')
-rw-r--r--Master/texmf-dist/tex/plain/kotex-plain/kotexutf-core.tex133
1 files changed, 89 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/plain/kotex-plain/kotexutf-core.tex b/Master/texmf-dist/tex/plain/kotex-plain/kotexutf-core.tex
index c183291560b..0bf642f463f 100644
--- a/Master/texmf-dist/tex/plain/kotex-plain/kotexutf-core.tex
+++ b/Master/texmf-dist/tex/plain/kotex-plain/kotexutf-core.tex
@@ -1,7 +1,7 @@
%% File `kotexutf-core.tex`
%%
-%% Copyright (C) 2009-2015 Dohyun Kim <nomos at ktug org>
-%% Copyright (C) 2015 Kangsoo Kim <karnes at ktug org>
+%% Copyright (C) 2009-2022 Dohyun Kim <nomos at ktug org>
+%% Copyright (C) 2015-2022 Kangsoo Kim <karnes at ktug org>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
@@ -23,71 +23,116 @@
\def\unihangul@two@octets#1#2{%
\expandafter\unihangulchar\expandafter{%
\number\numexpr
- (`#1 - 192) * 64 +
- (`#2 - 128) \relax}}
+ (`#1 - 192) * 64 +
+ (`#2 - 128) \relax}}
\def\unihangul@three@octets#1#2#3{%
\expandafter\unihangulchar\expandafter{%
\number\numexpr
- (`#1 - 224) * 4096 +
- (`#2 - 128) * 64 +
- (`#3 - 128) \relax}}
+ (`#1 - 224) * 4096 +
+ (`#2 - 128) * 64 +
+ (`#3 - 128) \relax}}
\def\unihangul@four@octets#1#2#3#4{%
\expandafter\unihangulchar\expandafter{%
\number\numexpr
- (`#1 - 240) * 262144 +
- (`#2 - 128) * 4096 +
- (`#3 - 128) * 64 +
- (`#4 - 128) \relax}}
+ (`#1 - 240) * 262144 +
+ (`#2 - 128) * 4096 +
+ (`#3 - 128) * 64 +
+ (`#4 - 128) \relax}}
+
+\def\unihangul@ii@octs#1#2{%
+ \ifincsname
+ \string#1\string#2%
+ \else
+ \ifx\protect\relax
+ \ifcsname u8:\string#1\string#2\endcsname
+ \csname u8:\string#1\string#2\endcsname
+ \else
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\unihangul@two@octets
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter#2%
+ \fi
+ \else
+ \noexpand#1\noexpand#2%
+ \fi
+ \fi
+}
+\def\unihangul@iii@octs#1#2#3{%
+ \ifincsname
+ \string#1\string#2\string#3%
+ \else
+ \ifx\protect\relax
+ \ifcsname u8:\string#1\string#2\string#3\endcsname
+ \csname u8:\string#1\string#2\string#3\endcsname
+ \else
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\unihangul@three@octets
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter#2%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter#3%
+ \fi
+ \else
+ \noexpand#1\noexpand#2\noexpand#3%
+ \fi
+ \fi
+}
+\def\unihangul@iv@octs#1#2#3#4{%
+ \ifincsname
+ \string#1\string#2\string#3\string#4%
+ \else
+ \ifx\protect\relax
+ \ifcsname u8:\string#1\string#2\string#3\string#4\endcsname
+ \csname U8:\string#1\string#2\string#3\string#4\endcsname
+ \else
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\unihangul@four@octets
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter#2%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter#3%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter#4%
+ \fi
+ \else
+ \noexpand#1\noexpand#2\noexpand#3\noexpand#4%
+ \fi
+ \fi
+}
\count@"80 \loop
- \uccode\count@\z@
- \lccode\count@\z@
- \catcode\count@=12
+ \uccode\count@\count@
+ \lccode\count@\count@
\ifnum\count@<"BF \advance\count@\@ne \repeat
\count@"C2 \loop
- \uccode\count@\z@
- \lccode\count@\z@
+ \uccode\count@\count@
+ \lccode\count@\count@
\begingroup
\lccode`\~\count@
- \lowercase{\endgroup
- \protected\def~##1{%
- \ifcsname U8:\string~\string##1\endcsname
- \csname U8:\string~\string##1\expandafter\endcsname
- \else
- \expandafter\unihangul@two@octets
- \expandafter~\expandafter##1%
- \fi }}
+ \lowercase{\endgroup \def~{\unihangul@ii@octs~}}
\ifnum\count@<"DF \advance\count@\@ne \repeat
\count@"E0 \loop
- \uccode\count@\z@
- \lccode\count@\z@
+ \uccode\count@\count@
+ \lccode\count@\count@
\begingroup
\lccode`\~\count@
- \lowercase{\endgroup
- \protected\def~##1##2{%
- \ifcsname U8:\string~\string##1\string##2\endcsname
- \csname U8:\string~\string##1\string##2\expandafter\endcsname
- \else
- \expandafter\unihangul@three@octets
- \expandafter~\expandafter##1\expandafter##2%
- \fi }}
+ \lowercase{\endgroup \def~{\unihangul@iii@octs~}}
\ifnum\count@<"EF \advance\count@\@ne \repeat
\count@"F0 \loop
- \uccode\count@\z@
- \lccode\count@\z@
+ \uccode\count@\count@
+ \lccode\count@\count@
\begingroup
\lccode`\~\count@
- \lowercase{\endgroup
- \protected\def~##1##2##3{%
- \ifcsname U8:\string~\string##1\string##2\string##3\endcsname
- \csname U8:\string~\string##1\string##2\string##3\expandafter\endcsname
- \else
- \expandafter\unihangul@four@octets
- \expandafter~\expandafter##1\expandafter##2\expandafter##3%
- \fi }}
+ \lowercase{\endgroup \def~{\unihangul@iv@octs~}}
\ifnum\count@<"F4 \advance\count@\@ne \repeat
%% subfont plane and char slot