From f4648633114b448dadb484b114606ac663073819 Mon Sep 17 00:00:00 2001 From: Hironori Kitagawa Date: Thu, 27 Aug 2015 16:17:54 +0900 Subject: [PATCH] Update manuals to match current lltjfont.sty --- doc/luatexja.dtx | 164 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 121 insertions(+), 43 deletions(-) diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index 44a9214..1c30699 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -1105,13 +1105,12 @@ For \LaTeXe, \LuaTeX-ja adopted most of the font selection system of \pLaTeXe\ ( % \begin{itemize} %<*en> -\item Commands \cs{fontfamily}, \cs{fontseries}, - \cs{fontshape}, and \cs{selectfont} can be used to change +\item Commands \cs{fontfamily}, \cs{fontseries}, and \cs{fontshape} can be used to change attributes of Japanese fonts. % %<*ja> -\item 和文フォントの属性を変更するには,\cs{fontfamily}, \cs{fontseries}, \cs{fontshape}, - そしてそれらを反映させるために \cs{selectfont} を用いればよい. +\item 和文フォントの属性を変更するには,\cs{fontfamily}, \cs{fontseries}, \cs{fontshape} を使用する. + もちろん,それらを実際に反映させるには手動で \cs{selectfont} を実行する必要がある. % %<*en> @@ -1172,14 +1171,16 @@ auto select&\cs{fontencoding}&\cs{fontfamily}&---&---&\cs{usefont}\\ %<*en> \item For defining a Japanese font family, use \cs{DeclareKanjiFamily} instead of - \cs{DeclareFontFamily}. However, in the present implementation, - using \cs{DeclareFontFamily} doesn't cause any problem. + \cs{DeclareFontFamily}. (In previous version of \LuaTeX-ja, + using \cs{DeclareFontFamily} didn't cause any problem. But this no longer applies + the current version.) \item Defining a Japanese font shape can be done by usual \cs{DeclareFontShape}: % %<*ja> \item 和文フォントファミリの定義には \cs{DeclareFontFamily} の - 代わりに \cs{DeclareKanjiFamily} を用いる.しかし,現在の - 実装では \cs{DeclareFontFamily} を用いても問題は生じない. + 代わりに \cs{DeclareKanjiFamily} を用いる.以前の + 実装では \cs{DeclareFontFamily} を用いても問題は生じなかったが,現在の実装では + そうはいかない. \item 和文フォントのシェイプを定義するには,通常の \cs{DeclareFontShape} を使えば良い: % \begin{lstlisting} @@ -5839,67 +5840,144 @@ In \LuaTeX-ja, this \cs{adjustbaseline} does same task, namely setting the \item[\cs{fontfamily}\{\}] %<*en> As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both}) -to . Which family will be changed is determined as follows: +to . + +First, Whether Japanese font family will be changed is determined by following conditions. +We use an auxiliary list~$N_{\mathrm{J}}$. % %<*ja> 元々の\LaTeXe におけるものと同様に,このコマンドは現在のフォントファミリ(欧文, 和文,\emph{もしくは両方})をに変更する. -どのファミリが変更されるかは以下のようにして決定される: +まず,和文フォントファミリが変更されるかは以下の順序で決定される. +補助的に「和文フォントファミリではない」ファミリを格納したリスト$N_{\mathrm{J}}$を用いる. % -\begin{itemize} +\begin{enumerate} %<*en> -\item Let current encoding scheme for Japanese fonts be - . Current Japanese font family will be changed to - , if one of the following two conditions is met: +\item If the family~ has been defined already by \cs{DeclareKanjiFamily}, + current Japanese font family will be changed to . + Note that need not be defined under \emph{current} Japanese font encoding. % %<*ja> -\item 現在の和文フォントに対するエンコーディングがであるとしよう. - 現在の和文フォントファミリは,以下の2つの条件のうちの1つが満たされているときに - に変更される: +\item ファミリが既に \cs{DeclareKanjiFamily} によって定義されている場合, + 和文フォントファミリはに変更される. + ここで,は現在の和文フォントエンコーディングで定義されていなくてもよい. % -\begin{itemize} %<*en> -\item The family under the encoding has been already defined by - \cs{DeclareKanijFamily}. +\item If the family~ has been listed in a list~$N_{\mathrm{J}}$, this means + that is not a Japanese font family, hence current Japanese font family + won't be changed. % %<*ja> -\item エンコーディングにおけるファミリが -既に \cs{DeclareKanjiFamily} によって定義されている. +\item ファミリがリスト$N_{\mathrm{J}}$に既に含まれていれば,それは + が和文フォントファミリではないことを意味するので,和文フォントファミリは変更されない. % %<*en> -\item A font definition named \texttt{.fd} (the file name is - all lowercase) exists. +\item If the \Pkg{luatexja-fontspec} package is loaded, we stop here, and current Japanese font family + won't be changed. + + If the \Pkg{luatexja-fontspec} package is \emph{not} loaded, +now \LuaTeX-ja looks whether there exists a Japanese font encoding~ such that + a font definition named \texttt{.fd} (the file name is + all lowercase) exists. If so, current Japanese font family will be changed to + ~(the font definition file won't be loaded here). + If not, current Japanese font family won't be changed, and + is appended to the list~$N_{\mathrm{J}}$. % %<*ja> -\item フォント定義ファイル\texttt{.fd}(ファイル名は全て小文字)が存在する. +\item もし\Pkg{luatexja-fontspec}パッケージが読み込まれていれば,ここで終了であり, +和文フォントファミリは変更されないことになる. + +もし\Pkg{luatexja-fontspec}パッケージが読み込まれていなければ,和文エンコーディングで +フォント定義ファイル\texttt{.fd}(ファイル名は全て小文字)が存在するようなも + のがあるかどうかを調べる. +存在すれば,和文フォントファミリはに変更される(フォント定義ファイルは変更されな + い). +存在しなければ,リスト$N_{\mathrm{J}}$にを追加するだけで,和文フォントファミリは変更されない. + % -\end{itemize} +\end{enumerate} + %<*en> -\item Let current encoding scheme for alphabetic fonts be - . For alphabetic font family, the criterion as above is used. +Next, whether alphabetic font family will be changed is determined by following conditions. +We use an auxiliary lists $F_{\mathrm{A}}$~and~$N_{\mathrm{A}}$, and +patches \cs{DeclareFontEncoding}~and~\cs{DeclareFontFamily} to keep track of alphabetic + font encodings~and~families. % %<*ja> -\item 現在の欧文フォントに対するエンコーディングをとする. - 欧文フォントファミリに対しても,上記の基準が用いられる. +次に,欧文フォントファミリについての判定を述べていく. +補助的に「欧文フォントファミリと判明した」ファミリのリスト$F_{\textrm{A}}$と, +「欧文フォントファミリではない」ファミリを格納したリスト$N_{\mathrm{A}}$を用いる. % + +\begin{enumerate} %<*en> -\item There is a case which none of the above applies, that is, the font - family named doesn't seem to be defined neither under the - encoding , nor under . -In this case, the default family for font substitution is used for - alphabetic and Japanese fonts. Note that current encoding will not - be set to , unlike the original implementation in \LaTeX. +\item If the family~ has been listed in a list~$F_{\mathrm{A}}$, + current alphabetic font family will be changed to . + Note that need not be defined under \emph{current} alphabetic font encoding. % %<*ja> -\item 上記のいずれもが適用されない,つまりがとの - どちらでも定義されないような場合がある. - この場合,代替フォントに用いられるデフォルトのフォントファミリが欧文フォントと - 和文フォントに用いられる.\LaTeX のオリジナルの実装とは異なり, - 現在のエンコーディングはには設定されないことに注意する. +\item ファミリがリスト$F_{\mathrm{A}}$に既に含まれていれば, + 欧文フォントファミリはに変更される. + ここで,は現在の欧文フォントエンコーディングで定義されていなくてもよい. % -\end{itemize}% -%\vspace{-\medskipamount} +%<*en> +\item If the family~ has been listed in a list~$N_{\mathrm{A}}$, this means + that is not a alphabetic font family, hence current alphabetic font family + won't be changed. +% +%<*ja> +\item ファミリがリスト$N_{\mathrm{A}}$に既に含まれていれば,それは + が欧文フォントファミリではないことを意味するので,欧文フォントファミリは変更されない. +% +%<*en> +\item If there exists an alphabetic font encoding such that the family~ has been + defined under it, current alphabetic font family will be changed to , and + is appended to the list~$F_{\mathrm{A}}$. +% +%<*ja> +\item ある欧文フォントエンコーディング下でファミリが定義されていれば, + リスト$F_{\mathrm{A}}$にを追加し,欧文フォントファミリはに変更される. +% +%<*en> +\item Now \LuaTeX-ja looks whether there exists an alphabetic font encoding~ such that + a font definition named \texttt{.fd} (the file name is + all lowercase) exists. If so, current alphabetic font family will be changed to + ~(the font definition file won't be loaded here). + If not, current alphabetic font family won't be changed, and + is appended to the list~$N_{\mathrm{A}}$. +% +%<*ja> +\item 最終段階では,欧文エンコーディングで +フォント定義ファイル\texttt{.fd}(ファイル名は全て小文字)が存在するようなも + のがあるかどうかを調べる. +存在すれば,欧文フォントファミリはに変更される(フォント定義ファイルは変更されな + い). +存在しなければ,リスト$N_{\mathrm{A}}$にを追加するだけで,欧文フォントファミリは変更されない. +% +\end{enumerate} +%<*en> +Of course, there is a case that ``Japanese font family nor alphabetic font family is changed''. +In this case, \LuaTeX-ja treats ``the argument is wrong'', so +the default family for font substitution is used for alphabetic and Japanese fonts. +%%% Note that current font encoding will not +%%% be set to , unlike the original implementation in \LaTeX. + +Note that the execution of \cs{DeclareFontFamily} \emph{after} loading of \LuaTeX-ja makes +the second argument (family) is appended to the list~$F_{\mathrm{A}}$. +% +%<*ja> +さて,引数によっては,「和文フォントファミリも欧文フォントファミリも変更されませんでした」 +という時代もあり得る. + この場合,引数は不正だった,ということになるので, +代替フォントに用いられるデフォルトのフォントファミリが欧文フォントと + 和文フォントに用いられる. +%%%LaTeX のオリジナルの実装とは異なり, +%%% 現在のエンコーディングはには設定されないことに注意する. + +なお,\cs{DeclareFontFamily}を\LuaTeX-jaの読み込み後に実行した場合は, +第2引数(ファミリ名)が自動的に$F_{\mathrm{A}}$に追加される. +% \begin{figure}[!tb] \begin{LTXexample}[pos=b] -- 2.11.0