OSDN Git Service

typo
[luatex-ja/luatexja.git] / src / patches / lltjfont.sty
index 738e192..79fee82 100644 (file)
@@ -3,7 +3,34 @@
 %
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjfont}[2016/04/01 Patch to NFSS2 for LuaTeX-ja]
+\ProvidesPackage{lltjfont}[2017/03/20 Patch to NFSS2 for LuaTeX-ja]
+
+\def\ltj@chardef@text@cmd#1{%
+  \let\@ifdefinable\@@ifdefinable%
+  \edef\ltj@chardef@text@cmd@name{\expandafter\@gobble\string#1}%
+  \afterassignment\ltj@chardef@text@cmd@\ltj@tempcnta
+}
+\def\ltj@chardef@text@cmd@{%
+  \ifnum\ltj@tempcnta>"7F
+    \expandafter\edef\csname \ltj@chardef@text@cmd@name\endcsname{%
+      \noexpand\ltjalchar\the\ltj@tempcnta\space
+    }%
+  \else
+    \expandafter\chardef\csname \ltj@chardef@text@cmd@name\endcsname\ltj@tempcnta
+  \fi
+}
+\def\DeclareTextSymbol#1#2#3{%
+  \@dec@text@cmd\ltj@chardef@text@cmd#1{#2}#3\relax
+}
+
+\ifdefined\UnicodeEncodingName
+  \let\ltj@temp@DeclareTextComposite=\DeclareTextComposite
+  \def\DeclareTextComposite#1#2#3#4{}%
+  \input{tuenc.def}
+  \let\DeclareTextComposite=\ltj@temp@DeclareTextComposite
+  \expandafter\patchcmd\csname TU\string\textasteriskcentered\endcsname{\char}{\ltjalchar}{}{}
+\fi
+
 
 \let\k@encoding\@empty
 \let\ck@encoding\@empty
 \ifdefined\cHT\else\newdimen\cHT\fi
 %\let\afont\font
 
+\let\ystrutbox\strutbox
 \newbox\dstrutbox
 \newbox\tstrutbox
 \newbox\zstrutbox
+\def\strutbox{%
+  \ifnum\ltjgetparameter{direction}=1 \dstrutbox       % dtou
+  \else\ifnum\ltjgetparameter{direction}=3 \tstrutbox  % tate
+  \else\ifnum\ltjgetparameter{direction}=11 \zstrutbox % utod
+  \else\ystrutbox % yoko
+  \fi\fi\fi
+}
 \def\strut{\relax
   \ifnum\ltjgetparameter{direction}=1 % dtou
     \ifmmode\copy\dstrutbox\else\unhcopy\dstrutbox\fi
   \else\ifnum\ltjgetparameter{direction}=4 % yoko
-    \ifmmode\copy\strutbox\else\unhcopy\strutbox\fi
-  \else % tate and utod
+    \ifmmode\copy\ystrutbox\else\unhcopy\ystrutbox\fi
+  \else\ifnum\ltjgetparameter{direction}=3 % tate
     \ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi
-  \fi\fi
+  \else % utod
+    \ifmmode\copy\zstrutbox\else\unhcopy\zstrutbox\fi
+  \fi\fi\fi
 }
+
+\def\ystrut{\relax\hbox{\yoko
+   \ifmmode\copy\ystrutbox\else\unhcopy\ystrutbox\fi}}
 \def\tstrut{\relax\hbox{\tate
    \ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi}}
-\def\zstrut{\relax\hbox{\tate
+\def\dstrut{\relax\hbox{\dtou
+   \ifmmode\copy\dstrutbox\else\unhcopy\dstrutbox\fi}}
+\def\zstrut{\relax\hbox{\utod
    \ifmmode\copy\zstrutbox\else\unhcopy\zstrutbox\fi}}
 
 {%
       \baselineskip\f@linespread\baselineskip
       \normalbaselineskip\baselineskip
       \adjustbaseline
-      \setbox\strutbox\hbox{\yoko
+      \setbox\ystrutbox\hbox{\yoko
           \vrule\@width\z@
                 \@height.7\baselineskip \@depth.3\baselineskip}%
       \setbox\dstrutbox\hbox{\dtou
       \setbox\tstrutbox\hbox{\tate
           \vrule\@width\z@
                 \@height.5\baselineskip \@depth.5\baselineskip}%
-      \setbox\zstrutbox\hbox{\tate
+      \setbox\zstrutbox\hbox{\utod
           \vrule\@width\z@
                 \@height.7\baselineskip \@depth.3\baselineskip}%
-        \let\size@update\relax}}
+     \let\size@update\relax}}
 
 \ifdefined\newluafunction
   \newluafunction\ltj@@adjust@baseline@inner
   \csname D@\k@encoding\endcsname
   \let\kenc@update\relax
   \let\ck@encoding\k@encoding
-  \edef\tmp@enc{'\luatexluaescapestring{\k@encoding}'}
+  \edef\tmp@enc{'\luatexluaescapestring{\k@encoding}'}%
   \directlua{luatexja.jfont.is_kyenc(\tmp@enc)}\ifin@%
     \let\cy@encoding\k@encoding
   \else
 }
 \@onlypreamble\romanprocess@table
 \@onlypreamble\kanjiprocess@table
-\DeclareTextCommandDefault{\textunderscore}{%
-  \leavevmode\kern.06em
-  \vbox{\hrule\@width.3em}}
 
 %%%%%% LuaTeX-ja specific
 
   \directlua{luatexja.jfont.does_alt_set'\luatexluaescapestring{#1}'}}
 
 %%%% patch \@text@composite because of {y,t}albaselineshift
-\def\@text@composite#1#2#3#{%
-  \begingroup
-  \setbox\z@=\hbox\bgroup%
-  \ltj@yablshift\z@\ltj@tablshift\z@
-  \expandafter\@text@composite@x
-  \csname\string#1-\string#2\endcsname}
-\def\@text@composite@x#1#2{%
-  \ifx#1\relax
-    \expandafter\@secondoftwo
-  \else
-    \expandafter\@firstoftwo
-  \fi
-  #1{#2}\egroup
-  \leavevmode
-  \expandafter\lower
-    \ifnum\ltjgetparameter{direction}=3
-      \ltjgetparameter{talbaselineshift}
-    \else\ifmmode
-      \z@
-    \else
-      \ltjgetparameter{yalbaselineshift}
-    \fi\fi
-    \box\z@
-  \endgroup}
+
+% %% \pltx@isletter from plfonts.dtx
+% \def\pltx@mark{\pltx@mark@}
+% \let\pltx@scanstop\relax
+% \long\def\pltx@cond#1\fi{%
+%   #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+% \long\def\pltx@isletter#1{%
+%   \expandafter\pltx@isletter@i#1\pltx@scanstop}
+% \long\def\pltx@isletter@i#1\pltx@scanstop{%
+%   \pltx@cond\ifx\pltx@mark#1\pltx@mark\fi{\@firstoftwo}%
+%     {\pltx@isletter@ii\pltx@scanstop#1\pltx@scanstop{}#1\pltx@mark}}
+% \long\def\pltx@isletter@ii#1\pltx@scanstop#{%
+%   \pltx@cond\ifx\pltx@mark#1\pltx@mark\fi%
+%     {\pltx@isletter@iii}{\pltx@isletter@iv}}
+% \long\def\pltx@isletter@iii#1\pltx@mark{\@secondoftwo}
+% \long\def\pltx@isletter@iv#1#2#3\pltx@mark{%
+%   \pltx@cond\ifx\pltx@mark#3\pltx@mark\fi{%
+%     \pltx@cond{\ifnum0\ifcat A\noexpand#21\fi\ifcat=\noexpand#21\fi>\z@}\fi
+%       {\@firstoftwo}{\@secondoftwo}%
+%   }{\@secondoftwo}}
+%
+% \def\@text@composite@x#1#2{%
+%   \ifx#1\relax
+%     #2%
+%   \else\pltx@isletter{#1}{#1}{%
+%     \begingroup
+%     \setbox\z@\hbox\bgroup%
+%       \ltj@yablshift\z@ \ltj@tablshift\z@
+%       #1%
+%       \@tempcntb\directlua{luatexja.pltx_composite_last_node_char()}%)
+%       \xdef\pltx@composite@temp{\noexpand\@tempcntb=\the\@tempcntb\relax}%
+%       \aftergroup\pltx@composite@temp
+%     \egroup
+%     \ifnum\ltjgetparameter{direction}=3 %
+%       \@tempdima=\ltj@tablshift sp\else\@tempdima=\ltj@yablshift sp\fi
+%     \ifnum\@tempcntb<\z@\@tempcnta\z@\else
+%       \@tempcnta=\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{\@tempcntb}}\relax
+%       \ifnum\@tempcnta=\z@\@tempdima\z@\fi
+%     \fi
+%     \ifnum\@tempcnta>\z@
+%       \ifodd\ltjgetparameter{alxspmode}{\@tempcntb}\else\leavevmode\hbox{}\fi
+%       \begingroup\mathsurround\z@$%
+%         \hbox{\lower\@tempdima\box\z@}
+%       $\endgroup%
+%       \ifnum\ltjgetparameter{alxspmode}{\@tempcntb}<2\hbox{}\fi
+%     \else
+%       \ifdim\@tempdima=\z@{\ltj@yablshift\z@ \ltj@tablshift\z@#1}%
+%       \else\lower\@tempdima\box\z@\fi
+%     \fi
+%     \endgroup}%
+%   \fi
+% }
 
 \endinput