summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/README8
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdfbin471601 -> 475636 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdfbin857865 -> 864463 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx213
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty6
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-otf.sty2
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua3
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-inputbuf.lua6
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua55
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua85
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty6
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua2
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/luatexja.lua6
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/luatexja.sty2
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty6
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec.sty22
16 files changed, 290 insertions, 132 deletions
diff --git a/Master/texmf-dist/doc/luatex/luatexja/README b/Master/texmf-dist/doc/luatex/luatexja/README
index e8b7327c40d..23b24686a77 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 20190408.0
+The LuaTeX-ja Package 20190504.0
--------------------------------
Copyright (c) 2011--2019 The LuaTeX-ja project
License: modified BSD (see COPYING)
@@ -40,9 +40,9 @@ Installation
2. If you must/want to install manually:
a. Download the source archive from CTAN,
- or tagged as 20190408.0 in the Git repository by
+ or tagged as 20190504.0 in the Git repository by
<http://git.osdn.jp/view?p=luatex-ja/luatexja.git
- ;a=snapshot;h=refs/tags/20190408.0;sf=tgz>
+ ;a=snapshot;h=refs/tags/20190504.0;sf=tgz>
b. Extract the archive and process following three files by LuaLaTeX
to generate classes for Japanese typesetting:
@@ -87,4 +87,4 @@ Notes
* src/*.{ins.dtx} and src/ltj-kinsoku_make.tex are not needed in regular use.
-Last commit date: Mon Apr 8 20:12:43 2019 +0900
+Last commit date: Sat May 4 18:31:06 2019 +0900
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
index b80e7af9b33..eedae61c07e 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
index faf50655248..1be6cee119a 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
index 42ec1a0343b..da30d2ac1de 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
@@ -1141,7 +1141,7 @@ Okumura), namely, \Pkg{ltjclasses}\footnote{%
\texttt{ltjsarticle.cls},~\texttt{ltjsbook.cls}, \texttt{ltjsreport.cls},~\texttt{ltjskiyou.cls}.}.
Original \Pkg{jsclasses} use \cs{mag}~primitive to set the main document font size.
-However, \LuaTeX\ beta-0.87.0~or~later does not support \cs{mag} in PDF~output,
+However, \LuaTeX\ does not support \cs{mag} in PDF~output,
so \Pkg{ltjsclasses} uses the \texttt{nomag*} option\footnote{Same effect as
the \Pkg{BXjscls} classes (by Takayuki Yato) and \Pkg{jsclasses}.
However, these classes uses only \TeX\ code, but \Pkg{ltjsclasses} uses Lua code.}
@@ -1163,7 +1163,7 @@ so \Pkg{ltjsclasses} uses the \texttt{nomag*} option\footnote{Same effect as
がそれぞれ\LuaTeX-ja標準で用意されている.
元々の\Pkg{jsclasses}では本文のフォントサイズを設定するのに\cs{mag}プリミティブが使われていたが,
-\LuaTeX~beta-0.87.0以降ではPDF出力時の\cs{mag}のサポートが廃止された.
+\LuaTeX ではPDF出力時の\cs{mag}のサポートが廃止された.
そのため,\Pkg{ltjsclasses}では\texttt{nomag*}オプション
\footnote{\Pkg{jsclasses}や,八登崇之氏による\Pkg{BXjscls}クラスにおける同名のオプションと
同じ.上記クラスは\TeX コードのみで実装しているが,\Pkg{ltjsclasses}ではLuaコードも用いている.}が標準で
@@ -2410,7 +2410,7 @@ However, the penalty inserted after it is 10 which is the \Param{postbreakpenalt
``ア'', not 20.
%</en>
%<*ja>
-\subsection{禁則処理関連パラメータとOpenTypeのfont feature}
+\subsection{禁則処理関連パラメータとOpenType機能}
禁則処理や \Param{kanjiskip}, \Param{xkanjiskip} の挿入に関連したパラメータのうち
\begin{quote}
\Param{jaxspmode},~\Param{alxspmode}, \Param{prebreakpenalty},
@@ -2419,8 +2419,8 @@ However, the penalty inserted after it is 10 which is the \Param{postbreakpenalt
は,文字コードごとに設定する量である.
\Pkg{fontspec}パッケージを使う(\ref{ssec:fontspec}節)場合など,
-各種のOpenType featureを適用することもあると思うが,前段落に述べたパラメータ類は,
-\emph{OpenType featureの適用前の文字コードによって適用される.}
+各種のOpenType機能を適用することもあると思うが,前段落に述べたパラメータ類は,
+\emph{OpenType機能の適用前の文字コードによって適用される.}
例えば,以下の例において10行目の「ア」は,\verb+hwid+ featureの適用により半角カタカナの「ア」
に置き換わる.しかし,その直後に挿入される \Param{postbreakpenalty}は,置換前の「ア」に対する値10である.
%</ja>
@@ -3561,7 +3561,7 @@ NFSS2用の命令(\ref{ssec:chgfnt}節,\ref{ssec:nfsspat}節)における
%<*ja>
\paragraph{\texttt{extend}と\texttt{slant}}
-OpenType font featureと見かけ上同じような形式で指定できるものに,
+OpenType機能と見かけ上同じような形式で指定できるものに,
\begin{description}
\item[\texttt{extend=}<extend>] 横方向に<extend>倍拡大する.
\item[\texttt{slant=}<slant>] <slant>に指定された割合だけ傾ける.
@@ -3646,7 +3646,7 @@ This functionality is disabled by \texttt{-ltjksp} specification.
%<en>\subsection{\cs{tfont}}
%<ja>\subsection{\cs{tfont} 命令}
-
+\label{ssec:tfont}
\begin{comment}
{\catcode`\<=12\catcode`\>=12
@@ -3729,6 +3729,23 @@ A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont
\item[\tt jfm-tmin.lua] A counterpart for \verb+tmin10.tfm+, which is one
of the default Japanese font metric shipped with \pTeX.
\end{description}
+\begin{figure}[!tb]
+\begin{LTXexample}[pos=b]
+\jfont\X=[KozMinPr6N-Regular.otf]:jfm=ujis
+\tfont\U=[KozMinPr6N-Regular.otf]:jfm=ujisv
+\tfont\V=[KozMinPr6N-Regular.otf]:jfm=ujisv;jpotf
+\def\TEST#1#2{\leavevmode\hbox{#1#2\string#2 “引用,と句読点.”}}
+\ttfamily\centering\TEST\yoko\X \quad \TEST\tate\U \quad \TEST\tate\V
+\end{LTXexample}
+\caption{\texttt{jpotf} ``feature''}
+\label{fig:jpotf}
+\end{figure}
+
+ \item If \texttt{vert}~and/or~\texttt{vrt2} features are activated,
+ one can specify \texttt{jpotf} to additional substitutions.
+ By default, it substitutes ideographic comma/period for fullwidth comma/period,
+ and double prime quotation marks for double quotation marks
+ (See~\autoref{fig:jpotf}).
\end{itemize}
%</en>
%<*ja>
@@ -3738,7 +3755,7 @@ A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont
以下の点が \cs{jfont} による横組用和文フォントとは異なる:
\begin{itemize}
\item 明示的に \texttt{vert}, \texttt{vrt2}(のいずれか)の
- 有効・無効を指定した場合を除き,自動的に OpenType feature~\texttt{vrt2} の有効化が
+ 有効・無効を指定した場合を除き,自動的に OpenType機能 \texttt{vrt2} の有効化が
指定されたものとみなされる
\footnote{もしフォントが\texttt{vrt2}を定義していなかった場合,代わりに
\texttt{vert}を用いる.}.
@@ -3774,6 +3791,43 @@ A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont
である \verb+tmin10.tfm+ に相当し,\texttt{min10.tfm} と同様に
「っ」など一部の文字幅が狭められている.
\end{description}
+
+\begin{figure}[!tb]
+\begin{LTXexample}[pos=b]
+\jfont\X=[KozMinPr6N-Regular.otf]:jfm=ujis
+\tfont\U=[KozMinPr6N-Regular.otf]:jfm=ujisv
+\tfont\V=[KozMinPr6N-Regular.otf]:jfm=ujisv;jpotf
+\def\TEST#1#2{\leavevmode\hbox{#1#2\string#2 “引用,と句読点.”}}
+\ttfamily\centering\TEST\yoko\X \quad \TEST\tate\U \quad \TEST\tate\V
+\end{LTXexample}
+\caption{\texttt{jpotf} ``feature''}
+\label{fig:jpotf}
+\end{figure}
+
+ \item \texttt{vert}, \texttt{vrt2}の少なくとも片方が(明示的・自動的を問わず)
+ 有効になっていた場合,さらに\texttt{jpotf}を指定することで
+ 「通常では行わない縦組用字形への変換」を行うことができる.
+
+ 標準では,この「変換」は全角のコンマ・ピリオドを句読点に,
+ また全角の二重引用符をダブルミニュートへ置き換える
+ \footnote{%
+ \texttt{jpotf}という名前にしたのは,
+ OTFパッケージの縦組用和文TFMでほぼ同じの処理(そちらではさらに一重引用符を
+ 「シングルミニュート」に置換する機能もあった)を行っていたことに由来する.
+ }.\autoref{fig:jpotf}を参照.
+
+ ユーザ側で「変換」をカスタマイズしたい場合,
+ \verb+luatexja.jfont.register_vert_replace+ 関数に変更内容を記したテーブルを渡す.
+ 例えば縦組中では「あ」を「い」に置換し,また「,」は(「、」に置換せず)「,」のままに
+ したい場合は次のようにすれば良い.
+\begin{lstlisting}
+\directlua{luatexja.jfont.register_vert_replace{
+ ['あ']='い', [',']=false,
+}}
+\end{lstlisting}
+ \verb+luatexja.jfont.register_vert_replace+ による変更はこの関数の\emph{実行後}に定義される
+ フォントについてのみ有効である.
+
\end{itemize}
なお,\pTeX では,\cs{font},~\cs{jfont},~\cs{tfont}のどれでも欧文フォント・横組用和文フォン
@@ -3881,7 +3935,7 @@ Identity-Hとなり,PDFの標準規格ISO32000-1:2008~(\cite{pdfstd})に非準
ので注意してほしい.
\emph{\texttt{psft} プリフィックスの下では
-\texttt{+jp90} などのOpenType font featureの効力はない.
+\texttt{+jp90} などのOpenType機能の効力はない.
非埋込フォントをPDFに使用すると,実際にどのようなフォントが
表示に用いられるか予測できないからである.}\
\texttt{extend} と \texttt{slant} 指定は単なる変形のため
@@ -3907,12 +3961,12 @@ for Chinese or Korean typesetting.
\texttt{cid}キーに値を指定すると,そのCIDを持った非埋込フォントを定義することができる:
%</ja>
\begin{lstlisting}[numbers=left]
-\jfont\testJ={psft:Ryumin-Light:cid=Adobe-Japan1-7;jfm=jis} % Japanese
-\jfont\testD={psft:Ryumin-Light:jfm=jis} % default value is Adobe-Japan1-7
-\jfont\testC={psft:AdobeMingStd-Light:cid=Adobe-CNS1-7;jfm=jis} % Traditional Chinese
-\jfont\testG={psft:SimSun:cid=Adobe-GB1-5;jfm=jis} % Simplified Chinese
-\jfont\testK={psft:Batang:cid=Adobe-Korea1-2;jfm=jis} % Korean
-\jfont\testKR={psft:SourceHanSerifAKR9:cid=Adobe-KR-9;jfm=jis} % Korean
+\jfont\testJ={psft:Ryumin-Light:cid=Adobe-Japan1-7;jfm=jis} % Japanese
+\jfont\testD={psft:Ryumin-Light:jfm=jis} % default: Adobe-Japan1-7
+\jfont\testC={psft:AdobeMingStd-Light:cid=Adobe-CNS1-7;jfm=jis}% Traditional Chinese
+\jfont\testG={psft:SimSun:cid=Adobe-GB1-5;jfm=jis} % Simplified Chinese
+\jfont\testK={psft:Batang:cid=Adobe-Korea1-2;jfm=jis} % Korean
+\jfont\testKR={psft:SourceHanSerifAKR9:cid=Adobe-KR-9;jfm=jis} % Korean
\end{lstlisting}
%<*en>
Note that the code above specifies \texttt{jfm-jis.lua}, which is for Japanese fonts,
@@ -4596,7 +4650,7 @@ applying font features by \Pkg{luaotfload}}.
\item JFMによれば,この「ヒ」のグリフの文字クラスは2000である.
\item 以上により文字クラス2000とみなされるため,結果として「ヒ」の幅は半角だと認識される.
\end{enumerate}
-この例は,\emph{文字クラスの決定はfont featureの適用によるグリフ置換の結果に基づく}ことを
+この例は,\emph{文字クラスの決定はOpenType機能の適用によるグリフ置換の結果に基づく}ことを
示している.
%</ja>
@@ -4627,7 +4681,7 @@ as follows:
%<*ja>
ここで,句点「。」(\texttt{U+3002})の文字クラスは,以下のようにして決まる.
\begin{enumerate}
-\item \Pkg{luaotfload} によって縦組用句点のグリフに置き換わる.
+\item \Pkg{luaotfload}によって縦組用句点のグリフに置き換わる.
\item 置換後のグリフは \texttt{U+FE12} であり,JFMに従えば文字クラスは\emph{0}と判定される.
\item この場合,置換前の横組用句点のグリフによって文字クラスを判定する.
\item 結果として,上の出力例中の句点の文字クラスは2000となる.
@@ -4953,10 +5007,10 @@ $i$,~$j\in \omega$に対して,\texttt{char\_type[$i$][$j$]} は
\begin{itemize}
\item 間に入るものがカーンであれば,この値は\
\texttt{[$j$]=\{[1]=<kern\_node>, ratio=<ratio>\}} であり,
-<kern\_node>はカーンを表すノードそのものである\footnote{%
-バージョン20150420.0以降ではノードのアクセス手法にdirect access
- modelを用いている.そのため,例えば\LuaTeX\ beta-0.78.2では,単なる自然数のようにし
- か見えないことに注意.
+<kern\_node>はカーンを表すノードである\footnote{%
+ バージョン20150420.0以降ではノードのアクセス手法にdirect access
+ modelを用いているため,ノードそのものを表すユーザーデータではなく,
+ 内部で参照のために使われる添字(整数)である.
}.
\item グルーであれば,この値は以下のキーを持つテーブルである.
\begin{description}
@@ -4972,7 +5026,9 @@ $i$,~$j\in \omega$に対して,\texttt{char\_type[$i$][$j$]} は
\end{description}
\end{itemize}
\item[ascent\textrm{, }descent]
-……
+ 縦組時に個々のグリフを90度回転させる場合,そのグリフは(実際の高さ・深さにかかわらず)
+ 便宜的に高さ\texttt{ascent},深さ\texttt{descent}を持つものだと想定して回転させる.
+ この仕様は\Pkg{luaotfload}がOpenTypeフォントのVORGテーブルを読まないための暫定的なものである.
\item[chars\_cbcache]
文字クラス決定の処理で.キャッシュとして使われる.
\end{cslist}
@@ -6879,7 +6935,9 @@ CID番号が<number>の文字を出力する.
もし現在の和文フォントがAdobe-Japan1,~Adobe-GB1, Adobe-CNS1, Adobe-Korea1,~Adobe-KRの
いずれのCID-keyed fontでもない場合,<number>はAdobe-Japan1のCID番号であると解釈し
「適切なグリフ」\footnote{%
- 例えばフォントにIVDコレクションAdobe-Japan1が含まれていれば,その情報を用いて
+ 特に縦組用グリフのCID番号を指定した場合は(LuaTeX-ja 20190504.0以降では若干改良されているが)
+ 意図しない結果になる可能性が高い.
+ また,フォントにIVDコレクションAdobe-Japan1が含まれていれば,その情報を用いて
グリフを選択する.
}を出力する.
%</ja>
@@ -6929,12 +6987,20 @@ ordinary characters in the following points:
\item 常に\textbf{JAchar}として扱われる.
%</ja>
%<*en>
-\item Processing codes for supporting OpenType features (\textit{e.g.},
+\item In vertical direction, \texttt{vert}/\texttt{vrt2} feature are automatically applied to
+ characters by \cs{UTF}, regardless these feature are not activated in current Japanese font.
+%</en>
+%<*ja>
+\item 縦組時には,現在の縦組用和文フォントで \texttt{vert}/\texttt{vrt2} 機能が
+ 有効か無効かを問わず,\cs{UTF} で出力される文字にはこれらのOpenType機能が働いた字形になる.
+%</ja>
+%<*en>
+\item Processing codes for supporting other OpenType features (for example,
glyph replacement and kerning) by the \Pkg{luaotfload} package
is not performed to these characters.
%</en>
%<*ja>
-\item OpenType機能(例えばグリフ置換やカーニング)をサポートするための
+\item その他のOpenType機能(例えばグリフ置換やカーニング)をサポートするための
\Pkg{luaotfload}パッケージのコードはこれらの文字には働かない.
%</ja>
\end{itemize}
@@ -7107,7 +7173,8 @@ for making the difference obvious.}
\item \cs{prevdepth}の値とその$h'$の深さの値が一致している
\end{itemize}
場合にのみ発動するようにしている.
- \item 行の中身に水平ボックス$h''$が入ってくることもあるが,その場合は$h''$の中身までは参照しない.
+ \item 行の中身に水平ボックス$h''$が入ってくることもあるが,その場合は$h''$の中身の高さ・深さまでは
+ 参照せず,あくまでも$h''$自身の高さ・深さのみを参照する.
参照するようにしてしまうと,\cs{smash}など手動で行った高さ・深さ調整の意味がなくなってしまうからである.
\end{itemize}
@@ -7747,7 +7814,7 @@ characters designed for ruby.
%<*ja>
横組・縦組専用仮名を用いる.また,\cs{rubyfamily} でルビ用仮名が使用可能となる\footnote{%
\cs{rubyfamily}とはいいつつ,実際にはフォントファミリを切り替えるのではない(通常では
- font featureの追加,\texttt{nfssonly} 指定時にはシェイプを \texttt{rb} に切り替え).
+ OpenType機能の有効化であり,\texttt{nfssonly} 指定時にはシェイプを \texttt{rb} に切り替える).
}.
%</ja>
\item[bold]
@@ -10668,53 +10735,6 @@ $|\textit{total}|$の分だけが,行中のグルーの伸び量,あるい
%</ja>
%<*ja>
-\section{IVS対応}
-\verb+luatexja.otf.enable_ivs()+ を実行し,IVS対応を有効にした状態では,
-\verb+pre_linebreak_filter+ や \verb+hpack_filter+ コールバックには
-次の4つが順に実行される状態となっている:
-\begin{description}
-\item[\tt ltj.do\_ivs] \textit{glyph\_node}~$p$の直後に,異体字セレクタ(を表す\textit{glyph\_node})
-が連続した場合に,$p$のフォントに対応したが持つ「異体字情報」に従って出力するグリフを変える.
-
-しかし,単に$p.\textit{char}$を変更するだけでは,後から
-OpenType機能の適用(すぐ下)により置換される可能性がある.そのため,
-\cs{CID} や \cs{UTF} と同じように,\textit{glyph\_node}~$p$の代わりに
-\texttt{user\_id} が\textit{char\_by\_cid}であるようなuser-defined whatsitを用いている.
-\item[(\Pkg{luaotfload} によるfont featureの適用)]
-\item[\tt ltj.otf] \texttt{user\_id} が\textit{char\_by\_cid}であるようなuser-defined whatsitを
-きちんと\textit{glyph\_node}に変換する.この処理は,\cs{CID}, \cs{UTF}やIVSによる置換が,
-OpenType機能の適用で上書きされてしまうのを防止するためである.
-\item[\tt ltj.main\_process] \textbf{JAglue}の挿入処理(\ref{sec-jfmglue}章)と,
-JFMの指定に従って各\textbf{JAchar}の「寸法を補正」することを行う.
-\end{description}
-
-問題は各フォントの持っているIVS情報をどのように取得するか,である.
-\Pkg{luaotfload} はフォント番号<font\_number>の情報を\
-\texttt{fonts.hashes.identifiers[<font\_number>]} 以下に格納している.
-しかし,OpenTypeフォントのIVS情報は格納されていないようである%
-\footnote{TrueTypeフォントに関しては,
-\begin{center}
-\texttt{fonts.hashes.idenfiers[<font\_number>]%
- .resources.variants[<selector>][<base\_char>]}
-\end{center}
-に,<base\_char>番の文字の後に異体字セレクタ<selector>が続いた場合に
-出力すべきグリフが書かれてある.}.
-%例えば,小塚明朝Pr6N~Rでは,
-
-一方,\LuaTeX 内部の \texttt{fontloader} の返すテーブルには
-OpenTypeフォントでもTrueTypeフォントでもIVS情報が格納されている.
-具体的には……
-
-そのため,\LuaTeX-jaのIVS対応においては,\LuaTeX 内部の\
-\texttt{fontloader} を直接用いることで,フォントのIVS情報を取得している.
-20140114.0以降でキャッシュを用いるようにした要因はここにあり,
-\texttt{fontloader} の呼び出しでかなり時間を消費することから,
-%%% to_table を使わなくしたことで,メモリ使用量は減った
-IVS情報をキャッシュに保存することで2回目以降の実行時間を節約している.
-%</ja>
-
-
-%<*ja>
\section{複数フォントの「合成」(未完)}
\section{\LuaTeX-jaにおけるキャッシュ}
\Pkg{luaotfload}パッケージが,各TrueType・OpenTypeフォントの情報を
@@ -11143,6 +11163,51 @@ direction~whatsit内部のノードリストに,\textit{dir\_box}として格
}
\]
のようになる.
+
+\subsection{縦組用字形の取得}
+縦組時には,「\hbox to \zw{、}」(\texttt{U+3001})から「\ltjjachar"FE11」(\texttt{U+FE11})%"
+のように縦組用字形への置き換えに関係する処理は,以下のようになっている.
+ \begin{itemize}
+ \item 各縦組用和文フォントは読み込み時に以下の属性が設定される:
+ \begin{description}
+ \item[\textit{vert\_activated}] 真となるのは,
+ 明示的に \texttt{-vert} も \texttt{-vrt2} のいずれも指定されていないちょうどその時.
+ \item[\textit{auto\_enable\_vrt2}] 真となるのは,
+ \texttt{vert}, \texttt{vrt2}のいずれについても有効・無効が指定されていないちょうどその時.
+ \end{description}
+ \textit{vert\_activated}については\texttt{luatexja.define\_jfont}コールバックで渡される引数
+ \texttt{jfont\_info}から取得可能である.
+
+ \item \textit{auto\_enable\_vrt2}が真の場合は,現在のscript tagとlanguage system identifierの値で
+ \texttt{vrt2}機能が利用可能か調べる.利用可能ならば\texttt{vrt2}を,そうでなければ
+ \texttt{vert}を有効化する.
+ \item また,各和文フォント読み込み時には,
+ 「OpenType機能による置換以前に行う縦組形への置換」を格納したテーブル\textit{vform}も作成する.
+ \begin{enumerate}
+ \item \LuaTeX-jaには,「\hbox to \zw{、}」(\texttt{U+3001})→「\ltjjachar"FE11」(\texttt{U+FE11})といった
+ いくつかの置換がハードコードされている.そのような各置換$i\longmapsto v$に対して,
+ \begin{quote}
+ 置換元$i$が(あるscript, languageにおける)\texttt{vert}では置換対象でなく,
+ かつ置換先$v$がフォント内に存在する文字コードである
+ \end{quote}
+ ならば,$i\longmapsto v$を\textit{vform}に登録する.
+ \item \ref{ssec:tfont}節にある\texttt{jpotf}が指定された場合,
+ ……
+ \item もし\texttt{vert}も\texttt{vrt2}も現在のscript, languageでは有効にできない場合,
+ どこかのscript, languageにおける\texttt{vert}で定義されている
+ 置換$i\longmapsto v$をすべて\textit{vform}に登録する.
+ \end{enumerate}
+
+ あとで説明するように,\textit{vform}は\textit{vert\_activated}が真であるような縦組用和文フォントでしか
+ 利用されない.
+
+ \item 「現在の水平リスト」内の\textbf{JAchar}を(欧文フォントから)和文フォントへ置き換える処理において,
+ その時点での組方向が縦組であり,かつ処理対象の各ノードの縦組用フォントで
+ \textit{vert\_activated}が真である場合,\textit{vform}に従いグリフが置き換えられる.
+
+ \Pkg{luaotfload}が行う,OpenType機能に沿ったグリフ置換はこの後の処理となる.G
+ \end{itemize}
+
%</ja>
\newpage
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty
index 8ca804f8a11..ca187cc900b 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty
@@ -2,7 +2,7 @@
% luatexja-ajmacros.sty
%
% Original:
-% \ProvidesPackage{ajmacros}[2005/12/25 13:52 iNOUE Koich! <inoue@ma.ns.musashi-tech.ac.jp>]
+% \ProvidesPackage{ajmacros}[2019/04/01 21:00 iNOUE Koich! <inoue@ma.ns.musashi-tech.ac.jp>]
%
@@ -347,7 +347,8 @@
\@ajligdef{#1}{\number\@tempcnta}\advance\@tempcnta\@ne
\expandafter\@ajligaturedef\fi}
\def\@aj@ligdef#1#2#3{\expandafter\xdef\csname ajLig\@ajmojifam#1\endcsname
- {\noexpand\CID{\noexpand\unless\noexpand\ifnum\noexpand\ltjgetparameter\noexpand{direction\noexpand}=3 #2\noexpand\else#3\noexpand\fi}}}
+ {\unexpanded{\unless\ifnum\ltjgetparameter{direction}=3 }%
+ \noexpand\CID{#2}\noexpand\else\noexpand\CID{#3}\noexpand\fi}}
\def\@aj@ligaturedef#1{\ifx\@nil#1\else
\@aj@ligdef{#1}{\number\@tempcnta}{\number\@tempcntb}%
\advance\@tempcnta\@ne\advance\@tempcntb\@ne
@@ -441,6 +442,7 @@
\@ajligdef{より}{12181}
\@ajligdef{升}{16194}
\@ajligdef{コト}{16195}
+\@aj@ligdef{令和}{23058}{23059}%AJ1-7
%
\def\@ajmojifam{○}
\@tempcnta7613
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-otf.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-otf.sty
index 76cfbcd91b9..082468b97bc 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-otf.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-otf.sty
@@ -90,7 +90,7 @@
\protected\def\CID#1{\ifvmode\leavevmode\fi\ltj@tempcnta#1\relax\directlua{luatexja.otf.cid(\the\ltj@tempcnta)}\relax}
%% \UTF compatible with the OTF package for pLaTeX
-\protected\def\UTF#1{\ifvmode\leavevmode\fi\directlua{luatexja.otf.append_jglyph(0x#1)}}
+\protected\def\UTF#1{\ifvmode\leavevmode\fi\directlua{luatexja.otf.utf(0x#1)}}
%% Load ajmacros
\ifltj@in@latex %<*LaTeX>
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua
index a4c1d681cc5..bd798545f3f 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-compat.lua
@@ -18,6 +18,7 @@ end
-- \kuten, \jis, \euc, \sjis, \ucs, \kansuji
+local utfchar=utf.char
local function to_kansuji(num)
if not num then num=0; return
elseif num<0 then
@@ -25,7 +26,7 @@ local function to_kansuji(num)
end
local s = ""
while num~=0 do
- s = utf.char(
+ s = utfchar(
ltjs.get_stack_table(luatexja.stack_table_index.KSJ + num%10,
'', tex.getcount('ltj@@stack'))) .. s
num=math.floor(num/10)
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-inputbuf.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-inputbuf.lua
index f8a7b578629..e901d438912 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-inputbuf.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-inputbuf.lua
@@ -6,9 +6,9 @@ luatexja.load_module('base'); local ltjb = luatexja.base
luatexja.load_module('charrange'); local ltjc = luatexja.charrange
require("unicode")
-local utflen = unicode.utf8.len
-local utfbyte = unicode.utf8.byte
-local utfchar = unicode.utf8.char
+local utflen = utf.len
+local utfbyte = utf.byte
+local utfchar = utf.char
local node_new = node.new
local node_free = node.free
local id_glyph = node.id('glyph')
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
index dabed15d5e0..dcb5d6f80ec 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 = '2019/02/11',
+ date = '2019/05/01',
description = 'Loader for Japanese fonts',
})
@@ -43,7 +43,7 @@ luatexbase.create_callback("luatexja.load_jfm", "data", function (ft, jn) return
local jfm_file_name, jfm_var, jfm_ksp
local defjfm_res
-local jfm_dir, is_def_jfont, is_vert_enabled, auto_enable_vrt2
+local jfm_dir, is_def_jfont, vert_activated, auto_enable_vrt2
local function norm_val(a)
if (not a) or (a==0.) then
@@ -297,10 +297,10 @@ do
end
-- EXT
- local utf8 = unicode.utf8
+ local utfbyte = utf.byte
function luatexja.jfont.jfontdefX(g, dir, csname)
jfm_dir, is_def_jfont = dir, true
- cstemp = csname:sub( (utf8.byte(csname,1,1) == tex.escapechar) and 2 or 1, -1)
+ cstemp = csname:sub( (utfbyte(csname,1,1) == tex.escapechar) and 2 or 1, -1)
cstemp = cstemp:sub(1, ((cstemp:sub(-1,-1)==' ') and (cstemp:len()>=2)) and -2 or -1)
global_flag = g and '\\global' or ''
tex.sprint(cat_lp, '\\expandafter\\font\\csname ',
@@ -338,7 +338,7 @@ do
chars = sz.chars, char_type = sz.char_type,
kanjiskip = sz.kanjiskip, xkanjiskip = sz.xkanjiskip,
chars_cbcache = {},
- vert_activated = is_vert_enabled,
+ vert_activated = vert_activated,
}
local t = identifiers[fn]
if auto_enable_vrt2 then
@@ -434,11 +434,11 @@ do
jfm_ksp = not (x=='-')
end
if jfm_dir == 'tate' then
- is_vert_enabled = (not name:match('[:;]%-vert')) and (not name:match('[:;]%-vrt2'))
+ vert_activated = (not name:match('[:;]%-vert')) and (not name:match('[:;]%-vrt2'))
auto_enable_vrt2
= (not name:match('[:;][+%-]?vert')) and (not name:match('[:;][+%-]?vrt2'))
else
- is_vert_enabled, auto_enable_vrt2 = nil, nil
+ vert_activated, auto_enable_vrt2 = nil, nil
end
return name
end
@@ -1093,16 +1093,32 @@ do
[0x300C]=0xFE41, [0x300D]=0xFE42, [0x300E]=0xFE43, [0x300F]=0xFE44,
[0xFF3B]=0xFE47, [0xFF3D]=0xFE48,
}
- local function add_vform(coverage, vform, ft, add_vert)
- if type(coverage)~='table' then return end
- for i,v in pairs(vert_form_table) do
- if not coverage[i] and ft.characters[v] then
- vform[i] = v
- end
- end
- if add_vert then -- vert feature が有効にならない場合
- for i,v in pairs(coverage) do vform[i] = vform[i] or v end
- end
+ local vert_jpotf_table = {}
+ local function add_vform(coverage, vform, ft, add_vert, jpotf_vert)
+ if type(coverage)~='table' then return end
+ for i,v in pairs(vert_form_table) do
+ if not coverage[i] and ft.characters[v] then vform[i] = v end
+ end
+ if jpotf_vert then
+ for i,v in pairs(vert_jpotf_table) do
+ if ft.characters[v] then vform[i] = coverage[v] or vform[v] or v end
+ end
+ end
+ if add_vert then -- vert feature が有効にならない場合
+ for i,v in pairs(coverage) do vform[i] = vform[i] or v end
+ end
+ end
+
+ local utfbyte, utfsub = utf.byte, utf.sub
+ luatexja.jfont.register_vert_replace = function(t)
+ for i,v in pairs(t) do
+ local ic = (type(i)=='number') and i or
+ ((type(i)=='string') and utfbyte(utfsub(i,1,1)) or nil)
+ if ic then
+ vert_jpotf_table[ic] = (type(v)=='number') and v or
+ ((type(v)=='string') and utfbyte(utfsub(v,1,1)) or nil)
+ end
+ end
end
luatexbase.add_to_callback(
@@ -1114,11 +1130,14 @@ luatexbase.add_to_callback(
local add_vert
= not (provides_feature(fnum, t.properties.script, t.properties.language, 'vert'))
and not (provides_feature(fnum, t.properties.script, t.properties.language, 'vrt2'))
+ local jpotf_vert = t.shared.features.jpotf
-- 現在の language, script で vert もvrt2 も有効にできない場合,強制的に vert 適用
for _,i in pairs(t.resources.sequences) do
if i.order[1]== 'vert' and i.type == 'gsub_single' and i.steps then
for _,j in pairs(i.steps) do
- if type(j)=='table' then add_vform(j.coverage,vform, t, add_vert) end
+ if type(j)=='table' then
+ add_vform(j.coverage,vform, t, add_vert, jpotf_vert)
+ end
end
end
end
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua
index d083026abbb..3b4d57e00c1 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-otf.lua
@@ -82,19 +82,49 @@ local function get_ucs_from_rmlgbm(c)
elseif v<0xF0000 then -- 素直に Unicode にマップ可能
return v
else -- privete use area
- local w = ltjr_cidfont_data["Adobe-Japan1"].characters[v]. tounicode
- -- must be non-nil!
- local i = string.len(w)
- if i==4 then -- UCS2
- return tonumber(w,16)
- elseif i==8 then
- i,w = tonumber(string.sub(w,1,4),16), tonumber(string.sub(w,-4),16)
- if (w>=0xD800) and (w<=0xDB7F) and (i>=0xDC00) and (i<=0xDFFF) then -- Surrogate pair
- return (w-0xD800)*0x400 + (i-0xDC00)
- else
- return 0
+ local r, aj = nil, ltjr_cidfont_data["Adobe-Japan1"]
+ -- 先に ltj_vert_table を見る
+ for i,w in pairs(aj.shared.ltj_vert_table) do
+ if w==v then r=i; break end
+ end
+ if not r then
+ -- なければ ToUnicode から引く
+ local w = aj.characters[v].tounicode -- must be non-nil!
+ local i = string.len(w)
+ if i==4 then -- UCS2
+ r = tonumber(w,16)
+ elseif i==8 then
+ i,w = tonumber(string.sub(w,1,4),16), tonumber(string.sub(w,-4),16)
+ if (w>=0xD800) and (w<=0xDB7F) and (i>=0xDC00) and (i<=0xDFFF) then -- Surrogate pair
+ r = (w-0xD800)*0x400 + (i-0xDC00)
+ else
+ r = 0
+ end
+ end
+ end
+ if aj.shared.ltj_vert_table[r] then
+ -- CID が縦組用字形だった場合
+ local curjfnt_num = tex_get_attr((ltjd_get_dir_count()==dir_tate)
+ and attr_curtfnt or attr_curjfnt)
+ local t = identifiers[curjfnt_num]
+ if t.resources.sequences then
+ for _,i in pairs(t.resources.sequences) do
+ if (i.order[1]=='vert' or i.order[1]=='vrt2')
+ and i.type == 'gsub_single' and i.steps then
+ for _,j in pairs(i.steps) do
+ if type(j)=='table' then
+ if type(j.coverage)=='table' then
+ for i,k in pairs(j.coverage) do
+ if i==r then return k end
+ end
+ end
+ end
+ end
+ end
+ end
end
end
+ return r
end
end
@@ -108,10 +138,39 @@ local function append_jglyph(char)
node_write(p)
end
+local utf
+do
+ utf = function (ucs)
+ local char = ucs
+ if ltjd_get_dir_count()==dir_tate then
+ local curjfnt_num = tex_get_attr((ltjd_get_dir_count()==dir_tate)
+ and attr_curtfnt or attr_curjfnt)
+ local t = identifiers[curjfnt_num]
+ if t.resources.sequences then
+ for _,i in pairs(t.resources.sequences) do
+ if (i.order[1]=='vert' or i.order[1]=='vrt2')
+ and i.type == 'gsub_single' and i.steps then
+ for _,j in pairs(i.steps) do
+ if type(j)=='table' then
+ if type(j.coverage)=='table' then
+ for i,k in pairs(j.coverage) do
+ if i==char then return append_jglyph(k) end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ return append_jglyph(char)
+ end
+end
+
local cid
do
cid = function (key)
- if key==0 then return append_jglyph(char) end
+ if key==0 then return append_jglyph(0) end
local curjfnt_num = tex_get_attr((ltjd_get_dir_count()==dir_tate)
and attr_curtfnt or attr_curjfnt)
local curjfnt = identifiers[curjfnt_num]
@@ -235,7 +294,7 @@ luatexja.otf = {
append_jglyph = append_jglyph,
enable_ivs = enable_ivs, -- 隠し機能: IVS
disable_ivs = disable_ivs, -- 隠し機能: IVS
- cid = cid,
+ cid = cid, utf = utf,
}
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty b/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty
index 1409c354d85..4277998e9d4 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty
@@ -14,7 +14,7 @@
\ifltj@in@latex %<*LaTeX>
\NeedsTeXFormat{LaTeX2e}
\PackageWarning{ltj-plain}{Don't load this package directly; load luatexja.sty instead.}
- \ProvidesPackage{ltj-plain}[2019/02/11]
+ \ProvidesPackage{ltj-plain}[2019/05/01]
\fi %</LaTeX>
%%------------------
@@ -100,6 +100,10 @@
\protected\def\@@end{%
\directlua{luatexja.ext_cleanup()}\ltj@@orig@end}
+\directlua{luatexja.jfont.register_vert_replace{
+ [',']='、', ['.']='。', ['“']=0x301D, ['”']=0x301F,
+}}
+
%%------------------ all done
\ltj@plain@AtEnd
\endinput
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua
index abdece238ae..357560c4bf4 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua
@@ -185,7 +185,7 @@ do
for i = 0,kx[2] do cidm[i] = -1 end
open_cmap_file(kx[1] .. "-V", increment, tonumber, entry)
for i,v in pairs(tt) do
- ttv[i] = cidmo[v.index]
+ ttv[i] = cidmo[v.index] -- "unicode" of vertical variant
end
-- tounicode エントリ
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
index 8fb24a80121..9756eadd62b 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
@@ -400,7 +400,7 @@ local function get_attr_icflag(p)
end
local prefix, inner_depth
-
+local utfchar = utf.char
local function debug_show_node_X(p,print_fn, limit)
local k = prefix
local s
@@ -409,7 +409,7 @@ local function debug_show_node_X(p,print_fn, limit)
.. ' ' .. pt .. ' ' .. tostring(p.subtype) .. ' '
if pt == 'glyph' then
s = base .. ' ' ..
- (p.char>=0xF0000 and string.format('(U+%X)', p.char) or utf.char(p.char)) .. ' '
+ (p.char>=0xF0000 and string.format('(U+%X)', p.char) or utfchar(p.char)) .. ' '
.. tostring(p.font) .. ' (' .. print_scaled(p.height) .. '+'
.. print_scaled(p.depth) .. ')x' .. print_scaled(p.width)
if p.xoffset~=0 or p.yoffset~=0 then
@@ -561,7 +561,7 @@ local function debug_show_node_X(p,print_fn, limit)
end
prefix = k;
elseif pt=='math_char' then
- s = base .. ' fam: ' .. p.fam .. ' , char = ' .. utf.char(p.char)
+ s = base .. ' fam: ' .. p.fam .. ' , char = ' .. utfchar(p.char)
print_fn(s)
elseif pt=='sub_box' or pt=='sub_mlist' then
print_fn(base)
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
index 98927dc0569..a0a4d213bdc 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
@@ -41,7 +41,7 @@
\ProcessOptions\relax
\fi %</LaTeX>
%%%% VERSION
-\def\LuaTeXjaversion{20190408.0}
+\def\LuaTeXjaversion{20190504.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 21f6c4ce2ec..91827a3b7fd 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}[2019/02/11 Default font settings of LuaTeX-ja]
+\ProvidesPackage{lltjdefs}[2019/05/01 Default font settings of LuaTeX-ja]
\ifdefined\ltj@stdmcfont\else\def\ltj@stdmcfont{IPAExMincho}\fi
\ifdefined\ltj@stdgtfont\else\def\ltj@stdgtfont{IPAExGothic}\fi
@@ -120,6 +120,10 @@
\directlua{for x=128,255 do luatexja.math.is_math_letters[x] = true end}
\protected\def\<{\ifvmode\leavevmode\fi\inhibitglue}
+\directlua{luatexja.jfont.register_vert_replace{
+ [',']='、', ['.']='。', ['“']=0x301D, ['”']=0x301F,
+}}
+
% END OF FILE
\endinput
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec.sty
index 32e4ef0b8ab..40f8c1e94e0 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-fontspec.sty
@@ -132,15 +132,19 @@
{ \fontspec_visible_space_fallback: }
}
-\def\verb
- {
- \relax\ifmmode\hbox\else\leavevmode\fi % same as lltjcore
- \bgroup
- \verb@eol@error \let\do\@makeother \dospecials
- \verbatim@font\@noligs
- \@ifstar\__fontspecsverb\@verb
- }
-
+\AtBeginDocument{
+ \cs_if_exist:NF \verbvisiblespace {
+ % >= LaTeX2e <2018-12-01> does not need the following patch
+ \def\verb
+ {
+ \relax\ifmmode\hbox\else\leavevmode\fi % same as lltjcore
+ \bgroup
+ \verb@eol@error \let\do\@makeother \dospecials
+ \verbatim@font\@noligs
+ \@ifstar\__fontspecsverb\@verb
+ }
+ }
+}
\cs_set:Npn \emshape { \gtfamily \itshape }
\cs_set:Npn \eminnershape { \mcfamily \upshape }