From 1f72a8c996bedad62f754f509516f15e4137889f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 11 Oct 2020 21:37:50 +0000 Subject: luatexja git-svn-id: svn://tug.org/texlive/trunk@56639 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/luatex/luatexja/README | 8 +- .../texmf-dist/doc/luatex/luatexja/luatexja-en.pdf | Bin 702575 -> 702554 bytes .../texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf | Bin 1137276 -> 1137264 bytes .../doc/luatex/luatexja/luatexja-ruby.pdf | Bin 485933 -> 353336 bytes .../doc/luatex/luatexja/luatexja-ruby.tex | 91 +++++++++++++++++---- .../tex/luatex/luatexja/addons/luatexja-ruby.sty | 52 ++++++++---- .../texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua | 17 +++- .../texmf-dist/tex/luatex/luatexja/ltj-jfont.lua | 2 +- Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua | 78 ++++++++++++------ Master/texmf-dist/tex/luatex/luatexja/luatexja.sty | 4 +- .../tex/luatex/luatexja/patches/lltjdefs.sty | 4 +- .../tex/luatex/luatexja/patches/lltjfont.sty | 28 +++---- 12 files changed, 201 insertions(+), 83 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/luatex/luatexja/README b/Master/texmf-dist/doc/luatex/luatexja/README index 3109243a2ee..7488d2f5d19 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 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 @@ Installation 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 + ;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 @@ Notes 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 diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf index ee8235c8466..6b2043d2af6 100644 Binary files a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf and b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf index 34affff76a4..8d19e491c80 100644 Binary files a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf and b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf index 2c11e1f7749..ade61a681c0 100644 Binary files a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf and b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex index 40657a363f4..f4a36144474 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex @@ -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@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@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 @@ plain \LuaTeX でのロードはまだサポートしておらず, \] \end{description} + \typeout{AAAA} 組み方の具体例を実際に示す.例示のため,平仮名にはルビが1字まで,「立」にはルビを 0.5字分までかけてよいことにしている. \begin{description} @@ -131,7 +140,10 @@ plain \LuaTeX でのロードはまだサポートしておらず, \quad は\ltjruby{聴衆}{ちようしゆう}と\quad は\ltjruby{暁}{あかつき}立\quad は\ltjruby{聴衆}{ちようしゆう}立\par} -\item[10]{\setkeys[ltj]{ruby}{mode=9}% +\item[10]{% + \typeout{MODE: \csname ltj@@rubyip@mode\endcsname.}% + \setkeys[ltj]{ruby}{mode=9}% + \typeout{MODE: \csname ltj@@rubyip@mode\endcsname.}% \ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}% は\ltjruby{美}{うつく}しい \quad は\ltjruby{聴衆}{ちようしゆう}と\quad @@ -188,6 +200,25 @@ plain \LuaTeX でのロードはまだサポートしておらず, \frame{\ltjruby[rubysmash=false,intergap=-1.5] {本}{ほん}} \end{LTXexample} +\item[ybaseheight=] 非負の値が指定された場合, + \emph{縦組以外での}ルビの親文字の高さを全角高さの倍と強制的に固定する. + 負の値が指定された場合は「固定しない」(すなわち,v0.3より前の挙動と同じになる). + 既定値は0.88. +\item[tbaseheight=] \texttt{ybaselineshift}と同様だが,こちらは\emph{縦組での}ルビの親文字の高さを指定する. + 既定値は0.5. +\item[baseheight=] \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=]各文字につく圏点の出力命令を指定する.既定値は「\verb+\ltjalchar`•+」 @@ -231,7 +262,7 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1} 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,14 +272,32 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1} \item[\Param{rubypostintrusion}\ttfamily =\{, \}] 文字 に,その\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+30A0}--\texttt{U+30FF}), + 仮名補助など(\texttt{U+1B000}--\texttt{U+1B16F}),\\ + 中点類・分離禁止文字 + \@for\@tmp:=`\・,`\:,`\;,`\―,`\‥,`\…,`〳,`\〴,`\〵,"2014 \do{\mybox{\@tmp}} +\end{quote} +次に,以下の文字は\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} - 平仮名(\texttt{U+3040}--\texttt{U+309F}),カギ括弧「」,読点「,」「、」,中黒「・」 + 閉じ括弧類 + \@for\@tmp:=`\’,`\”,`\〉,`\》,`\」,`\』,`\】,`\〕,`\〗,`\〙,`\〟,`\),`\],`\},`\⦆ \do{\mybox{\@tmp}}, + 句読点類\@for\@tmp:=`\、,`\,,`\。,`\. \do{\mybox{\@tmp}} \end{quote} -また,ここでは「文字コード$-1$の文字」は,「段落開始の \verb+\parindent+」を表す% -\footnote{通常の\LuaTeX-jaにおける指定では文中数式境界を表していることに注意.}. -この「文字」に対する\Param{rubypreintrusion}の値も1である. +\makeatother + +以上で記述されていない\Param{rubypreintrusion},~\Param{rubypostintrusion}の初期値はすべて0である. \paragraph{\texttt{\textbackslash ltjkenten}} 圏点を出力する命令で,\verb+\kenten+ という別名を定義している. @@ -326,7 +375,6 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1} などの組み方は\emph{想定していない}. \end{itemize} -\newpage \section{\ruby{注|意|点}{ちゆう|い|てん}} \begin{description} @@ -349,15 +397,15 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1} -\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの後側進入量(行中形)}}=0.25\,\mathrm{zw} \] となる.行分割後,「\ltjruby{陵}{りよう}」の実際の後側進入量は -auxファイルに記述される. -\item 2回目以降の実行では,auxファイルに保存された「\ltjruby{陵}{りよう}」の後側進入量 +\texttt{.ltjruby}ファイルに記述される. +\item 2回目以降の実行では,\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+ 命令の呼び出しを識別するキーが必要になるが, +\texttt{.ltjruby}ファイルに保存する際,各 \verb+\ltjruby+ 命令の呼び出しを識別するキーが必要になるが, そのキーとしては単純に「何個目の \verb+\ltjruby+ 命令か」である. なお,以上の処理は,1行目と2行目を比較すれば分かるように, @@ -387,8 +435,6 @@ auxファイルに保存する際,各 \verb+\ltjruby+ 命令の呼び出しを \ltjruby{承}{うけたまわ}り……\par \parindent0.25\zw\ltjruby{陵}{みささぎ}は…… \end{LTXexample} - - \end{description} \newpage @@ -561,6 +607,17 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B %\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 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B \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 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B 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分まで掛けても良い流儀 diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty index 518d6ec8bd8..7c1a939e6d5 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty @@ -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,6 +67,14 @@ \ltj@@rkeydef{fontcmd}%% フォント \define@boolkey[ltj]{ruby}{rubysmash}[true]{} +\ltj@@rkeydef{ybaseheight} % 縦組以外 (yoko, utod, dtou) +\ltj@@rkeydef{tbaseheight} % 縦組 +\define@key[ltj]{ruby}{baseheight}{% + \expandafter\def\csname ltj@@rubyip@ybaseheight\endcsname{#1}% + \expandafter\def\csname ltj@@rubyip@tbaseheight\endcsname{#1}% +} + +%% これらの値が正のとき,親文字の高さをこの値(\zh 単位)とみなす %%%%%%%% setkeys の別名 \protected\def\ltjsetruby{\setkeys[ltj]{ruby}} @@ -89,15 +97,17 @@ maxmargin = \ltj@safe@dimen{\ltj@@rubyip@maxmargin\zw}, pre = \ltj@safe@dimen{\ltj@@rubyip@pre#1}, post = \ltj@safe@dimen{\ltj@@rubyip@post#1}, - intergap = \ltj@safe@dimen{\ltj@@rubyip@intergap\zw}, + intergap = \ltj@safe@dimen{\ltj@@rubyip@intergap\zh}, stretch = 262144 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretchbol + 512 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretcheol + \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretch, mode - = 2097152 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretchruby + = (2097152 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretchruby + \ltj@safe@num{\ltj@@rubyip@mode} - + 1048576 * \ifltj@ruby@rubysmash1\else0\fi + + 1048576 * \ifltj@ruby@rubysmash1\else0\fi), + baseheight = \ltj@safe@dimen{\ifnum\ltjgetparameter{direction}=3 + \ltj@@rubyip@tbaseheight\else\ltj@@rubyip@ybaseheight\fi\zh}, \string} } %%% @@ -186,17 +196,27 @@ \ltjsetparameter{rubypreintrusion={\the\count@,1}, rubypostintrusion={\the\count@,1}} \advance\count@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@1\repeat +%% Kana Supplement +\count@="1B000\loop\relax\ifnum \count@<"1B170 + \ltjsetparameter{rubypreintrusion={\the\count@,1}, + rubypostintrusion={\the\count@,1}} + \advance\count@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 diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua index 0bbf7249e51..e3cae86534b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua @@ -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 @@ luatexbase.create_callback("luatexja.jfmglue.whatsit_getinfo", "data", 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 @@ end 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 @@ local function real_insert(g) 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 @@ do {}, {}, {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 diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua index 6b7667a0d16..ed40e86821f 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua @@ -3,7 +3,7 @@ -- luatexbase.provides_module({ name = 'luatexja.jfont', - date = '2020-09-16', + date = '2020-10-05', description = 'Loader for Japanese fonts', }) diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua index 865e301f30b..e2cb40d925b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua @@ -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_stretch = luatexbase.attributes['ltj@kcat2'] local attr_ruby_mode = luatexbase.attributes['ltj@kcat3'] local attr_ruby_id = luatexbase.attributes['ltj@kcat4'] -- uniq id local attr_ruby_intergap = luatexbase.attributes['ltj@kcat5'] +local attr_ruby_baseheight= luatexbase.attributes['ltj@kcat6'] local attr_ruby = luatexbase.attributes['ltj@rubyattr'] -- ルビ内部処理用,以下のようにノードによって使われ方が異なる -- * (whatsit) では JAglue 処理時に, @@ -128,6 +129,9 @@ function luatexja.ruby.read_old_break_info() 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 @@ end -- 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 @@ local function texiface_low(rst, rtlr, rtlp) 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 @@ end ---------------------------------------------------------------- -- 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 @@ end -- ルビボックスの生成(単一グループ) -- returned value: , , 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 @@ local function new_ruby_box(r, p, ppre, pmid, ppost, 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')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 @@ do 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 @@ do 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 diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty index cfee092e30b..74df9c779c4 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty @@ -35,13 +35,13 @@ \expandafter\let\csname ifltj@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@disablejfamtrue} \DeclareOption*{} \ProcessOptions\relax \fi % %%%% VERSION -\def\LuaTeXjaversion{20201001.0} +\def\LuaTeXjaversion{20201005.0} \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty index 03366c258f0..754a9122f84 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty @@ -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@stdmcfont\else\def\ltj@stdmcfont{file:HaranoAjiMincho-Regular.otf}\fi \ifdefined\ltj@stdgtfont\else\def\ltj@stdgtfont{file:HaranoAjiGothic-Medium.otf}\fi @@ -95,7 +95,7 @@ \@ltj@match@familyfalse \def\verbatim@font{\normalfont\ttfamily\kanjifamily\jttdefault\selectfont} -\def\@ltj@hook@family#1#2{ % #1: csname #2: contents +\def\@ltj@hook@family#1#2{% #1: csname #2: contents \ifltj@ltfilehook@avail % LaTeX 2020-10-01 \AddToHook{#1}{#2}% \else\ifcsname @#1hook\endcsname % LaTeX 2020-02-02 diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty index 564a1b6c159..bad7e6c7bcd 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty @@ -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@chardef@text@cmd#1{% @@ -639,7 +639,7 @@ \ifx\@forced@seriestrue\@undefined % 2020-02-02 pl0--2 \@latex@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@plv=300 @@ -834,29 +834,29 @@ \patchcmd\update@series@target@value@kanji{\f@series}{\k@series}{}{} \def\@meta@family@list@kanji{\@elt{mc}\@elt{gt}\@elt{jtt}} -\def\@ltj@hook@series@default#1#2#3{ +\def\@ltj@hook@series@default#1#2#3{% \ifltj@ltfilehook@avail % 2020-10-01 \AddToHook{#1/defaults}{#2}% \else\ifcsname @set#1defaultshook\endcsname %after 2020-04-07 \expandafter\g@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@hook@series@default{bfseries}{ +\@ltj@hook@series@default{bfseries}{% \let\bfseries@mc\bfdef@ult \let\bfseries@gt\bfdef@ult \let\bfseries@jtt\bfdef@ult -}{ +}{% \let\bfseries@rm\bfdef@ult \let\bfseries@sf\bfdef@ult \let\bfseries@tt\bfdef@ult } -\@ltj@hook@series@default{mdseries}{ +\@ltj@hook@series@default{mdseries}{% \let\mdseries@mc\mddef@ult \let\mdseries@gt\mddef@ult \let\mdseries@jtt\mddef@ult -}{ +}{% \let\mdseries@rm\mddef@ult \let\mdseries@sf\mddef@ult \let\mdseries@tt\mddef@ult @@ -890,11 +890,11 @@ \fi\fi\fi }{}{} -\def\@ltj@hook@series#1#2{ +\def\@ltj@hook@series#1#2{% \ifltj@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@hook@series{bfseries}{% @@ -913,7 +913,7 @@ } \let\@ltj@hook@series\@undefined -\def\@ltj@hook@efd#1#2{ +\def\@ltj@hook@efd#1#2{% \ifltj@ltfilehook@avail % 2020-10-01 \AddToHook{expand@font@defaults}{#1}% \else\ifdefined\@expandfontdefaultshook %after 2020-04-07 @@ -930,7 +930,7 @@ \let\@ltj@hook@efd\@undefined \ifltj@ltfilehook@avail % 2020-10-01 - \appto\init@series@setup{ + \appto\init@series@setup{% \ifx\kanjiseriesdefault\kanjiseriesdefault@kernel \mdseries \let\kanjiseriesdefault\k@series @@ -945,13 +945,13 @@ } \fi -\def\@ltj@hook@dfh#1{ +\def\@ltj@hook@dfh#1{% \ifltj@ltfilehook@avail % 2020-10-01 \AddToHook{normalfont}{#1}% \else\ifdefined\@defaultfamilyhook \g@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@font\normalfont \fi\fi } -- cgit v1.2.3