From: Hironori Kitagawa Date: Mon, 17 Jul 2017 07:44:45 +0000 (+0900) Subject: fig a bug in lltjext + array X-Git-Tag: 20170730.0~12^2 X-Git-Url: http://git.osdn.net/view?p=luatex-ja%2Fluatexja.git;a=commitdiff_plain;h=2e6f30a745adb8ad86e70c80354a1d9a17ee1be0 fig a bug in lltjext + array --- diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index ed8e0d7..7ef5c4b 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -5279,16 +5279,9 @@ For $i\in\omega$, \texttt{char\_type[$i$]} is information of characters whose cl 0&\text{\texttt{'left'} (default)}\\0.5&\text{\tt 'middle'}\\1&\text{\tt 'right'} \end{cases} \] -\item For $j\in \omega$, \texttt{[$j$]} stores a kern or a glue which will be inserted -between character class~$i$ and class~$j$. - -If a kern will be inserted, the value of this field is \texttt{[$j$]=\{false, , \}}, -where is a node\footnote{% - This version of \LuaTeX-ja uses ``direct access - model'' for accessing nodes, if possible. }. -If a glue will be inserted, we have \texttt{[$j$]=\{false, , , \}}, -where is also a node, and $\text{}=\textit{from\_jfm}+\text{}$. \end{itemize} +For $i$,~$j\in \omega$, \texttt{char\_type[$i$][$j$]} stores a kern or a glue which will be inserted +between character class~$i$ and class~$j$. \end{description} % %<*ja> @@ -5321,23 +5314,34 @@ JFMで指定されているそれぞれの値をスケーリングしたもの \end{cases} \] のいずれかの値をとる. -\item $j\in \omega$に対して,\texttt{[$j$]} は文字クラス$i$の文字と$j$の文字の間に挿入されるkern - やglueを格納している. -間に入るものがkernであれば,このフィールドの値は\ -\texttt{[$j$]=\{false, , \}} である. -はkernを表すノードそのものである\footnote{% +\end{itemize} +$i$,~$j\in \omega$に対して,\texttt{char\_type[$i$][$j$]} は +文字クラス$i$の文字と$j$の文字の間に挿入されるグルーやカーンを格納している. +\begin{itemize} + \item 間に入るものがカーンであれば,この値は\ +\texttt{[$j$]=\{[1]=, ratio=\}} であり, +はカーンを表すノードそのものである\footnote{% 本バージョンではノードのアクセス手法にdirect access modelを用いている.そのため,例えば\LuaTeX\ beta-0.78.2では,単なる自然数のようにし か見えないことに注意. }. -glueであれば,\texttt{[$j$]=\{false, , , \}} である. -はglueの長さを表すノードそのものであり, - $\text{}=\textit{from\_jfm}+\text{}$である. + \item グルーであれば,この値は以下のキーを持つテーブルである. + \begin{description} + \item[\texttt{width}, \texttt{stretch}, \texttt{shrink}] + グルーのそれぞれ自然長,伸び量,縮み量をsp単位で表したもの. + \item[\texttt{priority}] (バージョン2以降の)JFMでの指定 \texttt{\{,\}} を + \[ + (\text{}+4)\cdot 8+\text{}+4 + \] + として0--63の整数にパックしたもの. + \item[\texttt{ratio}, \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch}, \texttt{kanjiskip\_shrink}] + JFM中の同名のフィールドの値がそのまま使われている. + \end{description} \end{itemize} \item[ascent\textrm{, }descent] …… \item[chars\_cbcache] -…… +文字クラス決定の処理で.キャッシュとして使われる. \end{cslist} % diff --git a/src/lltjext.sty b/src/lltjext.sty index 0624b4f..9bf915f 100644 --- a/src/lltjext.sty +++ b/src/lltjext.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjext}[2017/05/05 v1.2g-ltj-5 Macros for vertical writing] +\ProvidesPackage{lltjext}[2017/07/17 v1.2g-ltj-6 Macros for vertical writing] \RequirePackage{luatexja} \newcount\ltj@ext@dir {\catcode`\*=11 @@ -801,7 +801,7 @@ \def\ltj@lltjext@patch@array{% \patchcmd{\@tabular}{\hbox\bgroup}{% \hbox\bgroup\ltj@ext@dir=\ltjgetparameter{direction}}{}{} - \pretocmd{\@array}% + \pretocmd{\array}% {\ltj@ext@dir=\ltjgetparameter{direction}\relax}{}{} \def\@startpbox##1{\bgroup \box@dir\adjustbaseline%%% これを追加 diff --git a/src/ltj-jfont.lua b/src/ltj-jfont.lua index 272b03c..ac75cc1 100644 --- a/src/ltj-jfont.lua +++ b/src/ltj-jfont.lua @@ -155,7 +155,7 @@ function define_jfm(t) if type(x)=='number' then v.kern[j] = {x, 0.5} elseif type(x)=='table' then - v.kern[j] = { x[1], ratio=x.ratio or (x[2] and 0.5*(1+x[2]) or 0.5) } + v.kern[j] = { x[1], (x.ratio or (x[2] and 0.5*(1+x[2]) or 0.5)) } end end t.char_type[i] = v