summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/luatexja/doc/luatexja.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/generic/luatexja/doc/luatexja.dtx')
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja.dtx117
1 files changed, 74 insertions, 43 deletions
diff --git a/macros/luatex/generic/luatexja/doc/luatexja.dtx b/macros/luatex/generic/luatexja/doc/luatexja.dtx
index 09df86b361..18ca18cdae 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja.dtx
+++ b/macros/luatex/generic/luatexja/doc/luatexja.dtx
@@ -5177,27 +5177,27 @@ JFMで指定されているそれぞれの値をスケーリングしたもの
\end{itemize}
$i$,~$j\in \omega$に対して,\texttt{char\_type[$i$][$j$]} は
文字クラス$i$の文字と$j$の文字の間に挿入されるグルーやカーンを格納している.
-\begin{itemize}
- \item 間に入るものがカーンであれば,この値は\
-\texttt{[$j$]=\{[1]=<kern\_node>, ratio=<ratio>\}} であり,
+
+間に入るものがカーンであれば,この値は%
+\texttt{[$j$]=\{[1]=<kern\_node>, ratio=<ratio>\}}であり,
<kern\_node>はカーンを表すノードである\footnote{%
バージョン20150420.0以降ではノードのアクセス手法にdirect access
modelを用いているため,ノードそのものを表すユーザーデータではなく,
内部で参照のために使われる添字(整数)である.
}.
- \item グルーであれば,この値は以下のキーを持つテーブルである.
- \begin{description}
- \item[\texttt{width}, \texttt{stretch}, \texttt{shrink}]
- グルーのそれぞれ自然長,伸び量,縮み量をsp単位で表したもの.
- \item[\texttt{priority}] バ(ージョン2以降の)JFMでの指定 \texttt{\{<stretch>,<shrink>\}} を
- \[
- (\text{<stretch>}+4)\cdot 8+\text{<shrink>}+4
- \]
- として0--63の整数にパックしたもの.
- \item[\texttt{ratio}, \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch}, \texttt{kanjiskip\_shrink}]
- JFM中の同名のフィールドの値がそのまま使われている.
- \end{description}
-\end{itemize}
+
+グルーであれば,この値は以下のキーを持つテーブルである.
+\begin{description}
+ \item[\texttt{width}, \texttt{stretch}, \texttt{shrink}]
+ グルーのそれぞれ自然長,伸び量,縮み量をsp単位で表したもの.
+ \item[\texttt{priority}] (バージョン2以降の)JFMでの指定 \texttt{\{<stretch>,<shrink>\}} を
+ \[
+ (\text{<stretch>}+4)\cdot 8+\text{<shrink>}+4
+ \]
+ として0--63の整数にパックしたもの.
+ \item[\texttt{ratio}, \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch}, \texttt{kanjiskip\_shrink}]
+ JFM中の同名のフィールドの値がそのまま使われている.
+\end{description}
\item[chars\_cbcache]
文字クラス決定の処理で.キャッシュとして使われる.
\end{cslist}
@@ -7171,7 +7171,7 @@ CID番号が<number>の文字を出力する.
特に縦組用グリフのCID番号を指定した場合は(LuaTeX-ja 20190504.0以降では若干改良されているが)
意図しない結果になる可能性が高い.
なお,バージョン20190708.0以降では,CIDからグリフへの選択にグリフ名の情報を使用していない.
- また,フォントにIVDコレクションAdobe-Japan1が含まれていれば,その情報を用いて
+ また,フォントにAdobe-Japan1のIVSが含まれていれば,その情報を用いて
グリフを選択する.
}を出力する.
@@ -10553,7 +10553,8 @@ variation selectors are ``combined'' with the previous character.
\item trueの場合は,異体字セレクタは「直前の文字に続けて」出力されるため,
例えば以下の例(左側は入力,右側はその出力)のようになる.
%</ja>
-\begin{LTXexample}
+%%%% [preset=...]: workaround for lstlisting inside LTXexample
+\begin{LTXexample}[preset=\expandafter\def\csname @captype\endcsname{lstlisting}]
\begin{lstlisting}[vsraw=true]
葛󠄀城市,葛󠄁飾区,葛西
\end{lstlisting}
@@ -10569,7 +10570,7 @@ The default setting of the \texttt{vscmd} key produces the following.
どのような形で出力されるかを規定するのが \texttt{vscmd} キーであり,
\Pkg{lltjp-listings} の標準設定では以下の例の右側のように出力される.
%</ja>
-\begin{LTXexample}
+\begin{LTXexample}[preset=\expandafter\def\csname @captype\endcsname{lstlisting}]
\begin{lstlisting}[vsraw=false,
vscmd=\ltjlistingsvsstdcmd]
葛󠄀城市,葛󠄁飾区,葛西
@@ -11017,9 +11018,9 @@ $|\textit{total}|$の分だけが,行中のグルーの伸び量,あるい
キャッシュとして保存しているのと同様の方法で,
\LuaTeX-jaもいくつかのキャッシュファイルを作成するようになった.
\begin{itemize}
- \item 通常,キャッシュは\texttt{\$TEXMFVAR/luatexja/}以下に保存され,
+ \item 通常,キャッシュは \texttt{\$TEXMFVAR/luatexja/} 以下に保存され,
そこから読み込みが行われる.
- \item 「通常の」テキスト形式のキャッシュ(拡張子は \texttt{.lua})以外にも,
+ \item 「通常の」テキスト形式のキャッシュ(拡張子は \texttt{.lua.gz},gzip圧縮されているため)以外にも,
それをバイナリ形式(バイトコード)に変換したものもサポートしている.
\begin{itemize}
\item キャッシュを読み込む時,同名のバイナリキャッシュがあれば,
@@ -11028,6 +11029,7 @@ $|\textit{total}|$の分だけが,行中のグルーの伸び量,あるい
同時に更新される.
また,(バイナリ版が見つからず)テキスト形式のキャッシュ側が読み込まれたときは,
\LuaTeX-jaはバイナリキャッシュを作成する.
+未圧縮のテキスト形式のキャッシュ(\texttt{hoge.lua})は20200802.0以降では利用しない.
\end{itemize}
\end{itemize}
%</ja>
@@ -11038,12 +11040,13 @@ in a similar way to the \Pkg{luaotfload} package:
\begin{itemize}
\item Cache files are usually stored in (and loaded from)
\texttt{\$TEXMFVAR/luatexja/}.
- \item In addition to caches of the text form (the extension is ``\texttt{.lua}''),
-caches of the \emph{binary}, precompiled form are supported.
+ \item In addition to caches of the text form (the extension is ``\texttt{.lua.gz}'',
+because they are compressed by gzip),
+caches of the \emph{binary}~(bytecode) form are supported.
\begin{itemize}
\item In loading a cache, the binary cache precedes
the text form.
- \item When \LuaTeX-ja updates a cache \texttt{hoge.lua},
+ \item When \LuaTeX-ja updates a compressed text cache \texttt{hoge.lua.gz},
its binary version is also updated.
\end{itemize}
\end{itemize}
@@ -11052,9 +11055,9 @@ its binary version is also updated.
%<*ja>
\subsection{キャッシュの使用箇所}
-\LuaTeX-ja では以下の3種類のキャッシュを使用している:
+\LuaTeX-ja では以下のキャッシュを使用している:
\begin{cslist}
-\item[ltj-cid-auto-adobe-japan1.lua]
+\item[ltj-cid-auto-adobe-japan1.\{lua.gz,luc\}]
Ryumin-Lightのような非埋め込みフォントの情報を格納しており,
(それらが\LuaTeX-jaの標準和文フォントなので)\LuaTeX-jaの読み込み時に自動で読まれる.
生成には\texttt{UniJIS2004-UTF32-\{H,V\}}, \texttt{Adobe-Japan1-UCS2}という3つの
@@ -11069,7 +11072,7 @@ CMapが必要である.
\LuaTeX-ja uses the following cache:
\begin{cslist}
-\item[ltj-cid-auto-adobe-japan1.lua]
+\item[ltj-cid-auto-adobe-japan1.\{lua.gz,luc\}]
The font table of a CID-keyed non-embedded Japanese font.
This is loaded in every run.
It is created from three CMaps, \texttt{UniJIS2004-UTF32-\{H,V\}} and
@@ -11092,11 +11095,11 @@ as in Page~\pageref{para-cid}.
\bf \texttt{cid} key&\bf name of the cache &
\multicolumn{2}{c}{\bf used CMaps}\\
\midrule
-Adobe-Japan1-*&ltj-cid-auto-adobe-japan1.lua&UniJIS2004-UTF32-*&Adobe-Japan1-UCS2\\
-Adobe-Korea1-*&ltj-cid-auto-adobe-korea1.lua&UniKS-UTF32-*&Adobe-Korea1-UCS2\\
-Adobe-KR-*&ltj-cid-auto-adobe-kr.lua&UniAKR-UTF32-*&Adobe-KR-UCS2\\
-Adobe-GB1-*&ltj-cid-auto-adobe-gb1.lua&UniGB-UTF32-*&Adobe-GB1-UCS2\\
-Adobe-CNS1-*&ltj-cid-auto-adobe-cns1.lua&UniCNS-UTF32-*&Adobe-CNS1-UCS2\\
+Adobe-Japan1-*&ltj-cid-auto-adobe-japan1.\{lua.gz,luc\}&UniJIS2004-UTF32-*&Adobe-Japan1-UCS2\\
+Adobe-Korea1-*&ltj-cid-auto-adobe-korea1.\{lua.gz,luc\}&UniKS-UTF32-*&Adobe-Korea1-UCS2\\
+Adobe-KR-*&ltj-cid-auto-adobe-kr.\{lua.gz,luc\}&UniAKR-UTF32-*&Adobe-KR-UCS2\\
+Adobe-GB1-*&ltj-cid-auto-adobe-gb1.\{lua.gz,luc\}&UniGB-UTF32-*&Adobe-GB1-UCS2\\
+Adobe-CNS1-*&ltj-cid-auto-adobe-cns1.\{lua.gz,luc\}&UniCNS-UTF32-*&Adobe-CNS1-UCS2\\
\bottomrule
\end{tabular}
\end{table}
@@ -11108,23 +11111,44 @@ Adobe-CNS1-*&ltj-cid-auto-adobe-cns1.lua&UniCNS-UTF32-*&Adobe-CNS1-UCS2\\
\pTeX との互換目的の文字コード変換命令で用いられる.
%</ja>
%<*en>
-\item[ltj-jisx0208.\{luc|lub\}]
+\item[ltj-jisx0208.luc]
The bytecode version of \texttt{ltj-jisx0208.lua}.
This is the conversion table between JIS~X~0208 and Unicode
which is used in Kanji-code conversion commands for compatibility with \pTeX.
%</en>
+
+%<*ja>
+\item[ltj-ivd\_aj1.luc]
+\LuaTeX-ja配布中の\texttt{ltj-ivd\_aj1.lua}をバイトコード化したものである.
+これはUnicodeの漢字異体字データベースのAdobe-Japan1コレクションの内容を
+ 格納したテーブルであり,\Pkg{luatexja-otf}パッケージの\cs{CID}命令で使われることがある.
+%</ja>
+%<*en>
+\item[ltj-ivd\_aj1.luc]
+The bytecode version of \texttt{ltj-ivd\_aj1.lua}.
+%</en>
+
+%<*ja>
+\item[extra\_***.\{lua.gz,luc\}]
+フォント``\texttt{***}''における,グリフ番号からUnicode値への変換テーブル,縦組時のグリフ回転の有無を格納したテーブル,
+及び縦組時におけるグリフの原点位置・高さのテーブルを格納している.
+%</ja>
+%<*en>
+\item[extra\_***.\{lua.gz,luc\}]
+This file conains some information (especially for vertical typesetting) about the font `\texttt{***}''.
+%</en>
\end{cslist}
%<*en>
\subsection{Internal}
Cache management system of \LuaTeX-ja is stored in \texttt{luatexja.base}
(\texttt{ltj-base.lua}).
-There are three public functions for cache management in \texttt{luatexja.base},
+There are four public functions for cache management in \texttt{luatexja.base},
where <filename> stands for the file name \emph{without suffix}:
\begin{cslist}
\item[save\_cache(<filename>, <data>)]
Save a non-nil table <data> into a cache <filename>.
-Both the text form <filename>\texttt{.lua} and its binary version
+Both the compressed text form <filename>\texttt{.lua.gz} and its binary version
are created or updated.
\item[save\_cache\_luc(<filename>, <data>{[, <serialized\_data>]})]
@@ -11139,25 +11163,28 @@ Load the cache <filename>.
and its return value is whether the cache is outdated.
\texttt{load\_cache} first tries to
-read the binary cache <filename>\texttt{.\{luc|lub\}}.
+read the binary cache <filename>\texttt{.luc}.
If its contents is up-to-date, \texttt{load\_cache} returns the contents.
If the binary cache is not found or
its contents is outdated, \texttt{load\_cache} tries to
-read the text form <filename>\texttt{.lua}.
+read the compressed text form <filename>\texttt{.lua.gz}.
Hence, the return value of \texttt{load\_cache} is non-nil,
if and only if the updated cache is found.
+
+\item[remove\_cache(<filename>)]
+Remove the cahce <filename>.
\end{cslist}
%</en>
%<*ja>
\subsection{内部命令}
\LuaTeX-jaにおけるキャッシュ管理は,\texttt{luatexja.base}~(\texttt{ltj-base.lua})に
-実装しており,以下の3関数が公開されている.
+実装しており,以下の関数が公開されている.
ここで,<filename>は保存するキャッシュのファイル名を\emph{拡張子なしで}指定する.
\begin{cslist}
\item[save\_cache(<filename>, <data>)]
nilでない<data>をキャッシュ<filename>に保存する.
-テキスト形式の<filename>\texttt{.lua}のみならず,
-そのバイナリ版も作成/更新される.
+テキスト形式の<filename>\texttt{.lua.gz}\footnote{拡張子からわかる通り,実際にはgzip圧縮される.}のみならず,
+そのバイナリ形式も作成・更新される.
\item[save\_cache\_luc(<filename>, <data>{[, <serialized\_data>]})]
@@ -11171,14 +11198,18 @@ nilでない<data>をキャッシュ<filename>に保存する.
<outdate>は1引数(キャッシュの中身)をとる関数であり,
その戻り値は「キャッシュの更新が必要」かどうかを示すブール値でないといけない.
-\texttt{load\_cache}は,まずバイナリキャッシュ<filename>\texttt{.\{luc|lub\}}を
+\texttt{load\_cache}は,まずバイナリキャッシュ<filename>\texttt{.luc}を
読みこむ.もしその内容が「新しい」,つまり<outdate>の評価結果が \texttt{false} なら
\texttt{load\_cache}はこのバイナリキャッシュの中身を返す.
-もしバイナリキャッシュが見つからなかったか,「古すぎる」ならばテキスト版
- <filename>\texttt{.lua}を読み込み,その値を返す.
+もしバイナリキャッシュが見つからなかったか,「古すぎる」ならば(gzip圧縮された)テキスト形式の
+ <filename>\texttt{.lua.gz}を読み込み,<outdate>で再度評価する.
以上より,\texttt{load\_cache}自体がnilでない値を返すのは,ちょうど「新しい」キャッシュが
見つかった場合である.
+
+\item[remove\_cache(<filename>)]
+キャッシュ<filename>を削除する.テキスト形式(gzip圧縮されているか否かを問わず)も
+バイナリ形式もまとめて削除する.
\end{cslist}
%</ja>