summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/plain/kotex-plain/kotexutf.tex
blob: 0e9d8076e313512b36d8b9ddfe10183ea5243866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
%% File `kotexutf.tex`
%%
%%   2010.01.04  v1.1
%%
%% Copyright (C) 2010-2013 Dohyun Kim <nomos at ktug org>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%  http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2006/05/20 or later.
%%
%% finemath on has been plainTeX default
%%
\def\finemath{}

\expandafter\edef\csname AT(@):catcode\endcsname{\noexpand\catcode`@\the\catcode`@}

\unless\ifdefined\makeatletter \def\makeatletter{\catcode`\@=11 }\fi
\unless\ifdefined\makeatother \def\makeatother{\catcode`\@=12 }\fi

\makeatletter

\unless\ifdefined\@tempcnta \newcount\@tempcnta\fi
\unless\ifdefined\@tempcntb \newcount\@tempcntb\fi
\unless\ifdefined\@empty \let\@empty\empty\fi
\unless\ifdefined\@sptoken
  \begingroup
  \def\:{\global\let\@sptoken= }\:  % this makes \@sptoken a space token
  \endgroup
\fi

\unless\ifdefined\ProvidesFile
  \def\ProvidesFile#1{\wlog{#1}\@ProvidesFile}
  \def\@ProvidesFile{\futurelet\dhucs@next\@@ProvidesFile}
  \def\@@ProvidesFile{%
    \ifx\dhucs@next\@sptoken\expandafter\@@@ProvidesFile
    \else\ifx\dhucs@next[\expandafter\expandafter\expandafter\ProvidesFile@
    \fi\fi}
  \def\@@@ProvidesFile{\afterassignment\@ProvidesFile\let\dhucs@next= }
  \def\ProvidesFile@[#1]{\wlog{#1}}
\fi

\unless\ifdefined\IeC \protected\def\IeC#1{#1}\fi
\unless\ifdefined\textperiodcentered \protected\def\textperiodcentered{$\cdot$}\fi
\unless\ifdefined\textquoteleft \protected\def\textquoteleft{`}\fi
\unless\ifdefined\textquoteright \protected\def\textquoteright{'}\fi
\unless\ifdefined\textquotedblleft \protected\def\textquotedblleft{``}\fi
\unless\ifdefined\textquotedblright \protected\def\textquotedblright{''}\fi

\unless\ifdefined\saved@space@catcode \xdef\saved@space@catcode{\the\catcode`\ }\fi
\unless\ifdefined\PackageError \def\PackageError#1#2#3{\errmessage{#2}}\fi
\unless\ifdefined\@inpenc@test \let\@inpenc@test\relax \fi
\unless\ifdefined\@begindocumenthook \let\@begindocumenthook\relax \fi
\unless\ifdefined\@onlypreamble \def\@onlypreamble#1{}\fi
\unless\ifdefined\cdp@list \let\cdp@list\relax \fi

\unless\ifdefined\protect \let\protect\relax \fi

\unless\ifdefined\normalfont \def\normalfont{\rm\hfontname{nanummjm}}\fi
\unless\ifdefined\bfseries \def\bfseries{\bf\hfontname{nanummjb}}\fi

% make first octet of a utf8 char active
\count@"C2
\loop\catcode\count@\active
  \ifnum\count@<"F4
  \advance\count@\@ne\repeat

\input utf8.def

\input kotexutf-core

\def\unihangulchar@@@{%
  \getthish@ngulcl@ss
  \dobeforeh@ngulch@r
  \leavevmode %%% moved from inside group
  \begingroup
    \geth@ngulpl@ne@ndch@r
    \font\font@name\h@font@name\h@ngulpl@ne\space\h@font@size
    \font@name
    \dhucs@check@if@char@exists
    \dhucs@emph\h@ngulch@r
    \h@ngulch@r
  \endgroup
  \do@fterh@ngulch@r
}

\input lucenc.dfu

% \다 = \nobreak 다
\def\nobreak@hangul@da{\nobreak 다}
\def\^^eb#1#2{%
  \ifx#1^^8b%
    \ifx#2^^a4% avoid orphan \다
      \expandafter\expandafter\expandafter\nobreak@hangul@da
    \else
      \errmessage{Undefined Control Sequence}%
    \fi
  \else
    \errmessage{Undefined Control Sequence}%
  \fi}


% hangul font definition
% ex: \hfont{nanumgtm}{at 12pt}
%     \hfontname{nanumgtm}
%     \hfontsize{at 12pt}
\protected\def\hfontname#1{\def\h@font@name{#1}}
\protected\def\hfontsize#1{\def\h@font@size{#1}}
\protected\def\hfont#1#2{\hfontname{#1}\hfontsize{#2}}

\csname AT(@):catcode\endcsname

\hfont{nanummjm}{}

\endinput

%% changes for ko.TeX 2.0, by Karnes.