summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ucs/utils/c40enc.def
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/ucs/utils/c40enc.def')
-rw-r--r--macros/latex/contrib/ucs/utils/c40enc.def41
1 files changed, 41 insertions, 0 deletions
diff --git a/macros/latex/contrib/ucs/utils/c40enc.def b/macros/latex/contrib/ucs/utils/c40enc.def
new file mode 100644
index 0000000000..22a96a9f44
--- /dev/null
+++ b/macros/latex/contrib/ucs/utils/c40enc.def
@@ -0,0 +1,41 @@
+%%
+%% This is file `c40enc.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ucs.dtx (with options: `c40enc.def')
+%%
+%% Copyright 2001 Dominique Unruh <unruh@ut.ee>
+%% Copyright 2013 Wolfgang Jeltsch <wolfgang@cs.ioc.ee>
+%%
+%% This program is provided under the terms of the LaTeX Project Public License with some
+%% modifications. See the file LICENSE for information.
+%%
+\ProvidesFile{c40enc.def}[2002/11/25 Fontencoding C40 (JIS)]%
+\DeclareFontEncoding{C40}{}{}%
+\DeclareFontSubstitution{C40}{song}{m}{n}%
+\input{cenccmn.tex}%
+\expandafter\let\csname C40/song/m/n\endcsname\undefined
+\def\cjk@Cforty#1#2#3#4{% Takes JIS0208 codepos in hex
+ {%
+ \count0="#1#2
+ \multiply\count0 by94
+ \advance\count0 by"#3#4
+ \advance\count0 by-"B3F
+ \count1\count0
+ \divide\count0 by256
+ \multiply\count0 by256
+ \advance\count1 by-\count0
+ \divide\count0 by256
+ %\typeout{C0=\number\count0, C1=\number\count1}%
+ \edef\temp@a{\ifnum\count0<10 0\fi\number\count0}%
+ \edef\temp@b{\ifx\temp@a\CJK@plane\else
+ \def\noexpand\CJK@plane{\temp@a}\noexpand\selectfont\fi
+ \char\number\count\@ne\space}%
+ %\typeout{C40: \meaning\temp@b}%
+ \expandafter}\temp@b%
+ }%
+\DeclareTextCommand\jischar{C40}[1]{\cjk@Cforty#1}
+\DeclareTextCommandDefault\jischar[1]{{\fontencoding{C40}%
+ \let\CJK@plane\undefined\cjk@Cforty#1}}