OSDN Git Service

updated documents: IVS is already supported in luaotfload
[luatex-ja/luatexja.git] / doc / luatexja.dtx
index c3e86bf..484f90b 100644 (file)
@@ -16,6 +16,7 @@
 %%%%%%%%
 \makeatletter
 %%%%%%%%
+\def\pgfsysdriver{pgfsys-pdftex.def}
 \directlua{if jit then jit.on() end}
 \usepackage{metalogo,amsmath,array,tikz,pict2e,multienum,float}
 \usepackage{booktabs,multicol,luatexja-ruby}
@@ -602,17 +603,17 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}.
 %<en>The following packages are needed for the \LuaTeX-ja\ package.
 %<ja>\LuaTeX-jaパッケージの動作には次のパッケージ類が必要である.
 \begin{itemize}
-\item \LuaTeX\ beta-0.80.0 (or later)
-\item \Pkg{luaotfload} v2.5 (or later)
+\item \LuaTeX\ beta-0.85.0 (or later)
+\item \Pkg{luaotfload} v2.6 (or later)
 \item \Pkg{adobemapping} (Adobe cmap and pdfmapping files)
 \item \Pkg{everysel} (if you want to use \LuaTeX-ja with \LaTeXe)
 \item \Pkg{fontspec} v2.4
 %<en>\item \emph{IPAex fonts} (\url{http://ipafont.ipa.go.jp/})
 %<ja>\item \emph{IPAexフォント(\url{http://ipafont.ipa.go.jp/})}
 \end{itemize}
-%<en>In summary, this version of \LuaTeX-ja no longer supports \TeX~Live~2014 (or older version).
+%<en>In summary, this version of \LuaTeX-ja no longer supports \TeX~Live~2015 (or older version).
 %<*ja>
-要約すると,本バージョンの\LuaTeX-jaは\TeX~Live~2014以前では動作しない\footnote{%
+要約すると,本バージョンの\LuaTeX-jaは\TeX~Live~2015以前では動作しない\footnote{%
   もっとも,自分で\LuaTeX のバイナリをSubversionリポジトリからビルドしていれば話は別である.
 }.
 %</ja>
@@ -1058,6 +1059,12 @@ Okumura), namely, \Pkg{ltjclasses}\footnote{%
   The latter \texttt{ltjt*.cls} are for vertically writtened Japanese documents.
 } and \Pkg{ltjsclasses}\footnote{%
   \texttt{ltjsarticle.cls},~\texttt{ltjsbook.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,
+so \Pkg{ltjsclasses} use different method%
+\footnote{Similar to \texttt{magstyle=xreal} in the \Pkg{BXjscls} classes (by Takayuki Yato).}
+to set the main document font size.
 %</en>
 %<*ja>
 しかしながら,上記の設定は日本語の文書にとって十分とは言えない.
@@ -1072,6 +1079,12 @@ Okumura), namely, \Pkg{ltjclasses}\footnote{%
 \Pkg{ltjsclasses}\footnote{%
   \texttt{ltjsarticle.cls},~\texttt{ltjsbook.cls},~\texttt{ltjskiyou.cls}.}%
 がそれぞれ用意されている.
+
+元々の\Pkg{ltjsclasses}ではフォントサイズを指定するのに\cs{mag}プリミティブが使われていたが,
+\LuaTeX~beta-0.87.0以降ではPDF出力時の\cs{mag}のサポートが廃止された.
+そのため,\Pkg{ltjsclasses}では別の方法
+\footnote{八登崇之氏による\Pkg{BXjscls}クラスにおける\texttt{magstyle=xreal}指定時と類似している.}で
+フォントサイズを指定することにしている.
 %</ja>
 
 %<*ja>
@@ -2684,7 +2697,7 @@ becuse a \emph{JAchar} is encapsulated by a horizontal box if needed.
 数式中の挙動は異なっているので注意が必要である.
 例えば,表\ref{tab:math_bsa}のように,数式中に明示的に現れた \cs{hbox} は,
 \begin{itemize}
- \item \pTeX では,ボックス全体が \cs{ybaselineshift} だとシフトされるので,
+ \item 2015年以前の\pTeX では,ボックス全体が \cs{ybaselineshift} だとシフトされるので,
  表\ref{tab:math_bsa}中の``い''のように,ボックス中の和文文字は
  \ \cs{ybaselineshift} だけシフトされ,一方,``for all''のように,
  ボックス内の欧文文字は2重にシフトされることになる.
@@ -2692,6 +2705,10 @@ becuse a \emph{JAchar} is encapsulated by a horizontal box if needed.
  数式中に明示的に現れた \cs{hbox} はシフトしない.そのため,
  表\ref{tab:math_bsa}中の``い''も``for all''も,それぞれ本文中に
  書かれたときと同じ上下位置に組まれる.
+
+ なお,\TeX~Live~2016以降の\pTeX では改修がなされ,\LuaTeX-jaと
+ 近い挙動になるようにしているが,数式中に直に書かれた``あ''のベースラインについては
+ まだ違いが見られる.
 \end{itemize}
 \begin{table}
 \small\centering
@@ -2708,12 +2725,16 @@ $\Phi\vdash F(x)\ \hbox{for all}\ x\in A$
 \end{lstlisting}\\
 \noalign{\vskip-\origbaselineskip}
 \midrule
-\emph{\pTeX}&
+\emph{\pTeX~(--2015)}&
 {\ltjsetparameter{yalbaselineshift=10pt}%
-数式abc: $a\lower10pt\hbox{い}$, $\int_0^x t\,dt=x^2/2$,
+数式abc: $\lower10pt\hbox{あ}a\lower10pt\hbox{い}$, $\int_0^x t\,dt=x^2/2$,
 $\Phi\vdash F(x)\ \lower10pt\hbox{for all}\ x\in A$
-\par}\\
-\midrule
+\par}\\\noalign{\vskip-\origbaselineskip}\midrule
+\emph{\pTeX~(2016--)}&
+{\ltjsetparameter{yalbaselineshift=10pt}%
+数式abc: $\lower10pt\hbox{あ}a\hbox{い}$, $\int_0^x t\,dt=x^2/2$,
+$\Phi\vdash F(x)\ \hbox{for all}\ x\in A$
+\par}\\\noalign{\vskip-\origbaselineskip}\midrule
 \emph{\LuaTeX-ja}&
 {\ltjsetparameter{yalbaselineshift=10pt}%
 数式abc: $あa\hbox{い}$, $\int_0^x t\,dt=x^2/2$,
@@ -5806,7 +5827,7 @@ The last \cs{kansuji} converts an integer into its Chinese numerals.
 \pTeX と同じようにJIS~X~0208の範囲しかサポートしていない.
 %</ja>
 \begin{center}
-\cs{kuten}, \cs{jis}, \cs{euc}, \cs{sjis}, \cs{jis}, \cs{kansuji}
+\cs{kuten}, \cs{jis}, \cs{euc}, \cs{sjis}, \cs{ucs}, \cs{kansuji}
 \end{center}
 %<*en>
 These six commands takes an internal integer, and returns a \emph{string}.
@@ -6784,11 +6805,14 @@ JFMの\texttt{chars}テーブルのエントリとして \verb+'AJ1-xxx'+ の形
 %<*en>
 \paragraph{IVS support}
 Recent fonts support Ideographic Variation Selector (IVS).
-It seems that \Pkg{luaotfload} and \Pkg{fontspec} packages do not support
-IVS, so we implemented IVS support in \Pkg{luatexja-otf}.
-\emph{IVS support by the \Pkg{luatexja-otf} package is experimental.
-If you want to enable IVS support, load
-\Pkg{luatexja-otf} and execute the following:}
+\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サポート}
@@ -6797,67 +6821,14 @@ If you want to enable IVS support, load
 (漢字用異体字セレクタ)を後置することによって
 字形を指定する仕組み(IVS)が含まれている.
 執筆時点の2013年12月では,\Pkg{luaotfload}や\Pkg{fontspec}パッケージ類は
-IVSに対応してはいないようである.これらのパッケージで対応してくれるのが理想的だが,
-それまでのつなぎとして,\Pkg{luatexja-otf}パッケージ内にIVS対応を仕込んでおいた.
-
-\medskip
-
-\emph{\Pkg{luatexja-otf}によるIVS対応は試験的なものである.
-有効にするには,
-\Pkg{luatexja-otf}パッケージを読み込んだ上で以下の命令を実行する%
-\footnote{この命令を2回以上実行しても意味がない.}:}
-%</ja>
+IVSに対応してはいないようであったため,
+\Pkg{luatexja-otf}パッケージ内に試験的なIVS対応を実装した.これは以下の命令の実行で有効になる:
 \begin{lstlisting}
 \directlua{luatexja.otf.enable_ivs()}
 \end{lstlisting}
-%<ja> すると,上の命令を実行した箇所以降では,以下のようにIVSによる字形指定が有効となる.
-%<en> After executing the command above, you can use IVS like the following:
-\begin{LTXexample}
-\Large
-\jfontspec{KozMinPr6N-Regular}
-奈良県葛󠄀城市と,東京都葛󠄁飾区.\\
-こんにちは,渡
-邉󠄀邉󠄁邉󠄂邉󠄃邉󠄄
-邉󠄅邉󠄆邉󠄇邉󠄈邉󠄉
-邉󠄊邉󠄋邉󠄌邉󠄍邉󠄎
-さん.
-\end{LTXexample}
-%<*ja>
-左上側の入力においては,漢字用異体字セレクタを明示するため,
-例えばVariation~Selector~18 (\texttt{U+E0101})を\IVSB{18}のように表記している.
+しかし,現在の\Pkg{luaotfload}や\Pkg{fontspec}パッケージは
+IVSに対応しているようであるので,もはや上の命令を実行する必要はない.
 %</ja>
-\medskip
-
-%<*en>
-Specifying glyph variants by IVS precedes glyph replacement by font features.
-For example, only ``葛'' in ``葛西'' is changed by font features
-\texttt{jp78}~or~\texttt{jp90}, which does not followed by any variation selector.
-%</en>
-%<*ja>
-また,IVSによる字形指定は,OpenType機能によるそれに優先されることとした.
-下の例において,\texttt{jp78}, \texttt{jp90} 指定で字形が変化した文字は
-異体字セレクタが続いていない「葛西」中の「葛」のみである.
-%</ja>
-\begin{LTXexample}
- \def\TEST#1{%
-   {\jfontspec[#1]{KozMinPr6N-Regular}%
-   葛󠄀城市,葛󠄁飾区,葛西}\\}
- 指定なし:\TEST{}
- \texttt{jp78}:\TEST{CJKShape=JIS1978}
- \texttt{jp90}:\TEST{CJKShape=JIS1990}
-\end{LTXexample}
-
-%<*ja>
-現状では,\TeX 側のインターフェースとなる \Pkg{luatexja-otf.sty} は一切変更していない
-ので,ZRさんによる\Pkg{PXipamjm}パッケージ%
-\footnote{\url{https://github.com/zr-tex8r/PXipamjm}. 説明は彼のブログ記事
-「pxipamjm パッケージの説明書のような何か(\url{http://d.hatena.ne.jp/zrbabbler/20131221})」
-にある.}
-にあるような気の利いた命令はまだない.
-異体字の一覧表示を行いたい場合は,gitリポジトリ内の \texttt{test/test19-ivs.tex} 中にある
-Lua・\TeX コードが参考になるだろう.
-%</ja>
-
 
 \subsection{\Pkg{luatexja-adjust}}
 \label{ssec-adj}
@@ -7403,6 +7374,18 @@ $i$は7より小さい自然数.
 \end{description}
 %<ja> \TeX 側から見える値,つまり \verb+\the\ltj@dir+ の値は常に0である.
 
+\cnt{ltjlineendcomment}
+%<*ja>
+  \LuaTeX-jaは\textbf{JAchar}で入力行が終了した場合,その直後にコメント文字を
+  おくことで余計な空白が挿入されることを防いでいる.
+  \cs{ltjlineendcomment}はその際のコメント文字のUnicodeにおける符号位置を指定する
+  (詳細は\ref{ssec:lineend}節を参照).
+
+  \LuaTeX-jaにおける既定値は$\texttt{"FFFFF}=1048575$であり,
+  ユーザは内部動作を熟知していない限りこのカウンタの値を変更してはならない.
+  \cs{ltjlineendcomment}の値がUnicodeの範囲外(負や,$\texttt{"10FFFF}=1114111$を超えた場合)
+  にくることは想定されていない.
+%</ja>
 \end{list}
 
 %<*en>
@@ -8009,6 +7992,7 @@ to State~$M$ (middle of line) sometimes.
 
 %<en>\subsection{Behavior in \LuaTeX-ja}
 %<ja>\subsection{\LuaTeX-jaの動作}
+  \label{ssec:lineend}
 %<*en>
 States in the input processor of \LuaTeX\ is the same as that of \TeX,
 and they can't be customized by any callbacks. Hence, we can only use
@@ -8023,9 +8007,10 @@ space must be done \emph{just before} an input line is read.
 
 Considering these situations, handling of an end-of-line in \LuaTeX-ja are as follows:
 \begin{quote}
-A character \cs{ltjlineendcomment} (default: \texttt{\textbackslash ltjlineendcomment="FFFFF},
-i.e. \texttt{U+FFFFF}; its category code is set to 14~(\textit{comment}) by
-\LuaTeX-ja) is appended to an input line, \emph{before \LuaTeX\ actually
+A character whose character code is \cs{ltjlineendcomment}%
+\footnote{Its default value is \texttt{"FFFFF}, so  \texttt{U+FFFFF} is used.
+The category code of \texttt{U+FFFFF} is set to 14~(\textit{comment}) by
+\LuaTeX-ja.} is appended to an input line, \emph{before \LuaTeX\ actually
 process it}, if and only if the following three conditions are satisfied:
 \begin{enumerate}
 \item The category code of \cs{endlinechar}%
@@ -8059,7 +8044,7 @@ there is a space before ``u''. This follows from following reasons:
 \item When line~3 is processed by \texttt{process\_input\_buffer} callback,
 ``あ'' is considered as an \textbf{JAchar}.
 Since  line~3 ends with an \textbf{JAchar},
-the comment character \cs{ltjlineendcomment} is appended to this line,
+the comment character (whose character code is \cs{ltjlineendcomment}) is appended to this line,
 and hence the linebreak immediately after this line is ignored.
 \item When line~4 is processed by \texttt{process\_input\_buffer} callback,
 ``い'' is considered as an \textbf{ALchar}.
@@ -8084,10 +8069,10 @@ emits a space.
 
 \begin{quote}
 各入力行に対し,\emph{その入力行が読まれる前の内部状態で}
-以下の3条件が満たされている場合,\LuaTeX-jaは\cs{ltjlineendcomment}の文字
-\footnote{デフォルトでは\texttt{\textbackslash ltjlineendcomment="FFFFF}
-  つまり\texttt{U+FFFFF}が挿入される.この文字はコメント文字として扱われるように
-  \LuaTeX-ja内部で設定をしている.}
+以下の3条件が満たされている場合,\LuaTeX-jaは\cs{ltjlineendcomment}の文字
+\footnote{\cs{ltjlineendcomment}の既定値は\texttt{"FFFFF}であるので
+  既定では\texttt{U+FFFFF}が使われることになる.この文字はコメント文字として扱われるように
+  \LuaTeX-ja内部で設定をしている.}%
 を末尾に追加する.よって,その場合に改行は空白とは見做されないこととなる.
 \begin{enumerate}
 \item \cs{endlinechar}の文字\footnote{普通は,改行文字(文字コード13番)である.}
@@ -8122,7 +8107,7 @@ u
 \begin{itemize}
 \item 3行目を \texttt{process\_input\_buffer} で処理する時点では,
       「あ」は\textbf{JAchar}(和文扱い)である.よって3行目は\textbf{JAchar}で終わることになり,
-      コメント文字\cs{ltjlineendcomment}が追加される.
+      \cs{ltjlineendcomment}番のコメント文字が追加される.
       よって,直後の改行文字は無視されることになり,空白は入らない.
 \item 4行目を \texttt{process\_input\_buffer} で処理する時点では,
       「い」は\textbf{ALchar}である.よって4行目は\textbf{ALchar}で終わることになり,
@@ -9541,12 +9526,16 @@ return {
    [0]=37001,  --   <9089 E0100>
    991049,     --   <9089 E0101>
    ...
-   ["vert"]=995025, -- vertical variant
+   ["vform"]=995025, -- vertical variant
   },
   ...
+  ["unicodes"]={
+    ["aj102.pe.vert"]=984163, -- glyph name to unicode
+    ...
+  }
  },
  ["chksum"]="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", -- checksum of the fontfile
- ["version"]=2, -- version of the cache
+ ["version"]=11, -- version of the cache
 }
 \end{lstlisting}
 %<*ja>