#1\mathstrut\cr\noalign{\vskip1pt\hrule height.4pt\vskip1pt}%
width:\hfill\ #2\cr height:\hfill\ #3\cr depth:\hfill\ #4\cr
}}}}}\,}
-
+\protected\def\+{\insertxkanjiskip late}
\makeatletter
\def\Param#1{\texorpdfstring{\@Param{#1}}{#1}} % parameter name
\protected\def\@Param#1{\eghostguarded{\hyperlink{fld:#1}{\underline{\smash{\textsf{#1}}}}}}
It is not desirable that \Param{xkanjiskip} is inserted into every
boundary between \textbf{JAchar}s and \textbf{ALchar}s. For example,
\Param{xkanjiskip} should not be inserted after opening parenthesis
-(\textit{e.g.}, compare ``(あ'' and ``(\hskip\ltjgetparameter{xkanjiskip}あ'').
+(\textit{e.g.}, compare ``(あ'' and ``(\+あ'').
\LuaTeX-ja can control whether \Param{xkanjiskip} can be inserted
before/after a character, by changing \Param{jaxspmode} for \textbf{JAchar}s and
\Param{alxspmode} parameters \textbf{ALchar}s respectively.
%<*ja>
\Param{xkanjiskip}がすべての\textbf{JAchar}と\textbf{ALchar}の境界に
挿入されるのは望ましいことではない.例えば,\Param{xkanjiskip}は開き括弧の
-後には挿入されるべきではない(「(あ」と「(\hskip\ltjgetparameter{xkanjiskip}あ」を
+後には挿入されるべきではない(「(あ」と「(\+あ」を
比べてみよ).
\LuaTeX-jaでは\Param{xkanjiskip}をある文字の前/後に挿入するかどうかを,
\textbf{JAchar}に対しては\Param{jaxspmode}を,\textbf{ALchar}に対しては
%</en>
-\subsection{\cs{inhibitglue}}
+\subsection{\cs{inhibitglue}, \cs{disinhibitglue}}
%<*en>
-\cs{inhibitglue} suppresses the insertion of \textbf{JAglue}.
+\cs{inhibitglue} suppresses the insertion of a glue/kern soecified in JFM at the place.
The following is an example, using a special JFM that there will be a glue between
the beginning of a box and ``あ'', and also between ``あ''~and~``ウ''.
%</en>
%<*ja>
-\cs{inhibitglue} は\textbf{JAglue}の挿入を抑制する.
+\cs{inhibitglue} は発行箇所でのJFM由来グルー/カーンの挿入を抑制する.
以下は,ボックスの始めと「あ」の間,「あ」「ウ」の間にグルーが入る特別なJFMを用いた例で
ある.
%</ja>
\inhibitglue\par\noindent あ1
\par\inhibitglue\noindent あ2
\par\noindent\inhibitglue あ3
+\par )4)\inhibitglue 5
\par\hrule\noindent あoff\inhibitglue ice
\end{LTXexample}
%</ja>
%<*en>
+\item \cs{inhibitglue} does \emph{not} suppress \Param{kanjiskip} or \cs{xkanjiskip}.
+%</en>
+%<*ja>
+\item \cs{inhibitglue}は\Param{kanjiskip}, \Param{xkanjiskip}の挿入は抑制しない.
+ 例えば上の例の6行目では,「)」と「5」の間には本来はJFM由来の半角空きが挿入されるはずだが,
+ それが\cs{inhibitglue}で無効になったため,\Param{xkanjiskip}が代わりに挿入されている.
+%</ja>
+
+%<*en>
\item The call of \cs{inhibitglue} in the (restricted) horizontal
mode is only effective on the spot; does not get over boundary of
paragraphs. Moreover, \cs{inhibitglue} cancels ligatures and
kernings, as shown in the last line of above example.
-%</en>
+%</en>i
%<*ja>
\item \cs{inhibitglue} の(制限された)水平モード中での呼び出しはその場でのみ
有効であり,段落の境界を乗り越えない.
%</ja>
\end{itemize}
+%<*en>
+\cs{disinhibitglue} suppresses the effect of \cs{inhbitglue}.
+In other words, \cs{disinhibitglue} allows the insertion of a glue/kern specified by JFM.
+If \cs{inhibitglue}~and~\cs{disinhibitglue} both specified at the same time,
+the latest one is effective.
+This commans is added in the version 2020****.0.
+
+Note that \cs{disinhibitglue} also cancels ligatures and kernings.
+%</en>
+%<*ja>
+\cs{disinhibitglue}は\cs{inhibitglue}の効果を無効化する.
+言い換えれば,(\cs{inhibitglue}で抑制されたはずの))JFM由来グルー/カーンの挿入を許可する.
+同じ箇所に\cs{inhibitglue}と\cs{disinhibitglue}が両方ある場合は,後ろの指定が有効になる.
+この命令はバージョン2020****.0で追加された.
+
+なお,\cs{disinhibitglue}もリガチャやカーニングを打ち消すことに注意されたい.これは
+(\cs{inhibitglue}と同様に)whatsitノードを使って実装されていることによる.
+%</ja>
\subsection{\cs{ltjfakeboxbdd}, \cs{ltjfakeparbegin}}
%<*en>
\end{LTXexample}
+\subsection{\cs{insertxkanjiskip}, \cs{insertkanjiskip}}
+%<*en>
+There are some situations which one wants to insert \Param{xkanjiskip} manually.
+A simple approach is to use \cs{hskip}\cs{ltjgetparamter\{xkanjiskip\}}, but this approach has
+several weak points. To cope with these weak points, \LuaTeX-ja defines a command \cs{insertxkanjiskip} which
+inserts \Param{xkanjiskip} glue manually, from the version 2020****.0.
+\begin{itemize}
+ \item ``\cs{insertxkanjiskip}'' (without any keyword) uses the value of \Param{xkanjiskip} at the place.
+ \item ``\cs{insertxkanjiskip late}'' (with ``\texttt{late}''~keyword) uses the value of \Param{xkanjiskip}
+ at the end of a paragraph/hbox.
+\end{itemize}
+See the example below.
+%</en>
+%<*ja>
+\TeX で日本語の文章を作成していると,
+しばしば「手動で和欧文間空白\Param{xkanjiskip}を挿入したい」という状況に遭遇する.
+このような場合,\cs{hskip}\cs{ltjgetparamter\{xkanjiskip\}}\+とするのがよくある対応であったが,これらには
+次のような難点がある:
+\begin{itemize}
+ \item \cs{xkanjiskip}は「段落やhboxでの終端での値がその段落/hbox全体で用いられる」となっているため,
+ \cs{hskip}\cs{ltjgetparamter\{xkanjiskip\}}\+以降に\Param{xkanjiskip}の値が変わる場合に対応できない.
+ \item \LuaTeX-jaでは,\cs{xkanjiskip}の自然長が$\cs{maxdimen}=(2^{30}-1)\,\mbox{sp}$であった場合,
+ JFMで指定された値を実際に利用することになっているが,それに対応できていない.
+ \item \Pkg{luatexja-adjust}(\ref{ssec:adj}節)による優先度行長調整では,
+ \cs{hskip}\cs{ltjgetparamter\{xkanjiskip\}}\+は手動で挿入したグルーであるから,
+ 自動で挿入された\Param{xkanjiskip}とは
+ 伸縮の優先順序が異なってしまう.
+\end{itemize}
+
+これらの難点に対処した,\Param{xkanjiskip}をグルーとして手動挿入する命令が\cs{insertxkanjiskip}である.
+これはバージョン2020****.0で追加された.
+以下の実行例に示すように,
+\begin{itemize}
+ \item 単独で\cs{insertxkanjiskip}とした場合は,その時点での\Param{xkanjiskip}の値を使用する
+ \item 「\cs{insertxkanjiskip~late}」と\texttt{late}キーワードを後置した場合は,
+ 段落/hbox終了時にそのときの\Param{xkanjiskip}の値に自動設定される
+ (段落/hbox途中での値は未定義)
+ \item どちらであっても,実行箇所に本来なら自動挿入されるはずのJFM由来グルー/カーンは挿入されない
+\end{itemize}
+となっている.
+%</ja>
+\begin{LTXexample}[width=0.3333\textwidth]
+\ltjsetparameter{xkanjiskip=0.25\zw}
+あ(% 0.5\zw (from JFM)
+あ\insertxkanjiskip (% 0.25\zw (xkanjiskip at here)
+あ\insertxkanjiskip late (% 0.25\zw (xkanjiskip at EOP)
+あa% 1.25\zw (xkanjiskip at EOP)
+\\%
+\ltjsetparameter{xkanjiskip=1.25\zw}
+あ\insertxkanjiskip (% 1.25\zw (xkanjiskip at here)
+あa% 1.25\zw (xkanjiskip at EOP)
+%% At the end of the paragraph (EOP), xkanjiskip is 1.25\zw.
+\end{LTXexample}
+
+%<*en>
+There is a similar command \cs{insertkanjiskip} (\Param{kanjiskip} instead~of \Param{xkanjiskip}) is also defined.
+Note that any shorthand form of \cs{insert}[\texttt{x}]\texttt{kanjiskip} are not defined by \LuaTeX-ja.
+%</en>
+%<*ja>
+\cs{insertxkanjiskip}(または\texttt{late}つき)の短縮形
+\footnote{ちょうど\cs{inhibitglue}の短縮形\cs{\ltjalchar`\<}\+に対応するもの.}は
+\LuaTeX-jaでは定義していない.短縮形を使いたい人は,面倒でも各自で
+\begin{lstlisting}
+ \protected\def\+{\insertxkanjiskip late}
+\end{lstlisting}
+などと定義してほしい.
+
+最後になるが,以上の説明の\Param{xkanjiskip}をすべて標準の和文間空白\Param{kanjiskip}に置き換えた
+\cs{insertkanjiskip}命令も準備されている.
+%</ja>
+
\subsection{\cs{ltjdeclarealtfont}}
\label{ssec:altfont}
%<*en>
結果として,2つの\textbf{JAchar}間には常に何らかのグルー/カーンが挿入されることとなる.
\begin{enumerate}
\item 両クラスタ(厳密には$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$)の中身の文字コードに対する
-\Param{autospacing}パラメタが両方ともfalseだった場合は,長さ0のglueとする.
-\item ã\83¦ã\83¼ã\82¶å\81´ã\81\8bã\82\89è¦\8bã\81\9f\Param{kanjiskip}ã\83\91ã\83©ã\83¡ã\82¿ã\81®è\87ªç\84¶é\95·ã\81\8c$\cs{maxdimen}=(2^{30}-1)\,{\rm sp}$で
-なければ,\Param{kanjiskip}パラメタの値を持つglueを採用する.
+\Param{autospacing}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8c両æ\96¹ã\81¨ã\82\82falseã\81 ã\81£ã\81\9få ´å\90\88ã\81¯ï¼\8cé\95·ã\81\950ã\81®glueã\81¨ã\81\99ã\82\8bï¼\8e
+\item ã\83¦ã\83¼ã\82¶å\81´ã\81\8bã\82\89è¦\8bã\81\9f\Param{kanjiskip}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81®è\87ªç\84¶é\95·ã\81\8c$\cs{maxdimen}=(2^{30}-1)\,\mbox{sp}$で
+ã\81ªã\81\91ã\82\8cã\81°ï¼\8c\Param{kanjiskip}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81®å\80¤ã\82\92æ\8c\81ã\81¤glueã\82\92æ\8e¡ç\94¨ã\81\99ã\82\8bï¼\8e
\item 2.でない場合は,\textit{Nq}, \textit{Np}で使われているJFMに指定されている\Param{kanjiskip}の値を用いる.
どちらか片方のクラスタだけが\textbf{JAchar}(\textsf{和文A}・\textsf{和文B})のときは,そちらのクラスタで使われている
JFM由来の値だけを用いる.もし両者で使われているJFMが異なった場合は,上の[M]~3.と同様の方法を用いて調整する.
\item $\mathit{Np}.\mathit{id}$が\textit{id\_math}のとき(つまりクラスタ\textit{Np}が文中数式を表す)
ときは,$x=-1$.
\item \textit{Np}の中身の中身の文字コードについて,「直前への\Param{xkanjiskip}の挿入」が禁止されている
-(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが偶数)ときは,
+ï¼\88ã\81¤ã\81¾ã\82\8aï¼\8c\Param{jaxspmode}~(or \Param{alxspmode})ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8cå\81¶æ\95°ï¼\89ã\81¨ã\81\8dã\81¯ï¼\8c
$x=\text{\texttt{'nox\_alchar'}}$.
\item 以上のいずれでもないときは,$x=\text{\texttt{'alchar'}}$.
\end{itemize}
\begin{enumerate}
\item 以下のいずれかの場合は,\Param{xkanjiskip}の挿入は抑止される.しかし,実際には行分割を許容するために,長さ0のglueを採用する:
\begin{itemize}
-\item 両クラスタにおいて,それらの中身の文字コードに対する\Param{autoxspacing}パラメタが共にfalseである.
+\item 両ã\82¯ã\83©ã\82¹ã\82¿ã\81«ã\81\8aã\81\84ã\81¦ï¼\8cã\81\9dã\82\8cã\82\89ã\81®ä¸èº«ã\81®æ\96\87å\97ã\82³ã\83¼ã\83\89ã\81«å¯¾ã\81\99ã\82\8b\Param{autoxspacing}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8cå\85±ã\81«falseã\81§ã\81\82ã\82\8bï¼\8e
\item \textit{Nq}の中身の文字コードについて,「直後への\Param{xkanjiskip}の挿入」が禁止されている
-(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが2以上).
+ï¼\88ã\81¤ã\81¾ã\82\8aï¼\8c\Param{jaxspmode}~(or \Param{alxspmode})ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8c2以ä¸\8aï¼\89ï¼\8e
\item \textit{Np}の中身の文字コードについて,「直前への\Param{xkanjiskip}の挿入」が禁止されている
-(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが偶数).
+ï¼\88ã\81¤ã\81¾ã\82\8aï¼\8c\Param{jaxspmode}~(or \Param{alxspmode})ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8cå\81¶æ\95°ï¼\89ï¼\8e
\end{itemize}
-\item ユーザ側から見た\Param{xkanjiskip}パラメタの自然長が$\cs{maxdimen}=(2^{30}-1)\,{\rm sp}$で
-なければ,\Param{xkanjiskip}パラメタの値を持つglueを採用する.
+\item ã\83¦ã\83¼ã\82¶å\81´ã\81\8bã\82\89è¦\8bã\81\9f\Param{xkanjiskip}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81®è\87ªç\84¶é\95·ã\81\8c$\cs{maxdimen}=(2^{30}-1)\,{\rm sp}$ã\81§
+ã\81ªã\81\91ã\82\8cã\81°ï¼\8c\Param{xkanjiskip}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81®å\80¤ã\82\92æ\8c\81ã\81¤glueã\82\92æ\8e¡ç\94¨ã\81\99ã\82\8bï¼\8e
\item 2.でない場合は,\textit{Nq}, \textit{Np}(\textsf{和文A}/\textsf{和文B}なのは片方だけ)
で使われているJFMに指定されている\Param{xkanjiskip}の値を用いる.
\end{enumerate}
\texttt{'nox\_alchar'}か\texttt{'alchar'}は
\begin{quote}
\textit{Nq}の中身の文字コードについて,「直後への\Param{xkanjiskip}の挿入」が禁止されている
-(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが2以上).
+ï¼\88ã\81¤ã\81¾ã\82\8aï¼\8c\Param{jaxspmode}~(or \Param{alxspmode})ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8c2以ä¸\8aï¼\89ï¼\8e
\end{quote}
か否かで判断する.
\end{enumerate}
--
luatexbase.provides_module({
name = 'luatexja.jfmglue',
- date = '2020-12-20',
+ date = '2020-12-22',
description = 'Insertion process of JFM glues, [x]kanjiskip and others',
})
luatexja.jfmglue = luatexja.jfmglue or {}
local PROCESSED = luatexja.icflag_table.PROCESSED
local IC_PROCESSED = luatexja.icflag_table.IC_PROCESSED
local BOXBDD = luatexja.icflag_table.BOXBDD
+local SPECIAL_JAGLUE = luatexja.icflag_table.SPECIAL_JAGLUE
local PROCESSED_BEGIN_FLAG = luatexja.icflag_table.PROCESSED_BEGIN_FLAG
local attr_icflag = luatexbase.attributes['ltj@icflag']
end,
[id_glue] = function(lp)
Np.first, Np.nuc, Np.last = (Np.first or lp), lp, lp;
- Np.id = getid(lp); set_attr(lp, attr_icflag, PROCESSED)
+ Np.id = getid(lp);
+ local f = luatexbase.call_callback("luatexja.jfmglue.special_jaglue", lp)
+ if f then
+ set_attr(lp, attr_icflag, PROCESSED)
+ end
return true, node_next(lp)
end,
[id_disc] = function(lp)
while lp ~= last do
local lpa = has_attr(lp, attr_icflag) or 0
-- unbox 由来ノードの検出
- if lpa>=PACKED then
+ if (lpa>=PACKED) and (lpa%PROCESSED_BEGIN_FLAG<=BOXBDD) then
if lpa%PROCESSED_BEGIN_FLAG == BOXBDD then
local lq = node_next(lp)
head = node_remove(head, lp); node_free(lp); lp = lq
do
local adjust_nq_aux = {
[id_glyph] = function() after_alchar(Nq) end, -- after_alchar(Nq)
- [id_hlist] = function() after_hlist(Nq) end,
+ [id_hlist] = function() after_hlist(Nq) end,
[id_pbox] = function() after_hlist(Nq) end,
[id_disc] = function() after_hlist(Nq) end,
- [id_pbox_w] = function()
- luatexbase.call_callback("luatexja.jfmglue.whatsit_after",
- false, Nq, Np)
- end,
+ [id_glue] = function()
+ luatexbase.call_callback("luatexja.jfmglue.special_jaglue_after", Nq.nuc)
+ end,
+ [id_pbox_w]= function()
+ luatexbase.call_callback("luatexja.jfmglue.whatsit_after", false, Nq, Np)
+ end,
}
adjust_nq = function()
end
do
+ local node_prev = node.direct.getprev
local node_write = node.direct.write
local XKANJI_SKIP = luatexja.icflag_table.XKANJI_SKIP
local XKANJI_SKIP_JFM = luatexja.icflag_table.XKANJI_SKIP_JFM
- local XSK = luatexja.stack_table_index.XSK
local KANJI_SKIP = luatexja.icflag_table.KANJI_SKIP
local KANJI_SKIP_JFM = luatexja.icflag_table.KANJI_SKIP_JFM
+ local XSK = luatexja.stack_table_index.XSK
local KSK = luatexja.stack_table_index.KSK
- local get_dir_count = ltjd.get_dir_count
- local dir_tate = luatexja.dir_table.dir_tate
- local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
- local attr_curtfnt = luatexbase.attributes['ltj@curtfnt']
+ local attr_yablshift = luatexbase.attributes['ltj@yablshift']
+ local attr_tablshift = luatexbase.attributes['ltj@tablshift']
+ local getcount, abs, scan_keyword = tex.getcount, math.abs, token.scan_keyword
+ local get_current_jfont
+ do
+ local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
+ local attr_curtfnt = luatexbase.attributes['ltj@curtfnt']
+ local dir_tate = luatexja.dir_table.dir_tate
+ local get_dir_count = ltjd.get_dir_count
+ function get_current_jfont()
+ return tex.getattribute((get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt)
+ end
+ end
-- \insertxkanjiskip
- function luatexja.jfmglue.insert_xk_skip()
- local st = ltjs.get_stack_skip(XSK, tex.getcount('ltj@@stack'))
- if st.width==1073741823 then
- local j = ltjf_font_metric_table[
- tex.getattribute((get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt)
- ]
- if j.xkanjiskip then
- local g, bk = node_new(id_glue), j.xkanjiskip
- setglue(g, bk[1] or 0, bk[2] or 0, bk[3] or 0, 0, 0)
- set_attr(g, attr_icflag, XKANJI_SKIP_JFM); node_write(g)
- return
+ -- SPECIAL_JAGLUE のノード:
+ -- * (X)KANJI_SKIP(_JFM): その場で値が決まっている
+ -- * PROCESSED_BEGIN_FLAG + (X)KANJI_SKIP: 段落終了時に決める
+ local function insert_k_skip_common(ind, name, ica, icb)
+ if abs(tex.nest[tex.nest.ptr].mode) ~= ltjs.hmode then return end
+ local g = node_new(id_glue); set_attr(g, attr_icflag, SPECIAL_JAGLUE)
+ local is_late = scan_keyword("late")
+ if not is_late then
+ local st = ltjs.get_stack_skip(ind, getcount('ltj@@stack'))
+ if st.width==1073741823 then
+ local bk = ltjf_font_metric_table[get_current_jfont()][name]
+ if bk then
+ setglue(g, bk[1] or 0, bk[2] or 0, bk[3] or 0, 0, 0)
+ end
+ set_attr(g, attr_yablshift, icb); node_write(g); return
end
+ setglue(g, st.width, st.stretch, st.shrink, st.stretch_order, st.shrink_order)
+ set_attr(g, attr_yablshift, ica)
+ else
+ set_attr(g, attr_yablshift, PROCESSED_BEGIN_FLAG + ica)
+ set_attr(g, attr_tablshift, get_current_jfont())
end
- local g = node_new(id_glue)
- setglue(g, st.width, st.stretch, st.shrink, st.stretch_order, st.shrink_order)
- set_attr(g, attr_icflag, XKANJI_SKIP); node_write(g)
+ node_write(g)
+ end
+ function luatexja.jfmglue.insert_xk_skip()
+ insert_k_skip_common(XSK, "xkanjiskip", XKANJI_SKIP, XKANJI_SKIP_JFM)
end
- -- \insertkanjiskip
function luatexja.jfmglue.insert_k_skip()
- local st = ltjs.get_stack_skip(KSK, tex.getcount('ltj@@stack'))
- if st.width==1073741823 then
- local j = ltjf_font_metric_table[
- tex.getattribute((get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt)
- ]
- if j.kanjiskip then
- local g, bk = node_new(id_glue), j.kanjiskip
- setglue(g, bk[1] or 0, bk[2] or 0, bk[3] or 0, 0, 0)
- set_attr(g, attr_icflag, KANJI_SKIP_JFM); node_write(g)
- return
+ insert_k_skip_common(KSK, "kanjiskip", KANJI_SKIP, KANJI_SKIP_JFM)
+ end
+ -- callback
+ local getglue = luatexja.getglue
+ local function special_jaglue(lx)
+ local lxi = get_attr_icflag(lx)
+ if lxi==SPECIAL_JAGLUE then
+ non_ihb_flag = false; return false
+ else
+ return lx
+ end
+ end
+ local function special_jaglue_after(lx)
+ if get_attr_icflag(lx)==SPECIAL_JAGLUE then
+ lxi=has_attr(lx, attr_yablshift)
+ if lxi>=PROCESSED_BEGIN_FLAG then
+ lxi = lxi%PROCESSED_BEGIN_FLAG
+ if lxi == KANJI_SKIP then
+ local w, st, sh, sto, sho = getglue(kanji_skip)
+ if w~=1073741823 then
+ setglue(lx, w, st, sh, sto, sho); set_attr(lx, attr_icflag, KANJI_SKIP)
+ else
+ local m = ltjf_font_metric_table[has_attr(lx, attr_tablshift)]
+ local bk = m.kanjiskip or null_skip_table
+ setglue(lx, bk[1], bk[2], bk[3], 0, 0)
+ set_attr(lx, attr_icflag, KANJI_SKIP_JFM)
+ end
+ elseif lxi == XKANJI_SKIP then
+ local w, st, sh, sto, sho = getglue(xkanji_skip)
+ if w~=1073741823 then
+ setglue(lx, w, st, sh, sto, sho); set_attr(lx, attr_icflag, XKANJI_SKIP)
+ else
+ local m = ltjf_font_metric_table[has_attr(lx, attr_tablshift)]
+ local bk = m.xkanjiskip or null_skip_table
+ setglue(lx, bk[1], bk[2], bk[3], 0, 0)
+ set_attr(lx, attr_icflag, XKANJI_SKIP_JFM)
+ end
+ end
+ else
+ set_attr(lx, attr_icflag, lxi)
+ end
+ Np.first = lx
+ if node_prev(lx) then
+ local lxp = node_prev(lx)
+ if lxp and getid(lxp)==id_penalty and get_attr_icflag(lxp)==KINSOKU then
+ Bp[#Bp+1]=lxp
+ end
end
+ non_ihb_flag = false; return false
end
- local g = node_new(id_glue)
- setglue(g, st.width, st.stretch, st.shrink, st.stretch_order, st.shrink_order)
- set_attr(g, attr_icflag, KANJI_SKIP); node_write(g)
+ return true
end
+ luatexbase.create_callback("luatexja.jfmglue.special_jaglue", "list",
+ special_jaglue)
+ luatexbase.create_callback("luatexja.jfmglue.special_jaglue_after", "list",
+ special_jaglue_after)
end
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja-core}[2020-12-20 Core of LuaTeX-ja]
+ \ProvidesPackage{luatexja-core}[2020-12-22 Core of LuaTeX-ja]
\fi %</LaTeX>
%% Load prerequisite packages.
\protected\def\inhibitglue{\ifhmode\relax\luafunction\ltj@@ihb@inner\fi}
\protected\def\ltjfakeparbegin{\ifhmode\relax\luafunction\ltj@@fakeparbegin@inner\fi}
\protected\def\ltjfakeboxbdd{\ifhmode\relax\luafunction\ltj@@fakeboxbdd@inner\fi}
-\protected\def\insertxkanjiskip{\ifhmode\relax\luafunction\ltj@@ins@xk@inner\fi}
-\protected\def\insertkanjiskip{\ifhmode\relax\luafunction\ltj@@ins@k@inner\fi}
+\protected\luadef\insertxkanjiskip \ltj@@ins@xk@inner
+\protected\luadef\insertkanjiskip \ltj@@ins@k@inner
%%%%%%%% \ltjdefcharrange<name>{100-200,3000-,5000,...}
icflag_table.PROCESSED = 73
icflag_table.IC_PROCESSED = 74
icflag_table.BOXBDD = 75
+icflag_table.SPECIAL_JAGLUE = 76
+-- 段落組版中のノードリストでは通常のノード (not whatsit) だが
+-- 和文処理グルー挿入プロセスで長さが決定されるもの
icflag_table.PROCESSED_BEGIN_FLAG = 4096 -- sufficiently large power of 2
local stack_ind = {}
2 hlist 0 (5.0+5.0)x10.0, dir=0 (packed)
.0 glyph 256 感 (U+611F) 75 (8.48+0.66)x10.0
======
- [12])
-(see the transcript file for additional information)</opt/texlive/texmf-local/f
-onts/truetype/sysfnt/OTF/ipaexm.ttf></opt/texlive/texmf-local/fonts/truetype/sy
-sfnt/OTF/ipaexg.ttf></usr/share/fonts/OTF/ipamp.ttf></usr/share/fonts/mine/KozM
-inPr6N-Regular.otf></usr/share/fonts/OTF/ipam.ttf></opt/texlive/2020/texmf-dist
-/fonts/type1/public/amsfonts/cm/cmbx10.pfb></opt/texlive/2020/texmf-dist/fonts/
-type1/public/amsfonts/cm/cmmi10.pfb></opt/texlive/2020/texmf-dist/fonts/type1/p
-ublic/amsfonts/cm/cmr10.pfb></opt/texlive/2020/texmf-dist/fonts/type1/public/am
-sfonts/cm/cmti10.pfb></opt/texlive/2020/texmf-dist/fonts/type1/public/amsfonts/
-cm/cmtt10.pfb>
-Output written on test04-jfm.pdf (12 pages, 714251 bytes).
+======
+49 whatsit 8 userid:4 (direction) (node list) dir: 4
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+45 glue 0 0.0pt plus 0.4pt (kanjiskip, JFM specified)
+28 glue 0 5.0pt minus 5.0pt (from JFM: priority 36)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ( (U+FF08) 66 (8.32031+0.71777)x5.09766 off: (-0.09766,0.0)
+3 penalty 0 10000 (for kinsoku)
+45 glue 0 0.0pt minus 0.4pt (kanjiskip, JFM specified)
+28 glue 0 0.0pt (from JFM: priority 36)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+45 glue 0 0.0pt plus 0.4pt (kanjiskip, JFM specified)
+28 glue 0 5.0pt minus 5.0pt (from JFM: priority 36)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ( (U+FF08) 66 (8.32031+0.71777)x5.09766 off: (-0.09766,0.0)
+3 penalty 0 10000 (for kinsoku)
+45 glue 0 0.0pt minus 0.4pt (kanjiskip, JFM specified)
+28 glue 0 0.0pt (from JFM: priority 36)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+45 glue 0 0.0pt plus 0.4pt (kanjiskip, JFM specified)
+28 glue 0 5.0pt minus 5.0pt (from JFM: priority 36)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ( (U+FF08) 66 (8.32031+0.71777)x5.09766 off: (-0.09766,0.0)
+======
+======
+49 whatsit 8 userid:4 (direction) (node list) dir: 4
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+44 glue 0 0.0pt plus 0.4pt minus 0.4pt (kanjiskip)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ( (U+FF08) 66 (8.32031+0.71777)x5.09766 off: (-0.09766,0.0)
+3 penalty 0 10000 (for kinsoku)
+45 glue 0 0.0pt minus 0.4pt (kanjiskip, JFM specified)
+28 glue 0 0.0pt (from JFM: priority 36)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+44 glue 0 0.0pt plus 0.4pt minus 0.4pt (kanjiskip)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ( (U+FF08) 66 (8.32031+0.71777)x5.09766 off: (-0.09766,0.0)
+======
+======
+49 whatsit 8 userid:4 (direction) (node list) dir: 4
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+46 glue 0 2.40553pt plus 1.0pt minus 1.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ( (U+FF08) 66 (8.32031+0.71777)x5.09766 off: (-0.09766,0.0)
+3 penalty 0 10000 (for kinsoku)
+46 glue 0 2.40553pt plus 1.0pt minus 1.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+3 penalty 0 10000 (for kinsoku)
+46 glue 0 2.40553pt plus 1.0pt minus 1.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ) (U+FF09) 66 (8.32031+0.71777)x5.09766
+45 glue 0 0.0pt plus 0.4pt (kanjiskip, JFM specified)
+28 glue 0 5.0pt minus 5.0pt (from JFM: priority 36)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ( (U+FF08) 66 (8.32031+0.71777)x5.09766 off: (-0.09766,0.0)
+3 penalty 0 10000 (for kinsoku)
+46 glue 0 2.40553pt plus 1.0pt minus 1.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ) (U+FF09) 66 (8.32031+0.71777)x5.09766
+======
+ [12]======
+49 whatsit 8 userid:4 (direction) (node list) dir: 4
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+46 glue 0 2.40553pt plus 1.0pt minus 1.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+49 glyph 256 a (U+61) 68 (5.2002+0.03906)x5.49805
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+49 glyph 256 c (U+63) 68 (5.22949+0.04883)x5.43945
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+======
+======
+49 whatsit 8 userid:4 (direction) (node list) dir: 4
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+49 glyph 256 a (U+61) 68 (5.2002+0.03906)x5.49805
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+49 glyph 256 c (U+63) 68 (5.22949+0.04883)x5.43945
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+46 glue 0 6.2pt plus 3.0pt (xkanjiskip)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+======
+======
+49 whatsit 8 userid:4 (direction) (node list) dir: 4
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+47 glue 0 2.5pt plus 2.5pt minus 1.25pt (xkanjiskip, JFM specified)
+49 glyph 256 c (U+63) 68 (5.22949+0.04883)x5.43945
+47 glue 0 2.5pt plus 2.5pt minus 1.25pt (xkanjiskip, JFM specified)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+47 glue 0 2.5pt plus 2.5pt minus 1.25pt (xkanjiskip, JFM specified)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+47 glue 0 2.5pt plus 2.5pt minus 1.25pt (xkanjiskip, JFM specified)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+======
+======
+49 whatsit 8 userid:4 (direction) (node list) dir: 4
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ) (U+FF09) 66 (8.32031+0.71777)x5.09766
+45 glue 0 0.0pt plus 0.4pt (kanjiskip, JFM specified)
+28 glue 0 5.0pt minus 5.0pt (from JFM: priority 36)
+2 hlist 0 (8.8+1.2)x10.0, dir=0 (packed)
+.0 glyph 256 あ (U+3042) 66 (8.11035+0.36133)x8.99902
+3 penalty 0 10000 (for kinsoku)
+45 glue 0 0.0pt minus 0.4pt (kanjiskip, JFM specified)
+28 glue 0 0.0pt (from JFM: priority 36)
+2 hlist 0 (8.8+1.2)x5.0, dir=0 (packed)
+.0 glyph 256 ) (U+FF09) 66 (8.32031+0.71777)x5.09766
+======
+ [13])
+(see the transcript file for additional information)</opt/texlive/2020/texmf-di
+st/fonts/truetype/public/ipaex/ipaexm.ttf></opt/texlive/2020/texmf-dist/fonts/t
+ruetype/public/ipaex/ipaexg.ttf></opt/texlive/2020/texmf-dist/fonts/truetype/pu
+blic/ipaex/ipamp.ttf></opt/fonts/kozuka/KozMinPr6N-Regular.otf></usr/share/font
+s/cjk/ipam.ttf></opt/texlive/2020/texmf-dist/fonts/type1/public/amsfonts/cm/cmb
+x10.pfb></opt/texlive/2020/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb
+></opt/texlive/2020/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></opt/t
+exlive/2020/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/texlive/
+2020/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb>
+Output written on test04-jfm.pdf (13 pages, 716694 bytes).
Transcript written on test04-jfm.log.
\head{その他: kanjiskip with inf stretch}
\jfont\knx=KozMinPr6N-Regular.otf:jfm=test2;-kern
-\ltjsetparameter{kanjiskip=1pt plus 1.25fil minus 2.75fill}
+{\ltjsetparameter{kanjiskip=1pt plus 1.25fil minus 2.75fill}
\ltjsetparameter{differentjfm=average}
\setbox0=\hbox{感感」\knx 感}
+\dumplist0}
+
+\head{inhibitglue and disinhibitglue}
+\setbox0=\hbox{あ(あ\disinhibitglue (あ\inhibitglue\disinhibitglue (}
+\dumplist0
+\setbox0=\hbox{あ\inhibitglue (あ\disinhibitglue\inhibitglue (}
+\dumplist0
+
+\head{insertxkanjiskip and insertkanjiskip}
+\setbox0=\hbox{あ\insertxkanjiskip (\insertxkanjiskip あ\insertxkanjiskip )(\insertxkanjiskip )}
+\dumplist0
+
+\setbox0=\hbox{あ\insertxkanjiskip あaあ\ltjsetparameter{xkanjiskip=6.2pt plus 3pt}cあ\insertxkanjiskip あ}
+\dumplist0
+
+\setbox0=\hbox{あ\insertxkanjiskip lateあaあ\ltjsetparameter{xkanjiskip=6.2pt plus 3pt}cあ\insertxkanjiskip lateあ}
+\dumplist0
+
+\setbox0=\hbox{あ\ltjsetparameter{xkanjiskip=\maxdimen plus 3pt}cあ\insertxkanjiskip あ\insertxkanjiskip lateあ}
+\dumplist0
+
+\setbox0=\hbox{)\insertxkanjiskip\unskip あ)}
\dumplist0
\end