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}[2022-10-02]
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 % defined at luatexja-core.sty
89 \protected\def\CID#1{\ifvmode\leavevmode\fi\ltj@tempcnta#1\relax\directlua{luatexja.otf.cid(\the\ltj@tempcnta)}\relax}
91 %% \UTF compatible with the OTF package for pLaTeX
92 \protected\def\UTF#1{\ifvmode\leavevmode\fi\directlua{luatexja.otf.utf(0x#1)}}
95 \ifltj@in@latex %<*LaTeX>
96 \RequirePackage{luatexja-ajmacros}
98 \input luatexja-ajmacros.sty %
99 % \bou is defined in lltjext, \mbox is defined in LaTeX kernel
100 \def\boutenchar{\char\euc"A1A2}%"
101 \def\bou#1{\ifvmode\leavevmode\fi\@bou#1\end}
103 \ifx#1\end \let\ltj@@next=\relax
105 \ifnum\ltjgetparameter{direction}=3\relax
106 \hbox to\z@{\vbox to\z@{\boxmaxdepth\maxdimen
107 \vss\moveleft0.2\zw\hbox{\yoko\boutenchar}\nointerlineskip
108 \hbox{\char\euc"A1A1}}\hss}\nobreak#1\relax
110 \hbox to\z@{\vbox to\z@{\boxmaxdepth\maxdimen
111 \vss\moveleft-0.2\zw\hbox{\boutenchar}\nointerlineskip
112 \hbox{\char\euc"A1A1}}\hss}\nobreak#1\relax
116 \protected\long\def\mbox#1{\leavevmode\hbox{#1}}
119 % macros from otf.sty
121 \protected\def\ajKunoji{%
122 \ifnum\ltjgetparameter{direction}=3 \mbox{\UTF{3033}\UTF{3035}}\else
123 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
125 \protected\def\ajKunojiwithBou{%
126 \ifnum\ltjgetparameter{direction}=3 \mbox{\bou{\mbox{\UTF{3033}}}\bou{\mbox{\UTF{3035}}}}\else
127 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
129 \protected\def\ajDKunoji{%
130 \ifnum\ltjgetparameter{direction}=3 \mbox{\UTF{3034}\UTF{3035}}\else
131 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
133 \protected\def\ajDKunojiwithBou{%
134 \ifnum\ltjgetparameter{direction}=3 \mbox{\bou{\mbox{\UTF{3034}}}\bou{\mbox{\UTF{3035}}}}\else
135 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
137 \protected\def\ajNinoji{\CID{12106}}
138 \protected\def\ajvarNinoji{%
139 \ifnum\ltjgetparameter{direction}=3 \CID{12107}\else
140 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
142 \protected\def\ajYusuriten{%
143 \ifnum\ltjgetparameter{direction}=3 \CID{16193}\else
144 \@PackageError{luatexja-otf}{A TATE character in YOKO mode!}{Change a direction to TATE.}%2003/03/12
146 \protected\def\ajMasu{\UTF{303c}}
147 \protected\def\ajYori{\UTF{309f}}
148 \protected\def\ajKoto{\UTF{30ff}}
149 \protected\def\ajUta{\UTF{303d}}
151 \protected\def\ajCommandKey{\UTF{2318}}
152 \protected\def\ajReturnKey{\UTF{23ce}}
153 \protected\def\ajCheckmark{\UTF{2713}}
154 \protected\def\ajVisibleSpace{\UTF{2423}}
155 \protected\def\ajSenteMark{\UTF{2617}}
156 \protected\def\ajGoteMark{\UTF{2616}}
157 \protected\def\ajClub{\UTF{2663}}
158 \protected\def\ajHeart{\UTF{2661}}
159 \protected\def\ajSpade{\UTF{2660}}
160 \protected\def\ajDiamond{\UTF{2662}}
161 \protected\def\ajvarClub{\UTF{2667}}
162 \protected\def\ajvarHeart{\UTF{2665}}
163 \protected\def\ajvarSpade{\UTF{2664}}
164 \protected\def\ajvarDiamond{\UTF{2666}}
165 \protected\def\ajPhone{\UTF{260e}}
166 \protected\def\ajPostal{\UTF{3020}}
167 \protected\def\ajvarPostal{\UTF{3036}}
168 \protected\def\ajSun{\UTF{2600}}
169 \protected\def\ajCloud{\UTF{2601}}
170 \protected\def\ajUmbrella{\UTF{2602}}
171 \protected\def\ajSnowman{\UTF{2603}}
172 \protected\def\ajJIS{\UTF{3004}}
173 \protected\def\ajJAS{\CID{12088}}
174 \protected\def\ajBall{\CID{12097}}
175 \protected\def\ajHotSpring{\UTF{2668}}
176 \protected\def\ajWhiteSesame{\UTF{fe46}}
177 \protected\def\ajBlackSesame{\UTF{fe45}}
178 \protected\def\ajWhiteFlorette{\UTF{2740}}
179 \protected\def\ajBlackFlorette{\UTF{273f}}
180 \protected\def\ajRightBArrow{\CID{8206}}
181 \protected\def\ajLeftBArrow{\CID{8207}}
182 \protected\def\ajUpBArrow{\CID{8208}}
183 \protected\def\ajDownBArrow{\CID{8209}}
184 \protected\def\ajRightHand{\CID{8219}}
185 \protected\def\ajLeftHand{\CID{8220}}
186 \protected\def\ajUpHand{\CID{8221}}
187 \protected\def\ajDownHand{\CID{8222}}
188 \protected\def\ajRightScissors{\CID{12176}}
189 \protected\def\ajLeftScissors{\CID{12175}}
190 \protected\def\ajUpScissors{\CID{12177}}
191 \protected\def\ajDownScissors{\CID{12178}}
192 \protected\def\ajRightWArrow{\CID{12197}}
193 \protected\def\ajLeftWArrow{\CID{12196}}
194 \protected\def\ajUpWArrow{\CID{12198}}
195 \protected\def\ajDownWArrow{\CID{12199}}
196 \protected\def\ajRightDownArrow{\CID{12202}}
197 \protected\def\ajLeftDownArrow{\CID{12203}}
198 \protected\def\ajLeftUpArrow{\CID{12204}}
199 \protected\def\ajRightUpArrow{\CID{12205}}
201 %%------------------ all done