%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjfont}[2011/11/22 Patch to NFSS2 for LuaLaTeX-ja]
+\ProvidesPackage{lltjfont}[2013/01/01 Patch to NFSS2 for LuaLaTeX-ja]
\let\k@encoding\@empty
\let\ck@encoding\@empty
\fi
\endgroup
}
+\def\DLMfontsw@standard#1#2#3{#1{#2{#3}}}
\def\reDeclareMathAlphabet#1#2#3{%
\ifdefined#2
- \ifdefined#3
- \toks0\expandafter{#3}%
- \@temptokena\expandafter{#2}%
- \long\protected\edef#1##1{\the\@temptokena{\the\toks0{##1}}}%
- \else\let#1#2\fi
+ \@temptokena\expandafter{#2}%
\else
- \ifdefined#3\let#1#3\fi\fi
+ \@temptokena{#2}%
+ \fi
+ \ifdefined#3
+ \toks0\expandafter{#3}%
+ \else
+ \toks0{#3}%
+ \fi
+ \long\protected\edef#1{%
+ \noexpand\DLMfontsw@standard{\the\@temptokena}{\the\toks0}}%
}
\@onlypreamble\reDeclareMathAlphabet
\def\all@shape{all}%
\edef\k@family{#1}%
\else % search font definition file...
\ifcsname kfam@list@\k@encoding\endcsname\else
- \expandafter\gdef\csname kfam@list@\k@encoding\endcsname{}
- \expandafter\gdef\csname notkfam@list@\k@encoding\endcsname{}
+ \expandafter\gdef\csname kfam@list@\k@encoding\endcsname{}%
+ \expandafter\gdef\csname notkfam@list@\k@encoding\endcsname{}%
\fi
\edef\@templist{\@nameuse{kfam@list@\k@encoding}}%
\expandafter\expandafter\expandafter\inlist@\expandafter\tmp@item\expandafter{\@templist}%
\edef\@templist{\@nameuse{notkfam@list@\k@encoding}}%
\expandafter\expandafter\expandafter\inlist@\expandafter\tmp@item\expandafter{\@templist}%
\ifin@\@notkfamtrue\else%
- \def\@temp##1+{\lowercase{\def\@@temp{##1}}}\expandafter\@temp\k@encoding+%
- \message{(I search kanjifont definition file: \@@temp#1.fd)}%
+ \def\@temp##1+{\lowercase{\def\@@temp{##1#1.fd}}}\expandafter\@temp\k@encoding+%
+ \message{(I search kanjifont definition file: \@@temp)}%
\IfFileExists{\@@temp#1.fd}{\@tempswztrue}{\@tempswzfalse}%
\if@tempswz
\expandafter\xdef\csname kfam@list@\k@encoding\endcsname
\edef\f@family{#1}%
\else % search font definition file...
\ifcsname ffam@list@\f@encoding\endcsname\else
- \expandafter\gdef\csname ffam@list@\f@encoding\endcsname{}
- \expandafter\gdef\csname notffam@list@\f@encoding\endcsname{}
+ \expandafter\gdef\csname ffam@list@\f@encoding\endcsname{}%
+ \expandafter\gdef\csname notffam@list@\f@encoding\endcsname{}%
\fi
\edef\@templist{\@nameuse{ffam@list@\f@encoding}}%
\expandafter\expandafter\expandafter\inlist@\expandafter\tmp@item\expandafter{\@templist}%
\edef\@templist{\@nameuse{notffam@list@\f@encoding}}%
\expandafter\expandafter\expandafter\inlist@\expandafter\tmp@item\expandafter{\@templist}%
\ifin@\@notffamtrue\else
- \def\@temp##1+{\lowercase{\def\@@temp{##1}}}\expandafter\@temp\f@encoding+%
- \message{(I search font definition file: \@@temp#1.fd)}%
+ \def\@temp##1+{\lowercase{\def\@@temp{##1#1.fd}}}\expandafter\@temp\f@encoding+%
+ \message{(I search font definition file: \@@temp)}%
\IfFileExists{\@@temp#1.fd}{\@tempswztrue}{\@tempswzfalse}%
\if@tempswz
\expandafter\xdef\csname ffam@list@\f@encoding\endcsname
\def\useroman#1#2#3#4{%
\romanencoding{#1}\romanfamily{#2}\romanseries{#3}\romanshape{#4}%
\selectfont\ignorespaces}
-\def\usefont#1#2#3#4{%
+\protected\def\usefont#1#2#3#4{%
\edef\tmp@item{{#1}}%
\expandafter\expandafter\expandafter
\inlist@\expandafter\tmp@item\expandafter{\kenc@list}%
\expandafter\ltj@@IsFontJapaneseX#1//:%
\expandafter\expandafter\expandafter
\inlist@\expandafter\tmp@item\expandafter{\kenc@list}}
-\def\ltj@@IsFontJapaneseX#1/#2/:{\edef\tmp@item{{\directlua{tex.print('#1')}}}}
+\def\ltj@@IsFontJapaneseX#1/#2/:{\edef\tmp@item{{\directlua{%
+ tex.print(luatexbase.catcodetables["latex-package"], '#1')}%
+}}}
\let\extract@afont\extract@font
\pickup@jfont\let\scriptfont@name\font@name
\xdef\font@name{\csname \string#2/\ssf@size\endcsname}%
\pickup@jfont
- \edef\math@fonts{\math@fonts\ltjsetparameter{%
- jatextfont={#1,\textfont@name},%
- jascriptfont={#1,\scriptfont@name},%
- jascriptscriptfont={#1,\font@name}}}%
+ \edef\math@fonts{\math@fonts\ltj@setpar@global%
+ \ltj@@set@stackfont#1,\textfont@name:{MJT}%
+ \ltj@@set@stackfont#1,\scriptfont@name:{MJS}%
+ \ltj@@set@stackfont#1,\font@name:{MJSS}%
+ }%
}
\def\getanddefine@fonts#1#2{%