texlive[56639] Master/texmf-dist: luatexja

commits+karl at tug.org commits+karl at tug.org
Sun Oct 11 23:37:50 CEST 2020


Revision: 56639
          http://tug.org/svn/texlive?view=revision&revision=56639
Author:   karl
Date:     2020-10-11 23:37:50 +0200 (Sun, 11 Oct 2020)
Log Message:
-----------
luatexja

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/luatexja/README
    trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
    trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
    trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf
    trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex
    trunk/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty
    trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
    trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
    trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua
    trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
    trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty
    trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/README
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexja/README	2020-10-11 21:36:29 UTC (rev 56638)
+++ trunk/Master/texmf-dist/doc/luatex/luatexja/README	2020-10-11 21:37:50 UTC (rev 56639)
@@ -1,4 +1,4 @@
-The LuaTeX-ja Package 20201001.0
+The LuaTeX-ja Package 20201005.0
 --------------------------------
 Copyright (c) 2011--2020 The LuaTeX-ja project
 License: modified BSD (see COPYING)
@@ -45,9 +45,9 @@
 2. If you must/want to install manually:
 
    a. Download the source archive from CTAN,
-      or tagged as 20201001.0 in the Git repository by
+      or tagged as 20201005.0 in the Git repository by
       <http://git.osdn.jp/view?p=luatex-ja/luatexja.git
-                              ;a=snapshot;h=refs/tags/20201001.0;sf=tgz>
+                              ;a=snapshot;h=refs/tags/20201005.0;sf=tgz>
 
    b. Extract the archive and process following three files by LuaLaTeX
       to generate classes for Japanese typesetting:
@@ -96,4 +96,4 @@
   This file and ltj-kinsoku.lua are not used anymore.
   (Do not remove ltj-kinsoku.tex.)
 
-Last commit date: Thu Oct 1 04:19:14 2020 +0900
+Last commit date: Mon Oct 5 15:47:16 2020 +0900

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex	2020-10-11 21:36:29 UTC (rev 56638)
+++ trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex	2020-10-11 21:37:50 UTC (rev 56639)
@@ -1,6 +1,7 @@
 %#! lualatex
 %%% a test of ruby.
 \documentclass[a4paper,10pt]{ltjsarticle}
+\usepackage[rgb]{xcolor}
 \usepackage{luatexja-otf,amsmath,bxghost}
 \usepackage[no-math]{fontspec}
 \usepackage[match]{luatexja-fontspec}
@@ -17,9 +18,11 @@
 \protected\def\Param#1{\eghostguarded{\underline{\smash{\textsf{\mdseries #1}}}}}
 
 \usepackage{luatexja-ruby,showexpl,booktabs}
+\definecolor{mygreen}{rgb}{0,0.5,0}
 \lstset{
   preset=\normalsize, basicstyle=\small\ttfamily, basewidth=0.5em,
   explpreset={numberstyle=\tiny, numbers=left, numbersep=1em, columns=fixed},
+  morecomment=[l]{\%}, commentstyle=\color{mygreen}
 }
 \makeatletter\let\SX at Info=\relax\makeatother
 \fboxsep=0mm
@@ -42,6 +45,8 @@
   HaranoAjiMincho-Regular:extend=0.67;jfm=ujisc33}{}
 
 \title{\textsf{luatexja-ruby}パッケージ}
+\author{\LuaTeX-jaプロジェクトチーム}
+\date{\texttt{\csname ver at luatexja-ruby.sty\endcsname}(\today)}
 \begin{document}
 \catcode`\<=13
 \def<#1>{{\rmfamily\mdseries\itshape$\langle$#1\/$\rangle$}}
@@ -53,6 +58,9 @@
 \textsf{luatexja-ruby}パッケージは,\LuaTeX-jaの機能を利用してルビの組版処理を行う追加パッケージである.
 \LuaTeX, \LuaTeX-jaの内部処理に割り込むことにより,熟語ルビ中の行分割や,
 行頭形・行中形・行末形の自動検出,また進入許容量の自動設定などを可能とした.
+
+v0.3より前とは親文字の高さの扱いが変わっている(\texttt{baseheight}キーを参照せよ)ほか,
+\Param{rubypreintrusion}, \Param{rubypostintrusion}パラメータの初期値が変わっているので注意すること.
 \end{abstract}
 
 \tableofcontents
@@ -116,6 +124,7 @@
 \]
 \end{description}
 
+  \typeout{AAAA}
 組み方の具体例を実際に示す.例示のため,平仮名にはルビが1字まで,「立」にはルビを
 0.5字分までかけてよいことにしている.
 \begin{description}
@@ -131,7 +140,10 @@
   \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
 は\ltjruby{暁}{あかつき}立\quad
 は\ltjruby{聴衆}{ちようしゆう}立\par}
-\item[10]{\setkeys[ltj]{ruby}{mode=9}%
+\item[10]{%
+  \typeout{MODE: \csname ltj@@rubyip at mode\endcsname.}%
+  \setkeys[ltj]{ruby}{mode=9}%
+  \typeout{MODE: \csname ltj@@rubyip at mode\endcsname.}%
 \ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
 は\ltjruby{美}{うつく}しい
   \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
@@ -188,8 +200,27 @@
 \frame{\ltjruby[rubysmash=false,intergap=-1.5]
   {本}{ほん}}
 \end{LTXexample}
+\item[ybaseheight=<real>] 非負の値が指定された場合,
+  \emph{縦組以外での}ルビの親文字の高さを全角高さの<real>倍と強制的に固定する.
+  負の値が指定された場合は「固定しない」(すなわち,v0.3より前の挙動と同じになる).
+  既定値は0.88.
+\item[tbaseheight=<real>] \texttt{ybaselineshift}と同様だが,こちらは\emph{縦組での}ルビの親文字の高さを指定する.
+  既定値は0.5.
+\item[baseheight=<real>] \texttt{ybaselineshift},\texttt{tbaselinesift}を同時に指定したことと同義.
+\begin{LTXexample}[width=0.3\textwidth, preset=\Large]
+\noindent
+\ltjruby[baseheight=0.88]{本}{ほん}\ 
+\ltjruby[baseheight=0.88]{dvi}{ディーヴィーアイ}\\
+\ltjruby[baseheight=0.5]{本}{ほん}\ 
+\ltjruby[baseheight=0.5]{dvi}{ディーヴィーアイ}\\
+\ltjruby[baseheight=0]{本}{ほん}\ 
+\ltjruby[baseheight=0]{dvi}{ディーヴィーアイ}\\
+\ltjruby[baseheight=-1]{本}{ほん}\ 
+\ltjruby[baseheight=-1]{dvi}{ディーヴィーアイ}
+\end{LTXexample}
 
 
+
 \item[kenten=<command>]各文字につく圏点の出力命令を指定する.既定値は「\verb+\ltjalchar`•+」
 であり,\texttt{U+2022} (Bullet)を\textbf{ALchar}として出力することを指定している.
 
@@ -231,7 +262,7 @@
   stretchruby={1}{2}{1}, stretch = {1}{2}{1},
   stretchbol={0}{1}{1}, stretcheol={1}{1}{0},
   maxmargin=0.5, size=0.5, intergap=0, rubysmash=false,
-  kenten=\ltjalchar`•, fontcmd=\relax
+  kenten=\ltjalchar`•, fontcmd=\relax, ybaseheight=0.88, tbaseheight=0.5
 \end{verbatim}
 
 \paragraph{\texttt{\textbackslash ltjsetparamater} に追加されるキー}
@@ -241,15 +272,33 @@
 \item[\Param{rubypostintrusion}\ttfamily =\{<chr\_code>, <post\_int>\}]
 文字<chr\_code> に,その\textbf{直前}のルビによって掛けられるルビ文字列の最大長をルビ全角単位で指定.
 \end{description}
-既定値は,\Param{rubypreintrusion},~\Param{rubypostintrusion}とも
-以下の文字に対しては1,その他の文字については0である:
+以下の文字は\Param{rubypreintrusion},~\Param{rubypostintrusion}とも初期値は1である:
+\makeatletter
+\def\mybox#1{{\fboxrule=0.1mm\fboxsep=0mm\fcolorbox{cyan}{white}{\hbox{\null\ltjjachar#1\null}}}}
 \begin{quote}
- 平仮名(\texttt{U+3040}--\texttt{U+309F}),カギ括弧「」,読点「,」「、」,中黒「・」
+ ひらがな(\texttt{U+3040}--\texttt{U+309F}),カタカナ(\texttt{U+30A0}--\texttt{U+30FF}),
+ 仮名補助など(\texttt{U+1B000}--\texttt{U+1B16F}),\\
+ 中点類・分離禁止文字
+ \@for\@tmp:=`\・,`\:,`\;,`\―,`\‥,`\…,`〳,`\〴,`\〵,"2014 \do{\mybox{\@tmp}}
 \end{quote}
-また,ここでは「文字コード$-1$の文字」は,「段落開始の \verb+\parindent+」を表す%
-\footnote{通常の\LuaTeX-jaにおける指定では文中数式境界を表していることに注意.}.
-この「文字」に対する\Param{rubypreintrusion}の値も1である.
+次に,以下の文字は\Param{rubypreintrusion}のみ初期値は1である:
+\begin{quote}
+  始め括弧類
+  \@for\@tmp:=`\‘,`\“,`\〈,`\《,`\「,`\『,`\【,`\〔,`\〖,`\〘,`\〝,`\(,`\[,`\{,`\⦅ \do{\mybox{\@tmp}},
+  「文字コード$-1$の文字
+  \footnote{段落開始の\ \texttt{\textbackslash parindent}\ を表す.
+    通常の\LuaTeX-jaにおける指定では「文字コード$-1$」は文中数式境界を表していることに注意.}」
+\end{quote}
+また,以下の文字は\Param{rubypostintrusion}のみ初期値は1である:
+\begin{quote}
+  閉じ括弧類
+  \@for\@tmp:=`\’,`\”,`\〉,`\》,`\」,`\』,`\】,`\〕,`\〗,`\〙,`\〟,`\),`\],`\},`\⦆ \do{\mybox{\@tmp}},
+  句読点類\@for\@tmp:=`\、,`\,,`\。,`\. \do{\mybox{\@tmp}}
+\end{quote}
+\makeatother
 
+以上で記述されていない\Param{rubypreintrusion},~\Param{rubypostintrusion}の初期値はすべて0である.
+
 \paragraph{\texttt{\textbackslash ltjkenten}}
 圏点を出力する命令で,\verb+\kenten+ という別名を定義している.
 \begin{quote}
@@ -326,7 +375,6 @@
 などの組み方は\emph{想定していない}.
 \end{itemize}
 
-\newpage
 
 \section{\ruby{注|意|点}{ちゆう|い|てん}}
 \begin{description}
@@ -349,15 +397,15 @@
 -\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの後側進入量(行中形)}}=0.25\,\mathrm{zw}
 \]
 となる.行分割後,「\ltjruby{陵}{りよう}」の実際の後側進入量は
-auxファイルに記述される.
-\item 2回目以降の実行では,auxファイルに保存された「\ltjruby{陵}{りよう}」の後側進入量
+<jobname>\texttt{.ltjruby}ファイルに記述される.
+\item 2回目以降の実行では,<jobname>\texttt{.ltjruby}ファイルに保存された「\ltjruby{陵}{りよう}」の後側進入量
 を用いて,「\ltjruby{陵}{みささぎ}」前側進入許容量を次のように計算する:
 \[
  \underbrace{0.5\,\mathrm{zw}}_{\text{元々の許容量}}
--\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの後側進入量 (from aux)}}=0.25\,\mathrm{zw}.
+-\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの後側進入量 (from \texttt{.ltjruby})}}=0.25\,\mathrm{zw}.
 \]
 \end{enumerate}
-auxファイルに保存する際,各 \verb+\ltjruby+ 命令の呼び出しを識別するキーが必要になるが,
+<jobname>\texttt{.ltjruby}ファイルに保存する際,各 \verb+\ltjruby+ 命令の呼び出しを識別するキーが必要になるが,
 そのキーとしては単純に「何個目の \verb+\ltjruby+ 命令か」である.
 
 なお,以上の処理は,1行目と2行目を比較すれば分かるように,
@@ -387,8 +435,6 @@
 \ltjruby{承}{うけたまわ}り……\par
 \parindent0.25\zw\ltjruby{陵}{みささぎ}は……
 \end{LTXexample}
-
-
 \end{description}
 
 \newpage
@@ -561,6 +607,17 @@
 %\directlua{ltj.ext_show_node_list(tex.box[0], '? ', print)}
 \fbox{\box0}
 
+\setbox0=\vbox{\hsize=30\zw\noindent
+\texttt{baseheight=0.88}での例\\
+  ふぁいる\ruby[baseheight=0.88]{dvi}{ディーヴィーアイ}ファイル
+  \ruby[baseheight=0.88]{oo}{ほーげーふーが}漢字\\
+  ファイル\ruby[baseheight=0.88]{dvi}{ディーヴィーアイ}ふぁいる
+  \ruby[baseheight=0.88]{oo}{ほーげーふーが}漢字\\
+  ああ(\ruby{ほげ}{ふがふがふがふが})」\ruby{ほげ}{ふがふがふがふが}「
+  【\ruby{ほげ}{ふがふがふがふが}】\ruby{ほげ}{ふがふがふがふが}…
+}
+\fbox{\box0}
+
 \def\rubytest{\ruby{国府津}{こうづ}\relax}
 % グループルビ
 
@@ -711,7 +768,7 @@
      \ruby{模型}{モデル}\quad \ruby{利用許諾}{ライセンス}}
 % ルビが極端に短い場合
 3.70 \ruby{なげきの聖母像}{ピエタ}\quad% ルビ全角まで許容
-     \ruby[maxmargin=0.75]{なげきの聖母像}{ピエタ}% ルビ全角1.5倍まで
+     \ruby[maxmargin=0.75]{なげきの聖母像}{ピエタ}\\% ルビ全角1.5倍まで
 % ルビが長い場合
 3.71 \ruby{顧客}{クライアント}\quad \ruby{境界面}{インターフエース}
 3.72 {\ltjsetruby{stretch=010, stretchbol=010, stretcheol=010}% はみ出さない流儀
@@ -763,7 +820,7 @@
 3.80 漢字の部首には「\ruby{偏}{へん}」「\ruby{冠}{かんむり}」「\ruby{脚}{きやく}」%
 「\ruby{旁}{つくり}」がある
 3.80 この\ruby{\噂}{うわさ}好きな人は\ruby{懐}{ふところ}具合もよく、\ruby{檜}{ひのき}材を
-3.81× に\ruby{暁}{あかつき}の\kern-1\zw の\ruby{趣}{おもむき}を
+3.81× に\ruby{暁}{あかつき}の\kern-1\zw の\ruby{趣}{おもむき}を(良くない例)
 3.82 に\ruby{暁}{あかつき}の\ruby{趣}{おもむき}を
 
 % 漢字にルビを2分まで掛けても良い流儀

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty	2020-10-11 21:36:29 UTC (rev 56638)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty	2020-10-11 21:37:50 UTC (rev 56639)
@@ -4,7 +4,7 @@
 
 % LaTeX only!
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-ruby}[2017/09/26 v0.23a]
+\ProvidesPackage{luatexja-ruby}[2020-10-05 v0.3]
 \RequirePackage{luatexja}
 
 %%------------------
@@ -67,7 +67,15 @@
 \ltj@@rkeydef{fontcmd}%% フォント
 \define at boolkey[ltj]{ruby}{rubysmash}[true]{}
 
+\ltj@@rkeydef{ybaseheight} % 縦組以外 (yoko, utod, dtou)
+\ltj@@rkeydef{tbaseheight} % 縦組
+\define at key[ltj]{ruby}{baseheight}{%
+  \expandafter\def\csname ltj@@rubyip at ybaseheight\endcsname{#1}%
+  \expandafter\def\csname ltj@@rubyip at tbaseheight\endcsname{#1}%
+}
 
+%% これらの値が正のとき,親文字の高さをこの値(\zh 単位)とみなす
+
 %%%%%%%% setkeys の別名
 \protected\def\ltjsetruby{\setkeys[ltj]{ruby}}
 
@@ -89,15 +97,17 @@
       maxmargin = \ltj at safe@dimen{\ltj@@rubyip at maxmargin\zw},
       pre = \ltj at safe@dimen{\ltj@@rubyip at pre#1},
       post = \ltj at safe@dimen{\ltj@@rubyip at post#1},
-      intergap =  \ltj at safe@dimen{\ltj@@rubyip at intergap\zw},
+      intergap =  \ltj at safe@dimen{\ltj@@rubyip at intergap\zh},
       stretch 
         = 262144 * \expandafter\ltj@@ruby at cts\ltj@@rubyip at stretchbol
 	  + 512 * \expandafter\ltj@@ruby at cts\ltj@@rubyip at stretcheol
 	  + \expandafter\ltj@@ruby at cts\ltj@@rubyip at stretch,
       mode 
-        = 2097152 * \expandafter\ltj@@ruby at cts\ltj@@rubyip at stretchruby
+        = (2097152 * \expandafter\ltj@@ruby at cts\ltj@@rubyip at stretchruby
           + \ltj at safe@num{\ltj@@rubyip at mode}
-          + 1048576 * \ifltj at ruby@rubysmash1\else0\fi
+          + 1048576 * \ifltj at ruby@rubysmash1\else0\fi),
+      baseheight = \ltj at safe@dimen{\ifnum\ltjgetparameter{direction}=3
+                     \ltj@@rubyip at tbaseheight\else\ltj@@rubyip at ybaseheight\fi\zh},
     \string}
 }
 %%%
@@ -186,17 +196,27 @@
   \ltjsetparameter{rubypreintrusion={\the\count@,1}, 
     rubypostintrusion={\the\count@,1}}
   \advance\count at 1\repeat
-%% 「」
-\ltjsetparameter{rubypreintrusion={`「,1}, 
-  rubypostintrusion={`」,1}}
-%% ,、
-\ltjsetparameter{rubypreintrusion={`,,1}, 
-  rubypostintrusion={`,,1}}
-\ltjsetparameter{rubypreintrusion={`、,1}, 
-  rubypostintrusion={`、,1}}
-%% ・
-\ltjsetparameter{rubypreintrusion={`・,1}, 
-  rubypostintrusion={`・,1}}
+%% カタカナ
+\count@="30A0\loop\relax\ifnum \count@<"3100
+  \ltjsetparameter{rubypreintrusion={\the\count@,1}, 
+    rubypostintrusion={\the\count@,1}}
+  \advance\count at 1\repeat
+%% Kana Supplement
+\count@="1B000\loop\relax\ifnum \count@<"1B170
+  \ltjsetparameter{rubypreintrusion={\the\count@,1}, 
+    rubypostintrusion={\the\count@,1}}
+  \advance\count at 1\repeat
+%% 開き括弧・閉じ括弧
+\@for\@tmp:=`\‘,`\“,`\〈,`\《,`\「,`\『,`\【,`\〔,`\〖,`\〘,`\〝,`\(,`\[,`\{,`\⦅ \do
+  {\ltjsetparameter{rubypreintrusion={\@tmp,1}}}
+\@for\@tmp:=`\’,`\”,`\〉,`\》,`\」,`\』,`\】,`\〕,`\〗,`\〙,`\〟,`\),`\],`\},`\⦆ \do
+  {\ltjsetparameter{rubypostintrusion={\@tmp,1}}}
+%% 中点類
+\@for\@tmp:=`\・,`\:,`\;,`\―,`\‥,`\…,`〳,`\〴,`\〵,"2014 \do
+  {\ltjsetparameter{rubypreintrusion={\@tmp,1},rubypostintrusion={\@tmp,1}}}
+%% 読点・句点
+\@for\@tmp:=`\、,`\,,`\。,`\. \do
+  {\ltjsetparameter{rubypostintrusion={\@tmp,1}}}
 %% 段落インデント部分
 \ltjsetparameter{rubypreintrusion={-1,1}}
 
@@ -205,7 +225,7 @@
   stretchruby={1}{2}{1}, stretch = {1}{2}{1},
   stretchbol={0}{1}{1}, stretcheol={1}{1}{0},
   maxmargin=0.5, size=0.5, intergap=0, rubysmash=false,
-  kenten=\ltjalchar`•, fontcmd=\relax
+  kenten=\ltjalchar`•, fontcmd=\relax, ybaseheight=0.88, tbaseheight=0.5
 }
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua	2020-10-11 21:36:29 UTC (rev 56638)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua	2020-10-11 21:37:50 UTC (rev 56639)
@@ -3,7 +3,7 @@
 --
 luatexbase.provides_module({
   name = 'luatexja.jfmglue',
-  date = '2020-07-30',
+  date = '2020-10-05',
   description = 'Insertion process of JFM glues, [x]kanjiskip and others',
 })
 luatexja.jfmglue = luatexja.jfmglue or {}
@@ -258,6 +258,8 @@
                            end)
 luatexbase.create_callback("luatexja.jfmglue.whatsit_after", "data",
                            function (stat, Nq, Np) return false end)
+luatexbase.create_callback("luatexja.jfmglue.whatsit_last_minute", "data",
+                           function (stat, Nq, Np) return false end)
 
 -- calc next Np
 local calc_np 
@@ -543,10 +545,13 @@
 function calc_np(last, lp)
    local k
    -- We assume lp = node_next(Np.last)
+   if Nq and Nq.id==id_pbox_w then
+      luatexbase.call_callback("luatexja.jfmglue.whatsit_last_minute", false, Nq, Np)
+   end
    Np, Nq, non_ihb_flag = Nq, Np, true
    -- We clear `predefined' entries of Np before pairs() loop,
    -- because using only pairs() loop is slower.
-   Np.post, Np.pre, Np.xspc = nil, nil, nil
+   Np.post, Np.pre, Np.xspc, Np.gk = nil, nil, nil, nil
    Np.first, Np.id, Np.last, Np.met, Np.class= nil, nil, nil, nil
    Np.auto_kspc, Np.auto_xspc, Np.char, Np.nuc = nil, nil, nil, nil
    -- auto_kspc, auto_xspc: normally true/false, 
@@ -751,6 +756,10 @@
    if g then
       head  = insert_before(head, Np.first, g)
       Np.first = g
+      local ngk = Np.gk
+      if not ngk then Np.gk = g
+      elseif type(ngk)=="table" then ngk[#ngk+1]=g
+      else  Np.gk = { ngk, g } end
    end
 end
 
@@ -1161,10 +1170,10 @@
       {}, {}, {first=nil},
       { auto_kspc=nil, auto_xspc=nil, char=nil, class=nil,
         first=nil, id=nil, last=nil, met=nil, nuc=nil,
-        post=nil, pre=nil, xspc=nil, }, 
+        post=nil, pre=nil, xspc=nil, gk=nil }, 
       { auto_kspc=nil, auto_xspc=nil, char=nil, class=nil,
         first=nil, id=nil, last=nil, met=nil, nuc=nil,
-        post=nil, pre=nil, xspc=nil, },
+        post=nil, pre=nil, xspc=nil, gk=nil },
    }
    init_var = function (mode,dir)
       -- 1073741823: max_dimen

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua	2020-10-11 21:36:29 UTC (rev 56638)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua	2020-10-11 21:37:50 UTC (rev 56639)
@@ -3,7 +3,7 @@
 --
 luatexbase.provides_module({
   name = 'luatexja.jfont',
-  date = '2020-09-16',
+  date = '2020-10-05',
   description = 'Loader for Japanese fonts',
 })
 

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua	2020-10-11 21:36:29 UTC (rev 56638)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua	2020-10-11 21:37:50 UTC (rev 56639)
@@ -3,7 +3,7 @@
 --
 luatexbase.provides_module({
   name = 'luatexja.ruby',
-  date = '2020-07-30',
+  date = '2020-10-05',
   description = 'Ruby annotation',
 })
 luatexja.ruby = {}
@@ -50,6 +50,7 @@
 local attr_ruby_mode = luatexbase.attributes['ltj at kcat3']
 local attr_ruby_id = luatexbase.attributes['ltj at kcat4'] -- uniq id
 local attr_ruby_intergap = luatexbase.attributes['ltj at kcat5']
+local attr_ruby_baseheight= luatexbase.attributes['ltj at kcat6']
 local attr_ruby = luatexbase.attributes['ltj at rubyattr']
 -- ルビ内部処理用,以下のようにノードによって使われ方が異なる
 -- * (whatsit) では JAglue 処理時に,
@@ -128,6 +129,9 @@
       local real_file = kpse.find_file(fname)
       if real_file then dofile(real_file) end
       cache_handle = io.open(fname, 'w')
+      if cache_handle then 
+         cache_handle:write('local lrob=luatexja.ruby.old_break_info\n')
+      end
    end
 end
 local make_uniq_id
@@ -142,12 +146,12 @@
 -- concatenation of boxes: reusing nodes
 -- ルビ組版が行われている段落/hboxでの設定が使われる.
 -- ルビ文字を格納しているボックスでの設定ではない!
+local function get_attr_icflag(p)
+    return (has_attr(p, attr_icflag) or 0) % PROCESSED_BEGIN_FLAG
+end
 local concat
 do
    local node_prev = node.direct.getprev
-   local function get_attr_icflag(p)
-      return (has_attr(p, attr_icflag) or 0) % PROCESSED_BEGIN_FLAG
-   end
    function concat(f, b)
       if f then
          if b then
@@ -264,6 +268,7 @@
    set_attr(wv, attr_ruby_maxprep, rst.pre)
    set_attr(wv, attr_ruby_maxpostp, rst.post)
    set_attr(wv, attr_ruby_intergap, rst.intergap)
+   set_attr(wv, attr_ruby_baseheight, rst.baseheight)
    set_attr(wv, attr_ruby_stretch, rst.stretch)
    set_attr(wv, attr_ruby_mode, rst.mode)
    local n = wv
@@ -309,11 +314,13 @@
 ----------------------------------------------------------------
 
 -- r, p の中身のノードは再利用される
-local function enlarge_parent(r, p, ppre, pmid, ppost, mapre, mapost, intmode)
+local function enlarge_parent(r, p, tmp_tbl, intmode)
    -- r: ルビ部分の格納された box,p: 同,親文字
    local rwidth = getfield(r, 'width')
    local sumprot = rwidth - getfield(p, 'width') -- >0
    local pre_intrusion, post_intrusion
+   local ppre, pmid, ppost = tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost
+   local mapre, mapost = tmp_tbl.mapre, tmp_tbl.mapost
    if intmode == 0 then --  とりあえず組んでから決める
       p = enlarge(p, rwidth, ppre, pmid, ppost, 0, 0)
       pre_intrusion  = min(mapre, round(ppre*getfield(p, 'glue_set')*65536))
@@ -349,17 +356,19 @@
 -- ルビボックスの生成(単一グループ)
 -- returned value: <new box>, <ruby width>, <post_intrusion>
 local max_margin
-local function new_ruby_box(r, p, ppre, pmid, ppost,
-                            mapre, mapost, imode, rgap)
+local function new_ruby_box(r, p, tmp_tbl)
    local post_intrusion = 0
-   local intmode = imode%4
+   local imode
+   local ppre, pmid, ppost = tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost
+   local mapre, mapost = tmp_tbl.mapre, tmp_tbl.mapost
    local rpre, rmid, rpost, rsmash
-   imode = floor(imode/262144); rsmash = (imode%2 ==1)
+   imode = floor(tmp_tbl.imode/0x100000); rsmash = (imode%2 ==1)
    imode = floor(imode/2); rpost = imode%8;
    imode = (imode-rpost)/8;  rmid  = imode%8;
    imode = (imode-rmid)/8;   rpre  = imode%8
    if getfield(r, 'width') > getfield(p, 'width') then  -- change the width of p
-      r, p, post_intrusion  = enlarge_parent(r, p, ppre, pmid, ppost, mapre, mapost, intmode)
+      r, p, post_intrusion  = enlarge_parent(r, p, tmp_tbl, 
+        floor(tmp_tbl.imode/4)%4)
    elseif getfield(r, 'width') < getfield(p, 'width') then -- change the width of r
       r = enlarge(r, getfield(p, 'width'), rpre, rmid, rpost, 0, 0)
       post_intrusion = 0
@@ -383,9 +392,10 @@
    end
    local a, k = node_new(id_rule), node_new(id_kern, 1)
    setfield(a, 'width', 0); setfield(a, 'height', 0)
-   setfield(a, 'depth', 0); setfield(k, 'kern', rgap)
+   setfield(a, 'depth', 0); setfield(k, 'kern', tmp_tbl.rgap)
    insert_after(r, r, a); insert_after(r, a, k);
    insert_after(r, k, p); setfield(p, 'next', nil)
+   if tmp_tbl.bheight >= 0 then setfield(p, 'height', tmp_tbl.bheight) end
    a = node.direct.vpack(r); setfield(a, 'shift', 0)
    set_attr(a, attr_ruby, post_intrusion)
    if rsmash or getfield(a, 'height')<getfield(p, 'height') then
@@ -406,7 +416,10 @@
 
 -- 中付き熟語ルビ,cmp containers
 -- 「文字の構成を考えた」やつはどうしよう
-local function pre_low_cal_box(w, cmp)
+local pre_low_cal_box
+do
+local tmp_tbl = {}
+pre_low_cal_box = function (w, cmp)
    local rb = {}
    local pb = {}
    local kf = {}
@@ -417,11 +430,14 @@
    local mdt -- nt*: node temp
    local coef = {} -- 連立一次方程式の拡大係数行列
    local rtb = expand_3bits(has_attr(wv, attr_ruby_stretch))
-   local rgap = has_attr(wv, attr_ruby_intergap)
-   local intmode = floor(has_attr(wv, attr_ruby_mode)/4)
+   tmp_tbl.rgap = has_attr(wv, attr_ruby_intergap)
+   tmp_tbl.imode = has_attr(wv, attr_ruby_mode)
+   tmp_tbl.bheight = has_attr(wv, attr_ruby_baseheight)
 
    -- node list 展開・行末形の計算
    local nt, nta, ntb = wv, nil, nil -- nt*: node temp
+   tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost = rtb[6], rtb[5], rtb[4]
+   tmp_tbl.mapre, tmp_tbl.mapost = max_allow_pre, 0
    for i = 1, cmp do
       nt = node_next(nt); rb[i] = nt; nta = concat(nta, node_copy(nt))
       nt = node_next(nt); pb[i] = nt; ntb = concat(ntb, node_copy(nt))
@@ -429,13 +445,14 @@
       for j = 1, 2*i do coef[i][j] = 1 end
       for j = 2*i+1, 2*cmp+1 do coef[i][j] = 0 end
       kf[i], coef[i][2*cmp+2]
-         = new_ruby_box(node_copy(nta), node_copy(ntb),
-                        rtb[6], rtb[5], rtb[4], max_allow_pre, 0, intmode, rgap)
+         = new_ruby_box(node_copy(nta), node_copy(ntb), tmp_tbl)
    end
    node_free(nta); node_free(ntb)
 
    -- 行頭形の計算
    local nta, ntb = nil, nil
+   tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost = rtb[9], rtb[8], rtb[7]
+   tmp_tbl.mapre, tmp_tbl.mapost = 0, max_allow_post
    for i = cmp,1,-1 do
       coef[cmp+i] = {}
       for j = 1, 2*i-1 do coef[cmp+i][j] = 0 end
@@ -442,8 +459,7 @@
       for j = 2*i, 2*cmp+1 do coef[cmp+i][j] = 1 end
       nta = concat(node_copy(rb[i]), nta); ntb = concat(node_copy(pb[i]), ntb)
       kf[cmp+i], coef[cmp+i][2*cmp+2]
-         = new_ruby_box(node_copy(nta), node_copy(ntb),
-                        rtb[9], rtb[8], rtb[7], 0, max_allow_post, intmode, rgap)
+         = new_ruby_box(node_copy(nta), node_copy(ntb), tmp_tbl)
    end
 
    -- ここで,nta, ntb には全 container を連結した box が入っているので
@@ -450,9 +466,10 @@
    -- それを使って行中形を計算する.
    coef[2*cmp+1] = {}
    for j = 1, 2*cmp+1 do coef[2*cmp+1][j] = 1 end
+   tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost = rtb[3], rtb[2], rtb[1]
+   tmp_tbl.mapre, tmp_tbl.mapost = max_allow_pre, max_allow_post
    kf[2*cmp+1], coef[2*cmp+1][2*cmp+2], post_intrusion_backup
-      = new_ruby_box(nta, ntb, rtb[3], rtb[2], rtb[1],
-                     max_allow_pre, max_allow_post, intmode, rgap)
+      = new_ruby_box(nta, ntb, tmp_tbl)
 
    -- w.value の node list 更新.
    local nt = wv
@@ -466,6 +483,7 @@
    end
    return coef
 end
+end
 
 local first_whatsit
 do
@@ -558,9 +576,7 @@
       local id = has_attr(wv, attr_ruby_id)
       if id>0 and cache_handle then
          cache_handle:write(
-                    'luatexja.ruby.old_break_info['
-                       .. tostring(id) .. ']=' .. num
-                       .. '\n')
+            'lrob[' .. tostring(id) .. ']=' .. num .. '\n')
       end
    end
 
@@ -736,6 +752,11 @@
             insert_before(Nq.nuc, Np.first, last_glue)
             Np.first = last_glue
             next_cluster_array[Nq.nuc] = last_glue -- ルビ処理用のグルー
+--            if Nq.gk then 
+--               if type(Nq.gk)=="table" then
+--                  for _,v in ipairs(Nq.gk) do luatexja.ext_show_node(node.direct.tonode(v), 'BBt> ', print) end
+--               else luatexja.ext_show_node(node.direct.tonode(Nq.gk), 'BBB> ', print) end
+--            end
          end
          local nqnv = getfield(Nq.nuc, 'value')
          local x =  node_next(node_next(nqnv))
@@ -779,4 +800,15 @@
    luatexbase.add_to_callback("luatexja.jfmglue.whatsit_after", whatsit_after_callback,
                               "luatexja.ruby.np_info_after", 1)
 end
+if false then -- いまは off
+    local function w (s, Nq, Np)
+       if Np.gk then 
+           if type(Np.gk)=="table" then
+               for _,v in ipairs(Np.gk) do luatexja.ext_show_node(node.direct.tonode(v), 'AAt> ', print) end
+           else luatexja.ext_show_node(node.direct.tonode(Np.gk), 'AAA> ', print) end
+       end
+    end
+    luatexbase.add_to_callback("luatexja.jfmglue.whatsit_last_minute", w,
+                              "luatexja.ruby.np_info_last_minute", 1)
+end
 

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty	2020-10-11 21:36:29 UTC (rev 56638)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty	2020-10-11 21:37:50 UTC (rev 56639)
@@ -35,13 +35,13 @@
   \expandafter\let\csname ifltj at in@latex\expandafter\endcsname
     \csname iftrue\endcsname
   \NeedsTeXFormat{LaTeX2e}
-  \ProvidesPackage{luatexja}[2020-09-19 Japanese Typesetting with Lua(La)TeX]
+  \ProvidesPackage{luatexja}[2020-10-05 Japanese Typesetting with Lua(La)TeX]
   \DeclareOption{disablejfam}{\ltj at disablejfamtrue}
   \DeclareOption*{}
   \ProcessOptions\relax
 \fi                             %</LaTeX>
 %%%% VERSION
-\def\LuaTeXjaversion{20201001.0}
+\def\LuaTeXjaversion{20201005.0}
 
 \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs
 

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty	2020-10-11 21:36:29 UTC (rev 56638)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty	2020-10-11 21:37:50 UTC (rev 56639)
@@ -3,7 +3,7 @@
 %
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjdefs}[2020-09-30 Default font settings of LuaTeX-ja]
+\ProvidesPackage{lltjdefs}[2020-10-05 Default font settings of LuaTeX-ja]
 
 \ifdefined\ltj at stdmcfont\else\def\ltj at stdmcfont{file:HaranoAjiMincho-Regular.otf}\fi
 \ifdefined\ltj at stdgtfont\else\def\ltj at stdgtfont{file:HaranoAjiGothic-Medium.otf}\fi
@@ -95,7 +95,7 @@
 \@ltj at match@familyfalse
 \def\verbatim at font{\normalfont\ttfamily\kanjifamily\jttdefault\selectfont}
 
-\def\@ltj at hook@family#1#2{ % #1: csname #2: contents
+\def\@ltj at hook@family#1#2{% #1: csname #2: contents
   \ifltj at ltfilehook@avail % LaTeX 2020-10-01
     \AddToHook{#1}{#2}%
   \else\ifcsname @#1hook\endcsname % LaTeX 2020-02-02

Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty	2020-10-11 21:36:29 UTC (rev 56638)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty	2020-10-11 21:37:50 UTC (rev 56639)
@@ -3,7 +3,7 @@
 %
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjfont}[2020-09-30 Patch to NFSS2 for LuaTeX-ja]
+\ProvidesPackage{lltjfont}[2020-10-05 Patch to NFSS2 for LuaTeX-ja]
 
 %% patching \DeclareTextComposite
 \def\ltj at chardef@text at cmd#1{%
@@ -639,7 +639,7 @@
   \ifx\@forced at seriestrue\@undefined % 2020-02-02 pl0--2
     \@latex at error
      {Please update LaTeX2e!^^J\space\space
-       At least LaTeX2e 2020-02-02 patch level 3 is required}
+       At least LaTeX2e 2020-02-02 patch level 3 is required}%
      {LaTeX2e 2020-02-02 patch level 2 (and 4) has a bug.}
   \else
     \ltj@@latex at plv=300
@@ -834,29 +834,29 @@
 \patchcmd\update at series@target at value@kanji{\f at series}{\k at series}{}{}
 \def\@meta at family@list at kanji{\@elt{mc}\@elt{gt}\@elt{jtt}}
 
-\def\@ltj at hook@series at default#1#2#3{
+\def\@ltj at hook@series at default#1#2#3{%
   \ifltj at ltfilehook@avail % 2020-10-01
     \AddToHook{#1/defaults}{#2}%
   \else\ifcsname @set#1defaultshook\endcsname %after 2020-04-07
     \expandafter\g at addto@macro\csname @set#1defaultshook\endcsname{#2}%
   \else % 2020-02-02
-    \expandafter\patchcmd\csname #1 \endcsname{#3}{#3#2}{}{}
+    \expandafter\patchcmd\csname #1 \endcsname{#3}{#3#2}{}{}%
   \fi\fi
 }
-\@ltj at hook@series at default{bfseries}{
+\@ltj at hook@series at default{bfseries}{%
   \let\bfseries at mc\bfdef at ult
   \let\bfseries at gt\bfdef at ult
   \let\bfseries at jtt\bfdef at ult
-}{
+}{%
   \let\bfseries at rm\bfdef at ult
   \let\bfseries at sf\bfdef at ult
   \let\bfseries at tt\bfdef at ult
 }
-\@ltj at hook@series at default{mdseries}{
+\@ltj at hook@series at default{mdseries}{%
   \let\mdseries at mc\mddef at ult
   \let\mdseries at gt\mddef at ult
   \let\mdseries at jtt\mddef at ult
-}{
+}{%
   \let\mdseries at rm\mddef at ult
   \let\mdseries at sf\mddef at ult
   \let\mdseries at tt\mddef at ult
@@ -890,11 +890,11 @@
   \fi\fi\fi
 }{}{}
 
-\def\@ltj at hook@series#1#2{
+\def\@ltj at hook@series#1#2{%
   \ifltj at ltfilehook@avail % 2020-10-01
     \AddToHook{#1}{#2}%
   \else % 2020-02-02
-    \expandafter\patchcmd\csname #1 \endcsname{\selectfont}{#2\selectfont}{}{}
+    \expandafter\patchcmd\csname #1 \endcsname{\selectfont}{#2\selectfont}{}{}%
   \fi
 }
 \@ltj at hook@series{bfseries}{%
@@ -913,7 +913,7 @@
 }
 \let\@ltj at hook@series\@undefined
 
-\def\@ltj at hook@efd#1#2{
+\def\@ltj at hook@efd#1#2{%
   \ifltj at ltfilehook@avail % 2020-10-01
     \AddToHook{expand at font@defaults}{#1}%
   \else\ifdefined\@expandfontdefaultshook %after 2020-04-07
@@ -930,7 +930,7 @@
 \let\@ltj at hook@efd\@undefined
 
 \ifltj at ltfilehook@avail % 2020-10-01
-  \appto\init at series@setup{
+  \appto\init at series@setup{%
     \ifx\kanjiseriesdefault\kanjiseriesdefault at kernel
       \mdseries
       \let\kanjiseriesdefault\k at series
@@ -945,13 +945,13 @@
   }
 \fi
 
-\def\@ltj at hook@dfh#1{
+\def\@ltj at hook@dfh#1{%
   \ifltj at ltfilehook@avail % 2020-10-01
     \AddToHook{normalfont}{#1}%
   \else\ifdefined\@defaultfamilyhook
     \g at addto@macro\@defaultfamilyhook{#1}%
   \else % 2020-02-02
-    \expandafter\patchcmd\csname normalfont \endcsname{\selectfont}{#1\selectfont}{}{}
+    \expandafter\patchcmd\csname normalfont \endcsname{\selectfont}{#1\selectfont}{}{}%
     \let\reset at font\normalfont
   \fi\fi
 }



More information about the tex-live-commits mailing list.