diff options
author | Karl Berry <karl@freefriends.org> | 2015-10-25 22:26:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-10-25 22:26:12 +0000 |
commit | b21104f52f6a326c74adaf89be9b55745d4e65ba (patch) | |
tree | 34821dc6557935976efbcf643c48e7f1d869c3f3 | |
parent | a3456c69107a97f155fa0b80458580d3aced4175 (diff) |
luatexja (25oct15)
git-svn-id: svn://tug.org/texlive/trunk@38705 c570f23f-e606-0410-a88d-b1316a301751
44 files changed, 1095 insertions, 729 deletions
diff --git a/Master/texmf-dist/doc/luatex/luatexja/README b/Master/texmf-dist/doc/luatex/luatexja/README index 0b1275b27dd..7b457d9c821 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/README +++ b/Master/texmf-dist/doc/luatex/luatexja/README @@ -1,4 +1,4 @@ -The LuaTeX-ja Package 20150922.0 +The LuaTeX-ja Package 20151025.0 -------------------------------- Copyright (c) 2011--2015 The LuaTeX-ja project License: modified BSD (see COPYING) @@ -34,9 +34,9 @@ Installation 2. If you must/want to install manually: a. Download the source archive from CTAN, - or tagged as 20150922.0 in the Git repository by + or tagged as 20151025.0 in the Git repository by <http://git.osdn.jp/view?p=luatex-ja/luatexja.git - ;a=snapshot;h=refs/tags/20150922.0;sf=tgz> + ;a=snapshot;h=refs/tags/20151025.0;sf=tgz> b. Extract the archive and process following three files by LuaLaTeX to generate classes for Japanese typesetting: @@ -81,4 +81,4 @@ Notes * src/*.{ins.dtx} and src/ltj-kinsoku_make.tex are not needed in regular use. -Last commit date: Tue Sep 22 19:52:08 2015 +0900 +Last commit date: Sun Oct 25 13:50:40 2015 +0900 diff --git a/Master/texmf-dist/doc/luatex/luatexja/ltjclasses.pdf b/Master/texmf-dist/doc/luatex/luatexja/ltjclasses.pdf Binary files differindex 1bce235b70f..786197272d9 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/ltjclasses.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/ltjclasses.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf b/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf Binary files differindex 031a168f10d..161505bac1b 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf Binary files differindex 9a3f30149a2..a11d1f50d73 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf Binary files differindex 13139cdb093..b3fa95de8a2 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx index 16bb3972dae..6ac495c4a4e 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx @@ -16,7 +16,6 @@ \makeatletter %%%%%%%% \directlua{if jit then jit.on() end} - \usepackage{metalogo,amsmath,array,tikz,pict2e,multienum,float} \usepackage{booktabs,multicol,luatexja-ruby} \usepackage[all]{xy} @@ -25,7 +24,7 @@ %%%%%%%% fonts \usepackage{luatexja-otf} \directlua{luatexja.otf.enable_ivs()} -\usepackage[match]{luatexja-fontspec} +\usepackage[match,no-math]{luatexja-fontspec} \usepackage[kozuka-pr6n]{luatexja-preset} \usepackage{unicode-math} \setmainfont[Ligatures=TeX]{Linux Libertine O} @@ -139,10 +138,11 @@ \DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\pTeX} %%%%%%%% other macros -\newlist{cslist}{description}{1} +\newlist{cslist}{description}{2} \setlist[cslist]{% style=nextline,font=\mdseries\ttfamily, before*=\def\<{\char`\<}\def\>{\char`\>}\def\{{\char`\{}\def\}{\char`\}}, + topsep=\medskipamount, %<ja> leftmargin=2\zw, %<en> leftmargin=2em, } @@ -2749,13 +2749,13 @@ For the detail, see Table~\ref{table-kcat}. %<*en> \bfseries meaning& \bfseries control word& -\bfseries widow penalty\hbox{}$^*$& +\bfseries widow penalty& \bfseries linebreak\\ %</en> %<*ja> \bfseries 意図& \bfseries 制御綴中に使用& -\bfseries 文字ウィドウ処理\hbox{}$^*$& +\bfseries 文字ウィドウ処理& \bfseries 直後での改行\\ %</ja> \midrule @@ -2770,7 +2770,7 @@ For the detail, see Table~\ref{table-kcat}. \medskip %<*ja> -文字ウィドウ処理\hbox{}$^*$: 「漢字が一文字だけ次の行に行くのを防ぐ」\ +文字ウィドウ処理:「漢字が一文字だけ次の行に行くのを防ぐ」 \cs{jcharwidowpenalty} が, その文字の直前に挿入されうるか否か,を示す. %</ja> @@ -2842,17 +2842,22 @@ between \XeTeX\ and \LuaTeX, by the following reasons: \begin{itemize} \item (plain format) \texttt{luatex-unicode-letters.tex} is based on old \texttt{unicode-letters.tex}. \item The latter half of \texttt{unicode-letters.tex}~and~\texttt{unicode-letters.def} -sets\cs{catcode} of Kanji and kana characters to 11, via setting \cs{XeTeXcharclass}. - -However, this latter half does not exist (plain case), or not executed (\LaTeX~case) in \LuaTeX, hence -\cs{catcode} of Kanji and kana characters remains 12 in \LuaTeX. +sets\cs{catcode} of several characters to 11, via setting \cs{XeTeXcharclass}. +However, this latter half does not exist (plain case), or not executed (\LaTeX~case) in \LuaTeX. \end{itemize} -In other words, Kanji nor kana characters cannot be used in -a control word, in the default setting of \LuaTeX. +In other words, +\begin{description} +\item[plain \LuaTeX] +Kanji nor kana characters cannot be used in +a control word, in the default setting of plain \LuaTeX. +\item[\LuaLaTeX] +In recent (2015-10-01 or later) \LuaLaTeX, Kanji and kana characters in a control word is supported (these catcode are 11), +but not fullwidth alphanumerics and several other characters. +\end{description} This would be inconvenient for \pTeX~users to shifting to \LuaTeX-ja, -since several control words containing Kanji, such as \verb+\西暦+, -are used in \pTeX. +since several control words containing Kanji or other fullwidth characters, such as +\verb+\西暦+~or~\verb+\1年目西暦+ are used in \pTeX. Hence, \LuaTeX-ja have a counterpart of \texttt{unicode-letters.tex} for \LuaTeX, \emph{to match the \cs{catcode} setting with that of \XeTeX.} %</en> @@ -2865,7 +2870,6 @@ for \LuaTeX, \emph{to match the \cs{catcode} setting with that of \XeTeX.} \LaTeX では \cs{catcode} の設定はカーネルに \texttt{unicode-letters.def} として統合され. このファイルを\XeLaTeX, \LuaLaTeX の両方が用いている. - だが,\XeTeX における \cs{catcode} の初期設定と \LuaTeX におけるそれは一致していない: \begin{itemize} @@ -2873,16 +2877,20 @@ for \LuaTeX, \emph{to match the \cs{catcode} setting with that of \XeTeX.} \texttt{unicode-letters.tex} が古い \item \texttt{unicode-letters.tex} 後半部や \texttt{unicode-letters.def} 後半部では \cs{XeTeXcharclass} の設定を行なっており, -それによって漢字や仮名の \cs{catcode} が11に設定されている. - +それによって漢字や仮名,および全角英数字の \cs{catcode} が11に設定されている. しかし,\texttt{luatex-unicode-letters.tex} ではこの「後半部」が まるごと省略されており,また\LuaLaTeX でも \texttt{unicode-letters.def} 後半部は実行されな - い.従って漢字や仮名の \cs{catcode} は12のままになっている. + い. \end{itemize} -言い換えると,\LuaTeX の初期状態では漢字や仮名を制御綴内に +言い換えると, +\begin{description} + \item[plain \LuaTeX] 漢字や仮名を制御綴内に 使用することはできない. - -これでは \pTeX で使用できた \verb+\西暦+ などが使えないこととなり, + \item[\LuaLaTeX] 最近の(2015-10-01以降の) +\LuaLaTeX では漢字や仮名を制御綴内に +使用することが可能になったが,全角英数字は相変わらず使用できない, +\end{description} +これでは \pTeX で使用できた \verb+\1年目西暦+\footnote{科研費\LaTeX で使用されているそうです.}などが使えないこととなり, \LuaTeX-jaへの移行で手間が生じる.そのため,\LuaTeX-jaでは \texttt{unicode-letters.tex} の後半部にあたる内容を自前でパッチし, 結果として\textbf{\XeTeX における初期設定と同じになるようにしている.} @@ -3836,8 +3844,8 @@ OpenType font featureと見かけ上同じような形式で指定できるも \paragraph{\texttt{extend} and \texttt{slant}} The following setting can be specified as OpenType font features: \begin{cslist}[style=standard] -\item[\cs{extend=}<extend>] expand the font horizontally by <extend>. -\item[\cs{slant=}<slant>] slant the font. +\item[\texttt{extend=}<extend>] expand the font horizontally by <extend>. +\item[\texttt{slant=}<slant>] slant the font. \end{cslist} Note that \LuaTeX-ja doesn't adjust JFMs by these \texttt{extend} and \texttt{slant} settings; you have to write new JFMs on purpose. @@ -3852,6 +3860,36 @@ letter-spacing and the width of italic correction are not correct: \S あいう\/ABC \end{LTXexample} +%<*ja> +\paragraph{\texttt{ltjksp} 指定} +\label{pg:ltjksp} +\LuaTeX-ja標準では, +JFM中における \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\ +\texttt{kanjiskip\_shrink}キー(\pageref{pg:ksp_nat}ページ)の使用によって, +「JFM由来のグルーの他に,\Param{kanjiskip}の自然長/伸び量/縮み量の一部が +同じ場所に挿入される」という状況が起こりうる. +この機能を無効化し,20150922.0版以前と同じような組版を得るためには +他のOpenType機能と同じように\ \texttt{-ltjksp}\ 指定を行えば良い. +\begin{LTXexample}[width=16\zw] +\leavevmode +\ltjsetparameter{kanjiskip=0pt plus 3\zw} +\vrule\hbox to 15\zw{あ「い」う,えお}\vrule + +\jfont\G=file:KozMinPr6N-Regular.otf% + :jfm=ujis;-ltjksp at 9.2487pt +\G\leavevmode% +\vrule\hbox to 15\zw{あ「い」う,えお}\vrule +\end{LTXexample} +なお, +\begin{lstlisting} + \jfont\G=file:KozMinPr6N-Regular.otf:jfm=ujis;-ltjksp;+ltjksp at 9.2487pt +\end{lstlisting} +のように \texttt{+ltjksp} 指定を行った場合は,\texttt{kanjiskip\_natural} など +3キーは再び有効化される.\texttt{-ltjksp}, \texttt{+ltjksp} を複数回指定した場合は, +最後に指定したものが有効となる. +%</ja> + + %<en>\subsection{\cs{tfont}} %<ja>\subsection{\cs{tfont} 命令} @@ -4181,20 +4219,48 @@ This field is a list of characters which are in this character %<ja>(必須) %<*en> +\begin{table}[t] + \centering +\begin{tabular}{llr} +\toprule +Direction of JFM&\textbf{\texttt{'yoko'} (horizontal)}&\multicolumn{1}{l}{\textbf{\texttt{'tate'} (vertical)}}\\ +\midrule +\texttt{width} field&the width of the ``real'' glyph&1.0~(full-width)\\ +\texttt{height} field&the height of the ``real'' glyph&0.5~(half-width)\\ +\texttt{depth} field&the depth of the ``real'' glyph&0.5~(half-width)\\ +\midrule +\texttt{italic} field&\multicolumn{2}{c}{0.0}\\ +\bottomrule +\end{tabular} +\caption{Default values of \texttt{width} field and other fields} +\label{tab-wid} +\end{table} Specify the width of characters in character class~$i$, the height, the depth and the amount of italic correction. All characters in character class~$i$ are regarded that its width, height, and depth are -as values of these fields. - -But there is one exception: \texttt{width} field can be \texttt{'prop'}. -This means that width of a character becomes that of its ``real'' glyph. +as values of these fields. The default values are shown in Table~\ref{tab-wid}. %</en> %<*ja> +\begin{table}[t] + \centering +\begin{tabular}{llr} +\toprule +JFM書字方向&\emph{\texttt{'yoko'}(横組)}&\multicolumn{1}{l}{\emph{\texttt{'tate'}(縦組)}}\\ +\midrule +\texttt{width}&「実際のグリフ」の幅&1.0(全角)\\ +\texttt{height}&「実際のグリフ」の高さ&0.5(二分)\\ +\texttt{depth}&「実際のグリフ」の深さ&0.5(二分)\\ +\midrule +\texttt{italic}&\multicolumn{2}{c}{0.0}\\ +\bottomrule +\end{tabular} +\caption{\texttt{width} フィールド等の標準値} +\label{tab-wid} +\end{table} 文字クラス$i$に属する文字の幅,高さ,深さ,イタリック補正の量を指定する. 文字クラス$i$に属する全ての文字は,その幅,高さ,深さがこのフィールドで指定した -値であるものとして扱われる. - -例外として,\emph{\texttt{width} フィールドには数値以外に \texttt{'prop'} が指定可能である}. -この場合,文字の幅はその「実際の」グリフの幅となる.OpenTypeの \texttt{prop} featureと併用 +値であるものとして扱われる.省略時や,数でない値を指定した時には表\nobreak\ref{tab-wid}に + 示されている値を用いる.例えば,横組用JFMで \texttt{width} フィールドには数値以外の値を指 + 定した場合,文字の幅はその「実際の」グリフの幅となる.OpenTypeの \texttt{prop} featureと併用 すれば,これによってプロポーショナル組を行うことができる. %</ja> @@ -4418,62 +4484,122 @@ Furthermore, the glyph is shifted according to values of fields \label{fig-pos-tate} \end{figure} -\item[kern={\{[$j$]=<kern>, [$j'$]=\{<kern>, [<ratio>]\}, ...\}}] - -\item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>, [<priority>], [<ratio>]\}, ...\}}]\ +\item[kern={\{[$j$]=<kern>, [$j'$]=\{<kern>, [ratio=<ratio>]\}, ...\}}] +\nopagebreak +\item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>, [ratio=<ratio>, ...]\}, ...\}}]\leavevmode %<*ja> -文字クラス$i$の文字と$j$の文字の間に挿入されるkernやglueの量を指定する. +文字クラス$i$の文字と$j$の文字の間に挿入されるカーンやグルーの量を指定する. - <priority>は \Pkg{luatexja-adjust} による優先順位付き - 行長調整(\ref{ssec-adj}節)が有効なときのみ意味を持つ. -このフィールドは省略可能であり,行調整処理におけるこのglueの優先 - 度を$-2$から$+2$の間の整数で指定する.大きい値ほど「伸びやすく,縮みやすい」 - ことを意味する.省略時の値 - は0であり,範囲外の値が指定されたときの動作は未定義である. - -<ratio>も省略可能フィールドであり,$-1$から$+1$の実数値をとる.省略時の値は0である. -\begin{itemize} -\item $-1$はこのグルーが「前の文字」由来であることを示す. -\item $+1$はこのグルーが「後の文字」由来であることを示す. -\item それ以外の値は,「前の文字」由来のグルーと「後の文字」由来の -グルーが混合されていることを示す. -\end{itemize} -なお,このフィールドの値は\Param{differentjfm}の値が +<ratio>は,グルーの自然長のうちどれだけの割合が「後の文字」由来かを示す量で, +$0$から$+1$の実数値をとる.省略時の値は$0.5$である. +このフィールドの値は\Param{differentjfm}の値が \texttt{pleft},~\texttt{pright},~\texttt{paverage}の値のときのみ実際に用いられる. 例えば,\cite{x4051}では,句点と中点の間には, 句点由来の二分空きと中点由来の四分空きが挿入されるが,この場合には \begin{itemize} \item <width>には$0.5+0.25=0.75$を指定する. -\item <ratio>には次の値を指定する. -\[ - -1\cdot \frac{0.5}{0.5+0.25} + 1 \cdot \frac{0.25}{0.5+0.25} = -\frac13 -\] +\item <ratio>には$0.25/(0.5+0.25)=1/3$を指定する. \end{itemize} %</ja> %<*en> \ -Specifies the width of kern or glue which will be inserted +Specifies the amount of kern or glue which will be inserted between characters in character class~$i$ and those in character class~$j$. -<priority> is an integer in $[-2,2]$ (treated as 0 if omitted), and this is -used only in line adjustment with priority by \Pkg{luatexja-adjust} -(see Subsection~\ref{ssec-adj}). Higher value means the glue is easy to shretch, -and is also easy to shrink. - -<ratio> is also an optional value between $-1$ and 1. For example, +<ratio> specifies how much the glue is originated in the ``right'' character. +It is a real number between 0 and 1, and treated as 0.5 if omitted. For example, The width of a glue between an ideographic full stop ``。'' and a fullwidth middle dot ``・'' is three-fourth of fullwidth, namely halfwidth from the ideographic full stop, and quarter-width from the fullwidth middle dot. In this case, -we specify <ratio> to -\[ - -1\cdot \frac{0.5}{0.5+0.25} + 1 \cdot \frac{0.25}{0.5+0.25} = -\frac13. -\] +we specify <ratio> to $0.25/(0.5+0.25)=1/3$. %</en> +%<*ja> +グルーの指定においては,上記に加えて各 \texttt{[$j$]} の各サブテーブル内に +次のキーを指定できる, +\begin{cslist}[style=standard] +\item[priority=<priority>] + \Pkg{luatexja-adjust} による優先順位付き + 行長調整(\ref{ssec-adj}節)の際に使われる値であり, +行調整処理におけるこのglueの優先 + 度を$-2$から$+2$の間の整数で指定する.大きい値ほど「伸びやすく,縮みやすい」 + ことを意味する.省略時の値 + は0であり,範囲外の値が指定されたときの動作は未定義である. +\item[kanjiskip\_natural=<num>\textrm{, }% + kanjiskip\_stretch=<num>\textrm{, }kanjiskip\_shrink=<num>]\leavevmode + \label{pg:ksp_nat} + +JFMによって本来挿入されるグルーの他に +\Param{kanjiskip}分の空白を自然長(\texttt{kanjiskip\_natural}),伸び量(\texttt{kanjiskip\_stretch}), +縮み量(\texttt{kanjiskip\_shrink})ごとに挿入する\footnote{本来\Param{xkanjiskip}が挿入される場所においては + \Param{xkanjiskip}分の空白を自然長・伸び量・縮み量ごとに.追加できる.}% +ための指定である.いずれも省略された場合のデフォルト値は0(追加しない)である. + +例えば,\LuaTeX-jaの横組標準JFMの \texttt{jfm-ujis.lua} では, +\begin{itemize} + \item 通常の文字「あ」と開き括弧類の間に入るグルーは,自然長・縮み量半角,伸び量0のグルー +となっているが,さらに\Param{kanjiskip}の伸び量に \texttt{kanjiskip\_stretch}(ここでは1)を掛け + た分だけ伸びることが許される. + \item 同様に,閉じ括弧類(全角コンマ「,」も含む)と通常の文字「う」「え」の間にも +自然長・縮み量半角,伸び量0のグルー +となっているが,さらに\Param{kanjiskip}の伸び量に \texttt{kanjiskip\_stretch}(ここでは1)を掛け + た分だけ伸びることが許される. +\end{itemize} +となっている.従って,以下のような組版結果を得る. + +\medskip +\begin{LTXexample}[width=16\zw] +\leavevmode +\ltjsetparameter{kanjiskip=0pt plus 3\zw} +\vrule\hbox to 15\zw{あ「い」う,えお}\vrule +\end{LTXexample} + +\end{cslist} +%</ja> +%<*en> +In case of glue, one can specify following additional keys in each \texttt{[$j$]} + subtable: +\begin{cslist}[style=standard] +\item[priority=<priority>] +An integer in $[-2,2]$ (treated as 0 if omitted), and this is +used only in line adjustment with priority by \Pkg{luatexja-adjust} +(see Subsection~\ref{ssec-adj}). Higher value means the glue is easy to stretch, +and is also easy to shrink. +\item[kanjiskip\_natural=<num>\textrm{, }% + kanjiskip\_stretch=<num>\textrm{, }kanjiskip\_shrink=<num>]\leavevmode + +These keys specifies the amount of the natural width of \Param{kanjiskip} +(the stretch/shrink part, respectively) which will be inserted +in addition to the original JFM glue. Default values of them are all 0. + +As an example, in \texttt{jfm-ujis.lua}, the standard JFM in horizontal writing, we have +\begin{itemize} + \item Between an ordinal letter ``あ'' and an ideographic opening bracket, we have +a glue whose natural part and shrink part are both half-width, while its stretch part is + zero. However, this glue also can be stretched + as much as the stretch part of \Param{kanjiskip} times the value of + \texttt{kanjiskip\_stretch} key (1 in this case). + \item Between an ideographic closeing brackets (the ideographic comma ``,'' + is included) and an ordinal letter, we have the same glue. + Again, this glue also can be stretched + as much as the stretch part of \Param{kanjiskip} times the value of + \texttt{kanjiskip\_stretch} key (1 in this case). +\end{itemize} +Hence we have the following result: + +\medskip +\begin{LTXexample}[width=16\zw] +\leavevmode +\ltjsetparameter{kanjiskip=0pt plus 3\zw} +\vrule\hbox to 15\zw{あ「い」う,えお}\vrule +\end{LTXexample} + +\end{cslist} +%</en> \item[end\_stretch=<kern>, end\_shrink=<kern>] %<*ja> @@ -4961,7 +5087,7 @@ This callback is called when \LuaTeX-ja is trying to encapsule a その\textit{glyph\_node}をカプセル化しようとする際に呼び出される. %</ja> \begin{lstlisting}[numbers=left] -function (<table> shift_info, <table> jfont_info, <number> char_class) +function (<table> shift_info, <table> jfont_info, <table> char_type) return <table> new_shift_info end \end{lstlisting} @@ -5000,7 +5126,7 @@ Then, the position of glyphs is shifted up by (和文OpenTypeフォントの標準値) \item 実フォント側の数値:$(\hbox{高さ})=28y$, $(\hbox{深さ})=5y$(和文TrueTypeフォントの標準値) \end{itemize} -となっていたとする.すると,実際の文字の出力位置は,以下の量だけ上にぜらされることとなる: +となっていたとする.すると,実際の文字の出力位置は,以下の量だけ上にずらされることとなる: %</ja> \[ \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{25}y= 1.04y. @@ -6278,8 +6404,8 @@ the commands of Japanese version: \ref{ssec-fontspec}節で述べたように,この追加パッケージは\Pkg{fontspec}% パッケージで定義されているコマンドに対応する和文フォント用のコマンドを提供する. -\Pkg{fontspec}パッケージで指定可能な各種font featureに加えて,和文版のコマンドには -以下の``font feature''を指定することができる: +\Pkg{fontspec}パッケージで指定可能な各種OpenType機能に加えて,和文版のコマンドには +以下の「フォント機能」を指定することができる: %</ja> @@ -6335,6 +6461,14 @@ will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}. \label{fig:yokotate-fontspec} \end{figure} +\item[Kanjiskip=<bool>] +%<*ja> +\pageref{pg:ltjksp}ページで説明した \verb+\jfont+ 中での \texttt{ltjksp} 指定と +同一の効力を持ち, +JFM中における \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\ +\texttt{kanjiskip\_shrink}キー(\pageref{pg:ksp_nat}ページ)の有効/無効を切り替える. +標準値は \texttt{true} である. +%</ja> \item[TateFeatures=\{<features>\}\textrm{, }TateFont=<font>] %<*en> @@ -6345,7 +6479,7 @@ Similarly, the \texttt{TateFont} key specifies the Japanese font which will be u A demonstrarion is shown in Figure~\ref{fig:yokotate-fontspec}. %</en> %<*ja> -縦組において使用されるフォントや,縦組においてのみ適用されるfeature達を +縦組において使用されるフォントや,縦組においてのみ適用されるフォント機能達を 指定する.使用例は図\ref{fig:yokotate-fontspec}参照. %</ja> @@ -6356,7 +6490,7 @@ horizontal writing,. A demonstrarion is shown in Figure~\ref{fig:yokotate-fontspec}. %</en> %<*ja> -同様に,横組においてのみ適用されるfeature達を +同様に,横組においてのみ適用されるフォント機能達を 指定する.使用例は図\ref{fig:yokotate-fontspec}参照. %</ja> @@ -6391,7 +6525,7 @@ as the following: %<*ja> \ref{ssec-altfont}節の \cs{ltjdeclarealtfont} や, \ref{ssec-nfsspat}節の \cs{DeclareAlternateKanjiFont} と同様に, -このキーを用いると一部の文字を異なったフォントやfont featureを使って組むことができる. +このキーを用いると一部の文字を異なったフォントや機能たちを使って組むことができる. \texttt{AltFont} キーに指定する値は,次のように二重のコンマ区切りリストである: %</ja> \begin{lstlisting}[escapechar=\#] @@ -6481,8 +6615,9 @@ BoldFeatures = { また,図\ref{fig:yokotate-fontspec}後半部では6行目の色の指定が効かず, 2行目で指定した\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ による色の指定が有効になっ -たままである.これは\emph{\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ によるfeature指定は -組方向に依存しないfeature指定より後に解釈される}からである. +たままである.これは\emph{\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ による +OpenType機能指定は +組方向に依存しないOpenType機能の指定より後に解釈される}からである. %</ja> @@ -6560,7 +6695,7 @@ ordinary characters in the following points: is not performed to these characters. %</en> %<*ja> -\item OpenType feature(例えばグリフ置換やカーニング)をサポートするための +\item OpenType機能(例えばグリフ置換やカーニング)をサポートするための \Pkg{luaotfload}パッケージのコードはこれらの文字には働かない. %</ja> \end{itemize} @@ -6637,7 +6772,7 @@ For example, only ``葛'' in ``葛西'' is changed by font features \texttt{jp78}~or~\texttt{jp90}, which does not followed by any variation selector. %</en> %<*ja> -また,IVSによる字形指定は,font featureによるそれに優先されることとした. +また,IVSによる字形指定は,OpenType機能によるそれに優先されることとした. 下の例において,\texttt{jp78}, \texttt{jp90} 指定で字形が変化した文字は 異体字セレクタが続いていない「葛西」中の「葛」のみである. %</ja> @@ -9006,7 +9141,7 @@ Letter, Other, Kanji, Open, Closeのどれに属するかは次によって決 %</ja> \begin{itemize} %<en>\item \textbf{ALchar}s above or equal to~\texttt{U+0080} are classified as Letter. -%<ja>\item (\texttt{U+0080}以降の)\textbf{ALchar}は,すべてLetter扱いである. +%<ja>\item \<(\texttt{U+0080}以降の)\textbf{ALchar}は,すべてLetter扱いである. %<en>\item \textbf{JAchar}s are classified in the order as follows: %<ja>\item \textbf{JAchar}については,以下の順序に従って文字種を決める: @@ -9183,13 +9318,13 @@ JFM中にある文字クラス$n$の定義の が連続した場合に,$p$のフォントに対応したが持つ「異体字情報」に従って出力するグリフを変える. しかし,単に$p.\textit{char}$を変更するだけでは,後から -font featureの適用(すぐ下)により置換される可能性がある.そのため, +OpenType機能の適用(すぐ下)により置換される可能性がある.そのため, \cs{CID} や \cs{UTF} と同じように,\textit{glyph\_node}~$p$の代わりに \texttt{user\_id} が\textit{char\_by\_cid}であるようなuser-defined whatsitを用いている. \item[(\Pkg{luaotfload} によるfont featureの適用)] \item[\tt ltj.otf] \texttt{user\_id} が\textit{char\_by\_cid}であるようなuser-defined whatsitを きちんと\textit{glyph\_node}に変換する.この処理は,\cs{CID}, \cs{UTF}やIVSによる置換が, -font featureの適用で上書きされてしまうのを防止するためである. +OpenType機能の適用で上書きされてしまうのを防止するためである. \item[\tt ltj.main\_process] \textbf{JAglue}の挿入処理(\ref{sec-jfmglue}章)と, JFMの指定に従って各\textbf{JAchar}の「寸法を補正」することを行う. \end{description} diff --git a/Master/texmf-dist/source/luatex/luatexja/ltjclasses.dtx b/Master/texmf-dist/source/luatex/luatexja/ltjclasses.dtx index 6332eab32b1..47be704650f 100644 --- a/Master/texmf-dist/source/luatex/luatexja/ltjclasses.dtx +++ b/Master/texmf-dist/source/luatex/luatexja/ltjclasses.dtx @@ -10,7 +10,7 @@ % % \fi % -% \CheckSum{4499} +% \CheckSum{4509} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -84,6 +84,7 @@ % \changes{v1.6-ltj-7}{2014/11/15}{縦組クラスとeveryshi.styとの相性が悪い問題を修正.} % \changes{v1.6-ltj-8}{2014/11/22}{縦組時のgeometry.styへの対応を別ファイル(lltjp-geometry.sty)に分離.それに伴いv1.6-ltj-3での変更を削除.} % \changes{v1.6-ltj-9}{2015/01/01}{縦組クラスの日付出力でエラーになることなどを修正.} +% \changes{v1.6-ltj-10}{2015/10/18}{Lua\TeX\ 0.81.0に伴うプリミティブ名の変更に対応.} % \fi % % \iffalse @@ -113,7 +114,7 @@ %<11pt&bk>\ProvidesFile{ltjtbk11.clo} %<12pt&bk>\ProvidesFile{ltjtbk12.clo} %</tate> - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 %<article|report|book> Standard LuaLaTeX-ja class] %<10pt|11pt|12pt> Standard LuaLaTeX-ja file (size option)] %<*driver> @@ -818,6 +819,9 @@ % \begin{macro}{\pdfpageheight} % 出力のPDFの用紙サイズをここで設定しておきます。 % |tombow|が真のときは2インチ足しておきます。 +% +% [2015-10-18 LTJ] Lua\TeX\ 0.81.0ではプリミティブの名称変更がされたので, +% それに合わせておきます. % \begin{macrocode} \setlength{\@tempdima}{\paperwidth} \setlength{\@tempdimb}{\paperheight} @@ -825,8 +829,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi % \end{macrocode} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx b/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx index 1327cf0d355..76fe37f27e8 100644 --- a/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx +++ b/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx @@ -22,7 +22,7 @@ % ----------------------------------------- % % \fi -% \CheckSum{5219} +% \CheckSum{5229} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -50,7 +50,7 @@ %<*driver> \ProvidesFile{ltjsclasses.dtx} %</driver> - [2015/05/26 ] + [2015/10/18 ] %<*driver> \documentclass{ltjsarticle} \usepackage{doc} @@ -714,6 +714,9 @@ % \begin{macro}{\pdfpageheight} % 出力のPDFの用紙サイズをここで設定しておきます。 % |tombow| が真のときは2インチ足しておきます。 +% +% [2015-10-18 LTJ] Lua\TeX\ 0.81.0ではプリミティブの名称変更がされたので, +% それに合わせておきます. % \begin{macrocode} \setlength{\@tempdima}{\paperwidth} \setlength{\@tempdimb}{\paperheight} @@ -721,8 +724,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi % \end{macrocode} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/luatex/luatexja/tool/ltj-unicode-ccfix_make2.pl b/Master/texmf-dist/source/luatex/luatexja/tool/ltj-unicode-ccfix_make2.pl index d5db9643eb2..f55962956d3 100755 --- a/Master/texmf-dist/source/luatex/luatexja/tool/ltj-unicode-ccfix_make2.pl +++ b/Master/texmf-dist/source/luatex/luatexja/tool/ltj-unicode-ccfix_make2.pl @@ -74,12 +74,13 @@ __EOT__ print << '__EOT__'; -if tex.getcatcode(0x6F22)==12 then - local tex_catcode = tex.setcatcode - local function set_letter(b,e) +local tex_catcode = tex.setcatcode +local tex_getcc = tex.getcatcode +local function set_letter(b,e) + if tex_getcc(b)~=11 then for i=b,e do tex_catcode('global', i, 11) end end - +end __EOT__ open LineBreak, $ARGV[0] or die "can't read $ARGV[0]"; @@ -95,7 +96,7 @@ while (<LineBreak>) { if (exists $lineBreakClass{$lb}) { if ($lineBreakClass{$lb} == 1) { # ideographs: set whole range to class 1 - print " set_letter(0x$s,0x$e)\n"; + print "set_letter(0x$s,0x$e)\n"; } } } @@ -103,7 +104,4 @@ while (<LineBreak>) { close LineBreak; print << '__EOT__'; - -end - __EOT__ diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty index 3a4b3caf6ac..691e53118ff 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty @@ -50,7 +50,6 @@ \cs_new:Nn \ltj_fontspec_define_option:nn { \__fontspec_keys_define_code:nnn {fontspec} {#1} {#2} } - \cs_new:Nn \ltj_fontspec_define_preparse_external:nn { \__fontspec_keys_define_code:nnn {fontspec-preparse-external} {#1} {#2} } @@ -111,6 +110,13 @@ \ltj_fontspec_define_option:nn {CID} { \__fontspec_update_featstr:n {cid=##1} } + \ltj_fontspec_define_option:nn {Kanjiskip} { + \str_if_eq_x:nnTF {false} { \str_lower_case:n { ##1 } }{ + \__fontspec_update_featstr:n {-ltjksp} + } { + \__fontspec_update_featstr:n {+ltjksp} + } + } \ltj_fontspec_define_option:nn {JFM} { \__fontspec_update_featstr:n {jfm=##1} } diff --git a/Master/texmf-dist/tex/luatex/luatexja/jfm-prop.lua b/Master/texmf-dist/tex/luatex/luatexja/jfm-prop.lua index af1c12e35fd..71dc1ae6940 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/jfm-prop.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/jfm-prop.lua @@ -6,4 +6,4 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 'prop', height = 0.88, depth = 0.12, italic=0.0, } -}
\ No newline at end of file +} diff --git a/Master/texmf-dist/tex/luatex/luatexja/jfm-ujis.lua b/Master/texmf-dist/tex/luatex/luatexja/jfm-ujis.lua index ced82f66463..a0d1675e127 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/jfm-ujis.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/jfm-ujis.lua @@ -10,21 +10,19 @@ luatexja.jfont.define_jfm { dir = 'yoko', zw = 1.0, zh = 1.0, - kanjiskip = {0.0, 0.25, 0}, - xkanjiskip = {0.25, 0.25, .125}, + kanjiskip = { 0.0, 0.25, 0 }, + xkanjiskip = { 0.25, 0.25, .125 }, [0] = { align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.88, depth = 0.12, italic=0.0, glue = { - -- [index] = { width, stretch, shrink, [priority, [ratio]] } - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [7] = {0, 0, 0}, - [8] = {0, 0, 0}, - [9] = {0, 0, 0}, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, + [7] = { 0, 0, 0, kanjiskip_shrink=1 }, + [8] = { 0, 0, 0, kanjiskip_shrink=1 }, } }, @@ -37,16 +35,15 @@ luatexja.jfont.define_jfm { width = 0.5, height = 0.88, depth = 0.12, italic=0.0, glue = { -- 3 のみ四分,あとは0 - [0] = {0, 0, 0}, - [1] = {0, 0, 0}, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1 }, - [4] = {0, 0, 0}, - [5] = {0, 0, 0}, - [6] = {0, 0, 0}, - [7] = {0, 0, 0}, - [8] = {0, 0, 0}, - [9] = {0, 0, 0}, + [0] = { 0, 0, 0, kanjiskip_shrink=1 }, + [1] = { 0, 0, 0, kanjiskip_shrink=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1, kanjiskip_stretch=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [5] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, + [7] = { 0, 0, 0, kanjiskip_shrink=1 }, + [8] = { 0, 0, 0, kanjiskip_shrink=1 }, } }, @@ -59,16 +56,15 @@ luatexja.jfont.define_jfm { width = 0.5, height = 0.88, depth = 0.12, italic=0.0, glue = { -- 3 は四分, 2, 4, 9 は0, あとは0.5 - [0] = { 0.5 , 0.0, 0.5, 0, -1 }, - [1] = { 0.5 , 0.0, 0.5, 0, -1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [5] = { 0.5 , 0.0, 0.5, 0, -1 }, - [6] = { 0.5 , 0.0, 0.5, 0, -1 }, - [7] = { 0.5 , 0.0, 0.5, 0, -1 }, - [8] = { 0.5 , 0.0, 0.5, 0, -1 }, - [9] = {0, 0, 0}, + [0] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [1] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1}, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [5] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [6] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [7] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [8] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, } }, @@ -79,16 +75,15 @@ luatexja.jfont.define_jfm { --end_stretch = 0.25, glue = { -- 3 のみ 0.5,あとは0.25 - [0] = { 0.25, 0.0, 0.25, 1, 1 }, - [1] = { 0.25, 0.0, 0.25, 1, 1 }, - [2] = { 0.25, 0.0, 0.25, 1, 1 }, - [3] = { 0.5 , 0.0, 0.5 , 1, 0 }, - [4] = { 0.25, 0.0, 0.25, 1, 1 }, - [5] = { 0.25, 0.0, 0.25, 1, 1 }, - [6] = { 0.25, 0.0, 0.25, 1, 1 }, - [7] = { 0.25, 0.0, 0.25, 1, 1 }, - [8] = { 0.25, 0.0, 0.25, 1, 1 }, - [9] = { 0.25, 0.0, 0.25, 1, 1 }, + [0] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [1] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [2] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [3] = { 0.5 , 0.0, 0.5 , priority=1 }, + [4] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [5] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [6] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [7] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [8] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, } }, @@ -98,14 +93,13 @@ luatexja.jfont.define_jfm { width = 0.5, height = 0.88, depth = 0.12, italic=0.0, glue = { -- 3 は.75, 2, 4 は0, あとは0.5 - [0] = { 0.5 , 0.0, 0.5, 0, -1 }, - [1] = { 0.5 , 0.0, 0.5, 0, -1 }, - [3] = { 0.75, 0.0, 0.25, 1, -1/3 }, - [5] = { 0.5 , 0.0, 0.5, 0, -1 }, - [6] = { 0.5 , 0.0, 0.5, 0, -1 }, - [7] = { 0.5 , 0.0, 0.5, 0, -1 }, - [8] = { 0.5 , 0.0, 0.5, 0, -1 }, - [9] = { 0.5 , 0.0, 0.5, 0, -1 }, + [0] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [1] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [3] = { 0.75, 0.0, 0.25, priority=1, ratio=1./3, kanjiskip_stretch=1 }, + [5] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [6] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [7] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [8] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, } }, @@ -114,12 +108,11 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.88, depth = 0.12, italic=0.0, glue = { - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [9] = {0, 0, 0}, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, }, kern = { [5] = 0.0 @@ -131,15 +124,14 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.88, depth = 0.12, italic=0.0, glue = { - [0] = { 0.5 , 0.0, 0.5, 0, 1 }, - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.75, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [7] = { 0.5 , 0.0, 0.5, 0, 1 }, - [8] = {0, 0, 0}, - [9] = {0, 0, 0}, + [0] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.75, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, + [7] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [8] = { 0, 0, 0, kanjiskip_shrink=1 }, }, kern = { [5] = 0.0 @@ -171,14 +163,13 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 0.5, height = 0.88, depth = 0.12, italic=0.0, glue = { - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [7] = {0, 0, 0}, - [8] = {0, 0, 0}, - [9] = {0, 0, 0}, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, + [7] = { 0, 0, 0, kanjiskip_shrink=1 }, + [8] = { 0, 0, 0, kanjiskip_shrink=1 }, } }, @@ -204,12 +195,11 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.88, depth = 0.12, italic=0.0, glue = { - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [9] = {0, 0, 0}, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, }, kern = { [8] = 0.0 @@ -220,7 +210,7 @@ luatexja.jfont.define_jfm { [99] = { -- box末尾 chars = {'boxbdd', 'parbdd'}, glue = { - [3] = { 0.25, 0.0, 0.25, 1 }, + [3] = { 0.25, 0.0, 0.25, priority=1 }, } }, diff --git a/Master/texmf-dist/tex/luatex/luatexja/jfm-ujisv.lua b/Master/texmf-dist/tex/luatex/luatexja/jfm-ujisv.lua index 179ad55faf4..6bf3075340b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/jfm-ujisv.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/jfm-ujisv.lua @@ -10,21 +10,19 @@ luatexja.jfont.define_jfm { dir = 'tate', zw = 1.0, zh = 1.0, - kanjiskip = {0.0, 0.25, 0}, - xkanjiskip = {0.25, 0.25, .125}, + kanjiskip = { 0.0, 0.25, 0 }, + xkanjiskip = { 0.25, 0.25, .125 }, [0] = { align = 'middle', left = 0.00, down = 0.00, width = 1.0, height = 0.50, depth = 0.50, italic=0.0, glue = { - -- [index] = { width, stretch, shrink, [priority, [ratio]] } - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [7] = {0, 0, 0}, - [8] = {0, 0, 0}, - [9] = {0, 0, 0}, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, + [7] = { 0, 0, 0, kanjiskip_shrink=1 }, + [8] = { 0, 0, 0, kanjiskip_shrink=1 }, } }, @@ -37,16 +35,15 @@ luatexja.jfont.define_jfm { width = 0.5, height = 0.50, depth = 0.50, italic=0.0, glue = { -- 3 のみ四分,あとは0 - [0] = {0, 0, 0}, - [1] = {0, 0, 0}, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1 }, - [4] = {0, 0, 0}, - [5] = {0, 0, 0}, - [6] = {0, 0, 0}, - [7] = {0, 0, 0}, - [8] = {0, 0, 0}, - [9] = {0, 0, 0}, + [0] = { 0, 0, 0, kanjiskip_shrink=1 }, + [1] = { 0, 0, 0, kanjiskip_shrink=1 }, + [2] = { 0, 0, 0, kanjiskip_stretch=1, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [5] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, + [7] = { 0, 0, 0, kanjiskip_shrink=1 }, + [8] = { 0, 0, 0, kanjiskip_shrink=1 }, } }, @@ -59,16 +56,15 @@ luatexja.jfont.define_jfm { width = 0.5, height = 0.50, depth = 0.50, italic=0.0, glue = { -- 3 は四分, 2, 4, 9 は0, あとは0.5 - [0] = { 0.5 , 0.0, 0.5, 0, -1 }, - [1] = { 0.5 , 0.0, 0.5, 0, -1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [5] = { 0.5 , 0.0, 0.5, 0, -1 }, - [6] = { 0.5 , 0.0, 0.5, 0, -1 }, - [7] = { 0.5 , 0.0, 0.5, 0, -1 }, - [8] = { 0.5 , 0.0, 0.5, 0, -1 }, - [9] = {0, 0, 0}, + [0] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [1] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [5] = { 0.5 , 0.0, 0.5, rario=0, kanjiskip_stretch=1 }, + [6] = { 0.5 , 0.0, 0.5, rario=0, kanjiskip_stretch=1 }, + [7] = { 0.5 , 0.0, 0.5, rario=0, kanjiskip_stretch=1 }, + [8] = { 0.5 , 0.0, 0.5, rario=0, kanjiskip_stretch=1 }, } }, @@ -79,16 +75,15 @@ luatexja.jfont.define_jfm { --end_stretch = 0.25, glue = { -- 3 のみ 0.5,あとは0.25 - [0] = { 0.25, 0.0, 0.25, 1, 1 }, - [1] = { 0.25, 0.0, 0.25, 1, 1 }, - [2] = { 0.25, 0.0, 0.25, 1, 1 }, - [3] = { 0.5 , 0.0, 0.25 , 1, 0 }, - [4] = { 0.25, 0.0, 0.25, 1, 1 }, - [5] = { 0.25, 0.0, 0.25, 1, 1 }, - [6] = { 0.25, 0.0, 0.25, 1, 1 }, - [7] = { 0.25, 0.0, 0.25, 1, 1 }, - [8] = { 0.25, 0.0, 0.25, 1, 1 }, - [9] = { 0.25, 0.0, 0.25, 1, 1 }, + [0] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [1] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [2] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [3] = { 0.5 , 0.0, 0.25, priority=1 }, + [4] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [5] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [6] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [7] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [8] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, } }, @@ -98,14 +93,13 @@ luatexja.jfont.define_jfm { width = 0.5, height = 0.50, depth = 0.50, italic=0.0, glue = { -- 3 は.75, 2, 4 は0, あとは0.5 - [0] = { 0.5 , 0.0, 0.5, 0, -1 }, - [1] = { 0.5 , 0.0, 0.5, 0, -1 }, - [3] = { 0.75, 0.0, 0.25, 1, -1/3 }, - [5] = { 0.5 , 0.0, 0.5, 0, -1 }, - [6] = { 0.5 , 0.0, 0.5, 0, -1 }, - [7] = { 0.5 , 0.0, 0.5, 0, -1 }, - [8] = { 0.5 , 0.0, 0.5, 0, -1 }, - [9] = { 0.5 , 0.0, 0.5, 0, -1 }, + [0] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [1] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [3] = { 0.75, 0.0, 0.25, priority=1, ratio=1./3, kanjiskip_stretch=1 }, + [5] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [6] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [7] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, + [8] = { 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1 }, } }, @@ -114,12 +108,11 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.50, depth = 0.50, italic=0.0, glue = { - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [9] = {0, 0, 0}, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, }, kern = { [5] = 0.0 @@ -131,15 +124,14 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.50, depth = 0.50, italic=0.0, glue = { - [0] = { 1.0 , 0.0, 0.5, 0, 1 }, - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.75, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [7] = { 0.5 , 0.0, 0.5, 0, 1 }, - [8] = {0, 0, 0}, - [9] = {0, 0, 0}, + [0] = { 1.0 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.75, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, + [7] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [8] = { 0, 0, 0, kanjiskip_shrink=1 }, }, kern = { [5] = 0.0 @@ -171,14 +163,13 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 0.5, height = 0.5, depth = 0.5, italic=0.0, glue = { - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [7] = {0, 0, 0}, - [8] = {0, 0, 0}, - [9] = {0, 0, 0}, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, + [7] = { 0, 0, 0, kanjiskip_shrink=1 }, + [8] = { 0, 0, 0, kanjiskip_shrink=1 }, } }, @@ -204,12 +195,11 @@ luatexja.jfont.define_jfm { align = 'left', left = 0.0, down = 0.0, width = 1.0, height = 0.50, depth = 0.50, italic=0.0, glue = { - [1] = { 0.5 , 0.0, 0.5, 0, 1 }, - [2] = {0, 0, 0}, - [3] = { 0.25, 0.0, 0.25, 1, 1 }, - [4] = {0, 0, 0}, - [6] = {0, 0, 0}, - [9] = {0, 0, 0}, + [1] = { 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 }, + [2] = { 0, 0, 0, kanjiskip_shrink=1 }, + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, + [4] = { 0, 0, 0, kanjiskip_shrink=1 }, + [6] = { 0, 0, 0, kanjiskip_shrink=1 }, }, kern = { [8] = 0.0 @@ -219,7 +209,7 @@ luatexja.jfont.define_jfm { [99] = { -- box末尾 chars = {'boxbdd', 'parbdd'}, glue = { - [3] = { 0.25, 0.0, 0.25, 1 }, + [3] = { 0.25, 0.0, 0.25, priority=1 }, } }, diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua index 1bceda3cce2..84f75b9509d 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua @@ -107,6 +107,9 @@ local function get_total_stretched(p, line) local total = 0 for q in node_traverse_id(id_glue, getlist(p)) do local a, ic = get_stretched(q, go, gs), get_attr_icflag(q) + if ic == KANJI_SKIP_JFM then ic = KANJI_SKIP + elseif ic == XKANJI_SKIP_JFM then ic = XKANJI_SKIP + end if type(res[ic]) == 'number' then -- kanjiskip, xkanjiskip は段落内で spec を共有しているが, -- それはここでは望ましくないので,各 glue ごとに異なる spec を使う. @@ -124,8 +127,6 @@ local function get_total_stretched(p, line) gs_used_line[qs] = line end end - elseif ic == KANJI_SKIP_JFM then ic = KANJI_SKIP - elseif ic == XKANJI_SKIP_JFM then ic = XKANJI_SKIP end res[ic], total = res[ic] + a, total + a else @@ -137,7 +138,9 @@ end local function clear_stretch(p, ic, name) for q in node_traverse_id(id_glue, getlist(p)) do - if get_attr_icflag(q) == ic then + local f = get_attr_icflag(q) + if (f == ic) or ((ic ==KANJI_SKIP) and (f == KANJI_SKIP_JFM)) + or ((ic ==XKANJI_SKIP) and (f == XKANJI_SKIP_JFM)) then local qs = getfield(q, 'spec') if getfield(qs, 'writable') then setfield(qs, name..'_order', 0) diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua index 3a7101e827d..7c5ba8661aa 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua @@ -296,9 +296,13 @@ local function calc_np_pbox(lp, last) Np.first = Np.first or lp; Np.id = id_pbox set_attr(lp, attr_icflag, get_attr_icflag(lp)); while lp ~=last and (lpa>=PACKED) and (lpa<BOXBDD) do - if getid(lp)==id_hlist or getid(lp)==id_vlist then + local lpi = getid(lp) + if lpi==id_hlist or lpi==id_vlist then head, lp, nc = ltjd_make_dir_whatsit(head, lp, list_dir, 'jfm pbox') Np.first = first and nc or Np.first + elseif (lpi==id_rule) and (lpa==PACKED) then + lp = node_next(lp) + nc, lp = lp, node_next(lp) else nc, lp = lp, node_next(lp) end @@ -319,9 +323,9 @@ local function calc_np_aux_glyph_common(lp) Np.first= (Np.first or lp) if getfield(lp, 'lang') == lang_ja then Np.id = id_jglyph - local m, cls = set_np_xspc_jachar(Np, lp) + local m, mc, cls = set_np_xspc_jachar(Np, lp) local npi, npf - lp, head, npi, npf = capsule_glyph(lp, m, cls, head, tex_dir, lp) + lp, head, npi, npf = capsule_glyph(lp, m, mc[cls], head, tex_dir) Np.first = (Np.first~=Np.nuc) and Np.first or npf or npi Np.nuc = npi return true, check_next_ickern(lp); @@ -567,6 +571,7 @@ do c = c or c_glyph local cls = slow_find_char_class(c, m, c_glyph) Nx.met, Nx.class, Nx.char = m, cls, c; + local mc = m.char_type; Nx.char_type = mc if cls~=0 then set_attr(x, attr_jchar_class, cls) end if c~=c_glyph then set_attr(x, attr_jchar_code, c) end Nx.pre = table_current_stack[PRE + c] or 0 @@ -574,12 +579,13 @@ do Nx.xspc = table_current_stack[XSP + c] or 3 Nx.kcat = table_current_stack[KCAT + c] or 0 Nx.auto_kspc, Nx.auto_xspc = (has_attr(x, attr_autospc)==1), (has_attr(x, attr_autoxspc)==1) - return m, cls + return m, mc, cls end function set_np_xspc_jachar_hbox(Nx, x) local m = ltjf_font_metric_table[getfont(x)] local c = has_attr(x, attr_jchar_code) or getchar(x) Nx.met, Nx.char = m, c; Nx.class = has_attr(x, attr_jchar_class) or 0; + local mc = m.char_type; Nx.char_type = mc Nx.pre = table_current_stack[PRE + c] or 0 Nx.post = table_current_stack[POST + c] or 0 Nx.xspc = table_current_stack[XSP + c] or 3 @@ -682,20 +688,20 @@ local function handle_penalty_suppress(post, pre, g) end -- 和文文字間の JFM glue を node 化 -local function new_jfm_glue(m, bc, ac) +local function new_jfm_glue(mc, bc, ac) -- bc, ac: char classes - local g = m.char_type[bc][ac] + local g = mc[bc][ac] if g then if g[1] then local f = node_new(id_glue) - set_attr(f, attr_icflag, g[4]) + set_attr(f, attr_icflag, g.priority) setfield(f, 'spec', node_copy(g[2])) - return f, g[3] + return f, g.ratio, g.kanjiskip_natural, g.kanjiskip_stretch, g.kanjiskip_shrink else - return node_copy(g[2]), g[3] + return node_copy(g[2]), g.ratio, false, false, false end end - return nil, 0 + return false, 0 end -- Nq.last (kern w) .... (glue/kern g) Np.first @@ -708,50 +714,6 @@ end -------------------- 和文文字間空白量の決定 -local null_skip_table = {0, 0, 0} --- get kanjiskip -local get_kanjiskip -local get_kanjiskip_normal, get_kanjiskip_jfm -do - local KANJI_SKIP = luatexja.icflag_table.KANJI_SKIP - local KANJI_SKIP_JFM = luatexja.icflag_table.KANJI_SKIP_JFM - get_kanjiskip_normal = function () - if Np.auto_kspc or Nq.auto_kspc then - return node_copy(kanji_skip) - else - local g = node_copy(zero_glue) - set_attr(g, attr_icflag, KANJI_SKIP) - return g - end - end - - get_kanjiskip_jfm = function () - local g - if Np.auto_kspc or Nq.auto_kspc then - g = node_new(id_glue); --copy_attr(g, Nq.nuc) - local gx = node_new(id_glue_spec); - setfield(gx, 'stretch_order', 0); setfield(gx, 'shrink_order', 0) - local pm, qm = Np.met, Nq.met - local bk = qm.kanjiskip or null_skip_table - if (pm.char_type==qm.char_type) and (qm.var==pm.var) then - setfield(gx, 'width', bk[1]) - setfield(gx, 'stretch', bk[2]) - setfield(gx, 'shrink', bk[3]) - else - local ak = pm.kanjiskip or null_skip_table - setfield(gx, 'width', round(diffmet_rule(bk[1], ak[1]))) - setfield(gx, 'stretch', round(diffmet_rule(bk[2], ak[2]))) - setfield(gx, 'shrink', -round(diffmet_rule(-bk[3], -ak[3]))) - end - setfield(g, 'spec', gx) - else - g = node_copy(zero_glue) - end - set_attr(g, attr_icflag, KANJI_SKIP_JFM) - return g - end -end - local calc_ja_ja_aux do local bg_ag = 2*id_glue - id_glue @@ -759,12 +721,13 @@ do local bk_ag = 2*id_kern - id_glue local bk_ak = 2*id_kern - id_kern - calc_ja_ja_aux = function (gb,ga, db, da) - local rbb, rab = 0.5*(1-db), 0.5*(1-da) -- 「前の文字」由来のグルーの割合 - local rba, raa = 0.5*(1+db), 0.5*(1+da) -- 「前の文字」由来のグルーの割合 + local function blend_diffmet(b, a, rb, ra) + return round(diffmet_rule((1-rb)*b+rb*a, (1-ra)*b+ra*a)) + end + calc_ja_ja_aux = function (gb, ga, db, da) if diffmet_rule ~= math.two_pleft and diffmet_rule ~= math.two_pright and diffmet_rule ~= math.two_paverage then - rbb, rab, rba, raa = 1,0,0,1 + db, da = 0, 1 end if not gb then if ga then @@ -778,126 +741,234 @@ do if k == bg_ag then local bs, as = getfield(gb, 'spec'), getfield(ga, 'spec') -- 両方とも glue. - local bd, ad = getfield(bs, 'width'), getfield(as, 'width') - setfield(bs, 'width', round(diffmet_rule(rbb*bd + rba*ad, rab*bd + raa*ad))) - bd, ad = getfield(bs, 'stretch'), getfield(as, 'stretch') - setfield(bs, 'stretch', round(diffmet_rule(rbb*bd + rba*ad, rab*bd + raa*ad))) - bd, ad = getfield(bs, 'shrink'), getfield(as, 'shrink') - setfield(bs, 'shrink', -round(diffmet_rule(-rbb*bd - rba*ad, -rab*bd - raa*ad))) + setfield(bs, 'width', blend_diffmet( + getfield(bs, 'width'), getfield(as, 'width'), db, da)) + setfield(bs, 'stretch', blend_diffmet( + getfield(bs, 'stretch'), getfield(as, 'stretch'), db, da)) + setfield(bs, 'shrink', -blend_diffmet( + -getfield(bs, 'shrink'), -getfield(as, 'shrink'), db, da)) node_free(ga) return gb elseif k == bk_ak then -- 両方とも kern. - local bd, ad = getfield(gb, 'kern'), getfield(ga, 'kern') - setfield(gb, 'kern', round(diffmet_rule(rbb*bd + rba*ad, rab*bd + raa*ad))) + setfield(gb, 'kern', blend_diffmet( + getfield(gb, 'kern'), getfield(ga, 'kern'), db, da)) node_free(ga) return gb elseif k == bk_ag then local as = getfield(ga, 'spec') -- gb: kern, ga: glue - local bd, ad = getfield(gb, 'kern'), getfield(as, 'width') - setfield(as, 'width', round(diffmet_rule(rbb*bd + rba*ad, rab*bd + raa*ad))) - ad = getfield(as, 'stretch') - setfield(bs, 'stretch', round(diffmet_rule(rba*ad, raa*ad))) - ad = getfield(as, 'shrink') - setfield(bs, 'shrink', -round(diffmet_rule(-rba*ad, -raa*ad))) + setfield(as, 'width', blend_diffmet( + getfield(gb, 'kern'), getfield(as, 'width'), db, da)) + setfield(as, 'stretch', blend_diffmet( + 0, getfield(as, 'stretch'), db, da)) + setfield(as, 'shrink', -blend_diffmet( + 0, -getfield(as, 'shrink'), db, da)) node_free(gb) - return ga + return ga, 0, 0, 0 else local bs = getfield(gb, 'spec') -- gb: glue, ga: kern - local bd, ad = getfield(bs, 'width'), getfield(ga, 'kern') - setfield(bs, 'width', round(diffmet_rule(rbb*bd + rba*ad, rab*bd + raa*ad))) - bd = getfield(bs, 'stretch') - setfield(bs, 'stretch', round(diffmet_rule(rbb*bd, rab*bd))) - bd = getfield(bs, 'shrink') - setfield(bs, 'shrink', -round(diffmet_rule(-rbb*bd, -rab*bd))) + setfield(bs, 'width', blend_diffmet( + getfield(bs, 'width'), getfield(ga, 'kern'), db, da)) + setfield(bs, 'stretch', blend_diffmet( + getfield(bs, 'stretch'), 0, db, da)) + setfield(bs, 'shrink', -blend_diffmet( + -getfield(bs, 'shrink'), 0, db, da)) node_free(ga) return gb end end end -local function calc_ja_ja_glue() - local qm, pm = Nq.met, Np.met - if (qm.char_type==pm.char_type) and (qm.var==pm.var) then - return new_jfm_glue(qm, Nq.class, Np.class) - else - local npn, nqn = Np.nuc, Nq.nuc - local gb, db = new_jfm_glue(qm, Nq.class, - slow_find_char_class(Np.char, - qm, getchar(npn))) - local ga, da = new_jfm_glue(pm, - slow_find_char_class(Nq.char, - pm, getchar(nqn)), - Np.class) - return calc_ja_ja_aux(gb, ga, db, da); +local null_skip_table = {0, 0, 0} +-- get kanjiskip +local get_kanjiskip, kanjiskip_jfm_flag +local calc_ja_ja_glue +do + local KANJI_SKIP = luatexja.icflag_table.KANJI_SKIP + local KANJI_SKIP_JFM = luatexja.icflag_table.KANJI_SKIP_JFM + + get_kanjiskip_low = function(flag, qm, bn, bp, bh) + if flag or (qm.with_kanjiskip and (bn or bp or bh)) then + if kanjiskip_jfm_flag then + local g = node_new(id_glue); + local gx = node_new(id_glue_spec); + setfield(gx, 'stretch_order', 0); setfield(gx, 'shrink_order', 0) + local bk = qm.kanjiskip or null_skip_table + setfield(gx, 'width', bn and (bn*bk[1]) or 0) + setfield(gx, 'stretch', bp and (bp*bk[2]) or 0) + setfield(gx, 'shrink', bh and (bh*bk[3]) or 0) + setfield(g, 'spec', gx) + set_attr(g, attr_icflag, KANJI_SKIP_JFM) + return g + elseif flag then + return node_copy(kanji_skip) + else + local g = node_new(id_glue); + local gx = node_new(id_glue_spec); + setfield(gx, 'stretch_order', 0); setfield(gx, 'shrink_order', 0) + local ks = getfield(kanji_skip, 'spec') + setfield(gx, 'width', bn and (bn*getfield(ks, 'width')) or 0) + setfield(gx, 'stretch', bp and (bp*getfield(ks, 'stretch')) or 0) + setfield(gx, 'shrink', bh and (bh*getfield(ks, 'shrink')) or 0) + setfield(g, 'spec', gx) + set_attr(g, attr_icflag, KANJI_SKIP_JFM) + return g + end + end + end + + get_kanjiskip = function() + if Np.auto_kspc or Nq.auto_kspc then + local pm, qm = Np.met, Nq.met + if (pm.char_type==qm.char_type) and (qm.var==pm.var) then + return get_kanjiskip_low(true, qm, 1, 1, 1) + else + local gb = get_kanjiskip_low(true, qm, 1, 1, 1) + local ga = get_kanjiskip_low(true, pm, 1, 1, 1) + return calc_ja_ja_aux(gb, ga, 0, 1) + end + else + local g = node_copy(zero_glue) + set_attr(g, attr_icflag, kanjiskip_jfm_flag and KANJI_SKIP_JFM or KANJI_SKIP) + return g + end + end + + calc_ja_ja_glue = function () + local qm, pm = Nq.met, Np.met + local qmc, pmc = qm.char_type, pm.char_type + if (qmc==pmc) and (qm.var==pm.var) then + local g, _, kn, kp, kh = new_jfm_glue(qmc, Nq.class, Np.class) + return g, (Np.auto_kspc or Nq.auto_kspc) and get_kanjiskip_low(false, qm, kn, kp, kh) + else + local npn, nqn = Np.nuc, Nq.nuc + local gb, db, bn, bp, bh + = new_jfm_glue(qmc, Nq.class, + slow_find_char_class(Np.char, + qm, getchar(npn))) + local ga, da, an, ap, ah + = new_jfm_glue(pmc, + slow_find_char_class(Nq.char, + pm, getchar(nqn)), + Np.class) + local g = calc_ja_ja_aux(gb, ga, db, da) + local k + if (pmc==qmc) and (qm.var==pm.var) then + gb = get_kanjiskip_low(false, qm, bn, bp, bh) + ga = get_kanjiskip_low(false, pm, an, ap, ah) + k = calc_ja_ja_aux(gb, ga, db, da) + end + return g, k + end end end -------------------- 和欧文間空白量の決定 -- get xkanjiskip -local get_xkanjiskip +local get_xkanjiskip, xkanjiskip_jfm_flag local get_xkanjiskip_normal, get_xkanjiskip_jfm do local XKANJI_SKIP = luatexja.icflag_table.XKANJI_SKIP local XKANJI_SKIP_JFM = luatexja.icflag_table.XKANJI_SKIP_JFM - get_xkanjiskip_normal = function (Nn) - if (Nq.xspc>=2) and (Np.xspc%2==1) and (Nq.auto_xspc or Np.auto_xspc) then - return node_copy(xkanji_skip) - else - local g = node_copy(zero_glue) - set_attr(g, attr_icflag, XKANJI_SKIP) - return g + + get_xkanjiskip_low = function(flag, qm, bn, bp, bh) + if flag or (qm.with_kanjiskip and (bn or bp or bh)) then + if xkanjiskip_jfm_flag then + local g = node_new(id_glue); + local gx = node_new(id_glue_spec); + setfield(gx, 'stretch_order', 0); setfield(gx, 'shrink_order', 0) + local bk = qm.xkanjiskip or null_skip_table + setfield(gx, 'width', bn and bk[1] or 0) + setfield(gx, 'stretch', bp and bk[2] or 0) + setfield(gx, 'shrink', bh and bk[3] or 0) + setfield(g, 'spec', gx) + set_attr(g, attr_icflag, XKANJI_SKIP_JFM) + return g + elseif flag then + return node_copy(xkanji_skip) + else + local g = node_new(id_glue); + local gx = node_new(id_glue_spec); + setfield(gx, 'stretch_order', 0); setfield(gx, 'shrink_order', 0) + local ks = getfield(xkanji_skip, 'spec') + setfield(gx, 'width', bn and getfield(ks, 'width') or 0) + setfield(gx, 'stretch', bp and getfield(ks, 'stretch') or 0) + setfield(gx, 'shrink', bh and getfield(ks, 'shrink') or 0) + setfield(g, 'spec', gx) + set_attr(g, attr_icflag, XKANJI_SKIP_JFM) + return g + end end end - get_xkanjiskip_jfm = function (Nn) - local g + + get_xkanjiskip = function(Nn) if (Nq.xspc>=2) and (Np.xspc%2==1) and (Nq.auto_xspc or Np.auto_xspc) then - g = node_new(id_glue) - local gx = node_new(id_glue_spec); - setfield(gx, 'stretch_order', 0); setfield(gx, 'shrink_order', 0) - local bk = Nn.met.xkanjiskip or null_skip_table - setfield(gx, 'width', bk[1]) - setfield(gx, 'stretch', bk[2]) - setfield(gx, 'shrink', bk[3]) - setfield(g, 'spec', gx) + return get_xkanjiskip_low(true, Nn.met, 1, 1, 1) else - g = node_copy(zero_glue) + local g = node_copy(zero_glue) + set_attr(g, attr_icflag, xkanjiskip_jfm_flag and XKANJI_SKIP_JFM or XKANJI_SKIP) + return g end - set_attr(g, attr_icflag, XKANJI_SKIP_JFM) - return g end end -------------------- 隣接した「塊」間の処理 -local function get_OA_skip() +local function get_OA_skip(is_kanji) local pm = Np.met - return new_jfm_glue(pm, - fast_find_char_class((Nq.id == id_math and -1 or 'jcharbdd'), pm), Np.class) + local g, _, kn, kp, kh = new_jfm_glue( + pm.char_type, + fast_find_char_class((Nq.id == id_math and -1 or 'jcharbdd'), pm), + Np.class) + local k + if is_kanji==0 then + k = (Np.auto_kspc or Nq.auto_kspc) and get_kanjiskip_low(false, pm, kn, kp, kh) + elseif is_kanji==1 then + k = ((Nq.xspc>=2) and (Np.xspc%2==1) and (Nq.auto_xspc or Np.auto_xspc)) + and get_xkanjiskip_low(false, pm, kn, kp, kh) + end + return g, k end -local function get_OB_skip() +local function get_OB_skip(is_kanji) local qm = Nq.met - return new_jfm_glue(qm, Nq.class, - fast_find_char_class((Np.id == id_math and -1 or'jcharbdd'), qm)) + local g, _, kn, kp, kh = new_jfm_glue( + qm.char_type, Nq.class, + fast_find_char_class((Np.id == id_math and -1 or'jcharbdd'), qm)) + local k + if is_kanji==0 then + k = (Np.auto_kspc or Nq.auto_kspc) and get_kanjiskip_low(false, qm, kn, kp, kh) + elseif is_kanji==1 then + k = ((Nq.xspc>=2) and (Np.xspc%2==1) and (Nq.auto_xspc or Np.auto_xspc)) + and get_xkanjiskip_low(false, qm, kn, kp, kh) + end + return g, k end -- (anything) .. jachar local function handle_np_jachar(mode) local qid = Nq.id if qid==id_jglyph or ((qid==id_pbox or qid==id_pbox_w) and Nq.met) then - local g = non_ihb_flag and calc_ja_ja_glue() or get_kanjiskip() -- M->K - handle_penalty_normal(Nq.post, Np.pre, g); real_insert(g) + local g, k + if non_ihb_flag then g, k = calc_ja_ja_glue() end -- M->K + if not g then g = get_kanjiskip() end + handle_penalty_normal(Nq.post, Np.pre, g); + real_insert(g); real_insert(k) elseif Nq.met then -- qid==id_hlist - local g = non_ihb_flag and get_OA_skip() or get_kanjiskip() -- O_A->K - handle_penalty_normal(0, Np.pre, g); real_insert(g) + local g, k + if non_ihb_flag then g, k = get_OA_skip(0) end -- O_A->K + if not g then g = get_kanjiskip() end + handle_penalty_normal(0, Np.pre, g); real_insert(g); real_insert(k) elseif Nq.pre then - local g = non_ihb_flag and get_OA_skip() or get_xkanjiskip(Np) -- O_A->X - handle_penalty_normal((qid==id_hlist and 0 or Nq.post), Np.pre, g); real_insert(g) + local g, k + if non_ihb_flag then g, k = get_OA_skip(1) end -- O_A->X + if not g then g = get_xkanjiskip(Np) end + handle_penalty_normal((qid==id_hlist and 0 or Nq.post), Np.pre, g); + real_insert(g); real_insert(k) else - local g = non_ihb_flag and get_OA_skip() -- O_A + local g = non_ihb_flag and (get_OA_skip()) -- O_A if qid==id_glue then handle_penalty_normal(0, Np.pre, g) elseif qid==id_kern then handle_penalty_suppress(0, Np.pre, g) else handle_penalty_always(0, Np.pre, g) @@ -913,10 +984,10 @@ end -- jachar .. (anything) local function handle_nq_jachar() if Np.pre then - local g = non_ihb_flag and get_OB_skip() or get_xkanjiskip(Nq) -- O_B->X + local g = non_ihb_flag and get_OB_skip(1) or get_xkanjiskip(Nq) -- O_B->X handle_penalty_normal(Nq.post, (Np.id==id_hlist and 0 or Np.pre), g); real_insert(g) else - local g =non_ihb_flag and get_OB_skip() -- O_B + local g =non_ihb_flag and (get_OB_skip()) -- O_B if Np.id==id_glue then handle_penalty_normal(Nq.post, 0, g) elseif Np.id==id_kern then handle_penalty_suppress(Nq.post, 0, g) else handle_penalty_always(Nq.post, 0, g) @@ -929,7 +1000,7 @@ end local function handle_np_ja_hlist() local qid = Nq.id if qid==id_jglyph or ((qid==id_pbox or Nq.id == id_pbox_w) and Nq.met) then - local g = non_ihb_flag and get_OB_skip() or get_kanjiskip() -- O_B->K + local g = non_ihb_flag and get_OB_skip(0) or get_kanjiskip() -- O_B->K handle_penalty_normal(Nq.post, 0, g); real_insert(g) elseif Nq.met then -- Nq.id==id_hlist local g = get_kanjiskip() -- K @@ -987,7 +1058,7 @@ local function handle_list_tail(mode) -- the current list is the contents of a hbox local npi, pm = Np.id, Np.met if npi == id_jglyph or (npi==id_pbox and pm) then - local g = new_jfm_glue(pm, Np.class, fast_find_char_class('boxbdd', pm)) + local g = new_jfm_glue(pm.char_type, Np.class, fast_find_char_class('boxbdd', pm)) if g then set_attr(g, attr_icflag, BOXBDD) head = insert_after(head, Np.last, g) @@ -1001,7 +1072,7 @@ local function handle_list_head(par_indented) local npi, pm = Np.id, Np.met if npi == id_jglyph or (npi==id_pbox and pm) then if non_ihb_flag then - local g = new_jfm_glue(pm, fast_find_char_class(par_indented, pm), Np.class) + local g = new_jfm_glue(pm.char_type, fast_find_char_class(par_indented, pm), Np.class) if g then set_attr(g, attr_icflag, BOXBDD) if getid(g)==id_glue and #Bp==0 then @@ -1054,16 +1125,14 @@ do kanji_skip = node_new(id_glue); set_attr(kanji_skip, attr_icflag, KANJI_SKIP) local s = skip_table_to_spec(KSK) setfield(kanji_skip, 'spec', s) - get_kanjiskip = (getfield(s, 'width') == 1073741823) - and get_kanjiskip_jfm or get_kanjiskip_normal + kanjiskip_jfm_flag = (getfield(s, 'width') == 1073741823) end do xkanji_skip = node_new(id_glue); set_attr(xkanji_skip, attr_icflag, XKANJI_SKIP) local s = skip_table_to_spec(XSK) setfield(xkanji_skip, 'spec', s) - get_xkanjiskip = (getfield(s, 'width') == 1073741823) - and get_xkanjiskip_jfm or get_xkanjiskip_normal + xkanjiskip_jfm_flag = (getfield(s, 'width') == 1073741823) end if mode then @@ -1088,7 +1157,8 @@ local ensure_tex_attr = ltjb.ensure_tex_attr local function cleanup(mode, TEMP) -- adjust attr_icflag for avoiding error if tex.getattribute(attr_icflag)~=0 then ensure_tex_attr(attr_icflag, 0) end - node_free(kanji_skip); node_free(xkanji_skip); node_free(TEMP) + node_free(kanji_skip); + node_free(xkanji_skip); node_free(TEMP) if mode then local h = node_next(head) diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua index 394e83b1148..3e4e0b1522c 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua @@ -48,10 +48,20 @@ font_metric_table={} -- [font number] -> jfm_name, jfm_var, size luatexbase.create_callback("luatexja.load_jfm", "data", function (ft, jn) return ft end) -local jfm_file_name, jfm_var +local jfm_file_name, jfm_var, jfm_ksp local defjfm_res local jfm_dir, is_def_jfont, is_vert_enabled +local function norm_val(a) + if (not a) or (a==0.) then + return nil + elseif a==true then + return 1 + else + return a + end +end + function define_jfm(t) local real_char -- Does current character class have the 'real' character? if t.dir~=jfm_dir then @@ -64,16 +74,13 @@ function define_jfm(t) if type(i) == 'number' then -- char_type if not v.chars then if i ~= 0 then defjfm_res= nil; return end - real_char = true else - real_char = false for j,w in pairs(v.chars) do if type(w) == 'number' and w~=-1 then - real_char = true; elseif type(w) == 'string' and utf.len(w)==1 then - real_char = true; w = utf.byte(w) + w = utf.byte(w) elseif type(w) == 'string' and utf.len(w)==2 and utf.sub(w,2) == '*' then - real_char = true; w = utf.byte(utf.sub(w,1,1)) + w = utf.byte(utf.sub(w,1,1)) end if not t.chars[w] then t.chars[w] = i @@ -81,44 +88,43 @@ function define_jfm(t) defjfm_res= nil; return end end - if type(v.align)~='string' then - v.align = 'left' -- left - end - if real_char then - if type(v.width)~='number' and v.width~='prop' then - defjfm_res= nil; return - else - if v.width=='prop' and jfm_dir=='tate' then - v.width = 1.0 - end - if type(v.height)~='number' then - v.height = 0.0 - end - if type(v.depth)~='number' then - v.depth = 0.0 - end - if type(v.italic)~='number' then - v.italic = 0.0 - end - if type(v.left)~='number' then - v.left = 0.0 - end - if type(v.down)~='number' then - v.down = 0.0 - end - end - end v.chars = nil end + if type(v.align)~='string' then + v.align = 'left' -- left + end + if type(v.width)~='number' then + v.width = (jfm_dir=='tate') and 1.0 + end + if type(v.height)~='number' then + v.height = (jfm_dir=='tate') and 0.0 + end + if type(v.depth)~='number' then + v.depth = (jfm_dir=='tate') and 0.0 + end + if type(v.italic)~='number' then + v.italic = 0.0 + end + if type(v.left)~='number' then + v.left = 0.0 + end + if type(v.down)~='number' then + v.down = 0.0 + end v.kern = v.kern or {}; v.glue = v.glue or {} - for j in pairs(v.glue) do + for j,x in pairs(v.glue) do if v.kern[j] then defjfm_res= nil; return end + x.ratio, x[5] = (x.ratio or (x[5] and 0.5*(1+x[5]) or 0.5)), nil + x.priority, x[4] = (x.priority or x[4] or 0), nil + x.kanjiskip_natural = norm_val(x.kanjiskip_natural) + x.kanjiskip_stretch = norm_val(x.kanjiskip_stretch) + x.kanjiskip_shrink = norm_val(x.kanjiskip_shrink) end for j,x in pairs(v.kern) do if type(x)=='number' then - v.kern[j] = {x, 0} + v.kern[j] = {x, 0.5} elseif type(x)=='table' then - v.kern[j] = {x[1], x[2] or 0} + v.kern[j] = { x[1], ratio=x.ratio or (x[2] and 0.5*(1+x[2]) or 0.5) } end end t.char_type[i] = v @@ -147,7 +153,6 @@ do return new else return nil end end - update_jfm_cache = function (j,sz) if metrics[j].size_cache[sz] then return end --local TEMP = node_new(id_kern) @@ -161,7 +166,14 @@ do if type(i) == 'number' then -- char_type for k,w in pairs(v.glue) do local h = node_new(id_glue_spec) - v[k] = {true, h, (w[5] and w[5]/sz or 0), FROM_JFM + (w[4] and w[4]/sz or 0)} + v[k] = { + true, h, + ratio=w.ratio/sz, + priority=FROM_JFM + w.priority/sz, + kanjiskip_natural = w.kanjiskip_natural and w.kanjiskip_natural/sz, + kanjiskip_stretch = w.kanjiskip_stretch and w.kanjiskip_stretch/sz, + kanjiskip_shrink = w.kanjiskip_shrink and w.kanjiskip_shrink/sz, + } setfield(h, 'width', w[1]) setfield(h, 'stretch', w[2]) setfield(h, 'shrink', w[3]) @@ -173,7 +185,7 @@ do setfield(g, 'kern', w[1]) setfield(g, 'subtype', 1) set_attr(g, attr_icflag, FROM_JFM) - v[k] = {false, g, w[2]/sz} + v[k] = {false, g, ratio=w[2]/sz} end end v.glue, v.kern = nil, nil @@ -274,6 +286,7 @@ do local ad = identifiers[fn].parameters local sz = metrics[j].size_cache[f.size] local fmtable = { jfm = j, size = f.size, var = jfm_var, + with_kanjiskip = jfm_ksp, zw = sz.zw, zh = sz.zh, ascent = ad.ascender, descent = ad.descender, @@ -312,7 +325,7 @@ do -- extract jfm_file_name and jfm_var -- normalize position of 'jfm=' and 'jfmvar=' keys local function extract_metric(name) - jfm_file_name = ''; jfm_var = '' + jfm_file_name = ''; jfm_var = ''; jfm_ksp = true local tmp, index = name:sub(1, 5), 1 if tmp == 'file:' or tmp == 'name:' or tmp == 'psft:' then index = 6 @@ -350,8 +363,11 @@ do name = name .. 'jfmvar=' .. jfm_var end end + for x in string.gmatch (name, "[:;]([+%%-]?)ltjks") do + jfm_ksp = not (x=='-') + end if jfm_dir == 'tate' then - is_vert_enabled = (not name:match('-vert')) and (not name:match('-vrt2')) + is_vert_enabled = (not name:match('[:;]%-vert')) and (not name:match('[:;]%-vrt2')) if not name:match('vert') and not name:match('vrt2') then name = name .. ';vert;vrt2' end @@ -758,7 +774,7 @@ do local bx = font_extra_basename[bname].vkerns local lookuphash = id.resources.lookuphash local desc = id.shared.rawdata.descriptions - if bx then + if bx and lookuphash then for i,v in pairs(bx) do lookuphash[i] = lookuphash[i] or v for j,w in pairs(v) do diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua index 15813fc6440..3ea3d4c184c 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua @@ -152,7 +152,7 @@ function (p, sty) set_attr(r, attr_ykblshift, 0) -- ltj-setwidth 内で実際の位置補正はおこなうので,補正量を退避 local met = ltjf_font_metric_table[f] - r = capsule_glyph_math(r, met, ltjf_find_char_class(pc, met)); + r = capsule_glyph_math(r, met, met.char_type[ltjf_find_char_class(pc, met)]); setfield(q, 'head', r); node_free(p); p=q; set_attr(r, attr_yablshift, k) end diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua index 1d4da319e7d..acbe7543ee1 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua @@ -65,7 +65,7 @@ local ltjw = {} --export luatexja.setwidth = ltjw luatexbase.create_callback("luatexja.set_width", "data", - function (fstable, fmtable, jchar_class) + function (fstable, fmtable, char_data) return fstable end) local call_callback = luatexbase.call_callback @@ -75,22 +75,24 @@ local fshift = { down = 0, left = 0} local min, max = math.min, math.max -- 和文文字の位置補正(横) -local function capsule_glyph_yoko(p, met, class, head, dir) - local char_data = met.char_type[class] +local function capsule_glyph_yoko(p, met, char_data, head, dir) if not char_data then return node_next(p), head, p end - -- f*: whd specified in JFM - local fwidth, pwidth = char_data.width, getfield(p, 'width') - fwidth = (fwidth ~= 'prop') and fwidth or pwidth fshift.down = char_data.down; fshift.left = char_data.left - fshift = call_callback("luatexja.set_width", fshift, met, class) - local fheight, fdepth = char_data.height, char_data.depth + fshift = call_callback("luatexja.set_width", fshift, met, char_data) local kbl = has_attr(p, attr_ykblshift) or 0 -- + -- f*: whd specified in JFM + local fwidth, pwidth = char_data.width, getfield(p, 'width') + fwidth = fwidth or pwidth + local fheight, pheight = char_data.height, getfield(p, 'height') + fheight = fheight or pheight + local fdepth, pdepth = char_data.depth,getfield(p, 'depth') + fdepth = fdepth or pdepth if pwidth==fwidth then -- 補正後glyph node は ht: p.height - kbl - down, dp: p.depth + min(0, kbl+down) を持つ -- 設定されるべき寸法: ht: fheight - kbl, dp: fdepth + kbl - local ht_diff = fheight + fshift.down - getfield(p, 'height') - local dp_diff = fdepth + kbl - getfield(p, 'depth') - min(kbl + fshift.down, 0) + local ht_diff = fheight + fshift.down - pheight + local dp_diff = fdepth + kbl - pdepth - min(kbl + fshift.down, 0) if ht_diff == 0 and dp_diff ==0 then -- offset only set_attr(p, attr_icflag, PROCESSED) setfield(p, 'xoffset', getfield(p, 'xoffset') - fshift.left) @@ -104,7 +106,7 @@ local function capsule_glyph_yoko(p, met, class, head, dir) setfield(box, 'depth', fdepth + kbl) setfield(box, 'dir', dir) set_attr(box, attr_icflag, PACKED) - set_attr(p, attr_icflag, PACKED) + --set_attr(p, attr_icflag, PACKED) head = p and node_insert_before(head, p, box) or node_insert_after(head, node_tail(head), box) return node_next(p), head, p, box @@ -133,8 +135,7 @@ end luatexja.setwidth.capsule_glyph_yoko = capsule_glyph_yoko -- 和文文字の位置補正(縦) -local function capsule_glyph_tate(p, met, class, head, dir) - local char_data = met.char_type[class] +local function capsule_glyph_tate(p, met, char_data, head, dir) if not char_data then return node_next(p), head end local ascent, descent = met.ascent, met.descent local fwidth, pwidth = char_data.width @@ -148,11 +149,11 @@ local function capsule_glyph_tate(p, met, class, head, dir) pwidth = pwidth + (met.v_advance[pc] or 0) ascent = met.v_origin[pc] and ascent - met.v_origin[pc] or ascent end - fwidth = (fwidth ~= 'prop') and fwidth or pwidth + fwidth = fwidth or pwidth fshift.down = char_data.down; fshift.left = char_data.left - fshift = call_callback("luatexja.set_width", fshift, met, class) - local fheight, fdepth = char_data.height, char_data.depth - + fshift = call_callback("luatexja.set_width", fshift, met, char_data) + local fheight = char_data.height or 0 + local fdepth = char_data.depth or 0 local y_shift = getfield(p, 'xoffset') + (has_attr(p,attr_tkblshift) or 0) local q @@ -186,16 +187,15 @@ local function capsule_glyph_tate(p, met, class, head, dir) end luatexja.setwidth.capsule_glyph_tate = capsule_glyph_tate -local function capsule_glyph_math(p, met, class) - local char_data = met.char_type[class] +local function capsule_glyph_math(p, met, char_data) if not char_data then return nil end local fwidth, pwidth = char_data.width, getfield(p, 'width') fwidth = (fwidth ~= 'prop') and fwidth or pwidth fshift.down = char_data.down; fshift.left = char_data.left - fshift = call_callback("luatexja.set_width", fshift, met, class) + fshift = call_callback("luatexja.set_width", fshift, met, char_data) local fheight, fdepth = char_data.height, char_data.depth - local y_shift, ca - = - getfield(p, 'yoffset') + (has_attr(p,attr_ykblshift) or 0), char_data.align + local y_shift + = - getfield(p, 'yoffset') + (has_attr(p,attr_ykblshift) or 0) setfield(p, 'yoffset', -fshift.down) setfield(p, 'xoffset', getfield(p, 'xoffset') + char_data.align*(fwidth-pwidth) - fshift.left) local box = node_new(id_hlist); diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-unicode-ccfix.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-unicode-ccfix.lua index b071b226c55..430bb398555 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-unicode-ccfix.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-unicode-ccfix.lua @@ -1,183 +1,181 @@ -- Do not edit this file! --- Created from LineBreak.txt by ltj-unicode-ccfix_make.pl on 2015年 2月 12日 木曜日 13:36:49 JST. +-- Created from LineBreak.txt by ltj-unicode-ccfix_make.pl on 2015年 10月 24日 土曜日 16:45:46 JST. -- In case of errors, fix the Perl script instead. -if tex.getcatcode(0x6F22)==12 then - local tex_catcode = tex.setcatcode - local function set_letter(b,e) +local tex_catcode = tex.setcatcode +local tex_getcc = tex.getcatcode +local function set_letter(b,e) + if tex_getcc(b)~=11 then for i=b,e do tex_catcode('global', i, 11) end end - - set_letter(0x231A,0x231B) - set_letter(0x23F0,0x23F3) - set_letter(0x2600,0x2603) - set_letter(0x2614,0x2615) - set_letter(0x2618,0x2618) - set_letter(0x261A,0x261F) - set_letter(0x2639,0x263B) - set_letter(0x2668,0x2668) - set_letter(0x267F,0x267F) - set_letter(0x26BD,0x26C8) - set_letter(0x26CD,0x26CD) - set_letter(0x26CF,0x26D1) - set_letter(0x26D3,0x26D4) - set_letter(0x26D8,0x26D9) - set_letter(0x26DC,0x26DC) - set_letter(0x26DF,0x26E1) - set_letter(0x26EA,0x26EA) - set_letter(0x26F1,0x26F5) - set_letter(0x26F7,0x26FA) - set_letter(0x26FD,0x26FF) - set_letter(0x2700,0x2704) - set_letter(0x2708,0x270D) - set_letter(0x2E80,0x2E99) - set_letter(0x2E9B,0x2EF3) - set_letter(0x2F00,0x2FD5) - set_letter(0x2FF0,0x2FFB) - set_letter(0x3003,0x3003) - set_letter(0x3004,0x3004) - set_letter(0x3006,0x3006) - set_letter(0x3007,0x3007) - set_letter(0x3012,0x3013) - set_letter(0x3020,0x3020) - set_letter(0x3021,0x3029) - set_letter(0x3030,0x3030) - set_letter(0x3031,0x3034) - set_letter(0x3036,0x3037) - set_letter(0x3038,0x303A) - set_letter(0x303D,0x303D) - set_letter(0x303E,0x303F) - set_letter(0x3042,0x3042) - set_letter(0x3044,0x3044) - set_letter(0x3046,0x3046) - set_letter(0x3048,0x3048) - set_letter(0x304A,0x3062) - set_letter(0x3064,0x3082) - set_letter(0x3084,0x3084) - set_letter(0x3086,0x3086) - set_letter(0x3088,0x308D) - set_letter(0x308F,0x3094) - set_letter(0x309F,0x309F) - set_letter(0x30A2,0x30A2) - set_letter(0x30A4,0x30A4) - set_letter(0x30A6,0x30A6) - set_letter(0x30A8,0x30A8) - set_letter(0x30AA,0x30C2) - set_letter(0x30C4,0x30E2) - set_letter(0x30E4,0x30E4) - set_letter(0x30E6,0x30E6) - set_letter(0x30E8,0x30ED) - set_letter(0x30EF,0x30F4) - set_letter(0x30F7,0x30FA) - set_letter(0x30FF,0x30FF) - set_letter(0x3105,0x312D) - set_letter(0x3131,0x318E) - set_letter(0x3190,0x3191) - set_letter(0x3192,0x3195) - set_letter(0x3196,0x319F) - set_letter(0x31A0,0x31BA) - set_letter(0x31C0,0x31E3) - set_letter(0x3200,0x321E) - set_letter(0x3220,0x3229) - set_letter(0x322A,0x3247) - set_letter(0x3250,0x3250) - set_letter(0x3251,0x325F) - set_letter(0x3260,0x327F) - set_letter(0x3280,0x3289) - set_letter(0x328A,0x32B0) - set_letter(0x32B1,0x32BF) - set_letter(0x32C0,0x32FE) - set_letter(0x3300,0x33FF) - set_letter(0x3400,0x4DB5) - set_letter(0x4DB6,0x4DBF) - set_letter(0x4E00,0x9FCC) - set_letter(0x9FCD,0x9FFF) - set_letter(0xA000,0xA014) - set_letter(0xA016,0xA48C) - set_letter(0xA490,0xA4C6) - set_letter(0xF900,0xFA6D) - set_letter(0xFA6E,0xFA6F) - set_letter(0xFA70,0xFAD9) - set_letter(0xFADA,0xFAFF) - set_letter(0xFE30,0xFE30) - set_letter(0xFE31,0xFE32) - set_letter(0xFE33,0xFE34) - set_letter(0xFE45,0xFE46) - set_letter(0xFE49,0xFE4C) - set_letter(0xFE4D,0xFE4F) - set_letter(0xFE51,0xFE51) - set_letter(0xFE58,0xFE58) - set_letter(0xFE5F,0xFE61) - set_letter(0xFE62,0xFE62) - set_letter(0xFE63,0xFE63) - set_letter(0xFE64,0xFE66) - set_letter(0xFE68,0xFE68) - set_letter(0xFE6B,0xFE6B) - set_letter(0xFF02,0xFF03) - set_letter(0xFF06,0xFF07) - set_letter(0xFF0A,0xFF0A) - set_letter(0xFF0B,0xFF0B) - set_letter(0xFF0D,0xFF0D) - set_letter(0xFF0F,0xFF0F) - set_letter(0xFF10,0xFF19) - set_letter(0xFF1C,0xFF1E) - set_letter(0xFF20,0xFF20) - set_letter(0xFF21,0xFF3A) - set_letter(0xFF3C,0xFF3C) - set_letter(0xFF3E,0xFF3E) - set_letter(0xFF3F,0xFF3F) - set_letter(0xFF40,0xFF40) - set_letter(0xFF41,0xFF5A) - set_letter(0xFF5C,0xFF5C) - set_letter(0xFF5E,0xFF5E) - set_letter(0xFFE2,0xFFE2) - set_letter(0xFFE3,0xFFE3) - set_letter(0xFFE4,0xFFE4) - set_letter(0x1B000,0x1B001) - set_letter(0x1F000,0x1F02B) - set_letter(0x1F030,0x1F093) - set_letter(0x1F0A0,0x1F0AE) - set_letter(0x1F0B1,0x1F0BF) - set_letter(0x1F0C1,0x1F0CF) - set_letter(0x1F0D1,0x1F0F5) - set_letter(0x1F200,0x1F202) - set_letter(0x1F210,0x1F23A) - set_letter(0x1F240,0x1F248) - set_letter(0x1F250,0x1F251) - set_letter(0x1F300,0x1F32C) - set_letter(0x1F330,0x1F37D) - set_letter(0x1F380,0x1F39B) - set_letter(0x1F39E,0x1F3B4) - set_letter(0x1F3B7,0x1F3BB) - set_letter(0x1F3BD,0x1F3CE) - set_letter(0x1F3D4,0x1F3F7) - set_letter(0x1F400,0x1F49F) - set_letter(0x1F4A1,0x1F4A1) - set_letter(0x1F4A3,0x1F4A3) - set_letter(0x1F4A5,0x1F4AE) - set_letter(0x1F4B0,0x1F4B0) - set_letter(0x1F4B3,0x1F4FE) - set_letter(0x1F507,0x1F516) - set_letter(0x1F525,0x1F531) - set_letter(0x1F54A,0x1F54A) - set_letter(0x1F550,0x1F579) - set_letter(0x1F57B,0x1F5A3) - set_letter(0x1F5A5,0x1F5D3) - set_letter(0x1F5DC,0x1F5F3) - set_letter(0x1F5FA,0x1F5FF) - set_letter(0x1F600,0x1F642) - set_letter(0x1F645,0x1F64F) - set_letter(0x1F680,0x1F6CF) - set_letter(0x1F6E0,0x1F6EC) - set_letter(0x1F6F0,0x1F6F3) - set_letter(0x20000,0x2A6D6) - set_letter(0x2A6D7,0x2A6FF) - set_letter(0x2A700,0x2B734) - set_letter(0x2B735,0x2B73F) - set_letter(0x2B740,0x2B81D) - set_letter(0x2B81E,0x2F7FF) - set_letter(0x2F800,0x2FA1D) - set_letter(0x2FA1E,0x2FFFD) - set_letter(0x30000,0x3FFFD) - end - +set_letter(0x231A,0x231B) +set_letter(0x23F0,0x23F3) +set_letter(0x2600,0x2603) +set_letter(0x2614,0x2615) +set_letter(0x2618,0x2618) +set_letter(0x261A,0x261F) +set_letter(0x2639,0x263B) +set_letter(0x2668,0x2668) +set_letter(0x267F,0x267F) +set_letter(0x26BD,0x26C8) +set_letter(0x26CD,0x26CD) +set_letter(0x26CF,0x26D1) +set_letter(0x26D3,0x26D4) +set_letter(0x26D8,0x26D9) +set_letter(0x26DC,0x26DC) +set_letter(0x26DF,0x26E1) +set_letter(0x26EA,0x26EA) +set_letter(0x26F1,0x26F5) +set_letter(0x26F7,0x26FA) +set_letter(0x26FD,0x26FF) +set_letter(0x2700,0x2704) +set_letter(0x2708,0x270D) +set_letter(0x2E80,0x2E99) +set_letter(0x2E9B,0x2EF3) +set_letter(0x2F00,0x2FD5) +set_letter(0x2FF0,0x2FFB) +set_letter(0x3003,0x3003) +set_letter(0x3004,0x3004) +set_letter(0x3006,0x3006) +set_letter(0x3007,0x3007) +set_letter(0x3012,0x3013) +set_letter(0x3020,0x3020) +set_letter(0x3021,0x3029) +set_letter(0x3030,0x3030) +set_letter(0x3031,0x3034) +set_letter(0x3036,0x3037) +set_letter(0x3038,0x303A) +set_letter(0x303D,0x303D) +set_letter(0x303E,0x303F) +set_letter(0x3042,0x3042) +set_letter(0x3044,0x3044) +set_letter(0x3046,0x3046) +set_letter(0x3048,0x3048) +set_letter(0x304A,0x3062) +set_letter(0x3064,0x3082) +set_letter(0x3084,0x3084) +set_letter(0x3086,0x3086) +set_letter(0x3088,0x308D) +set_letter(0x308F,0x3094) +set_letter(0x309F,0x309F) +set_letter(0x30A2,0x30A2) +set_letter(0x30A4,0x30A4) +set_letter(0x30A6,0x30A6) +set_letter(0x30A8,0x30A8) +set_letter(0x30AA,0x30C2) +set_letter(0x30C4,0x30E2) +set_letter(0x30E4,0x30E4) +set_letter(0x30E6,0x30E6) +set_letter(0x30E8,0x30ED) +set_letter(0x30EF,0x30F4) +set_letter(0x30F7,0x30FA) +set_letter(0x30FF,0x30FF) +set_letter(0x3105,0x312D) +set_letter(0x3131,0x318E) +set_letter(0x3190,0x3191) +set_letter(0x3192,0x3195) +set_letter(0x3196,0x319F) +set_letter(0x31A0,0x31BA) +set_letter(0x31C0,0x31E3) +set_letter(0x3200,0x321E) +set_letter(0x3220,0x3229) +set_letter(0x322A,0x3247) +set_letter(0x3250,0x3250) +set_letter(0x3251,0x325F) +set_letter(0x3260,0x327F) +set_letter(0x3280,0x3289) +set_letter(0x328A,0x32B0) +set_letter(0x32B1,0x32BF) +set_letter(0x32C0,0x32FE) +set_letter(0x3300,0x33FF) +set_letter(0x3400,0x4DB5) +set_letter(0x4DB6,0x4DBF) +set_letter(0x4E00,0x9FD5) +set_letter(0x9FD6,0x9FFF) +set_letter(0xA000,0xA014) +set_letter(0xA016,0xA48C) +set_letter(0xA490,0xA4C6) +set_letter(0xF900,0xFA6D) +set_letter(0xFA6E,0xFA6F) +set_letter(0xFA70,0xFAD9) +set_letter(0xFADA,0xFAFF) +set_letter(0xFE30,0xFE30) +set_letter(0xFE31,0xFE32) +set_letter(0xFE33,0xFE34) +set_letter(0xFE45,0xFE46) +set_letter(0xFE49,0xFE4C) +set_letter(0xFE4D,0xFE4F) +set_letter(0xFE51,0xFE51) +set_letter(0xFE58,0xFE58) +set_letter(0xFE5F,0xFE61) +set_letter(0xFE62,0xFE62) +set_letter(0xFE63,0xFE63) +set_letter(0xFE64,0xFE66) +set_letter(0xFE68,0xFE68) +set_letter(0xFE6B,0xFE6B) +set_letter(0xFF02,0xFF03) +set_letter(0xFF06,0xFF07) +set_letter(0xFF0A,0xFF0A) +set_letter(0xFF0B,0xFF0B) +set_letter(0xFF0D,0xFF0D) +set_letter(0xFF0F,0xFF0F) +set_letter(0xFF10,0xFF19) +set_letter(0xFF1C,0xFF1E) +set_letter(0xFF20,0xFF20) +set_letter(0xFF21,0xFF3A) +set_letter(0xFF3C,0xFF3C) +set_letter(0xFF3E,0xFF3E) +set_letter(0xFF3F,0xFF3F) +set_letter(0xFF40,0xFF40) +set_letter(0xFF41,0xFF5A) +set_letter(0xFF5C,0xFF5C) +set_letter(0xFF5E,0xFF5E) +set_letter(0xFFE2,0xFFE2) +set_letter(0xFFE3,0xFFE3) +set_letter(0xFFE4,0xFFE4) +set_letter(0x1B000,0x1B001) +set_letter(0x1F000,0x1F02B) +set_letter(0x1F030,0x1F093) +set_letter(0x1F0A0,0x1F0AE) +set_letter(0x1F0B1,0x1F0BF) +set_letter(0x1F0C1,0x1F0CF) +set_letter(0x1F0D1,0x1F0F5) +set_letter(0x1F200,0x1F202) +set_letter(0x1F210,0x1F23A) +set_letter(0x1F240,0x1F248) +set_letter(0x1F250,0x1F251) +set_letter(0x1F300,0x1F39B) +set_letter(0x1F39E,0x1F3B4) +set_letter(0x1F3B7,0x1F3BB) +set_letter(0x1F3BD,0x1F3FA) +set_letter(0x1F400,0x1F49F) +set_letter(0x1F4A1,0x1F4A1) +set_letter(0x1F4A3,0x1F4A3) +set_letter(0x1F4A5,0x1F4AE) +set_letter(0x1F4B0,0x1F4B0) +set_letter(0x1F4B3,0x1F4FF) +set_letter(0x1F507,0x1F516) +set_letter(0x1F525,0x1F531) +set_letter(0x1F54A,0x1F579) +set_letter(0x1F57B,0x1F5A3) +set_letter(0x1F5A5,0x1F5D3) +set_letter(0x1F5DC,0x1F5F3) +set_letter(0x1F5FA,0x1F5FF) +set_letter(0x1F600,0x1F64F) +set_letter(0x1F680,0x1F6D0) +set_letter(0x1F6E0,0x1F6EC) +set_letter(0x1F6F0,0x1F6F3) +set_letter(0x1F910,0x1F918) +set_letter(0x1F980,0x1F984) +set_letter(0x1F9C0,0x1F9C0) +set_letter(0x20000,0x2A6D6) +set_letter(0x2A6D7,0x2A6FF) +set_letter(0x2A700,0x2B734) +set_letter(0x2B735,0x2B73F) +set_letter(0x2B740,0x2B81D) +set_letter(0x2B81E,0x2B81F) +set_letter(0x2B820,0x2CEA1) +set_letter(0x2CEA2,0x2F7FF) +set_letter(0x2F800,0x2FA1D) +set_letter(0x2FA1E,0x2FFFD) +set_letter(0x30000,0x3FFFD) diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjarticle.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjarticle.cls index 2f3f4a67069..a90b1e2d89f 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjarticle.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjarticle.cls @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjarticle} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja class] \RequirePackage{luatexja} \newcounter{@paper} @@ -168,8 +168,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} \renewcommand{\baselinestretch}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjbk10.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjbk10.clo index 80833ea86a0..eb605cc8bfd 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjbk10.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjbk10.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjbk10.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xpt{15}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjbk11.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjbk11.clo index 729d0eac73e..bdd9b97faec 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjbk11.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjbk11.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjbk11.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xipt{15.5}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjbk12.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjbk12.clo index ff4980227c1..e9ec2762030 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjbk12.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjbk12.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjbk12.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xiipt{16.5}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjbook.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjbook.cls index 753b02d3d42..8a474c34dfc 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjbook.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjbook.cls @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjbook} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja class] \RequirePackage{luatexja} \newcounter{@paper} @@ -176,8 +176,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} \renewcommand{\baselinestretch}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjreport.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjreport.cls index f439b665ab0..aa9a1de288c 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjreport.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjreport.cls @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjreport} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja class] \RequirePackage{luatexja} \newcounter{@paper} @@ -174,8 +174,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} \renewcommand{\baselinestretch}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls index e962e19c561..7d1101828ca 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjsarticle} - [2015/05/26 ] + [2015/10/18 ] \RequirePackage{luatexja} \newif\if@restonecol \newif\if@titlepage @@ -301,8 +301,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax \ifmingoth \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.924872] \ltj@stdmcfont:jfm=min}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls index 31c40552de3..4fdcca173eb 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjsbook} - [2015/05/26 ] + [2015/10/18 ] \RequirePackage{luatexja} \newif\if@restonecol \newif\if@titlepage @@ -308,8 +308,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax \ifmingoth \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.924872] \ltj@stdmcfont:jfm=min}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsize10.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjsize10.clo index 4928287507a..0598ed74cb4 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsize10.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsize10.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjsize10.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xpt{15}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsize11.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjsize11.clo index 5ad8b0b3f84..23e9b5cef21 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsize11.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsize11.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjsize11.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xipt{15.5}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsize12.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjsize12.clo index 12deafaae8d..15ea37b7b38 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsize12.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsize12.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjsize12.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xiipt{16.5}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls index e8bfdf3484b..0d1d4bb6f05 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjskiyou} - [2015/05/26 ] + [2015/10/18 ] \RequirePackage{luatexja} \newif\if@restonecol \newif\if@titlepage @@ -303,8 +303,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax \ifmingoth \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.924872] \ltj@stdmcfont:jfm=min}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls index a640f22b67d..e2e7849906b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjspf} - [2015/05/26 ] + [2015/10/18 ] \RequirePackage{luatexja} \newif\if@restonecol \newif\if@titlepage @@ -301,8 +301,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax \ifmingoth \DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.903375] \ltj@stdmcfont:jfm=min}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjtarticle.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjtarticle.cls index f8bab8b2cbe..228d6d330c3 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjtarticle.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjtarticle.cls @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjtarticle} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja class] \RequirePackage{luatexja} \newcounter{@paper} @@ -180,8 +180,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} \renewcommand{\baselinestretch}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjtbk10.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjtbk10.clo index 1ee1254ad28..4565ea46ae7 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjtbk10.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjtbk10.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjtbk10.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xpt{17}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjtbk11.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjtbk11.clo index 5963a1d1178..65c4594c033 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjtbk11.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjtbk11.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjtbk11.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xipt{17}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjtbk12.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjtbk12.clo index c8fe221d249..b5c89c433a8 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjtbk12.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjtbk12.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjtbk12.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xiipt{18}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjtbook.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjtbook.cls index 3527d1196a9..36d9a46d476 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjtbook.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjtbook.cls @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjtbook} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja class] \RequirePackage{luatexja} \newcounter{@paper} @@ -188,8 +188,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} \renewcommand{\baselinestretch}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjtreport.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjtreport.cls index 56727a81c76..312af11a1cb 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjtreport.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjtreport.cls @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjtreport} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja class] \RequirePackage{luatexja} \newcounter{@paper} @@ -186,8 +186,13 @@ \advance \@tempdima 2in \advance \@tempdimb 2in \fi -\setlength{\pdfpagewidth}{\@tempdima} -\setlength{\pdfpageheight}{\@tempdimb} +\ifdefined\pdfpagewidth + \setlength{\pdfpagewidth}{\@tempdima} + \setlength{\pdfpageheight}{\@tempdimb} +\else + \setlength{\pagewidth}{\@tempdima} + \setlength{\pageheight}{\@tempdimb} +\fi \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} \renewcommand{\baselinestretch}{} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjtsize10.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjtsize10.clo index 977f2ad9ecd..5eb5897a84b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjtsize10.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjtsize10.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjtsize10.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xpt{17}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjtsize11.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjtsize11.clo index 30c30e26473..706e5c66af1 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjtsize11.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjtsize11.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjtsize11.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xipt{17}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjtsize12.clo b/Master/texmf-dist/tex/luatex/luatexja/ltjtsize12.clo index f0e8ab4911f..e999c9e0569 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjtsize12.clo +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjtsize12.clo @@ -39,7 +39,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltjtsize12.clo} - [2015/01/01 v1.6-ltj-9 + [2015/10/18 v1.6-ltj-10 Standard LuaLaTeX-ja file (size option)] \renewcommand{\normalsize}{% \@setfontsize\normalsize\@xiipt{18}% diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty index 69c409836df..d55c37578e7 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty @@ -65,7 +65,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-core}[2015/05/17 Core of LuaTeX-ja] + \ProvidesPackage{luatexja-core}[2015/10/12 Core of LuaTeX-ja] \fi %</LaTeX> %% Load prerequisite packages. @@ -92,7 +92,7 @@ %% Check if LuaTeX is used \ltx@LocalExpandAfter\ifx\csname directlua\endcsname\relax % Loading is silently aborted, since the notice of the wrong - % engine is aldready shown in otfluaload. + % engine is already shown in luaotfload. \ltj@core@AtEnd \expandafter\endinput\fi\relax @@ -184,8 +184,7 @@ \def\RequireLuaTeXjaSubmodule#1{% \@ifnextchar[{\ltj@requirelua@submod{#1}}{\ltj@requirelua@submod{#1}[]}} \def\ltj@requirelua@submod#1[#2]{% - \directlua{luatexja.load_module( - "\luatexluaescapestring{#1}")}} + \directlua{luatexja.load_module("\luatexluaescapestring{#1}")}} %%%%%%%% Load all sub-packages. @@ -206,25 +205,62 @@ \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(false, 'yoko','\luatexluaescapestring{\noexpand#1}')}} \protected\def\globaljfont#1{% \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true, 'yoko','\luatexluaescapestring{\noexpand#1}')}} -\def\ltj@@jfont{\directlua{luatexja.jfont.jfontdefY()}} +\ifdefined\newluafunction + \newluafunction\ltj@@jfont@inner + \directlua{ + local t = lua.get_functions_table() + t[\the\ltj@@jfont@inner] = luatexja.jfont.jfontdefY + } + \def\ltj@@jfont{\luafunction\ltj@@jfont@inner} +\else + \def\ltj@@jfont{\directlua{luatexja.jfont.jfontdefY()}} +\fi %%%%%%%% \tfont\CS={...:...;jfm=metric;...}, \globaltfont \protected\def\tfont#1{% - \afterassignment\ltj@@tfont\directlua{luatexja.jfont.jfontdefX(false, 'tate','\luatexluaescapestring{\noexpand#1}')}} + \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(false, 'tate','\luatexluaescapestring{\noexpand#1}')}} \protected\def\globaltfont#1{% - \afterassignment\ltj@@tfont\directlua{luatexja.jfont.jfontdefX(true, 'tate','\luatexluaescapestring{\noexpand#1}')}} -\def\ltj@@tfont{\directlua{luatexja.jfont.jfontdefY()}} + \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true, 'tate','\luatexluaescapestring{\noexpand#1}')}} %%%%%%%% \zw, \zh -\protected\def\zw{\directlua{tex.setdimen('ltj@zw', luatexja.jfont.get_zw())}\ltj@zw} -\protected\def\zh{\directlua{tex.setdimen('ltj@zh', luatexja.jfont.get_zh())}\ltj@zh} +\ifdefined\newluafunction + \newluafunction\ltj@zw@inner + \newluafunction\ltj@zh@inner + \directlua{ + local t, setdimen, ltjf = lua.get_functions_table(), tex.setdimen, luatexja.jfont + t[\the\ltj@zw@inner] = function() setdimen('ltj@zw', ltjf.get_zw()) end + t[\the\ltj@zh@inner] = function() setdimen('ltj@zh', ltjf.get_zh()) end + } + \protected\def\zw{\luafunction\ltj@zw@inner\ltj@zw} + \protected\def\zh{\luafuntcion\ltj@zh@inner\ltj@zh} +\else + \protected\def\zw{\directlua{tex.setdimen('ltj@zw', luatexja.jfont.get_zw())}\ltj@zw} + \protected\def\zh{\directlua{tex.setdimen('ltj@zh', luatexja.jfont.get_zh())}\ltj@zh} +\fi %%%%%%%% \inhibitglue -\protected\def\ltj@reset@globaldefs{% - \directlua{luatexja.global_temp = tex.globaldefs; tex.globaldefs = 0}} -\protected\def\ltj@restore@globaldefs{\directlua{tex.globaldefs = luatexja.global_temp}\relax} -\protected\def\inhibitglue{\ifhmode\ltj@@ihb\fi} -\def\ltj@@ihb{\relax\directlua{luatexja.jfmglue.create_inhibitglue_node()}} +\ifdefined\newluafunction + \newluafunction\ltj@reset@globaldefs@inner + \newluafunction\ltj@restore@globaldefs@inner + \newluafunction\ltj@@ihb@inner + \directlua{ + local t = lua.get_functions_table() + t[\the\ltj@reset@globaldefs@inner] + = function() luatexja.global_temp = tex.globaldefs; tex.globaldefs = 0 end + t[\the\ltj@restore@globaldefs@inner] + = function() tex.globaldefs = luatexja.global_temp end + t[\the\ltj@@ihb@inner] = luatexja.jfmglue.create_inhibitglue_node + } + \protected\def\ltj@reset@globaldefs{\luafunction\ltj@reset@globaldefs@inner} + \protected\def\ltj@restore@globaldefs{\luafunction\ltj@restore@globaldefs@inner} + \protected\def\inhibitglue{\ifhmode\relax\luafunction\ltj@@ihb@inner\fi} +\else + \protected\def\ltj@reset@globaldefs{% + \directlua{luatexja.global_temp = tex.globaldefs; tex.globaldefs = 0}} + \protected\def\ltj@restore@globaldefs{\directlua{tex.globaldefs = luatexja.global_temp}\relax} + \protected\def\inhibitglue{\ifhmode\ltj@@ihb\fi} + \def\ltj@@ihb{\relax\directlua{luatexja.jfmglue.create_inhibitglue_node()}} +\fi %%%%%%%% \ltjdefcharrange<name>{100-200,3000-,5000,...} \protected\def\ltjdefcharrange#1#2{% @@ -346,8 +382,24 @@ \fi} % [x]]kanjiskip = <skip> - \define@key[ltj]{japaram}{kanjiskip}{\ltjsetkanjiskip#1} - \define@key[ltj]{japaram}{xkanjiskip}{\ltjsetxkanjiskip#1} +\define@key[ltj]{japaram}{kanjiskip}{\ltjsetkanjiskip#1} +\define@key[ltj]{japaram}{xkanjiskip}{\ltjsetxkanjiskip#1} +\ifdefined\newluafunction + \newluafunction\ltjsetkanjiskip@inner + \newluafunction\ltjsetxkanjiskip@inner + \directlua{ + local t, scan_glue = lua.get_functions_table(), luatexja.token.scan_glue + local sss, sti = luatexja.stack.set_stack_skip, luatexja.stack_table_index + t[\the\ltjsetkanjiskip@inner] = function() + local d = scan_glue(); sss(sti.KSK, d); node.free(d) + end + t[\the\ltjsetxkanjiskip@inner] = function() + local d = scan_glue(); sss(sti.XSK, d); node.free(d) + end + } + \protected\def\ltjsetkanjiskip{\luafunction\ltjsetkanjiskip@inner} + \protected\def\ltjsetxkanjiskip{\luafunction\ltjsetxkanjiskip@inner} +\else \protected\def\ltjsetkanjiskip{% % SKIP \directlua{% local d = luatexja.token.scan_glue() @@ -358,7 +410,7 @@ local d = luatexja.token.scan_glue() luatexja.stack.set_stack_skip(luatexja.stack_table_index.XSK, d); node.free(d) }} - +\fi % jcharwidowpenalty = <count> \define@key[ltj]{japaram}{jcharwidowpenalty}{% %COUNT \ltj@@set@stack{JWP}{-10000}{10000}\z@#1 } @@ -558,37 +610,76 @@ } \setbox\z@\box\voidb@x \ifltj@everyhook@avail% using everyhook package - \PushPreHook{hbox}{% - \directlua{luatexja.direction.set_list_direction_hook()}% - \aftergroup\ltj@@reset@badness - } - \PushPreHook{vbox}{% - \directlua{luatexja.direction.set_list_direction_hook()}% - \aftergroup\ltj@@reset@badness - } + \ifdefined\newluafunction + \newluafunction\ltj@@box@dirhook + \directlua{ + local t, ltjd = lua.get_functions_table(), luatexja.direction + t[\the\ltj@@box@dirhook] + = function() ltjd.set_list_direction_hook() end + } + \PushPreHook{hbox}{\luafunction\ltj@@box@dirhook\aftergroup\ltj@@reset@badness} + \PushPreHook{vbox}{\luafunction\ltj@@box@dirhook\aftergroup\ltj@@reset@badness} + \else + \PushPreHook{hbox}{% + \directlua{luatexja.direction.set_list_direction_hook()}% + \aftergroup\ltj@@reset@badness + } + \PushPreHook{vbox}{% + \directlua{luatexja.direction.set_list_direction_hook()}% + \aftergroup\ltj@@reset@badness + } + \fi \else \let\ltj@@everyhbox=\everyhbox\let\ltj@@everyvbox=\everyvbox \newtoks\ltj@@i@everyhbox\newtoks\ltj@@i@everyvbox \let\everyhbox=\ltj@@i@everyhbox\let\everyvbox=\ltj@@i@everyvbox - \ltj@@everyhbox{% - \directlua{luatexja.direction.set_list_direction_hook()}% - \aftergroup\ltj@@reset@badness - \the\ltj@@i@everyhbox} - \ltj@@everyvbox{% - \directlua{luatexja.direction.set_list_direction_hook()}% - \aftergroup\ltj@@reset@badness - \the\ltj@@i@everyvbox} + \ifdefined\newluafunction + \newluafunction\ltj@@box@dirhook + \directlua{ + local t, ltjd = lua.get_functions_table(), luatexja.direction + t[\the\ltj@@box@dirhook] + = function() ltjd.set_list_direction_hook() end + } + \ltj@@everyhbox{\luafunction\ltj@@box@dirhook + \aftergroup\ltj@@reset@badness\the\ltj@@i@everyhbox} + \ltj@@everyvbox{\luafunction\ltj@@box@dirhook + \aftergroup\ltj@@reset@badness\the\ltj@@i@everyvbox} + \else + \ltj@@everyhbox{% + \directlua{luatexja.direction.set_list_direction_hook()}% + \aftergroup\ltj@@reset@badness + \the\ltj@@i@everyhbox} + \ltj@@everyvbox{% + \directlua{luatexja.direction.set_list_direction_hook()}% + \aftergroup\ltj@@reset@badness + \the\ltj@@i@everyvbox} + \fi +\fi + +\ifdefined\newluafunction + \newluafunction\ltj@@reset@badness@inner + \directlua{ + local t = lua.get_functions_table() + t[\the\ltj@@reset@badness@inner] = function() + if luatexja.global_temp then + tex.hbadness= tex.hbadness or luatexja.hbadness_temp + tex.vbadness= tex.vbadness or luatexja.vbadness_temp + tex.globaldefs= luatexja.global_temp or tex.globaldefs + end + end} + \protected\def\ltj@@reset@badness{\luafunction\ltj@@reset@badness@inner} +\else + \protected\def\ltj@@reset@badness{% + \directlua{% + if luatexja.global_temp then + tex.hbadness= tex.hbadness or luatexja.hbadness_temp + tex.vbadness= tex.vbadness or luatexja.vbadness_temp + tex.globaldefs= luatexja.global_temp or tex.globaldefs + end + }% + } \fi -\protected\def\ltj@@reset@badness{% - \directlua{% - if luatexja.global_temp then - tex.hbadness= tex.hbadness or luatexja.hbadness_temp - tex.vbadness= tex.vbadness or luatexja.vbadness_temp - tex.globaldefs= luatexja.global_temp or tex.globaldefs - end - }% -} \AtBeginShipout{\directlua{luatexja.direction.finalize()}} %%%% \raise, \lower, \moveleft, \moveright diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua index 2125969ec3e..940ed213525 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua @@ -1,5 +1,6 @@ require('lualibs') +tableunpack = table.unpack ------------------------------------------------------------------------ -- naming: diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty index 5e1ff328f6a..80437db7fde 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty @@ -34,14 +34,15 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja}[2015/09/21 Japanese Typesetting with LuaTeX] + \ProvidesPackage{luatexja}[2015/10/12 Japanese Typesetting with LuaTeX] \fi %</LaTeX> \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs %% Load all sub-packages. \ifltj@in@latex %<*LaTeX> - \RequirePackage{luatexja-core} [2013/05/14] + %% \RequirePackage{expl3} needed if the version of l3kernel is v6111 + \RequirePackage{luatexja-core} [2015/10/12] \RequirePackage{luatexja-compat}[2013/05/14] \else %<*!LaTeX> \input luatexja-core.sty % |