OSDN Git Service

lltjfont.sty: patch \@text@composite for non-zero {y,t}albaselineshift
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Fri, 1 Apr 2016 00:12:21 +0000 (09:12 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Fri, 1 Apr 2016 00:12:21 +0000 (09:12 +0900)
Code for pLaTeX: http://oku.edu.mie-u.ac.jp/tex/mod/forum/post.php?reply=10875

cf. 「ベースライン補正」の話の脱線について(続きの続き)- アセトアミノフェンの気ままな日常
    http://d.hatena.ne.jp/acetaminophen/20160315/1458140043
    by acetaminophen, 2016-03-15

src/patches/lltjfont.sty

index 08f9b7f..738e192 100644 (file)
@@ -3,7 +3,7 @@
 %
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjfont}[2016/02/07 Patch to NFSS2 for LuaTeX-ja]
+\ProvidesPackage{lltjfont}[2016/04/01 Patch to NFSS2 for LuaTeX-ja]
 
 \let\k@encoding\@empty
 \let\ck@encoding\@empty
 \def\ltj@@does@alt@set#1{%
   \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}
+
 \endinput