OSDN Git Service

luatexja-core.sty: Redefined \un{h,v}copy.
[luatex-ja/luatexja.git] / src / luatexja-core.sty
index fa58cb1..76b5fe5 100644 (file)
 \def\ltj@@getjfontnumber#1{% result in \ltj@tempcntc 
   \ltj@reset@globaldefs
   \begingroup\ltj@curjfnt=-1 \ltj@curtfnt=-1\relax
-  #1\directlua{luatexja.__temp = -\the\ltj@curjfnt*\the\ltj@curtfnt}\endgroup
+  #1\directlua{luatexja.__temp = -(\the\ltj@curjfnt)*(\the\ltj@curtfnt)}\endgroup
   \ltj@tempcntc=\directlua{tex.sprint(luatexja.__temp)}\relax
   \ifnum\ltj@tempcntc=-1
     \@PackageError{luatexja-core}%
     \ltj@@orig@moveleft\the\ltj@tempdima\noexpand\box\ltj@afbox
   }\ltj@afterbox\ltj@@moveleft@a}
 
+%%%% \vcenter
+\let\ltj@@orig@vcenter=\vcenter
+\protected\def\vcenter{\ltj@afterbox\ltj@@vcenter\vbox}
+\protected\def\ltj@@vcenter{%
+  \directlua{luatexja.direction.raise_box()}%
+  \ltj@@orig@vcenter{\box\ltj@afbox}%
+}
 
 %%%% \unhbox and \unvbox
 \let\ltj@@orig@unhbox=\unhbox
 \protected\def\ltj@@unvbox{%
   \directlua{luatexja.direction.check_dir(\the\ltj@tempcnta)}%
   \ltj@@orig@unvbox\ltj@tempcnta}
+\let\ltj@@orig@unhcopy=\unhcopy
+\let\ltj@@orig@unvcopy=\unvcopy
+\protected\def\unhcopy{\ltj@reset@globaldefs\afterassignment\ltj@@unhcopy\ltj@tempcnta}
+\protected\def\unvcopy{\ltj@reset@globaldefs\afterassignment\ltj@@unvcopy\ltj@tempcnta}
+\protected\def\ltj@@unhcopy{%
+  \directlua{luatexja.direction.check_dir(\the\ltj@tempcnta)}%
+  \ltj@@orig@unhcopy\ltj@tempcnta}
+\protected\def\ltj@@unvcopy{%
+  \directlua{luatexja.direction.check_dir(\the\ltj@tempcnta)}%
+  \ltj@@orig@unvcopy\ltj@tempcnta}
 
 
 %%%% lastbox