texlive[66814] Master/texmf-dist: luatexja (9apr23)
commits+karl at tug.org
commits+karl at tug.org
Sun Apr 9 21:45:14 CEST 2023
Revision: 66814
http://tug.org/svn/texlive?view=revision&revision=66814
Author: karl
Date: 2023-04-09 21:45:14 +0200 (Sun, 09 Apr 2023)
Log Message:
-----------
luatexja (9apr23)
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.dtx
trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-base.lua
trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua
trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-inputbuf.lua
trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua
trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua
trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua
trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.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 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/doc/luatex/luatexja/README 2023-04-09 19:45:14 UTC (rev 66814)
@@ -1,4 +1,4 @@
-The LuaTeX-ja Package 20230211.0
+The LuaTeX-ja Package 20230409.0
--------------------------------
Copyright (c) 2011--2023 The LuaTeX-ja project
License: modified BSD (see COPYING)
@@ -42,9 +42,9 @@
2. If you must/want to install manually:
a. Download the source archive from CTAN,
- or tagged as 20230211.0 in the Git repository by
+ or tagged as 20230409.0 in the Git repository by
<http://git.osdn.jp/view?p=luatex-ja/luatexja.git
- ;a=snapshot;h=refs/tags/20230211.0;sf=tgz>
+ ;a=snapshot;h=refs/tags/20230409.0;sf=tgz>
b. Extract the archive and process following three files by LuaLaTeX
to generate classes for Japanese typesetting:
@@ -93,4 +93,4 @@
This file and ltj-kinsoku.lua are not used anymore.
(Do not remove ltj-kinsoku.tex.)
-Last commit date: Sat Feb 11 18:49:41 2023 +0900
+Last commit date: Sun Apr 9 08:12:48 2023 +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.dtx
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx 2023-04-09 19:45:14 UTC (rev 66814)
@@ -3526,7 +3526,10 @@
%<*en>
\begin{description}
\item[\meta{JFM name}]
- The name of a (horizontal) JFM. \LuaTeX-ja searches and loads \texttt{jfm-\meta{JFM name}.lua}.
+ The name of a (horizontal) JFM. \LuaTeX-ja searches and loads \texttt{jfm-\meta{JFM name}.lua}
+ \footnote{When \LuaTeX-ja (version~20230409 or later)
+ is used under \LaTeXe, \LuaTeX-ja searches a JFM also in directories
+ which are specified in \cs{input at path}.}.
\item[\meta{JFM features}]
An optional comma-separated list of JFM options.
Enclosing braces (\verb+{}+) are optional, but this does not escape any characters.
@@ -3552,7 +3555,9 @@
%<*ja>
\begin{description}
\item[\meta{JFM name}]
- (横組用)JFMの名称.\LuaTeX-jaは\texttt{jfm-\meta{JFM name}.lua}というファイルを探索して読み込む.
+ (横組用)JFMの名称.\LuaTeX-jaは\texttt{jfm-\meta{JFM name}.lua}というファイルを探索して読み込む
+ \footnote{\LuaTeX-ja 20230409.0以降では,\LaTeXe 下で読み込まれた場合には
+ \cs{input at path}で指定された箇所も加えてJFMを探索する.}.
\item[\meta{JFM features}]
省略可能なコンマ区切りリスト.全体を囲む \verb+{}+ は省略可能であるが,
囲ったからといって\meta{JFM features}の中で使用可能な文字が増えるわけではない.
@@ -3859,7 +3864,7 @@
「JFM由来のグルーの他に,\Param{kanjiskip}の自然長/伸び量/縮み量の一部が
同じ場所に挿入される」という状況が起こりうる.
この機能を無効化し,バージョン20150922.0以前と同じような組版を得るためには,
-他のOpenType機能と同じように\texttt{-ltjksp}指定を行えば良い(\autoref{fig:ltjksp}参照).
+他のOpenType機能と同じように\>\mbox{\texttt{-ltjksp}}\>指定を行えば良い(\autoref{fig:ltjksp}参照).
なお,
\begin{lstlisting}
\jfont\G=HaranoAjiMincho-Regular:jfm=ujis;-ltjksp;+ltjksp at \zw
@@ -3875,7 +3880,7 @@
\texttt{kanjiskip\_shrink} keys (Page~\pageref{pg:ksp_nat}) makes tha
\LuaTeX-ja inserts not only a glue which is specified by a JFM, and also
the natural width/stretch part/shrink part of \Param{kanjiskip}.
-This functionality is disabled by \texttt{-ltjksp} specification,
+This functionality is disabled by \mbox{\texttt{-ltjksp}} specification,
as shown in~\autoref{fig:ltjksp}.
%</en>
\begin{figure}
@@ -3888,10 +3893,56 @@
\G\leavevmode%
\vrule\hbox to 15\zw{あ「い」う,えお}\vrule
\end{LTXexample}
-\caption{\texttt{ltjksp} `feature''}
+\caption{\texttt{ltjksp} ``feature''}
\label{fig:ltjksp}
\end{figure}
+%<*ja>
+\paragraph{\texttt{ltjpci}「機能」}
+\label{pg:ltjpci}
+\Pkg{luaotfload}~v3.19以降では,標準でUnicode(文字から作られるノードたち)がNFCに正規化される
+ようになっている.これにより,ソース中でたとえば「か」と合成用濁点(\texttt{U+3099})を続けて入力した場合,
+両者それぞれからノードが生成されるが,結果的には「が」を表す1ノードになるわけである.
+
+しかし,NFCに正規化することで,
+たとえば「\UTF{FA19}」(\texttt{U+FA19})が「神」(\texttt{U+795E})にというふうに,
+CJK互換漢字がCJK統合漢字に変換されてしまうという問題がある.
+異体字セレクタを用いればこのようなことは起きないが,古くからあるフォントでは異体字セレクタをサポートしていない.
+
+以上の事情に対応するため,\LuaTeX-jaでは,標準で
+\emph{CJK互換漢字・CJK互換漢字補助の文字には\Pkg{luaotfload}パッケージによる処理は働かない}ようにしている.
+この機能を無効化するには,他のOpenType機能と同じように\texttt{-ltjpci}指定を行えば良い(\autoref{fig:ltjpci}参照).
+\texttt{ltjksp}と同様に,\texttt{-ltjpci}, \texttt{+ltjpci}を複数回指定した場合は,
+最後に指定したものが有効となる.
+%</ja>
+%<*en>
+\paragraph{\texttt{ltjpci} ``feature''}
+\label{pg:ltjpci}
+By default, The \Pkg{luaotfload} package (since v3.19) normalizes Unicode sequences to NFC.
+However, this normalization converts CJK compatibility ideographs to their canonical equivalents,
+such as ``\UTF{FA19}''~(\texttt{U+FA19}) to ``神''. One can use variation selectors,
+but old fonts does not support them.
+
+So, \emph{\LuaTeX-ja now protects CJK compatibility ideographs from processing
+ by the \Pkg{luaotfload} package by defualt}.
+This functionality is disabled by \mbox{\texttt{-ltjpci}} specification,
+as shown in~\autoref{fig:ltjpci}.
+%</en>
+\begin{figure}
+\begin{LTXexample}[width=12\zw]
+\def\TEST{\leavevmode\char"FA10\char"FA12\char"FA15
+ \char"FA19.か\char"3099.は\char"309A.\par}
+\jfont\A=HaranoAjiMincho-Regular:jfm=ujis; at 15pt
+\A\TEST % default
+\jfont\G=HaranoAjiMincho-Regular:jfm=ujis;-ltjpci at 15pt
+\G\TEST % ltjpci off
+\jfont\H=HaranoAjiMincho-Regular:jfm=ujis;-normalize at 15pt
+\H\TEST % normalization off
+\end{LTXexample}
+\caption{\texttt{ltjpci} ``feature''}
+\label{fig:ltjpci}
+\end{figure}
+
%<en>\subsection{\cs{tfont}}
%<ja>\subsection{\cs{tfont} 命令}
\label{ssec:tfont}
@@ -9978,101 +10029,10 @@
その行はそこで改行するようにした方がいいだろう.
%</ja>
-\begin{table}[t]
-%<ja> \caption{「基底文字+合成用濁点・半濁点」から合成済み文字への変換をサポートする組み合わせ}
-%<en> \caption{Normalization of Kana Character Sequences with Combining (Semi)-voiced Sound Mark}\medskip
- \label{tab:kana_composite}
- \def\D#1{%
- {\fboxsep0pt\fcolorbox{cyan}{white}%
- {\hbox to 1\zw{\hss#1}}}} %"
- \def\DC#1{\D{\unitlength=1\zw
- \begin{picture}(1,0)
- \put(0.5,0.38){\arc[0,15]{0.25}}\put(0.5,0.38){\arc[30,45]{0.25}}\put(0.5,0.38){\arc[60,75]{0.25}}
- \put(0.5,0.38){\arc[90,105]{0.25}}\put(0.5,0.38){\arc[120,135]{0.25}}\put(0.5,0.38){\arc[150,165]{0.25}}
- \put(0.5,0.38){\arc[180,195]{0.25}}\put(0.5,0.38){\arc[210,225]{0.25}}\put(0.5,0.38){\arc[240,255]{0.25}}
- \put(0.5,0.38){\arc[270,285]{0.25}}\put(0.5,0.38){\arc[300,315]{0.25}}\put(0.5,0.38){\arc[330,345]{0.25}}
- \end{picture}\llap{#1\kern-.7\zw}}}
- \def\CDJ#1#2{$\mbox{\D{\char"#1}}+\mbox{\DC{゛}}\rightarrow \mbox{\D{\char"#2}}$}
- \def\CHJ#1#2{$\mbox{\D{\char"#1}}+\mbox{\DC{゜}}\rightarrow \mbox{\D{\char"#2}}$}
- \small\centering
- \begin{tabular}{@{}llllll@{}}
- \CDJ{3046}{3094}&
- \CDJ{304B}{304C}&
- \CDJ{304D}{304E}&
- \CDJ{304F}{3050}&
- \CDJ{3051}{3052}&
- \CDJ{3053}{3054}\\
- \CDJ{3055}{3056}&
- \CDJ{3057}{3058}&
- \CDJ{3059}{305A}&
- \CDJ{305B}{305C}&
- \CDJ{305D}{305E}&
- \CDJ{305F}{3060}\\
- \CDJ{3061}{3062}&
- \CDJ{3064}{3065}&
- \CDJ{3066}{3067}&
- \CDJ{3068}{3069}&
- \CDJ{306F}{3070}&
- \CDJ{3072}{3073}\\
- \CDJ{3075}{3076}&
- \CDJ{3078}{3079}&
- \CDJ{307B}{307C}&
- \CDJ{309D}{309E}&
- \CDJ{30A6}{30F4}&
- \CDJ{30AB}{30AC}\\
- \CDJ{30AD}{30AE}&
- \CDJ{30AF}{30B0}&
- \CDJ{30B1}{30B2}&
- \CDJ{30B3}{30B4}&
- \CDJ{30B5}{30B6}&
- \CDJ{30B7}{30B8}\\
- \CDJ{30B9}{30BA}&
- \CDJ{30BB}{30BC}&
- \CDJ{30BD}{30BE}&
- \CDJ{30BF}{30C0}&
- \CDJ{30C1}{30C2}&
- \CDJ{30C4}{30C5}\\
- \CDJ{30C6}{30C7}&
- \CDJ{30C8}{30C9}&
- \CDJ{30CF}{30D0}&
- \CDJ{30D2}{30D3}&
- \CDJ{30D5}{30D6}&
- \CDJ{30D8}{30D9}\\
- \CDJ{30DB}{30DC}&
- \CDJ{30EF}{30F7}&
- \CDJ{30F0}{30F8}&
- \CDJ{30F1}{30F9}&
- \CDJ{30F2}{30FA}&
- \CDJ{30FD}{30FE}\\
- \CHJ{306F}{3071}&
- \CHJ{3072}{3074}&
- \CHJ{3075}{3077}&
- \CHJ{3078}{307A}&
- \CHJ{307B}{307D}&
- \CHJ{30CF}{30D1}\\
- \CHJ{30D2}{30D4}&
- \CHJ{30D5}{30D7}&
- \CHJ{30D8}{30DA}&
- \CHJ{30DB}{30DD}
- \end{tabular}
-\end{table}
-%<*en>
-\subsection{Composition of Kana from Combining Character Sequences}
-In (u)\pTeX, Hiragana and Katakana in the NFD form%
-\footnote{namely, character sequences which contains
- ``COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK''~(\texttt{U+3099}) and
- ``COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK''~(\texttt{U+309A}).}
-are normalized to precomposed characters before (u)\pTeX\ looks into the input line.
-Character sequences which are involved in this normalization are shown in \autoref{tab:kana_composite}.
-
-The above normalization process is also performed in \LuaTeX-ja version~20220103.0 or later, because
-fonts might not have these transformation as an OpenType feature.
-%</en>
-
%<*ja>
-\subsection{濁点・半濁点付き仮名文字の正規化}
+\subsection{濁点・半濁点付き仮名の正規化→\Pkg{luaotfload}~v3.19以降ではそちらで}
\TeX~Live~2016以降の(u)\pTeX では,合成用濁点(\texttt{U+3099})・合成用半濁点(\texttt{U+309A})を用いて
-表現された平仮名・片仮名を合成済み文字に変換する(具体的には\autoref{tab:kana_composite}の組み合わせ)という処理を行っている.
+表現された平仮名・片仮名を合成済み文字に変換するという処理を行っている.
この処理を行っている要因としては,
\begin{itemize}
\item 無用なトラブルを避けるため.
@@ -10082,14 +10042,14 @@
合成用濁点・半濁点は利用できない.そのため上記の変換処理はさらに前から行われていた.
\end{itemize}
-一方,\LuaTeX(-ja)では入力の変換は基本的に行わず,文字の合成は使用しているフォントのOpenType機能に委ねるという立場である.
-しかし,\autoref{tab:kana_composite}に挙げた変換はUnicode正規化の範疇であり,この内容を持っているフォントは多くない.
-よって,前段落で述べた2つの理由(と\upTeX との互換性という意味も込めて)も考慮して,
-バージョン20220103.0以降では,\LuaTeX-jaは入力行に対して\autoref{tab:kana_composite}の変換を行う.
+\LuaTeX(-ja)では入力の変換は基本的に行わず,
+文字の合成は使用しているフォントのOpenType機能に委ねるという立場であったが,
+\Pkg{luaotfload}~v3.19以降では,標準でNFCへのUnicode正規化を行っている.
+そのため,バージョン2023****.0以降では,\LuaTeX-jaによる自前の変換\footnote{バージョン20220103.0で実装した.}は
+行わないようにしている.
%</ja>
-
+
%<*ja>
-
%<en>\section{Insertion of JFM glues, \Param{kanjiskip} and \Param{xkanjiskip}}
%<ja>\section{JFMグルーの挿入,\Param{kanjiskip}と\Param{xkanjiskip}}
\label{sec-jfmglue}
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-base.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-base.lua 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-base.lua 2023-04-09 19:45:14 UTC (rev 66814)
@@ -285,12 +285,17 @@
end
end
+ local compress, decompress = gzip.compress, gzip.decompress
local function save_cache(filename, t)
local fullpath = savepath .. '/' .. filename .. '.lua.gz'
local s = serialize(t, 'return', false, serial_spec)
if s then
- gzip.save(fullpath, s, 1)
- texio.write('log', '(save cache: ' .. fullpath .. ')')
+ local f = io.open(fullpath, 'wb')
+ if f then
+ f:write(compress(s, 31))
+ texio.write('log', '(save cache: ' .. fullpath .. ')')
+ f:close()
+ end
save_cache_luc(filename, t, s)
end
end
@@ -302,7 +307,8 @@
if isreadable(fn) then
texio.write('log','(load cache: ' .. filename .. ')')
if compressed then
- result = loadstring(gzip.load(fn))
+ local f = io.open(fn, 'rb'); result = f:read'*a'; f:close()
+ result = loadstring(decompress(result, 31))
else
result = loadfile(fn)
end
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua 2023-04-09 19:45:14 UTC (rev 66814)
@@ -1008,8 +1008,8 @@
local n = h; h = node_remove(h,h)
node_free(n)
end
- for box_rule in traverse(h) do
- if getid(box_rule)<id_rule then
+ for box_rule, bi in traverse(h) do
+ if bi<id_rule then
h = insert_before(h, box_rule, dir_pool[list_dir]())
end
end
@@ -1129,8 +1129,7 @@
tex.setattribute(attr_dir, 0)
finalize_inner = function (box)
- for n in traverse(getlist(box)) do
- local nid = getid(n)
+ for n, nid in traverse(getlist(box)) do
if (nid==id_hlist or nid==id_vlist) then
local ndir = get_box_dir(n, dir_yoko)
if ndir>=dir_node_auto then -- n is dir_node
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-inputbuf.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-inputbuf.lua 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-inputbuf.lua 2023-04-09 19:45:14 UTC (rev 66814)
@@ -14,6 +14,10 @@
local cnt_lineend = luatexbase.registernumber 'ltjlineendcomment'
local substituter
do
+if tonumber(luaotfload.version) < 3.19 then
+ ltjb.package_info_no_line('luatexja',
+ 'We are using luaotfload <v3.19, so I compose kana from combining character sequences manually'
+ )
local uchar = utf.char
local cd, cp = uchar(0x3099), uchar(0x309A)
substituter = (utf.substituter or utf.subtituter) -- typo in lualibs?
@@ -47,8 +51,10 @@
['ワ'..cd] = uchar(0x30F7), ['ヰ'..cd] = uchar(0x30F8),
['ヱ'..cd] = uchar(0x30F9), ['ヲ'..cd] = uchar(0x30FA),
}
+else
+ substituter = function(s) return s end
end
-
+end
--- the following function is modified from jafontspec.lua (by K. Maeda).
--- Instead of "%", we use U+FFFFF for suppressing spaces.
--DEBUG require"socket"
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua 2023-04-09 19:45:14 UTC (rev 66814)
@@ -3,7 +3,7 @@
--
luatexbase.provides_module({
name = 'luatexja.jfont',
- date = '2022-08-20',
+ date = '2023-04-06',
description = 'Loader for Japanese fonts',
})
@@ -43,7 +43,7 @@
luatexbase.create_callback("luatexja.load_jfm", "data", function (ft, jn) return ft end)
-local jfm_spec, jfm_name, jfm_var, jfm_ksp
+local jfm_spec, jfm_name, jfm_var, jfm_ksp, jfm_pci
local defjfm_res
local jfm_dir, is_def_jfont, vert_activated, auto_enable_vrt2
@@ -288,7 +288,7 @@
jfm_name, jfm_spec = 'ujis', 'ujis'
end
for j,v in ipairs(metrics) do if v.name==jfm_spec then return j end end
- luatexja.load_lua('jfm-' .. jfm_name .. '.lua')
+ defjfm_res=nil; luatexja.load_lua('jfm-' .. jfm_name .. '.lua')
if defjfm_res then
defjfm_res.name = jfm_spec; table.insert(metrics, defjfm_res)
return #metrics
@@ -323,7 +323,7 @@
update_jfm_cache(j, f.size); check_callback_order()
local sz = metrics[j].size_cache[f.size]
local fmtable = { jfm = j, size = f.size, var = jfm_var,
- with_kanjiskip = jfm_ksp,
+ with_kanjiskip = jfm_ksp, protect_compat_ig = jfm_pci,
zw = sz.zw, zh = sz.zh,
chars = sz.chars, char_type = sz.char_type,
kanjiskip = sz.kanjiskip, xkanjiskip = sz.xkanjiskip,
@@ -397,20 +397,31 @@
local jf_field = C(jf_field_char^1)
local jf_assignment = jf_field * ws * equals * ws * jf_field
local jf_switch = P'-' * jf_field * Cc(false) + P'+'^-1 * jf_field * Cc(true)
- local jf_feature_expr = Cg(jf_assignment + jf_switch) * ws * comma^0 * ws
+ local jf_feature_expr =
+ P{
+ 'FE',
+ FE = Cg(V'AT'+ jf_assignment + jf_switch) * ws * comma^0 * ws,
+ AT = jf_field * ws * equals * ws * Cf(Ct'' * P'{' * ws * (V'FE')^0 * P'}', rawset),
+ }
local jf_feature_list = ws * ( P'{' * ws * jf_feature_expr^0 * P'}' + jf_feature_expr^0 )
local jf_list = C((1-slash)^1) * (slash * Cf(Ct'' * jf_feature_list, rawset))^-1
local jf_value = (1 - semicolon)^1
+ local norm
+ norm = function (t)
+ local flag
+ if type(t)=='table' then
+ for i,v in pairs(t) do
+ flag=true
+ if v=='true' then t[i]=true elseif v=='false' then t[i]=false
+ elseif type(v)=='table' then norm(v) end
+ end
+ return flag and t
+ end
+ end
local function rem(name,value)
if name=='jfm' then
- local flag, t; jfm_name, t = lpegmatch(jf_list, value)
- if type(t)=='table' then
- for i,v in pairs(t) do
- flag=true
- if v=='true' then t[i]=true elseif v=='false' then t[i]=false end
- end
- end
- luatexja.jfont.jfm_feature = flag and t
+ local t; jfm_name, t = lpegmatch(jf_list, value)
+ luatexja.jfont.jfm_feature = norm(t)
elseif name=='jfmvar' then jfm_var = value end
return ''
end
@@ -451,6 +462,7 @@
-- print('NN>', name)
end
jfm_ksp = (is_feature_specified(name,'ltjksp')~=false)
+ jfm_pci = (is_feature_specified(name,'ltjpci')~=false)
if jfm_dir == 'tate' then
vert_activated = (is_feature_specified(name,'vert')~=false) and (is_feature_specified(name,'vrt2')~=false)
auto_enable_vrt2
@@ -619,11 +631,23 @@
end
------ used in ltjp.suppress_hyphenate_ja callback
-function luatexja.jfont.replace_altfont(pf, pc)
- local a = alt_font_table[pf]
- return a and a[pc] or pf
+do
+ local compat_ig = {}
+ for i=0xf900, 0xfaff do compat_ig[i] = true end
+ for i=0x2f800, 0x2fa1f do compat_ig[i] = true end
+ local protect_glyph = node.direct.protect_glyph
+--
+ local getfont, setfont = node.direct.getfont, node.direct.setfont
+ function luatexja.jfont.replace_altfont(a, pc, p)
+ local pf = get_attr(p, a); pf = (pf and pf>0 and pf) or getfont(p)
+ local af = alt_font_table[pf]
+ pf = af and af[pc] or pf; setfont(p, pf)
+ if compat_ig[pc] and font_metric_table[pf].protect_compat_ig then
+ protect_glyph(p)
+ end
+ return pf
+ end
end
-
------ for LaTeX interface
local alt_font_table_latex = {}
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua 2023-04-09 19:45:14 UTC (rev 66814)
@@ -110,10 +110,7 @@
setfield(b, 'type', 100); setfield(b, 'user_id', JA_AL_BDD);
insert_before(head, p, b)
end
- local pf = get_attr(p, attr_curjfnt)
- pf = (pf and pf>0 and pf) or getfont(p)
- setfont(p, ltjf_replace_altfont(pf, pc))
- setlang(p, lang_ja)
+ setlang(p, lang_ja);
ltjs_orig_char_table[p], prev_chartype = pc, 2
elseif prev_chartype==2 then
local b = node_new(id_whatsit,sid_user);
@@ -140,8 +137,7 @@
do
local ltjs_report_stack_level = ltjs.report_stack_level
local ltjf_font_metric_table = ltjf.font_metric_table
-local font_getfont = font.getfont
-local traverse_id = node.direct.traverse_id
+local traverse_glyph = node.direct.traverse_glyph
local cnt_stack = luatexbase.registernumber 'ltj@@stack'
local texget, getvalue = tex.get, node.direct.getdata
function set_box_stack_level(head, mode)
@@ -158,16 +154,20 @@
ltjs_report_stack_level(getcount(cnt_stack) + box_set)
for _,p in pairs(wtd) do node_free(p) end
if ltjs.list_dir == dir_tate then
- for p in traverse_id(id_glyph,to_direct(head)) do
- if has_attr(p, attr_icflag, 0) and getlang(p)==lang_ja then
- local nf = ltjf_replace_altfont( get_attr(p, attr_curtfnt) or getfont(p) , ltjs_orig_char_table[p])
- setfont(p, nf)
- if ltjf_font_metric_table[nf].vert_activated then
- local pc = getchar(p); pc = ltjf_font_metric_table[nf].vform[pc]
- if pc then setchar(p, pc) end
+ for p in traverse_glyph(to_direct(head)) do
+ if getlang(p)==lang_ja and has_attr(p, attr_icflag, 0) then
+ local pf = ltjf_replace_altfont(attr_curtfnt, getchar(p), p)
+ if ltjf_font_metric_table[pf].vert_activated then
+ local pc = ltjf_font_metric_table[pf].vform[pc]; if pc then setchar(p, pc) end
end
end
end
+ else
+ for p in traverse_glyph(to_direct(head)) do
+ if getlang(p)==lang_ja and has_attr(p, attr_icflag, 0) then
+ ltjf_replace_altfont(attr_curjfnt, getchar(p), p)
+ end
+ end
end
return head
end
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua 2023-04-09 19:45:14 UTC (rev 66814)
@@ -3,9 +3,19 @@
--
luatexja.load_module 'base'; local ltjb = luatexja.base
+local get_modtime
+do
+ local find_file = kpse.find_file
+ local lfs = require"lfs"
+ local file_attributes = lfs.attributes
+ get_modtime = function (f)
+ f = f and find_file(f, 'cmap files')
+ return f and file_attributes(f, 'modification')
+ end
+end
local cidfont_data = {}
local cache_chars = {}
-local cache_ver = 11
+local cache_ver = 12
local identifiers = fonts.hashes.identifiers
local cid_reg, cid_order, cid_supp, cid_name
@@ -213,7 +223,11 @@
k.characters[46].width = math.floor(655360/14);
end
ltjb.save_cache("ltj-cid-auto-" .. string.lower(cid_name),
- {version = cache_ver, k})
+ {version = cache_ver,
+ cid2ucs_modtime = get_modtime(cid_name..'-UCS2'),
+ ucs2cid = kx[1]..'-H',
+ ucs2cid_modtime = get_modtime(kx[1]..'-H'),
+ k})
k.shared.rawdata.resources=k.resources
k.shared.rawdata.descriptions=k.descriptions
end
@@ -222,7 +236,7 @@
--
local cidf_vert_processor
do
- local traverse_id, is_node = node.direct.traverse_id, node.is_node
+ local traverse_glyph, is_node = node.direct.traverse_glyph, node.is_node
local to_direct = node.direct.todirect
local id_glyph = node.id 'glyph'
local getfont = node.direct.getfont
@@ -235,10 +249,9 @@
if head and luatexja.jfont.font_metric_table[fnum] and luatexja.jfont.font_metric_table[fnum].vert_activated then
local vt = fontdata.ltj_vert_table
local nh = is_node(head) and to_direct(head) or head
- for n in traverse_id(id_glyph, head) do
- if getfont(n)==fnum then
- local c = getchar(n); setchar(n, vt[c] or c)
- end
+ for n in traverse_glyph(head) do
+ local c = getchar(n)
+ if getfont(n)==fnum then setchar(n, vt[c] or c) end
end
return head, false
end
@@ -249,7 +262,11 @@
local dummy_vht, dummy_vorg = {}, {}
setmetatable(dummy_vht, {__index = function () return 1 end } )
setmetatable(dummy_vorg, {__index = function () return 0.88 end } )
-local function cid_cache_outdated(t) return t.version~=cache_ver end
+local function cid_cache_outdated(t)
+ return (t.version~=cache_ver)
+ or (t.cid2ucs_modtime ~= get_modtime(cid_name..'-UCS2'))
+ or (t.ucs2cid_modtime ~= get_modtime(t.ucs2cid))
+end
local function read_cid_font()
local dat = ltjb.load_cache("ltj-cid-auto-" .. string.lower(cid_name),
cid_cache_outdated)
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua 2023-04-09 19:45:14 UTC (rev 66814)
@@ -33,7 +33,6 @@
local setdepth = node.direct.setdepth
local setlist = node.direct.setlist
-local node_traverse_id = node.direct.traverse_id
local node_traverse = node.direct.traverse
local node_copy = node.direct.copy
local node_remove = node.direct.remove
@@ -281,8 +280,7 @@
-- 数式の位置補正
function luatexja.setwidth.apply_ashift_math(head, last, attr_ablshift)
- for p in node_traverse(head) do
- local pid = getid(p)
+ for p, pid in node_traverse(head) do
if p==last then
return
elseif (get_attr(p, attr_icflag) or 0) ~= PROCESSED then
@@ -309,11 +307,12 @@
local attr_tablshift = luatexbase.attributes['ltj at tablshift']
local attr_ablshift
local disc, tex_dir
+ local traverse_glyph = node.direct.traverse_glyph
local function ashift_disc_inner(field)
local head = getfield(disc, field)
if not head then return end
local y_adjust, node_depth, adj_depth = 0, 0, 0
- for lp in node_traverse_id(id_glyph, head) do
+ for lp in traverse_glyph(head) do
y_adjust = get_attr(lp,attr_ablshift) or 0
local ld = getdepth(lp)
node_depth = max(ld + min(y_adjust, 0), node_depth)
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty 2023-04-09 19:45:14 UTC (rev 66814)
@@ -65,7 +65,7 @@
\expandafter\let\csname ifltj at in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja-core}[2023-02-11 Core of LuaTeX-ja]
+ \ProvidesPackage{luatexja-core}[2023-04-06 Core of LuaTeX-ja]
\fi %</LaTeX>
%% Load prerequisite packages.
@@ -221,11 +221,18 @@
\luadef\ltj@@start at time@measure\ltj@@start at time@measure at inner
\luadef\ltj@@stop at time@measure\ltj@@stop at time@measure at inner
+\let\ltj@@convert at input@path at to@lua\relax % defined in LaTeX only (ltj-latex.sty)
+
%%%%%%%% \jfont\CS={...:...;jfm=metric;...}, \globaljfont
-\protected\def\jfont#1{%
- \def\ltj at temp{#1}\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(false, 'yoko')}}
-\protected\def\globaljfont#1{%
- \def\ltj at temp{#1}\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true, 'yoko')}}
+%%%%%%%% \tfont\CS={...:...;jfm=metric;...}, \globaltfont
+\begingroup
+\def\ltj@@jfdef#1#2#3{%
+ \protected\gdef#1##1{%
+ \ltj@@convert at input@path at to@lua\def\ltj at temp{##1}%
+ \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(#2, '#3')}}}
+\ltj@@jfdef\jfont{false}{yoko}\ltj@@jfdef\globaljfont{true}{yoko}
+\ltj@@jfdef\tfont{false}{tate}\ltj@@jfdef\globaltfont{true}{tate}
+\endgroup
\newluafunction\ltj@@jfont at inner
\directlua{
(lua.get_functions_table())[\the\ltj@@jfont at inner] = luatexja.jfont.jfontdefY
@@ -232,11 +239,6 @@
}
\def\ltj@@jfont{\expandafter\expandafter\expandafter\luafunction\expandafter\ltj@@jfont at inner\ltj at temp}
-%%%%%%%% \tfont\CS={...:...;jfm=metric;...}, \globaltfont
-\protected\def\tfont#1{%
- \def\ltj at temp{#1}\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(false, 'tate')}}
-\protected\def\globaltfont#1{%
- \def\ltj at temp{#1}\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true, 'tate')}}
%%%%%%%% \zw, \zh
\newluafunction\ltj at zw@inner
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua 2023-04-09 19:45:14 UTC (rev 66814)
@@ -1,14 +1,23 @@
require 'lualibs'
------------------------------------------------------------------------
-local function load_lua(fn)
- local found = kpse.find_file(fn, 'tex')
- if not found then
+do
+ local ipath = {}
+ function luatexja.input_path_clear() for i in ipairs(ipath) do ipath[i]=nil end end
+ function luatexja.input_path_add(s) ipath[#ipath+1]=s end
+ function luatexja.load_lua(fn)
+ local found = kpse.find_file(fn, 'tex')
+ if not found then
+ for _,v in ipairs(ipath) do
+ found = kpse.find_file(v .. fn, 'tex'); if found then break end
+ end
+ end
+ if not found then
tex.error("LuaTeX-ja error: File `" .. fn .. "' not found")
- else
+ else
texio.write_nl('(' .. found .. ')'); dofile(found)
- end
+ end
+ end
end
-luatexja.load_lua = load_lua
function luatexja.load_module(name) require('ltj-' .. name.. '.lua') end
do
@@ -100,9 +109,9 @@
local load_module = luatexja.load_module
load_module 'base'; local ltjb = luatexja.base
if tex.outputmode==0 then
- ltjb.package_error('luatexja',
- 'DVI output is not supported in LuaTeX-ja',
- 'Use lua*tex instead dvilua*tex.')
+ ltjb.package_error('luatexja',
+ 'DVI output is not supported in LuaTeX-ja',
+ 'Use lua*tex instead dvilua*tex.')
end
load_module 'rmlgbm'; local ltjr = luatexja.rmlgbm -- must be 1st
if luatexja_debug then load_module 'debug' end
@@ -350,21 +359,28 @@
-- lastnodechar
do
- local getnest = tex.getnest
- local id_glyph = node.id 'glyph'
- function luatexja.pltx_composite_last_node_char()
- local n = getnest().tail
- local r = '-1'
- if n then
- if n.id==id_glyph then
- while n.components and n.subtype and n.subtype%4 >= 2 do
- n = node.tail(n)
- end
- r = tostring(n.char)
- end
+ local get_attr, traverse_glyph = node.get_attribute, node.traverse_glyph
+ local getnest = tex.getnest
+ local id_hlist = node.id 'hlist'
+ local id_glyph = node.id 'glyph'
+ local PACKED, PROCESSED_BEGIN_FLAG = icflag_table.PACKED, icflag_table.PROCESSED_BEGIN_FLAG
+ function luatexja.pltx_composite_last_node_char()
+ local n = getnest().tail
+ local r = '-1'
+ if n then
+ if n.id==id_hlist
+ and (get_attr(n, attr_icflag) or 0) % PROCESSED_BEGIN_FLAG == PACKED then
+ for i in traverse_glyph(n.head) do n = i; break end
end
- tex.sprint(-2, r)
- end
+ if n.id==id_glyph then
+ while n.components and n.subtype and n.subtype%4 >= 2 do
+ n = node.tail(n)
+ end
+ r = tostring(n.char)
+ end
+ end
+ tex.sprint(-2, r)
+ end
end
do
@@ -580,24 +596,24 @@
p=node_next(p)
end
function luatexja.ext_show_node_list(head,depth,print_fn, lim)
- prefix = depth
- inner_depth = 0
- if head then
- while head do
- debug_show_node_X(head, print_fn, lim or 1/0, inner_depth); head = node_next(head)
- end
- else
- print_fn(prefix .. ' (null list)')
- end
+ prefix = depth
+ inner_depth = 0
+ if head then
+ while head do
+ debug_show_node_X(head, print_fn, lim or 1/0, inner_depth); head = node_next(head)
+ end
+ else
+ print_fn(prefix .. ' (null list)')
+ end
end
function luatexja.ext_show_node(head,depth,print_fn, lim)
- prefix = depth
- inner_depth = 0
- if head then
- debug_show_node_X(head, print_fn, lim or 1/0, inner_depth)
- else
- print_fn(prefix .. ' (null list)')
- end
+ prefix = depth
+ inner_depth = 0
+ if head then
+ debug_show_node_X(head, print_fn, lim or 1/0, inner_depth)
+ else
+ print_fn(prefix .. ' (null list)')
+ end
end
end
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty 2023-04-09 19:45:14 UTC (rev 66814)
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjcore}[2022-05-30 Patch to LaTeX2e Kernel for LuaTeX-ja]
+\ProvidesPackage{lltjcore}[2023-02-26 Patch to LaTeX2e Kernel for LuaTeX-ja]
\RequirePackage{etoolbox}
%%% expl3
@@ -201,6 +201,20 @@
\patchcmd\@outputpage{\reset at font}{\@tombowreset@@paper\reset at font}{}{}
\patchcmd\@outputpage{\@begindvi}{\@begindvi\@outputtombow}{}{}
+%
+\pretocmd\@floatboxreset{\pltx at save@float at dir}{}{}
+\patchcmd\@endfloatbox{\outer at nobreak}{\outer at nobreak\pltx at check@float at dir}{}{}
+\def\pltx at save@float at dir{%
+ \edef\pltx at float@dir at first{\ltjgetparameter{direction}}}
+\def\pltx at check@float at dir{%
+ \ifx\pltx at float@dir at first\@undefined\else
+ \ifnum\ltjgetparameter{direction}=\pltx at float@dir at first\else
+ \pltx at err@float at dir
+ \fi
+ \fi}
+\def\pltx at err@float at dir{%
+ \@latex at error{Direction change inside float!?\MessageBreak
+ Use \noexpand\layoutcaption provided in \string\usepackage{lltjext}}\@ehc}
%%% Remove extra xkanjiskip
\renewcommand\@makefnmark{%
\unless\ifnum\ltjgetparameter{direction}=3
Modified: trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty 2023-04-09 19:44:26 UTC (rev 66813)
+++ trunk/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty 2023-04-09 19:45:14 UTC (rev 66814)
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjfont}[2021-05-26 Patch to NFSS2 for LuaTeX-ja]
+\ProvidesPackage{lltjfont}[2023-04-06 Patch to NFSS2 for LuaTeX-ja]
%%%%%%%% LaTeX2e version detection
\newcount\ltj@@latex at plv \ltj@@latex at plv=-1
@@ -1433,4 +1433,18 @@
\ltj@@getjfontnumber#1%
\directlua{luatexja.jfont.pickup_alt_font_b(\the\ltj at tempcntc,'\luatexluaescapestring{#2}')}%
}
+
+%%%% send \input at path data to lua
+\def\ltj@@convert at input@path at to@lua{%
+ \ltj@@cipath at clear
+ \ifdefined\input at path
+ \expandafter\@tfor\expandafter\ltj at temp\expandafter:\expandafter=\input at path\do{\ltj@@cipath at add{\ltj at temp}}%
+ \fi
+}
+\newluafunction\ltj@@cipath at clear@inner
+\directlua{
+ (lua.get_functions_table())[\the\ltj@@cipath at clear@inner] = luatexja.input_path_clear
+}
+\protected\luadef\ltj@@cipath at clear\ltj@@cipath at clear@inner
+\def\ltj@@cipath at add#1{\directlua{luatexja.input_path_add('\luatexluaescapestring{#1}')}}
\endinput
More information about the tex-live-commits
mailing list.