5 %% Avoid multiple loading.
6 \csname\if11luatexjaotfLoaded\fi\endcsname
8 \catcode32=\the\catcode32%
9 \catcode33=\the\catcode33%
10 \catcode35=\the\catcode35%
11 \catcode40=\the\catcode40%
12 \catcode41=\the\catcode41%
13 \catcode42=\the\catcode42%
14 \catcode43=\the\catcode43%
15 \catcode44=\the\catcode44%
16 \catcode45=\the\catcode45%
17 \catcode46=\the\catcode46%
18 \catcode58=\the\catcode58%
19 \catcode59=\the\catcode59%
20 \catcode60=\the\catcode60%
21 \catcode61=\the\catcode61%
22 \catcode62=\the\catcode62%
23 \catcode64=\the\catcode64%
24 \catcode91=\the\catcode91%
25 \catcode93=\the\catcode93%
26 \catcode94=\the\catcode94%
27 \catcode95=\the\catcode95%
28 \catcode126=\the\catcode126%
29 \endlinechar=\the\endlinechar
54 \edef\ltj@otf@AtEnd{\x
55 \noexpand\let\noexpand\ltj@otf@AtEnd\relax}
56 \def\luatexjaotfLoaded{\endinput}
58 %% Check if LaTeX is used.
59 \begingroup\expandafter\expandafter\expandafter\endgroup
60 \expandafter\ifx\csname RequirePackage\endcsname\relax %<*!LaTeX>
61 \expandafter\let\csname ifltj@in@latex\expandafter\endcsname
62 \csname iffalse\endcsname
64 \expandafter\let\csname ifltj@in@latex\expandafter\endcsname
65 \csname iftrue\endcsname
66 \NeedsTeXFormat{LaTeX2e}
67 \ProvidesPackage{luatexja-otf}[2017/05/20]
70 % Load core module if not yet.
71 \ifx\luatexjacoreLoaded\@undefined
72 \ifltj@in@latex %<*LaTeX>
73 \RequirePackage{luatexja}
79 %% When environment check fails, exit now.
80 \ifx\LuaTeXjaAvailable\@undefined
82 \expandafter\endinput\fi\relax
85 %! Main part of luatexja-otf
86 \RequireLuaTeXjaSubmodule{otf}
88 \newcount\ltj@tempcnta
90 \protected\def\CID#1{\ifvmode\leavevmode\fi\ltj@tempcnta#1\relax\directlua{luatexja.otf.cid(\the\ltj@tempcnta)}\relax}
92 %% \UTF compatible with the OTF package for pLaTeX
93 \protected\def\UTF#1{\ifvmode\leavevmode\fi\directlua{luatexja.otf.utf(0x#1)}}
96 \ifltj@in@latex %<*LaTeX>
97 \RequirePackage{luatexja-ajmacros}
99 \input luatexja-ajmacros.sty %
100 % \bou is defined in lltjext, \mbox is defined in LaTeX kernel
101 \def\boutenchar{\char\euc"A1A2}%"
102 \def\bou#1{\ifvmode\leavevmode\fi\@bou#1\end}
104 \ifx#1\end \let\ltj@@next=\relax
106 \ifnum\ltjgetparameter{direction}=3\relax
107 \hbox to\z@{\vbox to\z@{\boxmaxdepth\maxdimen
108 \vss\moveleft0.2\zw\hbox{\yoko\boutenchar}\nointerlineskip
109 \hbox{\char\euc"A1A1}}\hss}\nobreak#1\relax
111 \hbox to\z@{\vbox to\z@{\boxmaxdepth\maxdimen
112 \vss\moveleft-0.2\zw\hbox{\boutenchar}\nointerlineskip
113 \hbox{\char\euc"A1A1}}\hss}\nobreak#1\relax
117 \long\def\mbox#1{\leavevmode\hbox{#1}}
120 % macros from otf.sty
122 \protected\def\ajKunoji{%
123 \ifnum\ltjgetparameter{direction}=3 \mbox{\UTF{3033}\UTF{3035}}\else
124 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
126 \protected\def\ajKunojiwithBou{%
127 \ifnum\ltjgetparameter{direction}=3 \mbox{\bou{\mbox{\UTF{3033}}}\bou{\mbox{\UTF{3035}}}}\else
128 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
130 \protected\def\ajDKunoji{%
131 \ifnum\ltjgetparameter{direction}=3 \mbox{\UTF{3034}\UTF{3035}}\else
132 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
134 \protected\def\ajDKunojiwithBou{%
135 \ifnum\ltjgetparameter{direction}=3 \mbox{\bou{\mbox{\UTF{3034}}}\bou{\mbox{\UTF{3035}}}}\else
136 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
138 \protected\def\ajNinoji{\CID{12106}}
139 \protected\def\ajvarNinoji{%
140 \ifnum\ltjgetparameter{direction}=3 \CID{12107}\else
141 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
143 \protected\def\ajYusuriten{%
144 \ifnum\ltjgetparameter{direction}=3 \CID{16193}\else
145 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
147 \protected\def\ajMasu{\UTF{303c}}
148 \protected\def\ajYori{\UTF{309f}}
149 \protected\def\ajKoto{\UTF{30ff}}
150 \protected\def\ajUta{\UTF{303d}}
152 \protected\def\ajCommandKey{\UTF{2318}}
153 \protected\def\ajReturnKey{\UTF{23ce}}
154 \protected\def\ajCheckmark{\UTF{2713}}
155 \protected\def\ajVisibleSpace{\UTF{2423}}
156 \protected\def\ajSenteMark{\UTF{2617}}
157 \protected\def\ajGoteMark{\UTF{2616}}
158 \protected\def\ajClub{\UTF{2663}}
159 \protected\def\ajHeart{\UTF{2661}}
160 \protected\def\ajSpade{\UTF{2660}}
161 \protected\def\ajDiamond{\UTF{2662}}
162 \protected\def\ajvarClub{\UTF{2667}}
163 \protected\def\ajvarHeart{\UTF{2665}}
164 \protected\def\ajvarSpade{\UTF{2664}}
165 \protected\def\ajvarDiamond{\UTF{2666}}
166 \protected\def\ajPhone{\UTF{260e}}
167 \protected\def\ajPostal{\UTF{3020}}
168 \protected\def\ajvarPostal{\UTF{3036}}
169 \protected\def\ajSun{\UTF{2600}}
170 \protected\def\ajCloud{\UTF{2601}}
171 \protected\def\ajUmbrella{\UTF{2602}}
172 \protected\def\ajSnowman{\UTF{2603}}
173 \protected\def\ajJIS{\UTF{3004}}
174 \protected\def\ajJAS{\CID{12088}}
175 \protected\def\ajBall{\CID{12097}}
176 \protected\def\ajHotSpring{\UTF{2668}}
177 \protected\def\ajWhiteSesame{\UTF{fe46}}
178 \protected\def\ajBlackSesame{\UTF{fe45}}
179 \protected\def\ajWhiteFlorette{\UTF{2740}}
180 \protected\def\ajBlackFlorette{\UTF{273f}}
181 \protected\def\ajRightBArrow{\CID{8206}}
182 \protected\def\ajLeftBArrow{\CID{8207}}
183 \protected\def\ajUpBArrow{\CID{8208}}
184 \protected\def\ajDownBArrow{\CID{8209}}
185 \protected\def\ajRightHand{\CID{8219}}
186 \protected\def\ajLeftHand{\CID{8220}}
187 \protected\def\ajUpHand{\CID{8221}}
188 \protected\def\ajDownHand{\CID{8222}}
189 \protected\def\ajRightScissors{\CID{12176}}
190 \protected\def\ajLeftScissors{\CID{12175}}
191 \protected\def\ajUpScissors{\CID{12177}}
192 \protected\def\ajDownScissors{\CID{12178}}
193 \protected\def\ajRightWArrow{\CID{12197}}
194 \protected\def\ajLeftWArrow{\CID{12196}}
195 \protected\def\ajUpWArrow{\CID{12198}}
196 \protected\def\ajDownWArrow{\CID{12199}}
197 \protected\def\ajRightDownArrow{\CID{12202}}
198 \protected\def\ajLeftDownArrow{\CID{12203}}
199 \protected\def\ajLeftUpArrow{\CID{12204}}
200 \protected\def\ajRightUpArrow{\CID{12205}}
202 %%------------------ all done