~ubuntu-branches/ubuntu/lucid/vflib3/lucid

« back to all changes in this revision

Viewing changes to ascii-jtex/eKanji/ekanji.sty

  • Committer: Bazaar Package Importer
  • Author(s): Masayuki Hatta
  • Date: 2002-04-15 12:10:24 UTC
  • Revision ID: james.westby@ubuntu.com-20020415121024-cann32wucyfbq22f
Tags: upstream-3.6.12
ImportĀ upstreamĀ versionĀ 3.6.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% This is file `ekanji.sty' for eKanji fonts
 
3
%% by Hirotsugu Kakugawa (h.kakugwa@computer.org)
 
4
%%
 
5
\NeedsTeXFormat{LaTeX2e}%
 
6
\ProvidesPackage{ekanji}[1999/12/07 ver 1.0]%
 
7
 
 
8
\DeclareKanjiEncodingDefaults{}{}
 
9
\DeclareYokoKanjiEncoding{JY1}{ekan}{}
 
10
\DeclareTateKanjiEncoding{JT1}{ekan}{}
 
11
 
 
12
% eKanji Unicode 
 
13
\newcommand{\EKU}[1]{\ek@char{#1}{10}}
 
14
% eKanji KangXi
 
15
\newcommand{\EKK}[1]{\ek@char{#1}{20}}
 
16
% eKanji Morohashi
 
17
\newcommand{\EKM}[1]{\ek@char{#1}{30}}
 
18
 
 
19
 
 
20
\newcommand{\ek@char}[2]{%
 
21
\@tempcnta#1\relax\advance\@tempcnta-1\relax\divide\@tempcnta5640\relax%
 
22
\ifnum\@tempcnta<10%
 
23
  \xdef\ek@block{0\the\@tempcnta}%
 
24
\else%
 
25
  \xdef\ek@block{\the\@tempcnta}%
 
26
\fi%
 
27
\@tempcntb\@tempcnta%
 
28
\multiply\@tempcntb5640\relax\@tempcntb-\@tempcntb%
 
29
\@tempcnta#1\relax\advance\@tempcnta-1\relax\advance\@tempcntb\@tempcnta%
 
30
\xdef\ek@inblock{\the\@tempcntb}%
 
31
%\typeout{\ek@block, \ek@inblock}
 
32
\ek@@char{\ek@inblock}%
 
33
%\typeout{0x\ek@Ku\ek@Ten}
 
34
{\iftdir%
 
35
    \kanjiencoding{JT1}\kanjifamily{ekan}%
 
36
    \kanjishape{#2\ek@block}\kanjiseries{m}%
 
37
 \else%
 
38
    \kanjiencoding{JY1}\kanjifamily{ekan}%
 
39
    \kanjishape{#2\ek@block}\kanjiseries{m}%
 
40
 \fi%
 
41
 \selectfont\char\kuten"\ek@Ku\ek@Ten\relax}%
 
42
}
 
43
 
 
44
\newcommand{\ek@@char}[1]{%
 
45
\begingroup%
 
46
\@tempcnta#1\relax\divide\@tempcnta94\relax%
 
47
\@tempcntb\@tempcnta%
 
48
\multiply\@tempcntb94\relax\@tempcntb-\@tempcntb\advance\@tempcntb#1%
 
49
\ifnum\@tempcnta<30%
 
50
 \advance\@tempcnta16\relax%
 
51
\else%
 
52
 \advance\@tempcnta18\relax%
 
53
\fi%
 
54
\advance\@tempcntb1\relax%
 
55
%\typeout{Font \ek@block, Row \the\@tempcnta, Cell \the\@tempcntb}%
 
56
\ek@dtoh{\the\@tempcnta}\xdef\ek@Ku{\ek@hexH\ek@hexL}%
 
57
\ek@dtoh{\the\@tempcntb}\xdef\ek@Ten{\ek@hexH\ek@hexL}%
 
58
\endgroup}
 
59
 
 
60
\newcommand{\ek@dtoh}[1]{%
 
61
\begingroup%
 
62
\@tempcnta#1\relax\@tempcntb#1\relax%
 
63
\divide\@tempcntb16\relax%
 
64
\xdef\ek@hexH{\ek@@dtoh{\the\@tempcntb}}%
 
65
\multiply\@tempcntb16\relax\@tempcntb-\@tempcntb\advance\@tempcntb\@tempcnta%
 
66
\xdef\ek@hexL{\ek@@dtoh{\the\@tempcntb}}%
 
67
\endgroup}
 
68
 
 
69
\newcommand{\ek@@dtoh}[1]{%
 
70
\ifcase#1
 
71
 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or%
 
72
 8\or 9\or A\or B\or C\or D\or E\or F%
 
73
\fi}
 
74
 
 
75
 
 
76
%% EOF
 
77
\endinput
 
78
%% end of ekanji.sty.