OSDN Git Service

updated documents
[luatex-ja/luatexja.git] / doc / luatexja.dtx
index fc5ac40..fd3cc0f 100644 (file)
@@ -21,7 +21,7 @@
 \usepackage{metalogo,amsmath,array,tikz,pict2e,multienum,float}
 \usepackage{booktabs,multicol,luatexja-ruby}
 \usepackage[all]{xy}
-\usepackage{lltjext,alltt}
+\usepackage{lltjext,alltt,comment}
 
 %%%%%%%% Lua GC
 \patchcmd\@outputpage{\stepcounter{page}}{%
@@ -39,7 +39,6 @@
 
 %%%%%%%% fonts
 \usepackage{luatexja-otf}
-\directlua{luatexja.otf.enable_ivs()}
 \usepackage[no-math]{fontspec}
 \setmainfont[Ligatures=TeX]{Linux Libertine O}
 \setmonofont[Scale=MatchLowercase, ItalicFont=lmmono10-italic.otf,
@@ -1906,8 +1905,9 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である.
 \end{center}
 
 \item[moga-mobo]  MogaMincho, MogaGothic, and MoboGothic.
+%<en>    \\*[-\dimexpr\medskipamount+\baselineskip\relax]
 \item[moga-mobo-ex]  MogaExMincho, MogaExGothic, and MoboExGothic.
-%<en>These fonts can be downloaded from\\\hfill \url{http://yozvox.web.fc2.com/}.
+%<en>\par These fonts can be downloaded from \url{http://yozvox.web.fc2.com/}.
 %<ja>これらのフォントは \url{http://yozvox.web.fc2.com/} からダウンロードできる.
 \begin{center}\small
 \begin{tabular}{clll}
@@ -1935,7 +1935,7 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である.
 %<ja>\texttt{moga-mobo-ex}オプション指定時にはMogaEx90MinchoなどのExが名前についたフォントが使われる.
 
 \item[ume]  Ume Mincho and Ume Gothic.
-%<en>These fonts can be downloaded from\\\hfill \url{https://ja.osdn.net/projects/ume-font/wiki/FrontPage}.
+%<en>\par These fonts can be downloaded from\\\hfill \url{https://ja.osdn.net/projects/ume-font/wiki/FrontPage}.
 %<ja>これらのフォントは \url{https://ja.osdn.net/projects/ume-font/wiki/FrontPage} からダウンロードできる.
 \begin{center}\small
 \begin{tabular}{cll}
@@ -1962,6 +1962,70 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である.
 \end{tabular}
 \end{center}
 
+%<ja>\newpage
+ \item[sourcehan]  Source Han Serif and Source Han Sans fonts (Language-specific OTF \textit{or} OTC)
+%<en>    \\*[-\dimexpr\medskipamount+\baselineskip\relax]
+ \item[sourcehan-jp]  Source Han Serif JP and Source Han Sans JP fonts (Region-specific Subset OTF)
+\begin{center}\small
+\def\AD#1#2{Source Han #1 #2&Source Han #1 JP #2}%
+\begin{tabular}{cllll}
+\toprule
+\bf family&\bf series&\texttt{sourcehan}&\texttt{sourcehan-jp}\\
+\midrule
+ &medium&\AD{Serif}{Regular}\\
+%<en>\smash{\raisebox{1.5ex}{\textit{mincho}}}%
+%<ja>\smash{\raisebox{1.5ex}{\gt 明朝}}%
+ &bold&\AD{Serif}{Bold}\\
+\midrule
+ &&\AD{Sans}{Regular*}\\
+ &\smash{\raisebox{1.5ex}{medium}}
+ &\AD{Sans}{Medium}\\
+\cmidrule(l){2-4}
+%<en>\smash{\raisebox{2ex}{\textit{gothic}}}%
+%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}%
+ &bold&\AD{Sans}{Bold}\\
+ &heavy&\AD{Sans}{Heavy}\\
+\midrule
+%<en>\textit{rounded gothic}
+%<ja>\gt 丸ゴシック
+&&\AD{Sans}{Heavy}\\
+\bottomrule
+\end{tabular}
+\end{center}
+
+
+ \item[noto-otc]  Noto Serif CJK and Noto Sans CJK fonts (OTC)
+%<en>    \\*[-\dimexpr\medskipamount+\baselineskip\relax]
+ \item[noto-otf]  Noto Serif CJK and Noto Sans CJK fonts (Language-specific OTF)
+\begin{center}\small
+\def\AD#1#2{Noto #1 CJK #2&Noto #1 CJK JP #2}%
+\begin{tabular}{cllll}
+\toprule
+\bf family&\bf series&\texttt{noto-otc}&\texttt{noto-otf}\\
+\midrule
+ &medium&\AD{Serif}{Regular}\\
+%<en>\smash{\raisebox{1.5ex}{\textit{mincho}}}%
+%<ja>\smash{\raisebox{1.5ex}{\gt 明朝}}%
+ &bold&\AD{Serif}{Bold}\\
+\midrule
+ &&\AD{Sans}{Regular*}\\
+ &\smash{\raisebox{1.5ex}{medium}}
+ &\AD{Sans}{Medium}\\
+\cmidrule(l){2-4}
+%<en>\smash{\raisebox{2ex}{\textit{gothic}}}%
+%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}%
+ &bold&\AD{Sans}{Bold}\\
+ &heavy&\AD{Sans}{Black}\\
+\midrule
+%<en>\textit{rounded gothic}
+%<ja>\gt 丸ゴシック
+&&\AD{Sans}{Black}\\
+\bottomrule
+\end{tabular}
+\end{center}
+
+
+
 \end{cslist}
 %<en>\paragraph{Presets for single weight}
 %<ja>\paragraph{単ウェイト用プリセット一覧}
@@ -2860,6 +2924,7 @@ However, the penalty inserted after it is 10 which is the \Param{postbreakpenalt
 ``ア'', not 20.
 %</en>
 %<*ja>
+\newpage
 \subsection{禁則処理関連パラメータとOpenTypeのfont feature}
 禁則処理や \Param{kanjiskip}, \Param{xkanjiskip} の挿入に関連したパラメータのうち
 \begin{quote}
@@ -3859,7 +3924,7 @@ Specify the name of (horizontal) JFM.
 If specified JFM has not been loaded, \LuaTeX-ja search and load
 a file named \texttt{jfm-<name>.lua}.
 
-The following JFMs are shipped with \LuaTeX-ja:
+The following horizontal JFMs are shipped with \LuaTeX-ja:
 %</en>
 %<*ja>
 用いる(横組用)JFMの名前を指定する.もし以前に指定されたJFMが読み込まれていなければ,
@@ -3867,7 +3932,7 @@ The following JFMs are shipped with \LuaTeX-ja:
 %</ja>
 \begin{description}
 %<*en>
-\item[\tt jfm-ujis.lua] A standard JFM in \LuaTeX-ja. This JFM is
+\item[\tt jfm-ujis.lua] A standard horizontal JFM in \LuaTeX-ja. This JFM is
   based on \verb+upnmlminr-h.tfm+, a metric for UTF/OTF package that
   is used in \upTeX. When you use the \Pkg{luatexja-otf} package, you should use this JFM.
 %</en>
@@ -4068,12 +4133,13 @@ JFM中における \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
 %<ja>\subsection{\cs{tfont} 命令}
 
 
+\begin{comment}
+  {\catcode`\<=12\catcode`\>=12
 \begin{table}[t]
 %<en>\caption{Differences between vertical JFMs shipped with \LuaTeX-ja}
 %<ja>\caption{\LuaTeX-ja に同梱されている縦組用 JFM の違い}
 %<en>\medskip
 \label{tab-difjfm-tate}
-\catcode`\<=12\catcode`\>=12
 \ltjsetparameter{jacharrange={+3}}
 \small
 \def\r#1#2{%
@@ -4110,9 +4176,32 @@ JFM中における \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
 \end{minipage}
 \ltjsetparameter{jacharrange={-3}}
 \end{table}
+}
+\end{comment}
 
 %<*en>
-...
+\cs{tfont} loads a font as a Japanese font for vertical direction.
+This command admits the same syntax used in \cs{font}~and~\cs{jfont}.
+A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont}:
+\begin{itemize}
+ \item Both \texttt{vert}~and~\texttt{vrt2} Opentype features are activated,
+  unless they are explicitly activated or deactivated (as the third line in the example below).
+\begin{lstlisting}
+\tfont\S=file:KozMinPr6N-Regular.otf:jfm=ujisv
+    % vert and vrt2 are automatically activated
+\tfont\T=file:KozMinPr6N-Regular.otf:jfm=ujisv;-vert % vert and vrt2 are not activated
+\end{lstlisting}
+ \item ...
+ \item One have to specify the name of vertical JFM in  \texttt{jfm=<name>}.
+\LuaTeX-ja ships following vertical JFMs:
+\begin{description}
+\item[\tt jfm-ujisv.lua] A standard vertical JFM in \LuaTeX-ja. This JFM is
+  based on \verb+upnmlminr-v.tfm+, a metric for UTF/OTF package that
+  is used in \upTeX.
+\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}
+\end{itemize}
 %</en>
 %<*ja>
 \cs{tfont} はフォントを縦組用の和文フォントとして読み込む命令であり,
@@ -4130,7 +4219,7 @@ JFM中における \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
 \end{lstlisting}
  \item \ref{ssec-math}節で述べる,数式中の和文フォントには縦組用和文フォントは指定できない.
  \item \texttt{jfm=<name>}\ の部分には縦組用JFMを指定する.
-以下の縦組用JFMが\LuaTeX-jaには同梱されており,違いを\autoref{tab-difjfm-tate}に示した.
+以ä¸\8bã\81®ç¸¦çµ\84ç\94¨JFMã\81\8c\LuaTeX-jaã\81«ã\81¯å\90\8c梱ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8bï¼\8e\81\8aã\82\8aï¼\8cé\81\95ã\81\84ã\82\92\autoref{tab-difjfm-tate}ã\81«ç¤ºã\81\97ã\81\9fï¼\8e
 \begin{description}
 \item[\tt jfm-ujisv.lua] \LuaTeX-jaの標準縦組用JFMである.このJFMは\upTeX で
   用いられるUTF/OTFパッケージ用の和文用TFMである \verb+upnmlminr-v.tfm+ を
@@ -4271,15 +4360,15 @@ floating-point numbers in design-size unit.
 
 \begin{cslist}[style=standard]
 
-\item[version=$1\mathrel{\textrm{or}}2$]
+\item[version=<version>]
 %<en>(optional, default value is~1)
 %<ja>(任意,既定値は1)
 
 %<*en>
-The version JFM. Currently 1~and~2 are supported
+The version JFM. Currently 1,~2,~and,~3 are supported
 %</en>
 %<*ja>
-JFMのバージョン.1または2がサポートされる.
+JFMのバージョン.1,~2,~3がサポートされる.
 %</ja>
   
 \item[dir=<direction>]
@@ -4710,8 +4799,8 @@ we specify <ratio> to $0.25/(0.5+0.25)=1/3$.
              \Pkg{luatexja-adjust}による優先順位付き
             行長調整(\ref{ssec-adj}節)において,このグルーの優先度を指定する.許される値は以下の通り:
   \begin{description}
-    \item[バージョン1のとき] $-4$から$+3$の間の整数
-    \item[バージョン2ã\81®ã\81¨ã\81\8d] $-4$ã\81\8bã\82\89$+3$ã\81®é\96\93ã\81®æ\95´æ\95°ã\81®2ã\81¤çµ\84\texttt{\{<stretch>, <shrink>\}}ã\81\8bï¼\8c
+    \item[バージョン1] $-4$から$+3$の間の整数
+    \item[バージョン2以é\99\8d] $-4$ã\81\8bã\82\89$+3$ã\81®é\96\93ã\81®æ\95´æ\95°ã\81®2ã\81¤çµ\84\texttt{\{<stretch>, <shrink>\}}ã\81\8bï¼\8c
     または$-4$から$+3$の間の整数.<stretch>, <shrink>はそれぞれこのグルーが伸びるときの優先度,縮むときの
     優先度であり,単に整数$i$が指定された場合は\texttt{\{$i$, $i$\}}であると解釈される.
   \end{description}
@@ -4754,7 +4843,7 @@ In case of glue, one can specify following additional keys in each \texttt{[$j$]
 \begin{cslist}[style=standard]
 \item[priority=<priority>]
 An integer in $[-4,3]$ (treated as 0 if omitted), or
-a pair of these integers \texttt{\{<stretch>, <shrink>\}} (version~2 only).
+a pair of these integers \texttt{\{<stretch>, <shrink>\}} (version 2~or~later).
 This is
 used only in line adjustment with priority by \Pkg{luatexja-adjust}
 (see Subsection~\ref{ssec-adj}). Higher value means the glue is easy to stretch,
@@ -4943,8 +5032,31 @@ The following is the list of imaginary characters:
 %<ja>通常の(\cs{noindent} で開始されていない)段落の先頭.
 
 \item['jcharbdd']
-%<en>A boundary between \textbf{JAchar} and anything else (such as \textbf{ALchar}, kern, glue,\,\ldots).
-%<ja>\textbf{JAchar}と「その他のもの」(欧文文字,glue,kern等)との境界.
+%<en>A boundary between \textbf{JAchar} and anything else.
+%<*ja>
+\textbf{JAchar}と「その他のもの」との境界.
+
+バージョン2以前では\textbf{ALchar},箱,罫線(rule),glue,~kernなどいろいろなものと\textbf{JAchar}の境界に対して
+本特殊文字が用いられていたが,
+バージョン3以降では\ \texttt{'jcharbdd'}, \texttt{'alchar'}, \texttt{'nox\_alchar'},
+\texttt{'glue'} と細分化され,
+\texttt{'jcharbdd'} は主に\textbf{JAchar}とボックスや罫線(rule)との境界に使われるようになった.
+%</ja>
+  
+\item['alchar', 'nox\_alchar']
+%<*en>
+(version 3~or~later) A boundary between \textbf{JAchar} and \textbf{ALchar}.
+%</en>
+%<*ja>
+(バージョン3以降)\textbf{JAchar}と\textbf{ALchar}との境界.
+\textbf{JAchar}と\textbf{ALchar}の間に\Param{xkanjiskip}が入ることが可能な場合は
+\ \texttt{'alchar'}\ が,そうでない場合は\ \texttt{'nox\_alchar'}\ が用いられる
+(この区別は\textbf{ALchar}側の\Param{alxspmode}の値によってのみ行われる).
+%</ja>
+
+\item['glue']
+%<en>(version 3~or~later) A boundary between \textbf{JAchar}, and, a glue or kern.
+%<ja>(バージョン3以降))\textbf{JAchar}とglue,kernとの境界.
 
 \item[$-1$]
 %<en>The left/right boundary of an inline math formula.
@@ -6962,24 +7074,31 @@ OpenType機能指定は
 \subsection{\Pkg{luatexja-otf}}
 \label{ssec-ltjotf}
 %<*en>
-This optional package supports typesetting characters in
-Adobe-Japan1 character collection
-(or other CID character collection, if the font is supported).
+This optional package supports typesetting glyphs
+by specifying a CID number.
 The package \Pkg{luatexja-otf} offers the following 2~low-level
 commands:
 %</en>
 %<*ja>
-この追加パッケージはAdobe-Japan1(フォント自身が持っていれば,
-別のCID文字セットでも可)の文字の出力をサポートする.
+この追加パッケージはCID番号による文字の出力をサポートする.
 \Pkg{luatexja-otf}は以下の2つの低レベルコマンドを提供する:
 %</ja>
 \begin{cslist}
 \item[\cs{CID}\{<number>\}]
 %<*en>
-Typeset a character whose CID number is <number>.
+Typeset a glyph whose CID number is <number>.
+If the Japanese font is neither Adobe-Japan1,~Adobe-GB1, Adobe-CNS1,~nor~Adobe-Korea1 CID-keyed font,
+\LuaTeX-ja treats that <number> is a CID number of Adobe-Japan1 character collection,
+and tries to typeset a ``most suitable glyph''.
 %</en>
 %<*ja>
 CID番号が<number>の文字を出力する.
+もし現在の和文フォントがAdobe-Japan1,~Adobe-GB1, Adobe-CNS1,~Adobe-Korea1の
+  いずれのCID-keyed fontでもない場合,<number>はAdobe-Japan1のCID番号であると解釈し
+  「適切なグリフ」\footnote{%
+  例えばフォントにIVDコレクションAdobe-Japan1が含まれていれば,その情報を用いて
+  グリフを選択する.
+}を出力する.
 %</ja>
 
 \item[\cs{UTF}\{<hex\_number>\}]
@@ -7058,34 +7177,6 @@ JFMの\texttt{chars}テーブルのエントリとして \verb+'AJ1-xxx'+ の形
 正しく半角幅で組むために利用されている.
 %</ja>
 
-%<*en>
-\paragraph{IVS support}
-Recent fonts support Ideographic Variation Selector (IVS).
-\Pkg{luaotfload} and \Pkg{fontspec} packages used to be not supported IVS,
-so we implemented experimental IVS support in \Pkg{luatexja-otf},
-which is activated by
-\begin{lstlisting}
-\directlua{luatexja.otf.enable_ivs()}
-\end{lstlisting}
-However, recent \Pkg{luaotfload} and \Pkg{fontspec} packages seem to support IVS,
-so we don't execute above command anymore.
-%</en>
-%<*ja>
-\paragraph{IVSサポート}
-最近のOpenTypeフォントやTrueTypeフォントには,
-\texttt{U+E0100}--\texttt{U+E01EF}の範囲の「文字」
-(漢字用異体字セレクタ)を後置することによって
-字形を指定する仕組み(IVS)が含まれている.
-執筆時点の2013年12月では,\Pkg{luaotfload}や\Pkg{fontspec}パッケージ類は
-IVSに対応してはいないようであったため,
-\Pkg{luatexja-otf}パッケージ内に試験的なIVS対応を実装した.これは以下の命令の実行で有効になる:
-\begin{lstlisting}
-\directlua{luatexja.otf.enable_ivs()}
-\end{lstlisting}
-しかし,現在の\Pkg{luaotfload}や\Pkg{fontspec}パッケージは
-IVSに対応しているようであるので,もはや上の命令を実行する必要はない.
-%</ja>
-
 \subsection{\Pkg{luatexja-adjust}}
 \label{ssec-adj}
 \begin{figure}[t]