X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=doc%2Fluatexja.dtx;h=420f35a187aad9eb30e6e3c8dc91db26c6ca5d43;hb=1c4914cffa7e61e692eb09dfa6bcdb5038ee29b5;hp=511177d418606e4e3f197e49ef843deeed796312;hpb=be589322eba7705d201efa92dcabf086a2add363;p=luatex-ja%2Fluatexja.git diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index 511177d..420f35a 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -196,6 +196,15 @@ \def\cs#1{\texttt{\upshape \texorpdfstring{\textbackslash\hbox{\ltjsetparameter{autoxspacing=false}#1}}{\textbackslash#1}}} \ltjsetparameter{alxspmode={`\\,allow}} +\def\text@#1{% + \ifnum\mathstyle<\scriptstyle + \mbox{#1} + \else\ifnum\mathstyle<\scriptscriptstyle + \mbox{\let\f@size\sf@size\selectfont#1} + \else + \mbox{\let\f@size\ssf@size\selectfont#1} + \fi\fi +} %%%%%%%% \makeatother %%%%%%%% @@ -883,7 +892,7 @@ and finally delete the temporary directory. %<*en> \item The following 12~Japanese fonts are preloaded: \begin{center}\small -\begin{tabular}{cccccc} +\begin{tabular}{llllll} \toprule \textbf{direction}& \textbf{classification}&\textbf{font name}&\bfseries ``10\,pt''&\bfseries ``7\,pt''&\bfseries ``5\,pt''\\\midrule @@ -901,28 +910,30 @@ and finally delete the temporary directory. %<*ja> \item 以下の12個の和文フォントが定義される: \begin{center}\small -\begin{tabular}{cccccc} +\begin{tabular}{llllll} \toprule \emph{組方向}&\emph{字体}&\emph{フォント名}&\bfseries``10\,pt''&\bfseries``7\,pt''&\bfseries``5\,pt''\\\midrule -\smash{\raisebox{-1ex}{横組}}& +\smash{\raisebox{-0.7\zh}{横組}}& 明朝体&IPAex明朝&\cs{tenmin}&\cs{sevenmin}&\cs{fivemin}\\ -&ゴシック体&IPAexゴシック&\cs{tengt} &\cs{sevengt} &\cs{fivegt}\\ +&\textgt{ゴシック体}&IPAexゴシック&\cs{tengt} &\cs{sevengt} &\cs{fivegt}\\ \midrule -\smash{\raisebox{-1ex}{縦組}}& +\smash{\raisebox{-0.7\zh}{縦組}}& 明朝体&IPAex明朝&\cs{tentmin}&\cs{seventmin}&\cs{fivetmin}\\ -&ゴシック体&IPAexゴシック&\cs{tentgt} &\cs{seventgt} &\cs{fivetgt}\\ +&\textgt{ゴシック体}&IPAexゴシック&\cs{tentgt} &\cs{seventgt} &\cs{fivetgt}\\ \bottomrule \end{tabular} \end{center} % \begin{itemize} %<*en> -\item With \texttt{luatexja.cfg}, one can use other fonts -as ``default'' Japanese fonts (Subsection~\ref{ssec:cfg}). +\item The ``default'' Japanese fonts (and~JFMs for them) can be + modified by defining \cs{ltj@stdmcfont} etc.\ \emph{before} + one inputs \texttt{luatexja.sty} (Subsection~\ref{ssec:cfg}). % %<*ja> -\item \texttt{luatexja.cfg} を用いることによって,標準和文フォントを -IPAexフォントから別のフォントに置き換えることができる.\ref{ssec:cfg}節を参照. +\item 標準和文フォントやJFMをIPAexフォントから別のものに置き換えるには, + \cs{ltj@stdmcfont}等を\texttt{luatexja.sty}読み込み\emph{前}に定義すればよい. + \ref{ssec:cfg}節を参照. % %<*en> @@ -1003,7 +1014,7 @@ plfonts.dtx} and \texttt{pldefs.ltx}). \item By default, the following fonts are used for these two families. \begin{center}\small -\begin{tabular}{ccccc} +\begin{tabular}{lllll} \toprule \textbf{classification}&\textbf{family}&\cs{mdseries}&\cs{bfseries}&\textbf{scale}\\\midrule \emph{mincho} (明朝体)&\tt mc&IPAex Mincho&IPAex Gothic&0.962216\\ @@ -1018,7 +1029,7 @@ By default, the following fonts are used for these two families. %<*ja> \item \pLaTeX と同様に,標準では「明朝体」「ゴシック体」の2種類を用いる: \begin{center}\small -\begin{tabular}{cllc} +\begin{tabular}{llll} \toprule \emph{字体}&&&\emph{ファミリ名}\\\midrule 明朝体&\verb+\textmc{...}+&\verb+{\mcfamily ...}+&\cs{mcdefault}\\ @@ -1029,11 +1040,11 @@ By default, the following fonts are used for these two families. \newpage \item 標準では,次のフォントが用いられる: \begin{center}\small -\begin{tabular}{ccccc} +\begin{tabular}{lllll} \toprule \emph{字体}&\emph{ファミリ}&\cs{mdseries}&\cs{bfseries}&\emph{スケール}\\\midrule 明朝体&\tt mc&IPAex明朝&IPAexゴシック&0.962216\\ -ゴシック体&\tt gt&IPAexゴシック&IPAexゴシック&0.962216\\ +\textgt{ゴシック体}&\tt gt&IPAexゴシック&IPAexゴシック&0.962216\\ \bottomrule \end{tabular} \end{center} @@ -1120,7 +1131,7 @@ By default, the following fonts are used for these two families. However, above settings are not sufficient for Japanese-based documents. To typeset Japanese-based documents, you are better to use class files other than \texttt{article.cls}, \texttt{book.cls}, and so on. At -the present, we have the counterparts of \Pkg{jclasses} (standard +the present, \LuaTeX-ja has the counterparts of \Pkg{jclasses} (standard classes in \pLaTeX) and \Pkg{jsclasses} (classes by Haruhiko Okumura), namely, \Pkg{ltjclasses}\footnote{% \texttt{ltjarticle.cls},~\texttt{ltjbook.cls}, \texttt{ltjreport.cls}, @@ -1149,7 +1160,7 @@ so \Pkg{ltjsclasses} uses the \texttt{nomag*} option\footnote{Same effect as }, \Pkg{ltjsclasses}\footnote{% \texttt{ltjsarticle.cls},~\texttt{ltjsbook.cls}, \texttt{ltjsreport.cls},~\texttt{ltjskiyou.cls}.}% -がそれぞれ用意されている. +がそれぞれ\LuaTeX-ja標準で用意されている. 元々の\Pkg{jsclasses}では本文のフォントサイズを設定するのに\cs{mag}プリミティブが使われていたが, \LuaTeX~beta-0.87.0以降ではPDF出力時の\cs{mag}のサポートが廃止された. @@ -1269,7 +1280,7 @@ For \LaTeXe, \LuaTeX-ja adopted most of the font selection system of \pLaTeXe\ ( %<*en> \begin{center}\small -\begin{tabular}{cccccc} +\begin{tabular}{llllll} \toprule &\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}&\textbf{selection}\\\midrule alphabetic fonts @@ -1286,17 +1297,17 @@ auto select&\cs{fontencoding}&\cs{fontfamily}&---&---&\cs{usefont}\\ % %<*ja> \begin{center}\small -\begin{tabular}{cccccc} +\begin{tabular}{llllll} \toprule &\emph{エンコーディング}&\emph{ファミリ}&\emph{シリーズ}&\emph{シェープ}&\emph{選択}\\\midrule -欧文 +\emph{欧文} &\cs{romanencoding}&\cs{romanfamily}&\cs{romanseries}&\cs{romanshape} &\cs{useroman}\\ -和文 +\emph{和文} &\cs{kanjiencoding}&\cs{kanjifamily}&\cs{kanjiseries}&\cs{kanjishape} &\cs{usekanji}\\ -両方&---&--&\cs{fontseries}&\cs{fontshape}&---\\ -自動選択&\cs{fontencoding}&\cs{fontfamily}&---&---&\cs{usefont}\\ +\emph{両方}&---&--&\cs{fontseries}&\cs{fontshape}&---\\ +\emph{自動選択}&\cs{fontencoding}&\cs{fontfamily}&---&---&\cs{usefont}\\ \bottomrule \end{tabular} \end{center} @@ -1503,21 +1514,21 @@ alphabetic fonts \caption{\Pkg{luatexja-fontspec}で定義される命令}\label{tab:ltj_fntspc} \medskip {\centering\small -\begin{tabular}{cllll} +\begin{tabular}{lllll} \toprule -和文 +\emph{和文} &\cs{jfontspec}&\cs{setmainjfont}&\cs{setsansjfont}&\cs{setmonojfont}$^*$\\ -欧文 +\emph{欧文} &\cs{fontspec}&\cs{setmainfont}&\cs{setsansfont}&\cs{setmonofont}\\ \midrule -和文 +\emph{和文} &\cs{newjfontfamily}&\cs{renewjfontfamily}$^{**}$&\cs{setjfontfamily}$^{**}$\\ -欧文 +\emph{欧文} &\cs{newfontfamily}&\cs{renewfontfamily}$^{**}$&\cs{setfontfamily}$^{**}$\\ \midrule -和文 +\emph{和文} &\cs{newjfontface}&\cs{defaultjfontfeatures}&\cs{addjfontfeatures}\\ -欧文 +\emph{欧文} &\cs{newfontface}&\cs{defaultfontfeatures}&\cs{addfontfeatures}\\ \bottomrule \end{tabular}\par} @@ -1645,7 +1656,7 @@ The following presets are defined: \hyphenchar\font=-1 \exhyphenchar=-1 hiragino-pro, hiragino-pron, ipa, ipa-hg, ipaex, ipaex-hg, kozuka-pr6, kozuka-pr6n, kozuka-pro, moga-mobo, moga-mobo-ex, - morisawa-pr6n, morisawa-pro, ms, ms-hg, noembed, noto-otc, noto-otf, + bizud, morisawa-pr6n, morisawa-pro, ms, ms-hg, noembed, noto-otc, noto-otf, sourcehan, sourcehan-jp, ume, yu-osx, yu-win, yu-win10 \end{quote} @@ -1703,60 +1714,6 @@ as an external package \Pkg{luatexja-otf}. \ref{ssec:fontspec}節 (\Pkg{fontspec}) の方法で手動で指定する必要がある. % -%\subsection{Changing default Japanese fonts} -%\subsection{標準和文フォントの変更} -\label{ssec:cfg} -%<*en> -If \texttt{luatexja.cfg} can be seen from \LuaTeX, \LuaTeX-ja automatically reads it. -The main use of \texttt{luatexja.cfg} is for changing default Japanese fonts, -when IPAex fonts cannot be installed in \TeX~system. -One should not overuse this \texttt{luatexja.cfg}; fonts which will be used in -a document should be specified in its source. - -For example, -\begin{lstlisting} -\def\ltj@stdmcfont{IPAMincho} -\def\ltj@stdgtfont{IPAGothic} -\end{lstlisting} -makes that IPA~Mincho and IPA~Gothic will be used as default Japanese fonts, instead of -IPAex~Mincho and IPAex~Gothic. - -For another example, the following two lines makes that -non-embedded fonts Ryumin-Light~and~GothicBBB-Medium as default Japanese fonts -(as the earlier version of \LuaTeX-ja): -\begin{lstlisting} -\def\ltj@stdmcfont{psft:Ryumin-Light} -\def\ltj@stdgtfont{psft:GothicBBB-Medium} -\end{lstlisting} -% -%<*ja> -\LuaTeX から見える位置に \texttt{luatexja.cfg} があれば,\LuaTeX-jaはそれを読み込む. -このファイルを用いるとplain~\TeX, \LaTeXe における標準和文フォントを -IPAex明朝・IPAexゴシックから変更することができる. -しかし,基本的には\emph{文章中で用いるフォントは(例えば \Pkg{luatexja-preset} などで) -文書ソース内で指定するべき}であり,この \texttt{luatexja.cfg} は, -「IPAexフォントがインストールできない」など,IPAexフォントが使用できない場合にのみ -応急処置的に用いるべきである. - -例えば -\begin{lstlisting} -\def\ltj@stdmcfont{IPAMincho} -\def\ltj@stdgtfont{IPAGothic} -\end{lstlisting} -と記述しておけば,標準和文フォントがIPA明朝・IPAゴシックへと変 -更される. - - -なお,20140906.0以前のバージョンのように, -Ryumin-Light, GothicBBB-Mediumという名前の非埋込フォントを用いる場合は -\begin{lstlisting} -\def\ltj@stdmcfont{psft:Ryumin-Light} -\def\ltj@stdgtfont{psft:GothicBBB-Medium} -\end{lstlisting} -と記述すればよい. -% - - %\section{Changing Internal Parameters} %\section{パラメータの変更} @@ -1861,8 +1818,8 @@ determined from the following data: これらは以下のデータに基づいて決定している. % \begin{itemize} -%\item Blocks in Unicode~6.0. -%\item Unicode~6.0のブロック. +%\item Blocks in Unicode~11.0. +%\item Unicode~11.0のブロック. %\item The \texttt{Adobe-Japan1-UCS2} mapping between a CID Adobe-Japan1-6 and Unicode. %\item Adobe-Japan1-6のCIDとUnicodeの間の対応表\texttt{Adobe-Japan1-UCS2}. %\item The \Pkg{PXbase} bundle for \upTeX\ by Takayuki Yato. @@ -1962,7 +1919,7 @@ This range consists of the following Unicode ranges, \emph{except characters in %\caption{文字範囲3に指定されているUnicodeブロック.} \label{tab:rng3} \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%" -\centering\small +\centering\footnotesize \begin{tabular}{llll} "2000--"206F&General Punctuation& "2070--"209F&Superscripts and Subscripts\\ @@ -1980,8 +1937,8 @@ This range consists of the following Unicode ranges, \emph{except characters in "2600--"26FF&Miscellaneous Symbols\\ "2700--"27BF&Dingbats& "2900--"297F&Supplemental Arrows-B\\ -"2980--"29FF&Misc.\ Mathematical Symbols-B& -"2B00--"2BFF&Miscellaneous Symbols and Arrows +"2980--"29FF&Misc.\ Math Symbols-B& +"2B00--"2BFF&Misc.\ Symbols and Arrows \end{tabular} \end{table} %<*en> @@ -1999,8 +1956,10 @@ This range consists of the following Unicode ranges, \emph{except characters in \begin{lstlisting} \ltjdefcharrange{4}{% "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF, - "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A82F, "A840-"ABFF, "FB00-"FE0F, - "FE20-"FE2F, "FE70-"FEFF, "10000-"1FFFF, "E000-"F8FF} % non-Japanese + "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A95F, "A980-"ABFF, "E000-"F8FF, + "FB00-"FE0F, "FE20-"FE2F, "FE70-"FEFF, "10000-"1AFFF, "1B170-"1F0FF, + "1F300-"1FFFF +} % non-Japanese \end{lstlisting} %\item[Range~5${}^{\text{A}}$] Surrogates and Supplementary Private Use Areas. %\item[範囲5${}^{\text{A}}$] 代用符号と補助私用領域. @@ -2011,7 +1970,7 @@ This range consists of the following Unicode ranges, \emph{except characters in %\caption{文字範囲6に指定されているUnicodeブロック.} \label{tab:rng6} \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%" -\centering\small +\centering\footnotesize \begin{tabular}{llll} "2460--"24FF&Enclosed Alphanumerics& "2E80--"2EFF&CJK Radicals Supplement\\ @@ -2022,14 +1981,20 @@ This range consists of the following Unicode ranges, \emph{except characters in "31F0--"31FF&Katakana Phonetic Extensions& "3200--"32FF&Enclosed CJK Letters and Months\\ "3300--"33FF&CJK Compatibility& -"3400--"4DBF&CJK Unified Ideographs Extension A\\ +"3400--"4DBF&CJK Unified Ideographs Ext-A\\ "4E00--"9FFF&CJK Unified Ideographs& "F900--"FAFF&CJK Compatibility Ideographs\\ "FE10--"FE1F&Vertical Forms& "FE30--"FE4F&CJK Compatibility Forms\\ "FE50--"FE6F&Small Form Variants& -"{20}000--"{2F}FFF&(Supplementary Ideographic Plane)\\ -"{E0}100--"{E0}1EF&Variation Selectors Supplement +"FF00--"FFEF&Halfwidth and Fullwidth Forms\\ +"{1B}000--"{1B}0FF&Kana Supplement& +"{1B}100--"{1B}12F&Kana Extended-A\\ +%"{1B}130--"{1B}16F&Small Kana Extension +"{1F}100--"{1F}1FF&Enclosed Alphanumeric Supp.& +"{1F}200--"{1F}2FF&Enclosed Ideographic Supp.\\ +"{20}000--"{2F}FFF&(Supp. Ideographic Plane)& +"{E0}100--"{E0}1EF&Variation Selectors Supp. \end{tabular} \end{table} %<*en> @@ -2057,7 +2022,7 @@ The block list is indicated in \autoref{tab:rng7}. "31C0--"31EF&CJK Strokes& "A000--"A48F&Yi Syllables\\ "A490--"A4CF&Yi Radicals& -"A830--"A83F&Common Indic Number Forms\\ +"A960--"A97F&Hangul Jamo Extended-A\\ "AC00--"D7AF&Hangul Syllables& "D7B0--"D7FF&Hangul Jamo Extended-B \end{tabular} @@ -2502,7 +2467,7 @@ For the detail, see \autoref{tab:kcat}. %\medskip \noindent\hfill -\begin{tabular}{ccccc} +\begin{tabular}{llccc} \toprule \bfseries \cs{kcatcode}& %<*en> @@ -2666,8 +2631,8 @@ for \LuaTeX, \emph{to match the \cs{catcode} setting with that of \XeTeX.} {\large\char"#1#2#3#4}}\ (\texttt{U+#1#2#3#4})} %" \leavevmode\hbox to 0pt{\hss\begin{tabular}{cccccc} \toprule -%&\bf row&\bf col.&\bf \pTeX&\bf \upTeX&\bf\LuaTeX-ja\\ -%&\bf 区&\bf 点&\bf \pTeX&\bf \upTeX&\fontseries{b}\selectfont\LuaTeX-ja\\ +%&\textbf{row}&\textbf{col.}&\textbf{\pTeX}&\textbf{\upTeX}&\textbf{\LuaTeX-ja}\\ +%&\emph{区}&\emph{点}&\emph{\pTeX}&\emph{\upTeX}&\emph{\LuaTeX-ja}\\ \midrule %\D 3000&1&1&N&N&Y\\ \D 30FB&1&6&N&Y&N\\ @@ -2693,8 +2658,8 @@ for \LuaTeX, \emph{to match the \cs{catcode} setting with that of \XeTeX.} \end{tabular}\qquad \begin{tabular}{cccccc} \toprule -%&\bf row&\bf col.&\bf \pTeX&\bf \upTeX&\bf\LuaTeX-ja\\ -%&\bf 区&\bf 点&\bf \pTeX&\bf \upTeX&\fontseries{b}\selectfont\LuaTeX-ja\\ +%&\textbf{row}&\textbf{col.}&\textbf{\pTeX}&\textbf{\upTeX}&\textbf{\LuaTeX-ja}\\ +%&\emph{区}&\emph{点}&\emph{\pTeX}&\emph{\upTeX}&\emph{\LuaTeX-ja}\\ \midrule \D FF5C&1&35&N&N&Y\\ \D FF0B&1&60&N&N&Y\\ @@ -2865,6 +2830,10 @@ Down-TO-Upの意味なのだろう.\cs{dtou} を使用する機会はないだ ただし,現在のモードが非制限水平モードや(文中,別行立て問わず)数式モードであるときには 組方向を変更することは出来ない. また,縦組中の数式内のボックスは\pTeX と同じように組方向が \cs{utod} となる. + +なお,\LaTeX の下で\LuaTeX-jaを使用する場合,組方向変更命令には +「新たな組方向下での和文フォントを必要なら読み込み(・選択する)」という +処理が付け加えられている(\ref{ssec:ltx-jfm}節参照). % %<*en> @@ -3811,6 +3780,77 @@ A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont ト・縦組用和文フォントの定義が可能であったが,\LuaTeX-jaではそうでないので注意. % +%\subsection{Default Japanese fonts and JFMs} +%\subsection{標準和文フォント・JFMの変更} +\label{ssec:cfg} +%<*en> +If following commands are defined at loading \LuaTeX-ja package, these change +default Japanese fonts and JFMs for them: +% +%<*ja> +\LuaTeX-jaが読み込まれる前に以下の命令が定義されていた場合は, +それらが標準和文フォントやそれらに用いるJFMとして使われる. +% + +\begin{cslist}[style=standard] + \item[\cs{ltj@stdmcfont}] +%The default Japanese font for the mincho family. +%明朝体として用いるフォント. + \item[\cs{ltj@stdgtfont}] +%The default Japanese font for the gothic family. +%ゴシック体として用いるフォント. + \item[\cs{ltj@stdyokojfm}] +%The default JFM for horizontal direction. +%標準で用いる横組用JFM. + \item[\cs{ltj@stdyokojfm}] +%The default JFM for vertical direction. +%標準で用いる縦組用JFM. +\end{cslist} + +%<*en> +For example, +\begin{lstlisting} +\def\ltj@stdmcfont{IPAMincho} +\def\ltj@stdgtfont{IPAGothic} +\end{lstlisting} +makes that IPA~Mincho and IPA~Gothic will be used as default Japanese fonts, instead of +IPAex~Mincho and IPAex~Gothic. + +This feature is intended for classes which use special JFMs +\footnote{This is because commands has \texttt{@} in their names.}. +It is recommended to use \cs{luatexja-preset}~or~\cs{luatexja-fontspec} package +to select standard fonts in ordinary \LaTeX\ sources. +% +%<*ja> +例えば +\begin{lstlisting} +\def\ltj@stdmcfont{IPAMincho} +\def\ltj@stdgtfont{IPAGothic} +\end{lstlisting} +と記述しておけば,標準和文フォントがIPA明朝・IPAゴシックへと変 +更される. + +この機能は,特別のJFMを用いるクラス +\footnote{例えば阿部紀行氏によるjlreqがそれにあたる.}% +などでの使用を意図しており,命令名に\texttt{@}が含まれることから +通常の\TeX/\LaTeX 文書での使用は意図していない. +通常の\LaTeX 文書では\Pkg{luatexja-preset}や\Pkg{luatexja-fontspec}などで +使用フォントを選択することを推奨する. +% + +%<*en> +For compatibility with earlier versions, +\LuaTeX-ja reads \texttt{luatexja.cfg} automatically if it is found by \LuaTeX. +One should not overuse this \texttt{luatexja.cfg}; it will overwrite +the definition of \cs{ltj@stdmcfont} and others. +% +%<*ja> +旧バージョンとの互換性のため, +\LuaTeX から見える位置に\texttt{luatexja.cfg}があれば,\LuaTeX-jaはそれを読み込む. +しかし,\texttt{luatexja.cfg}内で\cs{ltj@stdmcfont}等が定義されていた場合はそちらが +優先されるので,もはや\texttt{luatexja.cfg}は使わないほうが良いだろう. +% + %\subsection{Prefix \texttt{psft}} %\subsection{\texttt{psft}プリフィックス} \label{ssec:psft} @@ -3854,22 +3894,22 @@ Identity-Hとなり,PDFの標準規格ISO32000-1:2008~(\cite{pdfstd})に非準 %<*en> The default font defined by using \texttt{psft:} prefix is for Japanese typesetting; -it is Adobe-Japan1-6 CID-keyed font. +it is Adobe-Japan1-7 CID-keyed font. One can specify \texttt{cid} key to use other CID-keyed non-embedded fonts for Chinese or Korean typesetting. % %<*ja> 標準で\texttt{psft:}プリフィックスで定義されるフォントは日本語用のもので -あり,Adobe-Japan1-6のCIDに対応したものとなる.しかし,\LuaTeX-jaは中国語 +あり,Adobe-Japan1-7のCIDに対応したものとなる.しかし,\LuaTeX-jaは中国語 の組版にも威力を発揮することが分かり,日本語フォントでない非埋込フォント の対応も必要となった.そのために追加されたのが\texttt{cid}キーである. \texttt{cid}キーに値を指定すると,そのCIDを持った非埋込フォントを定義することができる: % \begin{lstlisting}[numbers=left] -\jfont\testJ={psft:Ryumin-Light:cid=Adobe-Japan1-6;jfm=jis} % Japanese -\jfont\testD={psft:Ryumin-Light:jfm=jis} % default value is Adobe-Japan1-6 -\jfont\testC={psft:AdobeMingStd-Light:cid=Adobe-CNS1-6;jfm=jis} % Traditional Chinese +\jfont\testJ={psft:Ryumin-Light:cid=Adobe-Japan1-7;jfm=jis} % Japanese +\jfont\testD={psft:Ryumin-Light:jfm=jis} % default value is Adobe-Japan1-7 +\jfont\testC={psft:AdobeMingStd-Light:cid=Adobe-CNS1-7;jfm=jis} % Traditional Chinese \jfont\testG={psft:SimSun:cid=Adobe-GB1-5;jfm=jis} % Simplified Chinese \jfont\testK={psft:Batang:cid=Adobe-Korea1-2;jfm=jis} % Korean \end{lstlisting} @@ -5056,8 +5096,6 @@ Then, the position of glyphs is shifted up by \] \end{description} - - %\section{Parameters} %\section{パラメータ} \subsection{\cs{ltjsetparameter}} @@ -5973,6 +6011,77 @@ are typeset by \cs{piyo}. %\section{Commands for \LaTeXe} %\section{\LaTeXe 用の命令} +%<*en> +\subsection{Loading Japanese fonts in \LaTeXe} +\label{ssec:ltx-jfm} +From versoin~20190107, +\emph{\LuaTeX-ja does not load Japanese fonts for horizontal direction and + that for vertical direction at same time}, +to reduce the number of loaded fonts. +This will save time for typesetting and memory consumption of Lua side (\cite{tc18ltja}). + +\begin{itemize} + \item \cs{selectfont} loads (and chooses) only the Japanese font for current direction, + and does not load the Japanese font for other direction + (\LuaTeX-ja only detects its size and JFM, to calculate the amount of shifting the baseline). + + \item Direction changing commands (\cs{yoko},~\cs{tate}, \cs{dtou},~\cs{utod}) are patched to + include the following process: + \begin{quote} + If the Japanese font for new direction is not loaded, + \LuaTeX-ja loads it automatically. + \end{quote} + Original commands are saved as \cs{ltj@@orig@yoko} etc. + + \item Specifying Japanese font command which is + defined by \cs{jfont},~\cs{tfont}, or~\cs{DeclareFixedFont} directly + actually loads (and selects) the Japanese font. + For example, \textbf{JAchar}s in \cs{box0} will be typeset in \cs{HOGE}, + in the following code: +\begin{lstlisting} + % in horizontal direction (\yoko) + \DeclareFixedFont\HOGE{JT3}{gt}{m}{n}{12} % JT3: for vertical direction + \HOGE + \setbox0=\hbox{\tate あいう} +\end{lstlisting} + \end{itemize} +% + +%<*ja> +\subsection{\LaTeXe 下での和文フォントの読み込み} +\label{ssec:ltx-jfm} +バージョン20190107以降では,\LaTeXe の下で\LuaTeX-jaを使用した際に, +\emph{横組用和文フォントと縦組み用和文フォントを両方一度に読み込み・選択せずに, + 実際にそれぞれを使う組方向になったときに行う}という方針にした. +これは実際に読み込むフォント数を削減することで, +タイプセットにかかる時間と(主にLuaの)メモリ消費を削減するためである(\cite{tc18ltja}). + +\begin{itemize} + \item \cs{selectfont}は横組用・縦組用和文フォントのうち,現在の組方向で使う方を + 実際に読み込み(・選択し),そうでない方は「フォントサイズとJFMのみ\LuaTeX-jaが把握している状態」 + (以下,\emph{JFM把握状態})とする. + + \item 組方向変更命令\cs{yoko},~\cs{tate}, \cs{dtou},~\cs{utod}には + \begin{quote} + 新たな組方向での和文フォントが読み込まれていない(JFM把握状態)ならば, + 現在のエンコーディング・ファミリ・シリーズ・シェイプから改めて読み込む(または選択する) + \end{quote} + 処理が付け加えられている. + もとの「組方向を変更するだけ」の命令は\cs{ltj@@orig@yoko}のように\texttt{ltj@@orig@}が前についた + 命令に保存されている. + + \item \cs{jfont},~\cs{tfont},~\cs{DeclareFixedFont}で定義された和文フォントは + その時点で実際にフォントが読み込まれる.すなわち,以下のコードにおいて, + \cs{box0}中の\textbf{JAchar}は\cs{HOGE}でタイプセットされる. +\begin{lstlisting} + % in horizontal direction (\yoko) + \DeclareFixedFont\HOGE{JT3}{gt}{m}{n}{12} % JT3: for vertical direction + \HOGE + \setbox0=\hbox{\tate あいう} +\end{lstlisting} + \end{itemize} +% + %\subsection{Patch for NFSS2} %\subsection{NFSS2へのパッチ} \label{ssec:nfsspat} @@ -6119,12 +6228,24 @@ assignment, where \cs{DeclareRelationFont} does a global assignment. font family with respect to current Japanese font family, which was set by \cs{DeclareRelationFont} or \cs{SetRelationFont}. + + The following is an example of \cs{SetRelationFont} and \cs{userelfont}: % %<*ja> 次回(のみ)の\cs{selectfont}の実行時に,現在の欧文フォントのエンコーディング/ファミリ/…… を, \cs{DeclareRelationFont} か \cs{SetRelationFont} で指定された 現在の和文フォントに対応する「従属欧文」フォントに変更する. + + 以下に \cs{SetRelationFont} と \cs{userelfont} の例を +紹介しておこう.\cs{userelfont} の使用によって,「abc」の部分のフォントが +Latin Modern Sans Serif (TU/lmss/m/n) に変わっていることがわかる. % +\begin{LTXexample}[width=0.3\textwidth] +\makeatletter +\SetRelationFont{JY3}{\k@family}{m}{n}{TU}{lmss}{m}{n} + % \k@family: current Japanese font family +\userelfont\selectfont あいうabc +\end{LTXexample} \item[\cs{adjustbaseline}] %<*en> @@ -6230,21 +6351,35 @@ current Japanese font is changed, or only after \cs{selectfont} is executed. % \end{cslist} + %<*en> -As closing this subsection, we shall introduce an example of -\cs{SetRelationFont} and \cs{userelfont}: +Furthermore, \LuaTeX-ja applies patches which enables NFSS2 commands, +such~as \cs{DeclareSymbolFont}~and~\cs{SetSymbolFont}, to specify +Japanee fonts as math fonts. + +Specifying \texttt{disablejfam} option in \cs{usepackage} prevents +applying these patches. +Hence one cannot write Japanese Characters in math mode directly +if \texttt{disablejfam} option is specified. +The code below does not work either: +\begin{lstlisting} +\DeclareSymbolFont{mincho}{JY3}{mc}{m}{n} +\DeclareSymbolFontAlphabet{\mathmc}{mincho} +\end{lstlisting} % %<*ja> -この節の終わりに,\cs{SetRelationFont} と \cs{userelfont} の例を -紹介しておこう.\cs{userelfont} の使用によって,「abc」の部分のフォントが -Latin Modern Sans Serif (TU/lmss/m/n) に変わっていることがわかる. +この他にも,標準では +\cs{DeclareSymbolFont}, \cs{SetSymbolFont} などの命令で +(NFSS2の枠組みで)数式フォントとして日本語フォントを使えるようにするためのパッチを当てている. + +一方,\texttt{disablejfam}オプション指定時には,これらのパッチを当てないので +\begin{lstlisting} +\DeclareSymbolFont{mincho}{JY3}{mc}{m}{n} +\DeclareSymbolFontAlphabet{\mathmc}{mincho} +\end{lstlisting} +のように設定しても,数式モード中に直に日本語を記述することはできない. +\verb|$\mathmc{あ}$| のように \cs{mathmc} で囲んでもできない. % -\begin{LTXexample}[width=0.3\textwidth] -\makeatletter -\SetRelationFont{JY3}{\k@family}{m}{n}{TU}{lmss}{m}{n} - % \k@family: current Japanese font family -\userelfont\selectfont あいうabc -\end{LTXexample} %\subsection{Detail of \cs{fontfamily} command} %\subsection{\cs{fontfamily}コマンドの詳細} @@ -6733,13 +6868,14 @@ commands: \item[\cs{CID}\{\}] %<*en> Typeset a glyph whose CID number is . -If the Japanese font is neither Adobe-Japan1,~Adobe-GB1, Adobe-CNS1,~nor~Adobe-Korea1 CID-keyed font, +If the Japanese font is neither Adobe-Japan1,~Adobe-GB1, Adobe-CNS1, +Adobe-Korea1,~nor~Adobe-KR CID-keyed font, \LuaTeX-ja treats that is a CID number of Adobe-Japan1 character collection, and tries to typeset a ``most suitable glyph''. % %<*ja> CID番号がの文字を出力する. -もし現在の和文フォントがAdobe-Japan1,~Adobe-GB1, Adobe-CNS1,~Adobe-Korea1の +もし現在の和文フォントがAdobe-Japan1,~Adobe-GB1, Adobe-CNS1, Adobe-Korea1,~Adobe-KRの いずれのCID-keyed fontでもない場合,はAdobe-Japan1のCID番号であると解釈し 「適切なグリフ」\footnote{% 例えばフォントにIVDコレクションAdobe-Japan1が含まれていれば,その情報を用いて @@ -7079,7 +7215,7 @@ for making the difference obvious.} と同義. \end{cslist} -また,優先順位付きの行長調整のために,次の3パラメータが\cs{ltjsetparameter}内で +また,次のパラメータが\cs{ltjsetparameter}内で 追加される.いずれもグローバルに効力を発揮する. \begin{cslist}[style=standard] \item[\DParam{stretch\_priority}\,=\{\}] @@ -7095,22 +7231,30 @@ stretch_priority={kanjiskip=-35,xkanjiskip=-25,others=50} \texttt{others}キーが「\textbf{JAglue}以外のグルー」を表す. 各キーの値は,JFMグルーにおける「優先度$i$」を$10i$に対応させた整数値であり, 大きい方が先に伸ばされることを意味している. + 初期値は +\begin{lstlisting} +{kanjiskip=-35,xkanjiskip=-25,others=50} +\end{lstlisting} +であり,「優先度$-4$」と指定されているJFMグルーが最も伸びにくいようになっている. \item[\DParam{shrink\_priority}\,=\{\}] 同様に,「行を自然長より縮める」場合の調整に用いる優先度を指定する. -それ以外は\Param{stretch\_priority}と指定の形式は変わらない. +それ以外は\Param{stretch\_priority}と指定の形式は変わらない(初期値も変わらない). \item[\DParam{linestep\_factor}\,=] - 段階的な行送り調整の際,\cs{baselineskip}の何倍単位で行送りを変えるかを指定する. + 段階的な行送り調整の際,\cs{baselineskip}の自然長の何倍単位で行送りを変えるかを指定する. 0を指定すると無効になるのと変わらない.また負数を指定すると, その絶対値が指定されたかのように扱われる. 初期値は0.5(つまり半行単位)である. + + \item[\DParam{profile\_hgap\_factor}\,=] + 「中身まで見た」行送り計算の際, + 前の行にある深さが大きいものと次の行にある高さが大きいものが + 水平方向にどれだけ離れていないといけないかを + 「\cs{lineskip}の自然長の何倍か」で指定する. + 負数を指定すると,その絶対値が指定されたかのように扱われる. + 初期値は1(つまり\cs{lineskip}(の自然長))である. \end{cslist} -\Param{stretch\_priority}, \Param{shrink\_priority}の初期値はどちらも -\begin{lstlisting} -{kanjiskip=-35,xkanjiskip=-25,others=50} -\end{lstlisting} -であり,「優先度$-4$」と指定されているJFMグルーが最も伸び(縮み)にくいようになっている. % \subsection{\Pkg{luatexja-ruby}} @@ -7661,13 +7805,13 @@ We didn't taken account of when more than one options among them are specified. \label{sssec:ltjpreset-multi} %<*en> -Besides \texttt{morisawa-pro}~and~\texttt{morisawa-pr6n} presets, +Besides \texttt{bizud}, \texttt{morisawa-pro},~and~\texttt{morisawa-pr6n} presets, fonts are specified by font name, not by file name. In following tables, starred fonts (e.g.~KozGo\dots-Regular) are used for medium series of \textit{gothic}, \emph{if and only if \texttt{deluxe} option is specified}. % %<*ja> -\texttt{morisawa-pro}, \texttt{morisawa-pr6n}以外はフォントの指定は +\texttt{bizud}, \texttt{morisawa-pro}, \texttt{morisawa-pr6n}以外はフォントの指定は (ファイル名でなく)フォント名で行われる. 以下の表において,*\,つきのフォント(e.g.,~KozGo\dots-Regular)は,\emph{\texttt{deluxe}オプション指定時に} ゴシック体中字として用いられるものを示している. @@ -7714,7 +7858,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. @@ -7761,6 +7904,34 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. \end{tabular} \end{center} +%\newpage +\item[bizud] BIZ UD fonts (by Morisawa Inc.) bundled with + Windows~10 October 2018 Update. +\begin{center}\small +\begin{tabular}{ll>{\ttfamily}l} +\toprule +\textbf{family}&\textbf{series}\\ +\midrule +%\textit{mincho} +%\textgt{明朝}% + &&BIZ-UDMinchoM.ttc\\ +\midrule + &medium&BIZ-UDGothicR.ttc\\ +\cmidrule(l){2-3} +%\textit{gothic}% +%\gt ゴシック + &bold&BIZ-UDGothicB.ttc\\ + &extra bold&BIZ-UDGothicB.ttc\\ +\midrule +%\textit{rounded gothic} +%\gt 丸ゴシック +&&BIZ-UDGothicB.ttc\\ +\bottomrule +\end{tabular} +\end{center} + +%\newpage + \item[morisawa-pro] Morisawa Pro (Adobe-Japan1-4) fonts. % \\*[-\dimexpr\medskipamount+\baselineskip\relax] \item[morisawa-pr6n] Morisawa Pr6N (Adobe-Japan1-6, JIS04-savvy) fonts. @@ -7879,6 +8050,7 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. \end{tabular} \end{center} +%\newpage \item[sourcehan] Source Han Serif and Source Han Sans fonts (Language-specific OTF \textit{or} OTC) % \\*[-\dimexpr\medskipamount+\baselineskip\relax] \item[sourcehan-jp] Source Han Serif JP and Source Han Sans JP fonts (Region-specific Subset OTF) @@ -8256,18 +8428,23 @@ Current number of Japanese font family for math formulas. \attr{ltj@curjfnt} %<*en> -The font index of current Japanese font for horizontal direction. +If this attribute is a positive number, it stores the font number of current Japanese font for horizontal direction. +If this attribute is negative, it means that the Japanese font for horizontal direction is +not loaded---\LuaTeX-ja only knows its size and JFM. % %<*ja> -現在の横組用和文フォントのフォント番号. +基本的には現在の横組用和文フォントのフォント番号を格納しているが, +\LaTeX 下で使用する場合は($-2$以下の)負数となることがある. + 負数の場合は「横組用和文フォントは実際には読み込まれておらず,そのフォントサイズとJFMだけが + \LuaTeX-jaが把握している」状態を表す. % \attr{ltj@curtfnt} %<*en> -The font index of current Japanese font for vertical direction. +Similar to \cs{ltj@curjfnt}, but with current Japanese font for vertical direction. % %<*ja> -現在の縦組用和文フォントのフォント番号. +縦組用和文フォントに関する\cs{ltj@curjfnt}と同様の値. % \attr{ltj@charclass} @@ -10160,19 +10337,37 @@ For illustration, we introduce following classes of characters: 直前が和文文字であるかを示すフラグ \verb+\lst@ifkanji+ を新たに導入した. 以降,説明のために以下のように文字を分類する: % +%<*ja> \begin{center} \small -\begin{tabular}{lccccc} +\begin{tabular}{llllll} \toprule -&Letter&Other&Kanji&Open&Close\\\midrule +&\emph{Letter}&\emph{Other}&\emph{Kanji}&\emph{Open}&\emph{Close}\\\midrule \verb+\lst@ifletter+&T&F&T&F&T\\ \verb+\lst@ifkanji+&F&F&T&T&F\\ -%Meaning&char in an identifier&other alphabet&% -%most of Japanese char&opening brackets&closing brackets\\ -%意図&識別子中の文字&その他欧文文字&殆どの和文文字&開き括弧類&閉じ括弧類\\ +\emph{意図}&識別子中の文字&その他欧文文字&殆どの和文文字&開き括弧類&閉じ括弧類\\ \bottomrule \end{tabular} \end{center} +% +%<*en> +\begin{center} +\small +\begin{tabular}{llll} +\toprule +&\textbf{Letter}&\textbf{Other}&\\\midrule +\verb+\lst@ifletter+&T&F&\\ +\verb+\lst@ifkanji+&F&F&\\ +\textbf{Meaning}&char in an identifier&other alphabet&\\ + \midrule +&\textbf{Kanji}&\textbf{Open}&\textbf{Close}\\\midrule +\verb+\lst@ifletter+&T&F&T\\ +\verb+\lst@ifkanji+&T&T&F\\ +\textbf{Meaning}&most of Japanese char&opening brackets&closing brackets\\ +\bottomrule +\end{tabular} +\end{center} +% %<*en> Note that \textit{digits} in the \Pkg{listings} package can be Letter or Other according to circumstances. @@ -10204,27 +10399,27 @@ The following table summarizes $5\times 5=25$ cases: % \begin{center} \small -\begin{tabular}{llccccc} +\begin{tabular}{lllllll} \toprule %<*en> -&&\multicolumn{4}{c}{Next}\\\cmidrule(lr){3-7} -&&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss} -&\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule +&&\multicolumn{4}{c}{\textbf{Next}}\\\cmidrule(lr){3-7} +&&\hbox to 4em{Letter\hss}&\hbox to 4em{Other\hss} +&\hbox to 4em{Kanji\hss}&\hbox to 4em{Open\hss}&Close\\\midrule &Letter&collects&\multicolumn{3}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\ &Other&outputs&collects&\multicolumn{2}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\ -Prev&Kanji&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\ +\textbf{Prev}&Kanji&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\ &Open&\multicolumn{5}{c}{\hrulefill \ collects\ \hrulefill}\\ &Close&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\ % %<*ja> -&&\multicolumn{4}{c}{後ろ側の文字}\\\cmidrule(lr){3-7} -&&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss} -&\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule -直&Letter&収集&\multicolumn{3}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\ -前&Other&出力&収集&\multicolumn{2}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\ -文&Kanji&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\ -字&Open&\multicolumn{5}{c}{\hrulefill \ 収集\ \hrulefill}\\ -種&Close&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\ +&&\multicolumn{4}{c}{\textbf{後側文字種}}\\\cmidrule(lr){3-7} +&&\hbox to 4em{Letter\hss}&\hbox to 4em{Other\hss} +&\hbox to 4em{Kanji\hss}&\hbox to 4em{Open\hss}&Close\\\midrule +\emph{直}&Letter&収集&\multicolumn{3}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\ +\emph{前}&Other&出力&収集&\multicolumn{2}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\ +\emph{文}&Kanji&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\ +\emph{字}&Open&\multicolumn{5}{c}{\hrulefill \ 収集\ \hrulefill}\\ +\emph{種}&Close&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\ % \bottomrule \end{tabular} @@ -10622,6 +10817,7 @@ The following is the structure of the that table. \midrule Adobe-Japan1-*<j-cid-auto-adobe-japan1.lua&UniJIS2004-UTF32-*&Adobe-Japan1-UCS2\\ Adobe-Korea1-*<j-cid-auto-adobe-korea1.lua&UniKS-UTF32-*&Adobe-Korea1-UCS2\\ +Adobe-KR-*<j-cid-auto-adobe-kr.lua&UniAKR-UTF32-*&Adobe-KR-UCS2\\ Adobe-GB1-*<j-cid-auto-adobe-gb1.lua&UniGB-UTF32-*&Adobe-GB1-UCS2\\ Adobe-CNS1-*<j-cid-auto-adobe-cns1.lua&UniCNS-UTF32-*&Adobe-CNS1-UCS2\\ \bottomrule @@ -10968,11 +11164,11 @@ TUG 2013, October 2013. Requirements for Japanese Text Layout (W3C Working Group Note), 2011, 2012. \newblock \url{http://www.w3.org/TR/jlreq/}% % \\日本語訳の書籍版:W3C日本語組版タスクフォース(編),『W3C技術ノート 日本語組版処理の要件』,東京電機大学出版局,2012. -\bibitem{min10} 乙部厳己.min10フォントについて.\\\null\hfill +\bibitem{min10} 乙部厳己.「min10フォントについて」\\\null\hfill \url{http://argent.shinshu-u.ac.jp/~otobe/tex/files/min10.pdf} -\bibitem{x4051} 日本工業規格(Japanese Industrial Standard). JIS~X~4051, -日本語文書の組版方法(Formatting rules for Japanese documents), 1993, 1995, 2004. -\bibitem{ptexdoc} 濱野尚人,田村明史,倉沢良一.\TeX の出版への応用—縦組み機能の組み込み—. +\bibitem{x4051} 日本工業規格(Japanese Industrial Standard). 「JIS~X~4051, +日本語文書の組版方法(Formatting rules for Japanese documents)」, 1993, 1995, 2004. +\bibitem{ptexdoc} 濱野尚人,田村明史,倉沢良一.「\TeX の出版への応用—縦組み機能の組み込み—」. \\\null\hfill\texttt{.../texmf-dist/doc/ptex/base/ptexdoc.pdf} \bibitem{ptextug} Hisato Hamano. \newblock \textit{Vertical Typesetting with \TeX}, TUGBoat~\textbf{11}(3), 346--352, 1990. @@ -10981,6 +11177,8 @@ ISO 32000-1:2008, \textit{Document management -- Portable document format -- Par 1.7}, 2008. \newblock \\\null\hfill \url{http://www.iso.org/iso/iso\_catalogue/catalogue_tc/catalogue\_detail.htm?csnumber=51502} +\bibitem{tc18ltja} 北川弘典.「\LuaTeX-jaの近況」,\TeX Conf~2018.\\ + \url{https://osdn.net/projects/luatex-ja/wiki/Documentation/attach/tc18ltja.pdf} \end{thebibliography} \end{document}