%%%%%%%% \ltjdefcharrange<name>{100-200,3000-,5000,...}
\protected\def\ltjdefcharrange#1#2{%
- \ltj@tempcntc=#1 \expandafter\ltj@@dcrange#2,,\ignorespaces}
+ {\ltj@tempcntc=#1 \expandafter\ltj@@dcrange#2,,}\ignorespaces}
\def\ltj@@dcrange#1,{\def\ltj@temp{#1}%
\ifx\ltj@temp\empty\let\@next=\relax\else
\ltj@@dcrangeA{#1}\let\@next=\ltj@@dcrange\fi\@next}
\ltj@tempcnta=#1 \ltj@tempcntb=\ltj@tempcnta
\else
\def\ltj@temp{#1}%
- \ifx\ltj@temp\empty\ltj@tempcnta='200 \else\ltj@tempcnta=#1 \fi
+ \ifx\ltj@temp\empty\ltj@tempcnta='200\else\ltj@tempcnta=#1\fi\relax
\def\ltj@temp{#2}%
- \ifx\ltj@temp\empty\ltj@tempcntb="10FFFF \else\ltj@tempcntb=#2 \fi%"
+ \ifx\ltj@temp\empty\ltj@tempcntb="10FFFF\else\ltj@tempcntb=#2\fi\relax%"
\fi
\directlua{luatexja.charrange.add_char_range(\the\ltj@tempcnta,\the\ltj@tempcntb,
\the\ltj@tempcntc)}%
\define@key[ltj]{japaram}{jascriptscriptfont}{%
\expandafter\ltj@@set@stackfont#1:{mjss}}
\def\ltj@@set@stackfont#1,#2:#3{%
- {\directlua{tex.globaldefs=0}\ltj@curjfnt=-1 #2%
- \global\ltj@tempcnta=\ltj@curjfnt}%
- \ifnum\ltj@tempcnta=-1
+ \directlua{%
+ ltj.global_temp = tex.globaldefs;
+ tex.globaldefs = 0}%
+ \ltj@tempcnta=\ltj@curjfnt\ltj@curjfnt=-1 #2%
+ \ifnum\ltj@curjfnt=-1
\@PackageError{luatexja-core}%
{\string#2 is not a control sequence that represents \MessageBreak
a Japanese font}{}%
\else
\directlua{luatexja.stack.set_stack_font(ltj.isglobal, \asluastring{#3},
- \ltj@safe@num@or\ltj@defnum{#1}, \the\ltj@tempcnta)}%
- \fi}
+ \ltj@safe@num@or\ltj@defnum{#1}, \the\ltj@curjfnt)}%
+ \fi
+ \ltj@curjfnt=\ltj@tempcnta
+ \directlua{tex.globaldefs = ltj.global_temp}%
+ }
% yalbaselineshift = <dimen>
% yjabaselineshift = <dimen>