]> matita.cs.unibo.it Git - helm.git/blob - helm/software/share/texmf/unicode/contrib/lucenc.def
Preparing for 0.5.9 release.
[helm.git] / helm / software / share / texmf / unicode / contrib / lucenc.def
1 %%
2 %% This is file `lucenc.def',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% ucs.dtx  (with options: `lucenc.def')
8 %% 
9 %% Copyright 2001 Dominique Unruh <dominique@unruh.de>
10 %% 
11 %% This program is provided under the terms of the LaTeX Project Public
12 %% License with some modifications.
13 %% See the file LICENSE (http://www.unruh.de/DniQ/latex/unicode/content/LICENSE)
14 %% for information.
15 %% 
16 \catcode`\@11
17 \ifx\@tempcnta\undefined\csname newcount\endcsname\@tempcnta\fi
18 \ifx\@tempcntb\undefined\csname newcount\endcsname\@tempcntb\fi
19 \def\lucchar#1{%
20   \begingroup
21     \@tempcnta=#1\divide\@tempcnta by"1000
22     \multiply\@tempcnta by-"1000\advance\@tempcnta by#1%
23     \divide\@tempcnta by"100%
24     \@tempcntb=#1\divide\@tempcntb by"10000
25     \multiply\@tempcntb by-"10000\advance\@tempcntb by#1%
26     \divide\@tempcntb by"1000%
27     \xdef\LUC@plane@LUC{%
28       \ifcase\@tempcntb0\or1\or2\or3\or4\or5\or6\or7\or
29                        8\or9\or a\or b\or c\or d\or e\or f\fi
30       \ifcase\@tempcnta0\or1\or2\or3\or4\or5\or6\or7\or
31                        8\or9\or a\or b\or c\or d\or e\or f\fi}%
32     \ifnum#1>"FFFF
33       \@tempcnta=#1\divide\@tempcnta by"100000
34       \multiply\@tempcnta by-"100000\advance\@tempcnta by#1%
35       \divide\@tempcnta by"10000%
36       \xdef\LUC@plane@LUC{%
37         \ifcase\@tempcnta0\or1\or2\or3\or4\or5\or6\or7\or
38                          8\or9\or a\or b\or c\or d\or e\or f\fi
39         \LUC@plane@LUC}%
40       \ifnum#1>"FFFFF
41         \@tempcnta=#1\divide\@tempcnta by"1000000
42         \multiply\@tempcnta by-"1000000\advance\@tempcnta by#1%
43         \divide\@tempcnta by"100000%
44         \xdef\LUC@plane@LUC{%
45           \ifcase\@tempcnta0\or1\or2\or3\or4\or5\or6\or7\or
46                            8\or9\or a\or b\or c\or d\or e\or f\fi
47           \LUC@plane@LUC}%
48       \fi
49     \fi
50     \@tempcnta=#1\divide\@tempcnta by"100
51     \multiply\@tempcnta by-"100\advance\@tempcnta by#1%
52     \relax
53     %\typeout{Plane: \LUC@plane@LUC, Char: \number\@tempcnta}%
54   \expandafter\endgroup
55   \expandafter\luc@char\expandafter{\number\@tempcnta}%
56 }
57 \def\luc@loadfont{%
58   \expandafter\ifx\csname LUC-font-\LUCfont\LUC@plane@LUC\endcsname\relax
59     \expandafter\font\csname LUC-font-\LUCfont\LUC@plane@LUC\endcsname=%
60       \LUCfont\LUC@plane@LUC\fi
61   \csname LUC-font-\LUCfont\LUC@plane@LUC\endcsname}
62 \def\luc@char#1{%
63   \ifx\LUC@plane@LUC\LUC@plane@old\else
64     \ifx\LUCfont\undefined\selectfont
65     \else\luc@loadfont\fi
66   \fi
67   \char#1 }
68 \ifx\NeedsTeXFormat\undefined\endinput\fi
69
70 \ProvidesFile{lucenc.def}[2002/02/20 Encoding for Unicode fonts]
71 \DeclareFontEncoding{LUC}{}{}%
72 \DeclareFontSubstitution{LUC}{arial}{m}{n}%
73 \providecommand\LUC@@empty[1]{%
74   \edef\mandatory@arg{\mandatory@arg\csname LUC@plane@\f@encoding\endcsname}%
75   \empty@sfcnt#1%
76   \edef\uc@temp@a{\csname LUC@plane@\f@encoding\endcsname}%
77   \xdef\font@name{\csname \curr@fontshape/\f@size/\uc@temp@a\endcsname}}
78 \providecommand\LUC@@sub[1]{%
79   \expandafter\ifx\csname LUC@\mandatory@arg/\f@size\endcsname\relax
80   \expandafter\gdef\csname LUC@\mandatory@arg/\f@size\endcsname{}%
81   \sub@sfcnt#1%
82   \else
83   \sub@sfcnt\@gobble
84   \fi}
85 \DeclareSizeFunction{LUC}{\LUC@@empty\@font@warning}
86 \DeclareSizeFunction{LUCb}{\LUC@@empty\@font@warning}
87 \DeclareSizeFunction{sLUC}{\LUC@@empty\@font@info}
88 \DeclareSizeFunction{sLUCb}{\LUC@@empty\@font@info}
89 \DeclareSizeFunction{LUCsub}{\LUC@@sub\@font@warning}
90 \DeclareSizeFunction{LUCssub}{\LUC@@sub\@font@info}
91 \gdef\LUC@plane@LUC{00}%
92 \DeclareTextCommand{\textascii}{\LastDeclaredEncoding}[1]{\textunicodechar{`#1}}
93 \DeclareTextCommand{\textunicodechar}{\LastDeclaredEncoding}[1]{\lucchar{#1}}
94
95 %%% Local Variables:
96 %%% mode: latex
97 %%% coding: utf-8
98 %%% TeX-master: "../test.tex"
99 %%% End:
100 %%% Local IspellDict: british