]> matita.cs.unibo.it Git - helm.git/blobdiff - share/texmf/unicode/contrib/c40enc.def
the Matita manual is now convertible to a decent .tex that is processable both
[helm.git] / share / texmf / unicode / contrib / c40enc.def
diff --git a/share/texmf/unicode/contrib/c40enc.def b/share/texmf/unicode/contrib/c40enc.def
new file mode 100644 (file)
index 0000000..603f137
--- /dev/null
@@ -0,0 +1,42 @@
+%%
+%% 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 <dominique@unruh.de>
+%% 
+%% This program is provided under the terms of the LaTeX Project Public
+%% License with some modifications.
+%% See the file LICENSE (http://www.unruh.de/DniQ/latex/unicode/content/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}}