summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/CJK/CJKvert.sty
blob: 40edf3c56d6dafd7cec7726380762f77fc828ba8 (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
% This is the file CJKvert.sty of the CJK package
%   for vertical typesetting.
%
% created by Werner Lemberg <wl@gnu.org>
%
% Version 4.6.0 (11-Aug-2005)

\def\fileversion{4.6.0}
\def\filedate{2005/08/11}
\ProvidesPackage{CJKvert}[\filedate\space\fileversion]

\RequirePackage{graphicx}


% we suppress any unwanted spaces produced by linefeeds.

\endlinechar \m@ne


\newif\ifCJK@vertical@
\CJK@vertical@false

\newcommand{\CJKvert}{
  \CJK@vertical@true
  \gdef\CJK@direction{v}
  \renewcommand\baselinestretch{1.3}
  \normalfont}

\newcommand{\CJKhorz}{
  \CJK@vertical@false
  \gdef\CJK@direction{h}
  \renewcommand\baselinestretch{1}
  \normalfont}

\CJKvert


% we redefine \CJKsymbol so that pseudo bold characters will be shifted
%     vertically, not horizontally.
%
% for fonts without vertical representation forms, some glyphs shouldn't
%     be rotated; \CJKsymbolsimple can be then used for a redefinition in
%     the `.fdx' file.

\newcommand{\CJKsymbolsimple}[1]{
  \edef\CJK@temp{\csname \CJK@enc/\CJK@family/simpleoffset\endcsname}
  \expandafter\ifx\CJK@temp \relax
    \edef\CJK@temp{0pt}
  \fi
  \ifCJK@bold@
    \raise \CJK@temp \hbox{\symbol{#1}}
    \raise \CJK@temp \hbox to \z@{\hss \raise\CJKboldshift\hbox{\symbol{#1}}}
    \raise \CJK@temp \hbox to \z@{\hss \raise-\CJKboldshift\hbox{\symbol{#1}}}
  \else
    \raise \CJK@temp \hbox{\symbol{#1}}
  \fi
}

\DeclareRobustCommand{\CJKsymbol}[1]{
  \ifCJK@vertical@
    \expandafter\ifx\csname \CJK@enc/\CJK@family/norotate/v\endcsname \relax
      \edef\CJK@tempa{\csname \CJK@enc/\CJK@family/offset/v\endcsname}
      \expandafter\ifx\CJK@tempa \relax
        \edef\CJK@tempa{0pt}
      \fi
      \edef\CJK@tempb{\csname \CJK@enc/\CJK@family/fullheight/v\endcsname}
      \expandafter\ifx\CJK@tempb \relax
        \def\CJK@temp{\rotatebox[x=\CJK@tempa]{90}{\symbol{#1}}}
      \else
        \edef\CJK@tempc{\csname \CJK@enc/\CJK@family/height/v\endcsname}
        \expandafter\ifx\CJK@tempc \relax
          \edef\CJK@tempc{0pt}
        \fi
        \setbox\@tempboxa\hbox{\symbol{#1}}
        \ht\@tempboxa \CJK@tempc
        \@tempdima\CJK@tempb
        \advance\@tempdima -\CJK@tempc
        \dp\@tempboxa \@tempdima
        \def\CJK@temp{
          \rotatebox[x=\CJK@tempa]{90}{\copy\@tempboxa}}
      \fi
    \else
      \def\CJK@temp{\symbol{#1}}
    \fi
    \ifCJK@bold@
      \CJK@temp
      \hbox to \z@ {\hss \raise\CJKboldshift\hbox{\CJK@temp}}
      \hbox to \z@ {\hss \raise-\CJKboldshift\hbox{\CJK@temp}}
    \else
      \CJK@temp
    \fi
  \else
    \ifCJK@bold@
      \symbol{#1}
      \hbox to \CJKboldshift{\hss\symbol{#1}}
      \hbox to \CJKboldshift{\hss\symbol{#1}}
    \else
      \symbol{#1}
    \fi
  \fi}


% reset endline character.

\endlinechar `\^^M

\endinput