X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=doc%2Fluatexja.dtx;h=f3e910c44198d84be6277b5b9dbba48a6ea2de3f;hb=029c74784e3acac4ca96ef9c8c3789faf7334d38;hp=b95b4d60b97e9660c1eda4bb6f63b8d4af50ebcb;hpb=a1975ec0c7fc612eca83b48b90906d5eb78096f7;p=luatex-ja%2Fluatexja.git diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index b95b4d6..f3e910c 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -44,6 +44,7 @@ \usepackage[margin=25mm,lmargin=30mm,rmargin=30mm,footskip=6mm]{geometry} \usepackage{luatexja-adjust}\ltjdisableadjust \parskip=\smallskipamount +\makeatletter \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {3.25ex \@plus1ex \@minus.2ex}% {-1em}% @@ -77,6 +78,7 @@ explpreset={numberstyle=\tiny, numbers=left, numbersep=1em, columns=fixed} } % Suppress output from showexpl to stdout. +\makeatletter \let\SX@Info\relax %%%%%%%% colors @@ -156,7 +158,8 @@ \vskip\belowcaptionskip} \def\_{\leavevmode \kern .06em\vbox {\hrule \@width .333em}} -\def\cs#1{\texttt{\upshape\textbackslash\ltjsetparameter{autoxspacing=false}#1}} +\def\cs#1{\texttt{\upshape + \texorpdfstring{\textbackslash\ltjsetparameter{autoxspacing=false}#1}{\textbackslash#1}}} %%%%%%%% \makeatother @@ -735,7 +738,7 @@ For changes from \pTeX, see Subsection~\ref{ssec:chgptex}. % \begin{itemize} %<*en> -\item The encoding of your source file must be UTF-8. No other +\item The encoding of your source file must be UTF-8. Other encodings, such as EUC-JP or Shift-JIS, are not supported. % %<*ja> @@ -743,17 +746,23 @@ For changes from \pTeX, see Subsection~\ref{ssec:chgptex}. 従来日本語の文字コードとして用いられてきたEUC-JPやShift-JISは使用できない. % %<*en> -\item By default, \LuaTeX-ja uses Japanese fonts to typeset Greek and Cyrillic letters, - and some Unicode symbols such as \P~and~\S. To change this behavior, - put \lstinline!\ltjsetparameter{jacharrange={-2,-3,-8}}! in the preamble. +\item By default, \LuaTeX-ja uses Japanese fonts to typeset Greek and Cyrillic letters. + To change this behavior, + put \verb!\ltjsetparameter{jacharrange={-2,-3}}! in the preamble. For the detailed description, see Subsection~\ref{ssec-setrange}. % %<*ja> \item -標準では,\LuaTeX-jaはギリシャ文字やキリル文字,それに\P や\S などの記号を和文フォントを使っ +標準では,\LuaTeX-jaはギリシャ文字やキリル文字を和文フォントを使っ て組む.ギリシャ語などを本格的に組むなどこの状況が望ましくない場合, - プリアンブルに \lstinline!\ltjsetparameter{jacharrange={-2,-3,-8}}! を入れると + プリアンブルに +\begin{lstlisting} + \ltjsetparameter{jacharrange={-2,-3}} +\end{lstlisting} + を入れると 上記種類の文字は欧文フォントを用いて組まれるようになる. + なお,\P,~\S といったISO~8859-1の上位領域とJIS~X~0208の共通部分の文字は + 本バージョンから標準で欧文扱い(\textbf{ALchar})となった. 詳しい説明は\ref{ssec-setrange}節を参照してほしい. % %<*en> @@ -1103,13 +1112,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> @@ -1170,14 +1178,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} @@ -1422,17 +1432,17 @@ before \Pkg{luatexja-preset}: \item[nfssonly] %<*en> -With this option,selecting Japanese fonts won't be performed using the functionality of - the \Pkg{fontspec} package, but only standard NFSS2. +With this option, selecting Japanese fonts won't be performed using the functionality of + the \Pkg{fontspec} package, but only standard NFSS2 (hence without + \cs{addjfontfeatures} etc.). +This option is ignored when \Pkg{luatexja-fontspec} package is loaded. -This option will be disabled when \Pkg{luatexja-fontspec} package is loaded. Note that the \Pkg{fontspec} can coexist with the option as the following: \begin{lstlisting} \usepackage{fontspec} \usepackage[hiragino-pron,nfssonly]{luatexja-preset} \end{lstlisting} -Note that the functionality of the \Pkg{luatexja-fontspec} package, such as - \cs{setmainjfont}, cannot be used in the example above. +In this case, one can use \cs{setmainfont} etc.\ to select \emph{alphabetic} fonts. % %<*ja> \LaTeX 標準のフォント選択機構(NFSS2)を用いて @@ -1583,8 +1593,6 @@ There is not rounded gothic family in Kozuka fonts. \end{tabular} \end{center} -%\newpage - \item[hiragino-pro] Hiragino Pro (Adobe-Japan1-5) fonts. % \\*[-\dimexpr\medskipamount+\baselineskip\relax] \item[hiragino-pron] Hiragino ProN (Adobe-Japan1-5, JIS04-savvy) fonts. @@ -1964,6 +1972,7 @@ and the character ``漢'' to the character range~100. \begin{lstlisting} \ltjdefcharrange{100}{"20000-"2FFFF,`漢} \end{lstlisting} + %<*en> A character can belong to only one character range. For example, whole SIP belong to the range~4 in the default setting of \LuaTeX-ja, @@ -1972,18 +1981,18 @@ removed from the range~4. % %<*ja> 各文字はただ一つの文字範囲に所属することができる. -例えば,SIPは全て\LuaTeX-jaのデフォルトでは4番の文字範囲に -属しているが,上記の指定を行えばSIPは100番に属すようになり,4番からは除かれる. +例えば,SIP内の文字は全て\LuaTeX-jaのデフォルトでは4番の文字範囲に +属しているが,上記の指定を行えばSIP内の文字は100番に属すようになり,4番からは除かれる. % %<*en> -The distinction between \textbf{ALchar} and \textbf{JAchar} is done for character ranges. +The distinction between \textbf{ALchar} and \textbf{JAchar} is performed by character ranges. This can be edited by setting the \textsf{jacharrange} parameter. -For example, this is just the default setting of \LuaTeX-ja, and +For example, the code below is just the default setting of \LuaTeX-ja, and it sets \begin{itemize} - \item a character which belongs character ranges 1,~4, and~5 is \textbf{ALchar}, - \item a character which belongs character ranges 2,~3, 6, 7, and~8 is \textbf{JAchar}. + \item a character which belongs character ranges 1,~4, 5, and~8 is \textbf{ALchar}, + \item a character which belongs character ranges 2,~3, 6, and~7 is \textbf{JAchar}. \end{itemize} % %<*ja> @@ -1991,12 +2000,12 @@ it sets これは\textsf{jacharrange}パラメータによって編集できる. 例えば,以下は\LuaTeX-jaの初期設定であり,次の内容を設定している: \begin{itemize} - \item 1番,4番,5番の文字範囲に属する文字は\textbf{ALchar}. - \item 2番,3番,6番,7番,8番の文字範囲に属する文字は\textbf{JAchar}. + \item 1番,4番,5番,8番の文字範囲に属する文字は\textbf{ALchar}. + \item 2番,3番,6番,7番の文字範囲に属する文字は\textbf{JAchar}. \end{itemize} % \begin{lstlisting} -\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}} +\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8}} \end{lstlisting} %<*en> The argument to \textsf{jacharrange} parameter is a list of non-zero integer. @@ -2011,12 +2020,12 @@ and positive integer $+n$ means that ``\dots\ is a \textbf{JAchar}''. % %<*en> -\paragraph{Default setting} +\paragraph{Default character ranges} \LuaTeX-ja predefines eight character ranges for convenience. They are determined from the following data: % %<*ja> -\paragraph{初期設定} +\paragraph{文字範囲の初期値} \LuaTeX-jaでは8つの文字範囲を予め定義しており, これらは以下のデータに基づいて決定している. % @@ -2034,24 +2043,26 @@ Now we describe these eight ranges. The superscript ``J'' or ``A'' after the number shows whether each character in the range is treated as \textbf{JAchar}s or not by default. These settings are similar to the \texttt{prefercjk} settings defined in \texttt{PXbase} bundle. -Any characters above \texttt{U+0080} which does not belong to +Any characters equal to or above \texttt{U+0080} which does not belong to these eight ranges belongs to the character range~217. % %<*ja> 以下ではこれら8つの文字範囲について記述する.添字のアルファベット「J」「A」 -は,その文字範囲内の文字が\textbf{JAchar}か\textbf{ALchar}かを表している.これらの設定は -\texttt{PXbase}バンドルで定義されている\texttt{prefercjk}と類似のものである. +は,その文字範囲内の文字が\textbf{JAchar}か\textbf{ALchar}かを表している.これらの初期設定は +\texttt{PXbase}バンドルで定義されている\texttt{prefercjk}と類似のものであるが, +8ビットフォント使用時のトラブルを防ぐために \texttt{U+0080}--\texttt{U+00FF} の文字は全部 +\textbf{ALchar}としている. なお,\texttt{U+0080} 以降でこれら8つの文字範囲に属さない文字は,217番の文字範囲に属することになっている. % \begin{description} %<*en> -\item[Range~8${}^{\kern.1em\text{J}}$] The intersection of the upper half of ISO~8859-1 +\item[Range~8${}^{\text{A}}$] The intersection of the upper half of ISO~8859-1 (Latin-1 Supplement) and JIS~X~0208 (a basic character set for Japanese). This character range consists of the following characters: % %<*ja> -\item[範囲8${}^{\kern.1em\text{J}}$] ISO~8859-1の上位領域(ラテン1補助)と +\item[範囲8${}^{\text{A}}$] ISO~8859-1の上位領域(ラテン1補助)と JIS~X~0208の共通部分.この文字範囲は 以下の文字で構成される: % @@ -2085,9 +2096,10 @@ This range consists of the following Unicode ranges, \emph{except characters in \item \texttt{U+0180}--\texttt{U+024F}: Latin Extended-B \item \texttt{U+0250}--\texttt{U+02AF}: IPA Extensions \item \texttt{U+02B0}--\texttt{U+02FF}: Spacing Modifier Letters -\item \texttt{U+0300}--\texttt{U+036F}: \\\null\hfill Combining Diacritical Marks -\item \texttt{U+1E00}--\texttt{U+1EFF}: \\\null\hfill Latin Extended Additional -\par\ +%\par\ +\item \texttt{U+0300}--\texttt{U+036F}: \\*\null\hfill Combining Diacritical Marks +\item \texttt{U+1E00}--\texttt{U+1EFF}: \\*\null\hfill Latin Extended Additional +%\par\ \end{itemize} \end{multicols} %<*en> @@ -2096,7 +2108,7 @@ This range consists of the following Unicode ranges, \emph{except characters in % %<*ja> \item[範囲2${}^{\text{\kern.1emJ}}$] ギリシャ文字とキリル文字.JIS~X~0208(したがってほとんどの - 和文フォント)はこれらの文字を持つ. + 和文フォント)には,これらの文字の一部が含まれている. % \begin{multicols}{2} \begin{itemize} @@ -2221,6 +2233,54 @@ The block list is indicated in Table~\ref{table-rng7}. \end{table} \end{description} +%<*en> +\paragraph{Notes on \texttt{U+0080}--\texttt{U+00FF}} +You should treat characters in \\texttt{U+0080}--\texttt{U+00FF} as \textbf{ALchar}, +when you use traditional 8-bit fonts, such as the \Pkg{textcomp} package or the +\Pkg{marvosym} package. + +For example, the codepoint \cs{textparagraph} which is provided by the \Pkg{textcomp} +package is 182. This codepoint corresponds \P\ (\text{U+00B6}) in Unicode. +Similarly, \cs{Frowny} which is provided by the \Pkg{marvosym} package has +the same codepoint as \S\ (\text{U+00A7}). +Hence, as previous versions of \LuaTeX-ja, if these characters are treated as +\text{JAchar}s, then \cs{textparagraph} produces ``ltjjachar`¶'' (in a Japanese font), +and \cs{Frowny} produces ``\ltjjachar`§'' (in a Japanese font). + +To avoid such situations, the default setting of \LuaTeX-ja is changed in this release +so that all characters \texttt{U+0080}--\texttt{U+00FF} are treated as \textbf{ALchar}. +If you want to output a character as \textbf{ALchar}/\textbf{JAchar} regardless the range +setting, you can use \cs{ltjalchar}/\cs{ltjjachar} respectively. +\begin{LTXexample}[width=0.3\textwidth] +\gtfamily +¶,\ltjalchar`¶,\ltjjachar`¶\\ % default: ALchar +α,\ltjalchar`α,\ltjjachar`α % default: JAchar +\end{LTXexample} +% +%<*ja> +\paragraph{\texttt{U+0080}--\texttt{U+00FF}についての注意} +\LuaTeX-jaで,\Pkg{textcomp}パッケージや\Pkg{marvosym}パッケージ等,Unicodeフォントでなく +伝統的な8ビットフォントを用いる場合には注意が必要である. + +例えば,\Pkg{textcomp}パッケージの提供する \cs{textparagraph} は, +符号位置が182,つまり \texttt{0xB6} であり,Unicodeではこの符号位置では\P\ (\text{U+00B6}) に対応する. +また,\Pkg{marvosym}パッケージの提供する \cs{Frowny} も,符号位置は167,つまりUnicodeにおける +\S\ (\text{U+00A7}) と同じ符号位置にある. +即ち,以前のバージョンのように,「前節の文字範囲8内の文字は\textbf{JAchar}」という設定で +あったとすると,上記の \cs{textparagraph} は和文フォントで「\ltjjachar`¶」を出力し, +また \cs{Frowny} は和文フォントで「\ltjjachar`§」を出力することになる. +このような事態を避けるために,\emph{本バージョンからは \texttt{U+0080}--\texttt{U+00FF} の範囲の +文字は全て\textbf{ALchar}となるように初期設定を変更}している. + +なお,文字範囲の設定に関わらず文字を\textbf{ALchar}, \textbf{JAchar}で出力したい場合には, +それぞれ \cs{ltjalchar},~\cs{ltjjachar} に該当文字の文字コードを渡せばよい. +\begin{LTXexample}[width=0.3\textwidth] +\gtfamily +¶,\ltjalchar`¶,\ltjjachar`¶\\ % default: ALchar +α,\ltjalchar`α,\ltjjachar`α % default: JAchar +\end{LTXexample} +% + %\subsection{\Param{kanjiskip} and \Param{xkanjiskip}} %\subsection{\Param{kanjiskip}と\Param{xkanjiskip}} \label{subs-kskip} @@ -3007,7 +3067,7 @@ the direction inside the box and that outside the box differ. \put(0,0){\vector(1,0){5}} \put(2.5,-0.2){\makebox(0,0)[t]{$h_{\mathrm{T}}$}} \put(0,0){\vector(-1,0){2}}\put(-1,-0.2){\makebox(0,0)[t]{$d_{\mathrm{T}}$}} \put(0,0){\vector(0,-1){7}}\put(0.2,-3.5){\makebox(0,0)[l]{$w_{\mathrm{T}}$}} - \end{picture}}} + \end{picture}}}% } \def\DTOUeg{% \hbox{\smash{\begin{picture}(0,0)(-5,0) @@ -3018,7 +3078,7 @@ the direction inside the box and that outside the box differ. \put(0,0){\vector(-1,0){5}} \put(-2.5,0.3){\makebox(0,0)[b]{$h_{\mathrm{D}}$}} \put(0,0){\vector(1,0){2}}\put(1,0.3){\makebox(0,0)[b]{$d_{\mathrm{D}}$}} \put(0,0){\vector(0,1){7}}\put(-0.2,3.5){\makebox(0,0)[r]{$w_{\mathrm{D}}$}} - \end{picture}}} + \end{picture}}}% } \def\YOKOeg{% \hbox{\smash{\begin{picture}(0,0) @@ -3029,7 +3089,7 @@ the direction inside the box and that outside the box differ. \put(0,0){\vector(0,1){5}} \put(0.3,2.5){\makebox(0,0)[l]{$h_{\mathrm{Y}}$}} \put(0,0){\vector(0,-1){2}}\put(0.3,-1){\makebox(0,0)[l]{$d_{\mathrm{Y}}$}} \put(0,0){\vector(1,0){7}}\put(3.5,0.2){\makebox(0,0)[b]{$w_{\mathrm{Y}}$}} - \end{picture}}} + \end{picture}}}% } \begin{tabular}{ccc} \toprule @@ -3135,7 +3195,7 @@ the direction inside the box and that outside the box differ. \begin{align*} W_{\mathrm{Y}} &= h_{\mathrm{D}}+d_{\mathrm{D}},\\ H_{\mathrm{Y}} &= w_{\mathrm{D}},\\ - D_{\mathrm{Y}} &= 0\,pt + D_{\mathrm{Y}} &= 0\,\mathrm{pt} \end{align*}% }& \parbox[c]{15\unitlength}{\begin{picture}(15,15)(0,-4) @@ -5585,7 +5645,7 @@ With the help of this example, we remark the specification of \cs{inhibitglue}: Using \cs{ltjdeclarealtfont}, one can ``compose'' more than one Japanese fonts. This \cs{ltjdeclarealtfont} uses in the following form: \begin{quote} -\ttfamily \textbackslash ltjdeclarealtfont{} +\ttfamily \textbackslash ltjdeclarealtfont\{\} \end{quote} where ~and~ are defined by \cs{jfont}. Its meaning is @@ -5593,8 +5653,7 @@ Its meaning is If the current Japanese font is , characters which belong to is typeset by another Japanese font , instead of . \end{quote} - - is a comma-separated list of character codes, but also accepts negative integers: +Here is a comma-separated list of character codes, but also accepts negative integers: $-n$~($n≥1$) means that all characters of character classes~$n$, with respect to JFM used by . Note that characters which do not exist in are ignored. @@ -5618,7 +5677,7 @@ are typeset by \cs{piyo}. \cs{ltjdeclarealtfont} は以下の書式で使用する: \begin{quote} -\ttfamily \textbackslash ltjdeclarealtfont{} +\ttfamily \textbackslash ltjdeclarealtfont\{\} \end{quote} これは「現在の和文フォント」がであるとき, に属する文字はを用いて組版される,という意味である. @@ -5837,66 +5896,12 @@ 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 . See Subsection~\ref{ssec-fontfamilycmd} for detail. % %<*ja> 元々の\LaTeXe におけるものと同様に,このコマンドは現在のフォントファミリ(欧文, -和文,\emph{もしくは両方})をに変更する. -どのファミリが変更されるかは以下のようにして決定される: -% -\begin{itemize} -%<*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: -% -%<*ja> -\item 現在の和文フォントに対するエンコーディングがであるとしよう. - 現在の和文フォントファミリは,以下の2つの条件のうちの1つが満たされているときに - に変更される: -% -\begin{itemize} -%<*en> -\item The family under the encoding has been already defined by - \cs{DeclareKanijFamily}. -% -%<*ja> -\item エンコーディングにおけるファミリが -既に \cs{DeclareKanjiFamily} によって定義されている. -% -%<*en> -\item A font definition named \texttt{.fd} (the file name is - all lowercase) exists. -% -%<*ja> -\item フォント定義ファイル\texttt{.fd}(ファイル名は全て小文字)が存在する. -% -\end{itemize} -%<*en> -\item Let current encoding scheme for alphabetic fonts be - . For alphabetic font family, the criterion as above is used. -% -%<*ja> -\item 現在の欧文フォントに対するエンコーディングをとする. - 欧文フォントファミリに対しても,上記の基準が用いられる. -% -%<*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. -% -%<*ja> -\item 上記のいずれもが適用されない,つまりがとの - どちらでも定義されないような場合がある. - この場合,代替フォントに用いられるデフォルトのフォントファミリが欧文フォントと - 和文フォントに用いられる.\LaTeX のオリジナルの実装とは異なり, - 現在のエンコーディングはには設定されないことに注意する. +和文,\emph{もしくは両方})をに変更する.詳細は\ref{ssec-fontfamilycmd}節を参照すること. % -\end{itemize}% -%\vspace{-\medskipamount} \begin{figure}[!tb] @@ -5973,6 +5978,172 @@ Avant Garde (OT1/pag/m/n) に変わっていることがわかる. \userelfont\selectfont あいうabc \end{LTXexample} +%\subsection{\cs{fontfamily}} +%\subsection{\cs{fontfamily}} +\label{ssec-fontfamilycmd} +%<*en> +In this subsection, we describe when \cs{fontfamily} changes current +Japanese/alphabetic font family. Basically, current Japanese fotn family is changed to + if it is recognized as a Japanese font family, and similar with alphabetic font +family. There is a case that current Japanese/alphabetic font family are both changed to +, and another case that isn't recognized as a Japanese/alphabetic font +family either. + +\paragraph{Recognition as Japanese font family} +First, Whether Japanese font family will be changed is determined in following order. +This order is very similar to \cs{fontfamily} in \pLaTeXe, but we re-implemented in Lua. +We use an auxiliary list~$N_{\mathrm{J}}$. +% +%<*ja> +本節では,\cs{fontfamily} がいつ和文/欧文フォントファミリを変更するかについて解説 +する.基本的には,が和文フォントファミリだと認識されれば和文側が,欧文フォントファ +ミリだと認識されれば欧文側が変更される.どちらとも認識されれば和文・欧文の両方が変わるこ +とになるし,当然どちらとも認識されないこともある. + +\paragraph{和文フォントファミリとしての認識} +まず,が和文フォントファミリとして認識されるかは以下の順序で決定される. +これは\pLaTeXe の \cs{fontfamily} にとても似ているが,ここではLuaによって実装している. +補助的に「和文フォントファミリではないと認識された」ファミリを格納したリスト$N_{\mathrm{J}}$を用いる. +% +\begin{enumerate} +%<*en> +\item If the family~ has been defined already by \cs{DeclareKanjiFamily}, + is recognized as a Japanese font family. + Note that need not be defined under \emph{current} Japanese font encoding. +% +%<*ja> +\item ファミリが既に \cs{DeclareKanjiFamily} によって定義されている場合, + は和文フォントファミリであると認識される. + ここで,は現在の和文フォントエンコーディングで定義されていなくてもよい. +% +%<*en> +\item If the family~ has been listed in a list~$N_{\mathrm{J}}$, this means + that is not a Japanese font family. +% +%<*ja> +\item ファミリがリスト$N_{\mathrm{J}}$に既に含まれていれば,それは + が和文フォントファミリではないことを意味する. +% +%<*en> +\item If the \Pkg{luatexja-fontspec} package is loaded, we stop here, and is not + recognized as a Japanese font family. + + 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, is recognized as a Japanese font family (the font definition file won't be loaded here). + If not, is not a Japanese font family, and + is appended to the list~$N_{\mathrm{J}}$. +% +%<*ja> +\item もし\Pkg{luatexja-fontspec}パッケージが読み込まれていれば,ここで終了であり, +は和文フォントファミリとして認識されないことになる. + +もし\Pkg{luatexja-fontspec}パッケージが読み込まれていなければ,和文エンコーディングで +フォント定義ファイル\texttt{.fd}(ファイル名は全て小文字)が存在するようなも + のがあるかどうかを調べる. +存在すれば,は和文フォントファミリと認識される(フォント定義ファイルは読み込まれな + い). +存在しなければ,は和文フォントファミリでないと認識され,リスト$N_{\mathrm{J}}$にを追加することでそれを記憶する. + +% +\end{enumerate} + +%<*en> +\paragraph{Recognition as alphabetic font family} +Next, whether alphabetic font family will be changed is determined in following order. +We use auxiliary lists $F_{\mathrm{A}}$~and~$N_{\mathrm{A}}$, +% +%<*ja> +\paragraph{欧文フォントファミリとしての認識} +同様に,が和文フォントファミリとして認識されるかは以下の順序で決定される. +補助的に「欧文フォントファミリと既に認識された」ファミリのリスト$F_{\textrm{A}}$と, +「欧文フォントファミリではないと認識された」ファミリを格納したリスト$N_{\mathrm{A}}$を用いる. +% + +\begin{enumerate} +%<*en> +\item If the family~ has been listed in a list~$F_{\mathrm{A}}$, + is recognized as an alphabetic font family. +% +%<*ja> +\item ファミリがリスト$F_{\mathrm{A}}$に既に含まれていれば, + は欧文フォントファミリと認識される. +% +%<*en> +\item If the family~ has been listed in a list~$N_{\mathrm{A}}$, this means + that is not an alphabetic font family. +% +%<*ja> +\item ファミリがリスト$N_{\mathrm{A}}$に既に含まれていれば,それは + が欧文フォントファミリではないことを意味する. +% +%<*en> +\item If there exists an alphabetic font encoding such that the family~ has been + defined under it, is recognized as an alphabetic font family, and + to memorize this, 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> +Also, each call of \cs{DeclareFontFamily} \emph{after} loading of \LuaTeX-ja makes +the second argument (family) is appended to the list~$F_{\mathrm{A}}$. +% +%<*ja> +また,\cs{DeclareFontFamily}が\LuaTeX-jaの読み込み後に実行された場合は, +第2引数(ファミリ名)が自動的に$F_{\mathrm{A}}$に追加される. +% + +%<*en> +The above order is very similar to \cs{fontfamily} in \pLaTeXe, but more complicated (clause~3.). +This is because \pLaTeXe\ is a \emph{format} however \LuaTeX-ja is not, +hence \LuaTeX-ja does not know calls of \cs{DeclareFontFamily} \emph{before} itself is +loaded. +% +%<*ja> +以上の方針は\pLaTeXe における \cs{fontfamily} にやはり類似しているが,3.が加わり若干複雑になっている. +それは\pLaTeXe がフォーマットであるのに対し\LuaTeX-jaはそうでないため, +\LuaTeX-jaは自身が読み込まれる前にどういう\cs{DeclareFontFamily}の呼び出しがあったか +把握できないからである. +% + +%\paragraph{Remarks} +%\paragraph{注意} +%<*en> +Of course, there is a case that is not recognized as a Japanese font family, nor +an alphabetic font family. +In this case, \LuaTeX-ja treats ``the argument is wrong'', so +set both current alphabetic and Japanese font family to , +to use the default family for font substitution. +% +%<*ja> +さて,引数によっては,「和文フォントファミリとも欧文フォントファミリも認識されなかった」 +という事態もあり得る. + この場合,引数は不正だった,ということになるので, +和文・欧文の両方のフォントファミリをに設定し,代用フォントが使われるに任せることにする. +% + + %<*en> \section{Addons} \LuaTeX-ja has several addon packages.