%<*!showexpl>
%#! lualatex -shell-escape
-
-% To typeset this manual, you need following two fonts:
-% - KozMinPr6N-Regular.otf
-% - KozGoPr6N-Medium.otf
-% - KozGoPr6N-Regular.otf
+%% KozMinPr6N-Regular.otf is needed to typeset this document.
%%%%% section ==> 章
%%%%% subsection => 節
\makeatletter
%%%%%%%%
\def\pgfsysdriver{pgfsys-pdftex.def}
-\directlua{if jit then jit.on() end}
-\usepackage{metalogo,amsmath,array,tikz,pict2e,multienum,float}
+\usepackage{metalogo,amsmath,array,tikz,pict2e,multienum,float,mathtools}
\usepackage{booktabs,multicol,luatexja-ruby}
\usepackage[all]{xy}
\usepackage{lltjext,alltt,comment}
-%%%%%%%% Lua GC
-\patchcmd\@outputpage{\stepcounter{page}}{%
- \directlua{%
- if jit then
- local k = collectgarbage("count")
- if k>900000 then
- collectgarbage("collect")
- texio.write_nl("term and log", "GC: ", math.floor(k), math.floor(collectgarbage("count")))
- end
- end
- }%
- \stepcounter{page}%
-}{}{}
-
%%%%%%%% fonts
\usepackage{luatexja-otf}
\usepackage[no-math]{fontspec}
-\setmainfont[Ligatures=TeX]{Linux Libertine O}
-\setmonofont[Scale=MatchLowercase, ItalicFont=lmmono10-italic.otf,
- BoldFont=lmmonolt10-bold.otf, BoldItalicFont=lmmonolt10-boldoblique.otf
-]{lmmono10-regular.otf}
-\setsansfont[Scale=MatchLowercase,Ligatures=TeX]{Linux Biolinum O}
+\setmainfont[Ligatures=TeX,RawFeature=-notdef]{Linux Libertine O}
+\setmonofont[RawFeature=-notdef, Ligatures=CommonOff, %CharacterVariant={31,45,61,36},
+%<en> Scale=0.8132073118633364, FakeStretch=1.183236,
+%<ja> Scale=MatchLowercase, FakeStretch=1.137121,
+ Contextuals=AlternateOff, Kerning=Off,
+ Ligatures={CommonOff,RequiredOff,ContextualOff,RareOff,HistoricOff,TeXOff},
+ ItalicFont=Iosevka Slab Oblique,
+ BoldFont=Iosevka Slab Bold, BoldItalicFont=Iosevka Slab Bold Oblique,
+]{Iosevka Slab}
+\setsansfont[Scale=MatchLowercase,Ligatures=TeX,RawFeature=-notdef]{Linux Biolinum O}
\usepackage[match]{luatexja-fontspec}
-\usepackage[kozuka-pr6n]{luatexja-preset}
+\usepackage[haranoaji]{luatexja-preset}
\usepackage{unicode-math}
-\setmonojfont{KozGoPr6N-Regular.otf}
+\setmonojfont{HaranoAjiGothic-Regular.otf}
\setmathfont[Scale=MatchLowercase]{XITSMath}
+\newjfontface\KOZM{KozMinPr6N-Regular.otf}
\setLaTeXa{\scshape a}
%<*ja>
%<*ja>
\usepackage[textwidth=44\zw, lines=41, footskip=6mm]{geometry}
\usepackage{luatexja-adjust}%\ltjdisableadjust
-\advance\leftmargini-1\zw\advance\leftmarginii-1\zw
+\advance\leftmargini-1\zw
%</ja>
%<en>\long\def\fakefn#1#2{\par\noindent{\footnotesize\hbox to1.8em{\hss#1}#2\par}}
%<*ja>
\def\IVS#1{\char\numexpr "E0100+#1\relax}%"
\def\IVSA#1#2#3#4#5{%
- \textcolor{blue}{\raisebox{3.5pt}{\tt%
- \fboxsep=0.5pt\fbox{\tiny \oalign{0#1#2\crcr#3#4#5\crcr}}}}%
+ \hbox to1em{\hss\textcolor{blue}{\raisebox{3.5pt}{\normalfont\ttfamily%
+ \fboxsep=0.5pt\fbox{\hbox to0.75em{\hss\tiny \oalign{0#1#2\crcr#3#4#5\crcr}\hss}}}}\hss}%
}
{\catcode`\%=11
\gdef\IVSB#1{\expandafter\IVSA\directlua{
local cat_str = luatexbase.catcodetables['string']
tex.sprint(cat_str, string.format('%X', 0xE00EF+#1))
}}}
+\def\UCSA#1#2#3#4{%
+ \hbox to1em{\hss\textcolor{blue}{\raisebox{3.5pt}{\normalfont\ttfamily%
+ \fboxsep=0.5pt\fbox{\hbox to0.75em{\hss\tiny \oalign{#1#2\crcr#3#4\crcr}\hss}}}}\hss}%
+}
+\def\UCSB#1#2{%
+ \hbox to1em{\hss\textcolor{red}{\raisebox{3.5pt}{\normalfont\ttfamily%
+ \fboxsep=0.5pt\fbox{\hbox to0.75em{\hss\tiny \oalign{\hss#1\hss\crcr\hss#2\hss\crcr}\hss}}}}\hss}%
+}
\usepackage{listings,showexpl,enumitem}
\lstset{
basicstyle=\ttfamily\small, pos=r, breaklines=true,
numbers=none, rframe={}, basewidth=0.5em, numberstyle=\tiny, numbersep=0.5em,
- explpreset={numberstyle=\tiny, numbers=left, numbersep=1em, columns=fixed}
+ explpreset={numberstyle=\tiny, numbers=left, numbersep=1em, columns=fixed},
+ morecomment=[l]{\%}, commentstyle=\color{green}
}
% Suppress output from showexpl to stdout.
\makeatletter
pdftitle={LuaTeX-jaパッケージ}
%</ja>
}
+\usepackage{bxghost}
%<*ja>
\def\HyRef@autoref#1#2{%
\begingroup
\Hy@safe@activestrue
\expandafter\HyRef@autosetref\csname r@#2\endcsname{#2}{#1}%
- \endgroup\ltjalchar"200C %" 欧文ゴースト
+ \endgroup\eghostguarded{}%" 欧文ゴースト
}
\def\figureautorefname{図}
\def\tableautorefname{表}
\theoremstyle{definition}
%<en>\newtheorem{defn}{Definition}
%<ja>\newtheorem{defn}{定義}
+\DeclareMathOperator\nint{nint}
%%%%%%%% logo
\usepackage{metalogo}
\def\_{\leavevmode \kern .06em\vbox {\hrule \@width .333em}}
\def\cs#1{\texttt{\upshape
- \texorpdfstring{\textbackslash\hbox{\ltjsetparameter{autoxspacing=false}#1}}{\textbackslash#1}}}
+ \texorpdfstring{\hbox{\ltjsetparameter{autoxspacing=false}\textbackslash#1}}{\textbackslash#1}}}
\ltjsetparameter{alxspmode={`\\,allow}}
\def\text@#1{%
\ifnum\mathstyle<\scriptstyle
#1\mathstrut\cr\noalign{\vskip1pt\hrule height.4pt\vskip1pt}%
width:\hfill\ #2\cr height:\hfill\ #3\cr depth:\hfill\ #4\cr
}}}}}\,}
-
+\protected\def\+{\insertxkanjiskip late}
\makeatletter
-\def\myghost{\ifmmode\else\ltjalchar"200C \fi}
\def\Param#1{\texorpdfstring{\@Param{#1}}{#1}} % parameter name
-\protected\def\@Param#1{\myghost\hyperlink{fld:#1}{\underline{\smash{\textsf{#1}}}}\myghost}
-\protected\def\DParam#1{\myghost\hypertarget{fld:#1}{\underline{\smash{\textsf{#1}}}}\myghost} % parameter name (definition)
+\protected\def\@Param#1{\eghostguarded{\hyperlink{fld:#1}{\underline{\smash{\textsf{#1}}}}}}
+\protected\def\DParam#1{\eghostguarded{\hypertarget{fld:#1}{\underline{\smash{\textsf{#1}}}}}} % parameter name (definition)
\def\Pkg#1{\texorpdfstring{\textsf{#1}}{#1}} % packages/classes
-\ltjsetparameter{alxspmode={"200C,allow}}
\begin{document}
\lstset{
vscmd=\IVSB
}
-\catcode`\<=13
-\def<#1>{{\normalfont\rm\itshape$\langle$#1\/$\rangle$}}
-\let\LARG=<
+\def\meta#1{{\normalfont\rmfamily\itshape$\langle$#1\/$\rangle$}}
\maketitle
\tableofcontents
grammatical (and contextual) errors.} Also, several parts
are written in Japanese only.
%</en>
-%<*ja>
-\emph{\large 本ドキュメントはまだまだ未完成です.}
-%</ja>
\clearpage
%<en>\part{User's manual}
外部UTF-8入力が利用可能となり,さらにUnicode化を推進し,\pTeX の内部処理
までUnicode化した\upTeX も開発されている.また,\pTeX に\eTeX 拡張をマー
ジした\epTeX も登場し,\TeX\ Live\ 2011では\pLaTeX が\epTeX の上で動作す
-るようになった.だが,\pdfTeX 拡張(PDF直接出力やmicro-typesetting)を
+るようになった.だが,\pdfTeX 拡張の主要部分(PDF直接出力やmicro-typesetting)を
\pTeX に対応させようという動きはなく,海外とのgapは未だにあるのが現状であ
る.
%</ja>
%<*ja>
\paragraph{命令の名称} 例えば\pTeX で追加された次のようなプリミティブ
%</ja>
-\begin{verbatim}
+\begin{lstlisting}
\kanjiskip=10pt \dimen0=kanjiskip
\tbaselineshift=0.1zw
\dimen0=\tbaselineshift
\prebreakpenalty`ぁ=100
\ifydir ... \fi
-\end{verbatim}
+\end{lstlisting}
%<en> However, we cannot use them under \LuaTeX-ja.
%<en> Instead of them, we have to write as the following.
%<ja> は\LuaTeX-jaには存在しない.\LuaTeX-jaでは以下のように記述することになる.
-\begin{verbatim}
+\begin{lstlisting}
\ltjsetparameter{kanjiskip=10pt} \dimen0=\ltjgetparameter{kanjiskip}
\ltjsetparameter{talbaselineshift=0.1\zw}
\dimen0=\ltjgetparameter{talbaselineshift}
\ltjsetparameter{prebreakpenalty={`ぁ,100}}
-\ifnum\ltjgetparemeter{direction}=4 ... \fi
-\end{verbatim}
+\ifnum\ltjgetparameter{direction}=4 ... \fi
+\end{lstlisting}
%<*en>
Note that \pTeX\ adds new two useful units, namely \texttt{zw}~and~\texttt{zh}.
-As shown above, they are changed by \cs{zw}~and~\cs{zh} respectively, in \LuaTeX-ja.
+As shown above, \emph{they are changed to \cs{zw}~and~\cs{zh} respectively} in \LuaTeX-ja.%
+\footnote{\LuaTeX-ja 20200127.0 introduces \cs{ltj@zw}~and~\cs{ltj@zh}, which are copy of
+ \cs{zw}~and~\cs{zh}.}
%</en>
%<*ja>
-特に注意してほしいのは,\pTeX で追加された \texttt{zw} と \texttt{zh} という単位は
-\LuaTeX-ja では使用できず,\cs{zw}, \cs{zh} と制御綴の形にしないといけないという点である.
+特に注意してほしいのは,\pTeX で追加された\texttt{zw}と\texttt{zh}という単位は
+\LuaTeX-ja では使用できず,\emph{\cs{zw}, \cs{zh} と制御綴の形にしないといけない}という点である
+\footnote{%
+ 別のパッケージやユーザが\cs{zw},~\cs{zh}を書き換えてしまうことに対応するため,
+ \LuaTeX-ja 20200127.0以降では,\cs{ltj@zw},~\cs{ltj@zh}がそれぞれ\cs{zw},~\cs{zh}の
+ コピーとして定義されている.
+}.
%</ja>
%<*en>
From version~20150906.0, characters which belongs both ISO~8859-1 and JIS~X~0208,
such as \P~and~\S, are now typeset in alphabetic fonts.
-If you are using \LaTeXe\ prior to 2017/01/01, these characters are not typeset correctly
-without the \cs{fontspec} (and~\Pkg{luatexja-fontspec}) package.
%</en>
%<*ja>
\paragraph{ギリシャ文字・キリル文字とISO~8859-1の記号}
また,\P,~\S といったISO~8859-1の上位領域とJIS~X~0208の共通部分の文字は
バージョン20150906.0から標準で欧文扱いとなった.\LaTeXe\ 2017/01/01以降では
標準でTUエンコーディングのLatin Modernフォントが使われるので,
-特に何もせずソース中にそのまま記述してもこれらの文字が出力される
-\footnote{\LaTeXe\ 2017/01/01より前では,ソース中に直接記述しても
- \Pkg{fontspec}パッケージ(および\Pkg{luatexja-fontspec}パッケージ)非読み込みの状態では出力されない.}.
+特に何もせずソース中にそのまま記述してもこれらの文字が出力される.
和文扱いで出力するには \verb+\ltjjachar`§+ のように \cs{ltjjachar} 命令
を使えばよい.
%</ja>
%<ja>\paragraph{プロジェクトWiki} プロジェクトWikiは構築中である.
%<*en>
\begin{itemize}
-\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29} (English)
-\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage} (Japanese)
-\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28zh%29} (Chinese)
+\item \url{https://github.com/luatexja/luatexja/wiki/Home(en)} (English)
+\item \url{https://github.com/luatexja/luatexja/wiki} (Japanese)
+\item \url{https://github.com/luatexja/luatexja/wiki/Home(zh)} (Chinese)
\end{itemize}
%</en>
%<*ja>
\begin{itemize}
-\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage}(日本語)
-\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29}(英語)
-\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28zh%29}(中国語)
+\item \url{https://github.com/luatexja/luatexja/wiki}(日本語)
+\item \url{https://github.com/luatexja/luatexja/wiki/Home(en)}(英語)
+\item \url{https://github.com/luatexja/luatexja/wiki/Home(zh)}(中国語)
\end{itemize}
%</ja>
-%<en>This project is hosted by OSDN.
-%<ja>本プロジェクトはOSDNのサービスを用いて運営されている.
+%<en>This project is hosted by GitHub.
+%<ja>本プロジェクトはGitHubのサービスを用いて運営されている.
%<en>\paragraph{Members}\
%<ja>\clearpage\paragraph{開発メンバー}\
%<ja>\section{使い方}
%<en>\subsection{Installation}
%<ja>\subsection{インストール}
-
+\label{ssec:install}
%<en>The following packages are needed for the \LuaTeX-ja\ package.
%<ja>\LuaTeX-jaパッケージの動作には次のパッケージ類が必要である.
\begin{itemize}
-\item \LuaTeX\ 1.0.0 (or later)
-\item \Pkg{luaotfload} v2.6 (or later)
+\item \href{http://www.luatex.org/}{\LuaTeX}\ 1.10.0 (or later)
+%<en> (DVI output (\cs{outputmode=0} is not supported.)
+%<ja> (DVI出力(\cs{outputmode=0})は対応していない.)
+\item recent \href{https://github.com/latex3/luaotfload}{\Pkg{luaotfload}} (v3.1 or later recommended)
\item \Pkg{adobemapping} (Adobe cmap and pdfmapping files)
-\item \Pkg{etoolbox}, \Pkg{everysel} (if you want to use \LuaTeX-ja with \LaTeXe)
-\item \Pkg{ltxcmds}, \Pkg{pdftexcmds}, \Pkg{filehook}, \Pkg{atbegshi}
-\item \Pkg{fontspec} v2.5c (or later)
-%<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, \LuaTeX-ja version 20180825.0 (or~later) no longer supports \TeX~Live~2016.
+\item \LaTeXe\ 2020-02-02 patch level 5 or later
+%<en> (if you want to use \LuaTeX-ja with \LaTeXe)
+%<ja> (\LaTeXe 下で\LuaTeX-jaを使う場合)
+\item \href{https://github.com/josephwright/etoolbox/}{\Pkg{etoolbox}}
+%<en> (if you want to use \LuaTeX-ja with \LaTeXe)
+%<ja> (\LaTeXe 下で\LuaTeX-jaを使う場合)
+\item \Pkg{everysel} (only for \LaTeXe\ 2020-02-02~and~2020-10-01)
+\item \Pkg{filehook}, \Pkg{atbegshi} (only for \LaTeXe\ 2020-02-02)
+\item \Pkg{ltxcmds}, \Pkg{pdftexcmds}
+\item \href{https://github.com/wspr/fontspec/}{\Pkg{fontspec}} v2.7c (or later)
+%<*en>
+\item \emph{Harano Aji fonts} (\url{https://github.com/trueroad/HaranoAjiFonts})\\
+ More specifically, HaranoAjiMincho-Regular~and~HaranoAjiGothic-Medium.
+%</en>
%<*ja>
-要約すると,バージョン20180825.0以降の\LuaTeX-jaは\TeX~Live~2016以前では動作しない\footnote{%
- もっとも,自分で\LuaTeX のバイナリをSubversionリポジトリからビルドしていれば話は別である.
-}.
+\item \emph{原ノ味フォント(\url{https://github.com/trueroad/HaranoAjiFonts})}\\
+\LuaTeX-jaの最低限の動作には原ノ味明朝Regular~(HaranoAjiMincho-Regular)と
+原ノ味角ゴシックMedium~(HaranoAjiGothic-Medium)があれば十分である.
%</ja>
+\end{itemize}
%<*en>
Now \LuaTeX-ja is available from
CTAN (in the \texttt{macros/luatex/generic/luatexja} directory), and
the following distributions:
\begin{itemize}
- \item MiK\TeX\ (in \texttt{luatexja.tar.lzma}); see the next subsection
- \item \TeX\ Live (in \texttt{texmf-dist/tex/luatex/luatexja})
- \item W32\TeX\ (in \texttt{luatexja.tar.xz})
+ \item \href{https://www.tug.org/texlive/}{\TeX~Live} (in \texttt{texmf-dist/tex/luatex/luatexja})
+ \item MiK\TeX\ (in \texttt{luatexja.tar.xz})
\end{itemize}
-IPAex fonts are also available in these distributions.
+Harano Aji fonts are also available in these distributions
+(\texttt{haranoaji} in \TeX~Live and MiK\TeX).
%</en>
%<*ja>
現在,\LuaTeX-jaはCTAN (\texttt{macros/luatex/generic/luatexja})に収録されている他,
以下のディストリビューションにも収録されている:
\begin{itemize}
\item MiK\TeX\ (\texttt{luatexja.tar.lzma})
- \item \TeX\ Live (\texttt{texmf-dist/tex/luatex/luatexja})
- \item W32\TeX\ (\texttt{luatexja.tar.xz})
+ \item \TeX~Live (\texttt{texmf-dist/tex/luatex/luatexja})
\end{itemize}
-これらのディストリビューションはIPAexフォントも収録している.
-W32\TeX においてはIPAexフォントは \texttt{luatexja.tar.xz} 内にある.
+これらのディストリビューションは原ノ味フォントも収録している
+(\TeX~Live, MiK\TeX では\texttt{haranoaji}).
+%</ja>
+
+%<*en>
+\paragraph{HarfBuzz~and~\LuaTeX-ja}
+Using \LuaTeX-ja with LuaHB\TeX (\LuaTeX\ integrated with
+\href{https://github.com/harfbuzz/harfbuzz}{HarfBuzz}) is not well tested.
+Maybe documents can typeset without an error,
+but with unwanted results (especially, vertical typesetting and \cs{CID}).
+
+Especially,
+\emph{We don't recommend defining a Japanese font with HarfBuzz},
+by specifying \texttt{Renderer=Harfbuzz}~etc.\ (\Pkg{fontspec}) or~{mode=harf} (otherwise).
+%</en>
+%<*ja>
+\paragraph{HarfBuzzと\LuaTeX-ja}
+現時点では,HarfBuzzの機能を用いたときの\LuaTeX-jaの使用は十分にテストされていない.
+エラーが発生せずにタイプセットできるかもしれないが,特に縦組時や
+\cs{CID}などで意図しない結果となりうる可能性が大きい.
+特に,\emph{\texttt{Renderer=Harfbuzz}等(\Pkg{fontspec})や\texttt{mode=harf}指定(それ以外)を通じて
+ 和文フォントに対してHarfBuzzを用いることは推奨しない}.
%</ja>
%<en>\paragraph{Manual installation}
At the present, \LuaTeX-ja has no \emph{stable} release.
\begin{itemize}
-\item Clone the Git repository:
+\item Clone the Git repository by
\begin{lstlisting}
-$ git clone git://git.osdn.jp/gitroot/luatex-ja/luatexja.git
+$ git clone https://github.com/luatexja/luatexja.git
\end{lstlisting}
-\item Download the \texttt{tar.gz} archive of HEAD in the \texttt{master} branch from
+\item Download the \texttt{zip} archive of HEAD in the \texttt{master} branch from
\begin{flushleft}
-\url{http://git.osdn.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
+\url{https://github.com/luatexja/luatexja/archive/refs/heads/master.zip}.
\end{flushleft}
\end{itemize}
開発版であって,安定版でないことに注意.
\begin{itemize}
-\item Gitリポジトリをクローンする:
+\item Gitリポジトリを次のコマンドでクローンする:
\begin{lstlisting}
-$ git clone git://git.osdn.jp/gitroot/luatex-ja/luatexja.git
+$ git clone https://github.com/luatexja/luatexja.git
\end{lstlisting}
-\item \texttt{master} ブランチのスナップショット(\texttt{tar.gz} 形式)をダウンロードする.
+\item \texttt{master} ブランチのスナップショット(\texttt{zip} 形式)をダウンロードする:
\begin{flushleft}
-\url{http://git.osdn.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
+\url{https://github.com/luatexja/luatexja/archive/refs/heads/master.zip}.
\end{flushleft}
\end{itemize}
\texttt{master} ブランチ(従って,CTAN内のアーカイブも)はたまにしか更新されないことに注意.
%<*en>
\item If you downloaded this package from CTAN, you have to run following commands
- to generate classes
- and \texttt{ltj-kinsoku.lua} (the file which stores default ``\textit{kinsoku}'' parameters):
+ to generate classes:
%</en>
%<*ja>
-\item もしCTANから本パッケージを取得したのであれば,日本語用クラスファイルや
-標準の禁則処理用パラメータを
-格納した \texttt{ltj-kinsoku.lua} を生成するために,
+\item もしCTANから本パッケージを取得したのであれば,日本語用クラスファイルを生成するために,
以下を実行する必要がある:
%</ja>
\begin{lstlisting}
$ lualatex ltjclasses.ins
$ lualatex ltjsclasses.ins
$ lualatex ltjltxdoc.ins
-$ luatex ltj-kinsoku_make.tex
\end{lstlisting}
-%<*en>
-\emph{Do not forget The last line (processing \texttt{ltj-kinsoku\_make.tex})}.
-\texttt{*.\{dtx,ins\}} and \texttt{ltj-kinsoku\_make.tex} used here are not needed in regular use.
-%</en>
-%<*ja>
-\emph{最後の \texttt{ltj-kinsoku\_make.tex} の実行を忘れないように注意}.
-ここで使用した \texttt{*.\{dtx,ins\}} と \texttt{ltj-kinsoku\_make.tex} は
-通常の使用にあたっては必要ない.
-%</ja>
-
-
%<*en>
\item Copy all the contents of \texttt{src/} into one of your \texttt{TEXMF} tree.
従来日本語の文字コードとして用いられてきたEUC-JPやShift-JISは使用できない.
%</ja>
%<*en>
-\item \LuaTeX-ja is very slower than \pTeX.
- Generally speaking, LuaJIT\TeX\ processes \LuaTeX-ja
- about 30\% faster than \LuaTeX, but not always%
- \footnote{%
- LuaJIT has several limitations such as 1\,GB~(or~2\,GB) memory limitation.
- So typesetting a large source by LuaJIT\TeX may cause an ``out of memory'' error,
- or failure of loading/saving font cache of \Pkg{luaotfload}.
- }.
+\item \LuaTeX-ja is very slower than \pTeX, and uses a lot of memory.
%</en>
%<*ja>
\item \LuaTeX-jaは動作が\pTeX に比べて非常に遅い.
-コードを調整して徐々に速くしているが,まだ満足できる速度ではない.
-LuaJIT\TeX を用いると\LuaTeX のだいたい1.3倍の速度で動くようであるが,
-IPA mj明朝などの大きいフォントを用いた場合には\LuaTeX よりも遅くなることもある
- \footnote{%
- LuaJITは1\,GB(あるいは2\,GB)のメモリ制限など,いくつかの制限事項があることが知られている.そのため,
- 大きいソースファイルをLuaJIT\TeX でタイプセットするとLuaの側で``out of memory''エラーが発生してしまう.
- 本ドキュメントのように,「各ページごとにLuaで使っているメモリ容量をチェックし,
- 必要なら\texttt{collectgarbage("collect")}でガベージコレクタを実行」すると
- 状況が多少改善されるかもしれない.
- また,LuaJIT\TeX でIPA mj明朝などの「大きい」フォントを利用した場合はフォントキャッシュの保存に失敗し,
- 毎回フォントを読み込まなければならず結果的に時間がかかることがある.
- }.
+ コードを調整して徐々に速くしているが,まだ満足できる速度ではない.
+ また,和文フォントを読み込むために多量のメモリを消費することにも注意が必要である.
%</ja>
-\item%
+\item
%<*en>
-\textbf{(Outdated) note for MiK\TeX\ users}\quad
-\LuaTeX-ja requires that several CMap files%
-\footnote{\texttt{UniJIS2004-UTF32-\{H,V\}} and \texttt{Adobe-Japan1-UCS2}.}
-must be found from \LuaTeX.
-Strictly speaking, those CMaps are needed
-only in the first run of \LuaTeX-ja after installing or updating.
-But it seems that MiK\TeX\ does not satisfy this condition,
-so you will encounter an error like the following:
-%</en>
-%<*ja>
-\LuaTeX-jaが動作するためには,\emph{導入・更新後の初回起動時に}
-\texttt{UniJIS2004-UTF32-\{H,V\}}, \texttt{Adobe-Japan1-UCS2}という3つのCMapが
-\LuaTeX によって見つけられることが必要である.
-しかし古いバージョンのMiK\TeX ではそのようになっていないので,次のエラーが発生するだろう:
-%</ja>
+Note that when \LuaTeX-ja is loaded in plain \LuaTeX,
+we cannot use color specification on font loading, such as
\begin{lstlisting}
-! LuaTeX error ...iles (x86)/MiKTeX 2.9/tex/luatex/luatexja/ltj-rmlgbm.lua
-bad argument #1 to 'open' (string expected, got nil)
+ \font\hoge=lmroman10-regular.otf:color=FF0000 % \font primitive
\end{lstlisting}
-
-%<*en>
-If so, please execute a batch file which is written on
-\href{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29}{ the Project Wiki (English)}.
-This batch file creates a temporary directory, copy CMaps in it,
-run a test file which loads \LuaTeX-ja in this directory,
-and finally delete the temporary directory.
+This is because codes for shifting baseline in math mode (\LuaTeX-ja) collide with and prevents loading
+codes for font color (\Pkg{luaotfload}) in these environments.
+\emph{We recommend to use \LaTeX\ 2020-02-02 (or later)}, since we can avoid this collision in there.
%</en>
%<*ja>
-そのような場合には,
-\href{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29}{%
- プロジェクトWiki英語版トップページ}中に書かれているバッチファイルを
-実行して欲しい.このバッチファイルは,作業用ディレクトリにCMap達を
-コピーし,その中で\LuaTeX-jaの初回起動を行い,作業用ディレクトリを消す作業をしている.
+なお,\LuaTeX-jaをplain~\LuaTeX で用いる場合,
+以下のような\emph{フォント読み込み時の色指定}(\cs{textcolor}命令ではなく!)\emph{は利用できない}.
+\begin{lstlisting}
+ \font\hoge=lmroman10-regular.otf:color=FF0000 % \font primitive
+\end{lstlisting}
+これは,\LuaTeX-jaによる数式内のベースライン補正(\ref{ssec:baseline}節)のコードが
+\Pkg{luaotfload}パッケージのフォント色処理のコードと衝突するためである.
+\LaTeX\ 2020-02-02以降では衝突回避のための仕組みが備わっているので.\emph{\LaTeX\ 2020-02-02以降での使用を勧める}.
%</ja>
-
\end{itemize}
%<en>\subsection{Using in plain \TeX}
\textbf{direction}&
\textbf{classification}&\textbf{font name}&\bfseries ``10\,pt''&\bfseries ``7\,pt''&\bfseries ``5\,pt''\\\midrule
\smash{\raisebox{-1ex}{\emph{yoko} (horizontal)}}&
-\emph{mincho}&IPAex Mincho&\cs{tenmin}&\cs{sevenmin}&\cs{fivemin}\\
-&\emph{gothic}&IPAex Gothic&\cs{tengt} &\cs{sevengt} &\cs{fivegt}\\
+\emph{mincho}&HaranoAjiMincho-Regular&\cs{tenmin}&\cs{sevenmin}&\cs{fivemin}\\
+&\emph{gothic}&HaranoAjiGothic-Medium&\cs{tengt} &\cs{sevengt} &\cs{fivegt}\\
\midrule
\smash{\raisebox{-1ex}{\emph{tate} (vertical)}}&
-\emph{mincho}&IPAex Mincho&\cs{tentmin}&\cs{seventmin}&\cs{fivetmin}\\
-&\emph{gothic}&IPAex Gothic&\cs{tentgt} &\cs{seventgt} &\cs{fivetgt}\\
+\emph{mincho}&HaranoAjiMincho-Regular&\cs{tentmin}&\cs{seventmin}&\cs{fivetmin}\\
+&\emph{gothic}&HaranoAjiGothic-Medium&\cs{tentgt} &\cs{seventgt} &\cs{fivetgt}\\
\bottomrule
\end{tabular}
\end{center}
\toprule
\emph{組方向}&\emph{字体}&\emph{フォント名}&\bfseries``10\,pt''&\bfseries``7\,pt''&\bfseries``5\,pt''\\\midrule
\smash{\raisebox{-0.7\zh}{横組}}&
-明朝体&IPAex明朝&\cs{tenmin}&\cs{sevenmin}&\cs{fivemin}\\
-&\textgt{ゴシック体}&IPAexゴシック&\cs{tengt} &\cs{sevengt} &\cs{fivegt}\\
+明朝体&原ノ味明朝Regular&\cs{tenmin}&\cs{sevenmin}&\cs{fivemin}\\
+&\textgt{ゴシック体}&原ノ味角ゴシックMedium&\cs{tengt} &\cs{sevengt} &\cs{fivegt}\\
\midrule
\smash{\raisebox{-0.7\zh}{縦組}}&
-明朝体&IPAex明朝&\cs{tentmin}&\cs{seventmin}&\cs{fivetmin}\\
-&\textgt{ゴシック体}&IPAexゴシック&\cs{tentgt} &\cs{seventgt} &\cs{fivetgt}\\
+明朝体&原ノ味明朝Regular&\cs{tentmin}&\cs{seventmin}&\cs{fivetmin}\\
+&\textgt{ゴシック体}&原ノ味角ゴシックMedium&\cs{tentgt} &\cs{seventgt} &\cs{fivetgt}\\
\bottomrule
\end{tabular}
\end{center}
one inputs \texttt{luatexja.sty} (Subsection~\ref{ssec:cfg}).
%</en>
%<*ja>
-\item 標準和文フォントやJFMをIPAexフォントから別のものに置き換えるには,
+\item 標準和文フォントやJFMを原ノ味フォントから別のものに置き換えるには,
\cs{ltj@stdmcfont}等を\texttt{luatexja.sty}読み込み\emph{前}に定義すればよい.
\ref{ssec:cfg}節を参照.
%</ja>
\begin{center}\small
\begin{tabular}{lllc}
\toprule
-\textbf{classification}&&&\textbf{commands}\\\midrule
+\textbf{classification}&\textbf{commands}&&\textbf{family}\\\midrule
\emph{mincho} (明朝体)&\verb+\textmc{...}+&\verb+{\mcfamily ...}+&\cs{mcdefault}\\
\emph{gothic} (\textgt{ゴシック体})&\verb+\textgt{...}+&\verb+{\gtfamily ...}+&\cs{gtdefault}\\
+(Japanese counterpart for typewriter font)&---&---&\cs{jttdefault}\\
\bottomrule
\end{tabular}
\end{center}
+ Here \cs{jttdefault} specifies the Japanese font family in \cs{verb}~or~\texttt{verbatim}
+ environment, and its default value is \cs{mcdefault} (mincho family).%
+ \footnote{%
+ When \Pkg{ltjsclasses} classes are used, or
+ \Pkg{luatexja-fontspec} (or \Pkg{luatexja-preset}) is loaded with \texttt{match} option,
+ \cs{ttfamily} changes the current Japanese font amily to \cs{jttdefault}.
+ These classes and packages also redefine \cs{jttdefault} to
+ \cs{gtdefault} (\emph{gothic}~family).
+ } \LuaTeX-ja does not define commands to only switch current Japanese font family to
+ \cs{jttdefault}.
+
\item
By default, the following fonts are used for these two families.
\begin{center}\small
\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\\
-\emph{gothic} (\textgt{ゴシック体})&\tt gt&IPAex Gothic&IPAex Gothic&0.962216\\
+\textbf{classification}&\textbf{family}&\textbf{\cs{mdseries}}&\textbf{\cs{bfseries}}&\textbf{scale}\\\midrule
+\emph{mincho} (明朝体)&\texttt{mc}&HaranoAjiMincho-Regular&HaranoAjiGothic-Medium&0.962216\\
+\emph{gothic} (\textgt{ゴシック体})&\texttt{gt}&HaranoAjiGothic-Medium&HaranoAjiGothic-Medium&0.962216\\
\bottomrule
\end{tabular}
\end{center}
There is no italic nor slanted shape for these \texttt{mc}~and~\texttt{gt}.
%</en>
%<*ja>
-\item \pLaTeX ã\81¨å\90\8cæ§\98ã\81«ï¼\8cæ¨\99æº\96ã\81§ã\81¯ã\80\8cæ\98\8eæ\9c\9dä½\93ã\80\8dã\80\8cã\82´ã\82·ã\83\83ã\82¯ä½\93ã\80\8dã\81®2種é¡\9eã\82\92ç\94¨ã\81\84ã\82\8bï¼\9a
+\item \pLaTeX ã\81¨å\90\8cæ§\98ã\81«ï¼\8cæ¨\99æº\96ã\81§ã\81¯ã\80\8cæ\98\8eæ\9c\9dä½\93ã\80\8dã\80\8cã\82´ã\82·ã\83\83ã\82¯ä½\93ã\80\8dã\81®2種é¡\9eã\82\92ç\94¨ã\81\84ã\82\8bï¼\8e
\begin{center}\small
\begin{tabular}{llll}
\toprule
-\emph{字体}&&&\emph{ファミリ名}\\\midrule
+\emph{字体}&\emph{命令}&&\emph{ファミリ名}\\\midrule
明朝体&\verb+\textmc{...}+&\verb+{\mcfamily ...}+&\cs{mcdefault}\\
\textgt{ゴシック体}&\verb+\textgt{...}+&\verb+{\gtfamily ...}+&\cs{gtdefault}\\
+(タイプライタ体と合わせる和文)&---&&\cs{jttdefault}\\
\bottomrule
\end{tabular}
\end{center}
- \newpage
+ \cs{jttdefault}は\cs{verb}や\texttt{verbatim}環境中の和文文字に使われる和文フォントファミリであり,
+ 標準値は\cs{mcdefault},つまり明朝体である
+ \footnote{%
+ \Pkg{ltjsclasses}を使用したり,また\Pkg{luatexja-fontspec}や\Pkg{luatexja-preset}パッケージを
+ \texttt{match}オプションを指定して読み込んだときは,単なる\cs{ttfamily}によっても和文フォントが
+ \cs{jttdefault}に変更される.また,これらのクラスファイルやパッケージは
+ \cs{jttdefault}を \cs{gtdefault}(ゴシック体)に再定義する.
+ }.和文フォントファミリ(のみ)を\cs{jttdefault}に切り替える命令は準備していない.
+
\item 標準では,次のフォントが用いられる:
\begin{center}\small
\begin{tabular}{lllll}
\toprule
-\emph{字体}&\emph{ファミリ}&\cs{mdseries}&\cs{bfseries}&\emph{スケール}\\\midrule
-明朝体&\tt mc&IPAex明朝&IPAexゴシック&0.962216\\
-\textgt{ゴシック体}&\tt gt&IPAexゴシック&IPAexゴシック&0.962216\\
+\emph{字体}&\emph{ファミリ}&\textbf{\cs{mdseries}}&\textbf{\cs{bfseries}}&\emph{スケール}\\\midrule
+明朝体&\texttt{mc}&原ノ味明朝Regular&原ノ味角ゴシックMedium&0.962216\\
+\textgt{ゴシック体}&\texttt{gt}&原ノ味角ゴシックMedium&原ノ味角ゴシックMedium&0.962216\\
\bottomrule
\end{tabular}
\end{center}
\LaTeX へのパッチを読み込まない.
\texttt{disablejfam}のない状況では,以前と同様に和文文字を数式モード中に
- 直に書くことができる(但し\autoref{para:jachar_in_math}ページの記述も参照).
+ 直に書くことができる(但し\pageref{para:jachar_in_math}ページの記述も参照).
その際には明朝体(\texttt{mc})で出力される.
%</ja>
-%<*en>
- \item \cs{jttdefault}%
- \footnote{%
- When \Pkg{ltjsclasses} classes are used, or
- \Pkg{luatexja-fontspec} (or \Pkg{luatexja-preset}) is loaded with \texttt{match} option,
- \cs{ttfamily} changes the current Japanese font amily to \cs{jttdefault}.
- These classes and packages also redefine \cs{jttdefault} to
- \cs{gtdefault} (\emph{gothic}~family).
- } specifies the Japanese font family in \cs{verb}~or~\texttt{verbatim} environment.
- The default value of \cs{jttdefault} is \cs{mcdefault}, so the mincho family is used.
-%</en>
-%<*ja>
- \item \cs{verb} や \texttt{verbatim} 環境中の和文文字に使われる和文フォントファミリは
- \ \cs{jttdefault} で指定する%
- \footnote{%
- \Pkg{ltjsclasses}を使用したり,あるいは \texttt{match} オプションを指定して\Pkg{luatexja-fontspec}%
- や\Pkg{luatexja-preset}パッケージを読み込んだときは,単なる \cs{ttfamily} によっても和文フォントが
- \ \cs{jttdefault}\ に変更される.また,これらのクラスファイルやパッケージは
- \ \cs{jttdefault}\ を \cs{gtdefault}(ゴシック体)に再定義する.
- }.標準値は \cs{mcdefault},つまり明朝体として用いるのと
- 同じフォントファミリである.
-%</ja>
%<*en>
\item If you use the \Pkg{beamer} class with the default font theme (which uses sans serif
フォントを変更する命令)の前で実行することにより使うことができる.
\pLaTeX では標準の欧文フォントはOT1エンコーディングのComputer Modern Roman (\texttt{cmr})%
- であったが,2017年以降の\LuaLaTeX ではTUエンコーディングのlatin Modern Roman (\texttt{lmr})%
+ であったが,2017年以降の\LuaLaTeX ではTUエンコーディングのLatin Modern Roman (\texttt{lmr})%
に変更されている.そのため,前段落で述べた「従属欧文」も,Latin Modern Romanに設定している.
%</ja>
\texttt{ltjsarticle.cls},~\texttt{ltjsbook.cls}, \texttt{ltjsreport.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,
+However, \LuaTeX\ does not support \cs{mag} in PDF~output,
so \Pkg{ltjsclasses} uses the \texttt{nomag*} option\footnote{Same effect as
the \Pkg{BXjscls} classes (by Takayuki Yato) and \Pkg{jsclasses}.
However, these classes uses only \TeX\ code, but \Pkg{ltjsclasses} uses Lua code.}
がそれぞれ\LuaTeX-ja標準で用意されている.
元々の\Pkg{jsclasses}では本文のフォントサイズを設定するのに\cs{mag}プリミティブが使われていたが,
-\LuaTeX~beta-0.87.0以降ではPDF出力時の\cs{mag}のサポートが廃止された.
+\LuaTeX ではPDF出力時の\cs{mag}のサポートが廃止された.
そのため,\Pkg{ltjsclasses}では\texttt{nomag*}オプション
\footnote{\Pkg{jsclasses}や,八登崇之氏による\Pkg{BXjscls}クラスにおける同名のオプションと
同じ.上記クラスは\TeX コードのみで実装しているが,\Pkg{ltjsclasses}ではLuaコードも用いている.}が標準で
有効になっており,これを使って本文フォントサイズの設定を行っている.
-しかし,この\texttt{nomag*}オプションでは(20180121.0版より前の版において\Pkg{unicode-math}パッケージ使用時に
-起きたように)予想外の意図しない現象に遭遇する危険がある.そのような場合は
+しかし,この\texttt{nomag*}オプションでは(バージョン20180121.0より前で\Pkg{unicode-math}パッケージ使用時に起きたように)予想外の意図しない現象に遭遇する危険がある.そのような場合は
\cs{documentclass}において\texttt{nomag}オプションを指定してほしい.
%</ja>
%<*ja>
\LaTeX で用いる際には,\pLaTeXe\ (\texttt{plfonts.dtx})用のフォント選択機構の大部分を流用している.
%</ja>
-\begin{itemize}
-%<*en>
-\item Commands \cs{fontfamily}, \cs{fontseries}, and \cs{fontshape} can be used to change
- attributes of Japanese fonts.
-%</en>
-%<*ja>
-\item 和文フォントの属性を変更するには,\cs{fontfamily}, \cs{fontseries}, \cs{fontshape} を使用する.
- もちろん,それらを実際に反映させるには手動で \cs{selectfont} を実行する必要がある.
-%</ja>
%<*en>
\begin{center}\small
-\begin{tabular}{llllll}
+\begin{tabular}{>{\bfseries}llllll}
\toprule
&\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}&\textbf{selection}\\\midrule
-alphabetic fonts
+Alphabetic fonts
&\cs{romanencoding}&\cs{romanfamily}&\cs{romanseries}&\cs{romanshape}
&\cs{useroman}\\
Japanese fonts
&\cs{kanjiencoding}&\cs{kanjifamily}&\cs{kanjiseries}&\cs{kanjishape}
&\cs{usekanji}\\
-both&---&--&\cs{fontseries}&\cs{fontshape}&---\\
+both&---&--&\cs{fontseries}&\cs{fontshape}$^*$&---\\
auto select&\cs{fontencoding}&\cs{fontfamily}&---&---&\cs{usefont}\\
\bottomrule
\end{tabular}
\begin{center}\small
\begin{tabular}{llllll}
\toprule
-&\emph{ã\82¨ã\83³ã\82³ã\83¼ã\83\87ã\82£ã\83³ã\82°}&\emph{ã\83\95ã\82¡ã\83\9fã\83ª}&\emph{ã\82·ã\83ªã\83¼ã\82º}&\emph{ã\82·ã\82§ã\83¼プ}&\emph{選択}\\\midrule
+&\emph{ã\82¨ã\83³ã\82³ã\83¼ã\83\87ã\82£ã\83³ã\82°}&\emph{ã\83\95ã\82¡ã\83\9fã\83ª}&\emph{ã\82·ã\83ªã\83¼ã\82º}&\emph{ã\82·ã\82§ã\82¤プ}&\emph{選択}\\\midrule
\emph{欧文}
&\cs{romanencoding}&\cs{romanfamily}&\cs{romanseries}&\cs{romanshape}
&\cs{useroman}\\
\emph{和文}
&\cs{kanjiencoding}&\cs{kanjifamily}&\cs{kanjiseries}&\cs{kanjishape}
&\cs{usekanji}\\
-\emph{両方}&---&--&\cs{fontseries}&\cs{fontshape}&---\\
+\emph{両方}&---&--&\cs{fontseries}&\cs{fontshape}$^*$&---\\
\emph{自動選択}&\cs{fontencoding}&\cs{fontfamily}&---&---&\cs{usefont}\\
\bottomrule
\end{tabular}
\end{center}
%</ja>
+\begin{itemize}
+%<*en>
+\item \cs{fontfamily}, \cs{fontseries}, and~\cs{fontshape} try to change
+ attributes of Japanese fonts, as well as those of alphabetic fonts.
+ Of course, \cs{selectfont} is needed to select current text fonts.
+
+ Note that \cs{fontshape} always changes current alphabetic font shape,
+ but it does \emph{not} change current Japanese font shape if
+ the target shape is unavailable for current Japanese encoding/family/series.
+ For the detail, see Subsection~\ref{ssec:nfsspat}.
+%</en>
+%<*ja>
+\item \cs{fontfamily}, \cs{fontseries}, \cs{fontshape} は欧文・和文フォント両方の属性を変更しようとする.
+ もちろん,それらを実際に反映させるには手動で \cs{selectfont} を実行する必要がある.
+
+ なお,\cs{fontshape\{\meta{shape}\}}は常に欧文フォントのシェイプを設定するが,
+ もしも現在の和文フォントファミリ・シリーズで要求されたシェイプが利用不能だった場合には,和文フォントのシェイプは変更しない.
+ 詳細は\ref{ssec:nfsspat}節を参照すること.
+%</ja>
+
%<*en>
- \verb+\fontencoding{+<encoding>\verb+}+ changes the encoding of alphabetic fonts
+\item \verb+\fontencoding{+\meta{encoding}\verb+}+ changes the encoding of alphabetic fonts
or Japanese fonts depending on the argument. For example,
\verb+\fontencoding{JY3}+ changes the encoding of Japanese fonts to
\texttt{JY3}, and \verb+\fontencoding{T1}+ changes the encoding of
For the detail, see Subsection~\ref{ssec:nfsspat}.
%</en>
%<*ja>
- ここで,\verb+\fontencoding{+<encoding>\verb+}+ は,引数により和文側か欧文
+\item ここで,\cs{fontencoding\{\meta{encoding}\}}は,引数により和文側か欧文
側かのどちらかのエンコーディングを変更する.例えば,
\verb+\fontencoding{JY3}+ は和文フォントのエンコーディングを
\texttt{JY3}に変更し,\verb+\fontencoding{T1}+ は欧文フォント側を
\item 和文フォントのシェイプを定義するには,通常の \cs{DeclareFontShape} を使えば良い:
%</ja>
\begin{lstlisting}
-\DeclareFontShape{JY3}{mc}{bx}{n}{<-> s*KozMinPr6N-Bold:jfm=ujis;-kern}{}
- % Kozuka Mincho Pr6N Bold
+\DeclareFontShape{JY3}{mc}{b}{n}{<-> s*HaranoAjiMincho--Bold:jfm=ujis;-kern}{}
+ % Harano Aji Mincho Bold
\end{lstlisting}
%<*ja>
仮名書体を使う場合など,複数の和文フォントを組み合わせて使いたい場合は
To use the functionality of the \Pkg{fontspec} package to Japanese fonts,
it is needed to load the \Pkg{luatexja-fontspec} package in the preamble, as follows:
\begin{quote}
-\ttfamily \textbackslash usepackage[<options>]\{luatexja-fontspec\}
+\ttfamily \textbackslash usepackage[\meta{options}]\{luatexja-fontspec\}
\end{quote}
This \Pkg{luatexja-fontspec} package
automatically loads \Pkg{luatexja} and \Pkg{fontspec}
\LuaTeX-ja上において,\Pkg{fontspec}パッケージと同様の機能を和文フォントに対しても用いる場
合は\Pkg{luatexja-fontspec}パッケージを読み込む:
\begin{quote}
-\ttfamily \textbackslash usepackage[<options>]\{luatexja-fontspec\}
+\ttfamily \textbackslash usepackage[\meta{options}]\{luatexja-fontspec\}
\end{quote}
このパッケージは自動で\Pkg{luatexja}パッケージと\Pkg{fontspec}パッケージを読み込む.
%</ja>
\caption{Commands of \Pkg{luatexja-fontspec}}\label{tab:ltj_fntspc}
\medskip
{\centering\small
-\begin{tabular}{cllll}
+\begin{tabular}{>{\bfseries}lllll}
\toprule
Japanese fonts
-&\cs{jfontspec}&\cs{setmainjfont}&\cs{setsansjfont}&\cs{setmonojfont}$^*$\\
-alphabetic fonts
+&\cs{jfontspec}&\cs{setmainjfont}&\cs{setsansjfont}&\cs{setmonojfont}\\
+Alphabetic fonts
&\cs{fontspec}&\cs{setmainfont}&\cs{setsansfont}&\cs{setmonofont}\\
\midrule
Japanese fonts
-&\cs{newjfontfamily}&\cs{renewjfontfamily}$^{**}$&\cs{setjfontfamily}$^{**}$\\
-alphabetic fonts
-&\cs{newfontfamily}&\cs{renewfontfamily}$^{**}$&\cs{setfontfamily}$^{**}$\\
+&\cs{newjfontfamily}&\cs{renewjfontfamily}&\cs{setjfontfamily}\\
+Alphabetic fonts
+&\cs{newfontfamily}&\cs{renewfontfamily}&\cs{setfontfamily}\\
\midrule
Japanese fonts
&\cs{newjfontface}&\cs{defaultjfontfeatures}&\cs{addjfontfeatures}\\
-alphabetic fonts
+Alphabetic fonts
&\cs{newfontface}&\cs{defaultfontfeatures}&\cs{addfontfeatures}\\
\bottomrule
\end{tabular}\par}
-\medskip
-\fakefn{$^*$}{%
- \cs{setmonojfont} is defined if and only if \texttt{match} option is specified.}
-\fakefn{$^{**}$}{%
- \cs{renewfontfamily}~and~\cs{setfontfamily} are new commands
- in \Pkg{fontspec}~v2.6h (2018/7/30).
- Hence, \Pkg{luatexja-fontspec} define \cs{renewjfontfamily}~and~\cs{setjfontfamily}
- only when \Pkg{fontspec}~v2.6h (or later) is used.
-}
\end{table}
%</en>
%<*ja>
\begin{tabular}{lllll}
\toprule
\emph{和文}
-&\cs{jfontspec}&\cs{setmainjfont}&\cs{setsansjfont}&\cs{setmonojfont}$^*$\\
+&\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}$^{**}$\\
+&\cs{newjfontfamily}&\cs{renewjfontfamily}&\cs{setjfontfamily}\\
\emph{欧文}
-&\cs{newfontfamily}&\cs{renewfontfamily}$^{**}$&\cs{setfontfamily}$^{**}$\\
+&\cs{newfontfamily}&\cs{renewfontfamily}&\cs{setfontfamily}\\
\midrule
\emph{和文}
&\cs{newjfontface}&\cs{defaultjfontfeatures}&\cs{addjfontfeatures}\\
&\cs{newfontface}&\cs{defaultfontfeatures}&\cs{addfontfeatures}\\
\bottomrule
\end{tabular}\par}
-
-\medskip
-\fakefn{$^*$}{\cs{setmonojfont} は \texttt{match} オプションが
-指定された時のみ定義される.}
-\fakefn{$^{**}$}{%
- \cs{renewfontfamily} と \cs{setfontfamily} は
- \Pkg{fontspec}~v2.6h (2018/7/30)で新たに追加された命令である.
- そのため,\Pkg{luatexja-fontspec}が \cs{renewjfontfamily} と \cs{setjfontfamily} を
- 定義するのはv2.6h以降の\Pkg{fontspec}を使用した時のみになっている.
-}
-
\end{table}
%</ja>
%<*en>
If this option is specified, usual family-changing commands such as
\cs{rmfamily},~\cs{textrm}, \cs{sffamily},~\dots\ also change Japanese font family.
-
-Note that \emph{\cs{setmonojfont} is defined
-if and only if this \texttt{\textup{match}} option is specified}.
%</en>
%<*ja>
このオプションが指定されると,「\pLaTeXe 新ドキュメントクラス」のように\
\cs{rmfamily}, \verb+\textrm{...}+, \cs{sffamily} 等が
欧文フォントだけでなく和文フォントも変更するようになる.
-
-\emph{なお,\cs{setmonojfont} はこの \texttt{match} オプションが
-指定された時のみ定義される.}この命令は標準の「タイプライタ体に対応する和文フォント」を指定する.
%</ja>
- \item[pass=<opts>]
-%<en> \emph{(Obsoleted)}\ Specify options <opts> which will be passed to the \Pkg{fontspec} package.
-%<ja> \Pkg{fontspec} パッケージに渡すオプション <opts> を指定する.本オプションは時代遅れである.
+ \item[pass=\meta{options}]
+%<en> \emph{(Obsoleted)}\ Specify options \meta{options} which will be passed to the \Pkg{fontspec} package.
+%<ja> \Pkg{fontspec} パッケージに渡すオプション \meta{options} を指定する.本オプションは時代遅れである.
-\item[scale=<float>]
+\item[scale=\meta{float}]
%<*en>
Override the ratio of the font size of Japanese fonts to that of alphabetic fonts.
The default value is determined as follows:
\usepackage[no-math]{fontspec}\usepackage{luatexja-fontspec}
\usepackage[no-math]{luatexja-fontspec}
\end{lstlisting}
-
-
%<*en>
-The reason that \cs{setmonojfont} is not defined by default is that
-it is popular for Japanese fonts that nearly all Japanese glyphs have same
-widths. Also note that kerning information in a font is not used
+Note that kerning information in a font is not used
(that is, \texttt{kern} feature is set off) by default in these seven (or~eight) commands.
This is because of the compatibility with previous versions of \LuaTeX-ja
(see \ref{para-kern}).
Below is an example of \cs{jfontspec}.
%</en>
%<*ja>
-標準で \cs{setmonojfont} コマンドが定義されないのは,
-和文フォントではほぼ全ての和文文字のグリフが等幅であるのが伝統的であったことによる.
-また,これらの和文用のコマンドではフォント内のペアカーニング情報は標準では使用されない,
+これらの和文用のコマンドではフォント内のペアカーニング情報は標準では使用されない,
言い換えれば \texttt{kern} featureは標準では無効化となっている.
これは以前のバージョンの\LuaTeX-jaとの互換性のためである(\ref{para-kern}節を参照).
%</ja>
\begin{LTXexample}[width=0.4\textwidth]
-\jfontspec[CJKShape=NLC]{KozMinPr6N-Regular}
-JIS~X~0213:2004→辻\par
-\jfontspec[CJKShape=JIS1990]{KozMinPr6N-Regular}
-JIS~X~0208:1990→辻
+\jfontspec[CJKShape=NLC]{HaranoAjiMincho-Regular}
+JIS~X~0213:2004→辻鯵\par
+\jfontspec[CJKShape=JIS1990]{HaranoAjiMincho-Regular}
+JIS~X~0208-1990→辻鯵\par
+\jfontspec[CJKShape=JIS1978]{HaranoAjiMincho-Regular}
+JIS~C~6226-1978→辻鯵
\end{LTXexample}
%<en>\subsection{Presets of Japanese fonts}
\begin{quote}
\ttfamily
\hyphenchar\font=-1 \exhyphenchar=-1
- hiragino-pro, hiragino-pron, ipa, ipa-hg, ipaex, ipaex-hg,
+ haranoaji, hiragino-pro, hiragino-pron, ipa, ipa-hg, ipaex, ipaex-hg,
kozuka-pr6, kozuka-pr6n, kozuka-pro, moga-mobo, moga-mobo-ex,
- bizud, 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, noto, noto-jp,
sourcehan, sourcehan-jp, ume, yu-osx, yu-win, yu-win10
\end{quote}
%<ja> 例えば,本ドキュメントでは\Pkg{luatexja-preset}パッケージを
%<en> For example, this document loads \Pkg{luatexja-preset} package by
\begin{lstlisting}
-\usepackage[kozuka-pr6n]{luatexja-preset}
+\usepackage[haranoaji]{luatexja-preset}
\end{lstlisting}
-%<ja>ã\81¨ã\81\97ã\81¦èªã\81¿è¾¼ã\81¿ï¼\8cå°\8få¡\9aæ\9b¸ä½\93(Pr6N)を使うことを指定している.
-%<en> which means that Kozuka~Pr6N fonts will be used in this document.
+%<ja>ã\81¨ã\81\97ã\81¦èªã\81¿è¾¼ã\81¿ï¼\8cå\8e\9fã\83\8eå\91³ã\83\95ã\82©ã\83³ã\83\88を使うことを指定している.
+%<en> which means that Harano Aji fonts will be used in this document.
%<*en>
一部を(\Pkg{luatexja-otf}という別のパッケージとして)実装した.
%</ja>
-\begin{LTXexample}
-\jfontspec{KozMinPr6N-Regular.otf}
-森\UTF{9DD7}外と内田百\UTF{9592}とが\UTF{9AD9}島屋に行く。
-
+\begin{LTXexample}[width=0.4\textwidth]
+森\UTF{9DD7}外と\CID{13966}田百\UTF{9592}とが
+\UTF{9AD9}島屋に\\
\CID{7652}飾区の\CID{13706}野家,
-\CID{1481}城市,葛西駅,
-高崎と\CID{8705}\UTF{FA11}
-
-\aj半角{はんかくカタカナ}
+\CID{1481}城市,葛西駅,\\
+高崎と\CID{8705}\UTF{FA11},濱と\ajMayuHama\\
+\aj半角{カタカナ}\ajKakko3\ajMaruYobi{2}%
+\ajLig{令和}\ajLig{○問}\ajJIS
\end{LTXexample}
%<*ja>
it sets
\begin{itemize}
\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}.
+ \item a character which belongs character ranges 2,~3, 6, 7,~and~9 is \textbf{JAchar}.
\end{itemize}
%</en>
%<*ja>
例えば,以下は\LuaTeX-jaの初期設定であり,次の内容を設定している:
\begin{itemize}
\item 1番,4番,5番,8番の文字範囲に属する文字は\textbf{ALchar}.
- \item 2番,3番,6番,7番の文字範囲に属する文字は\textbf{JAchar}.
+ \item 2番,3番,6番,7番,9番の文字範囲に属する文字は\textbf{JAchar}.
\end{itemize}
%</ja>
\begin{lstlisting}
-\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8}}
+\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8, +9}}
\end{lstlisting}
%<*en>
The argument to \textsf{jacharrange} parameter is a list of non-zero integer.
%<*en>
\paragraph{Default character ranges}
-\LuaTeX-ja predefines eight character ranges for convenience. They are
+\LuaTeX-ja predefines nine character ranges for convenience. They are
determined from the following data:
%</en>
%<*ja>
\paragraph{文字範囲の初期値}
-\LuaTeX-jaでは8つの文字範囲を予め定義しており,
+\LuaTeX-jaでは9つの文字範囲を予め定義しており,
これらは以下のデータに基づいて決定している.
%</ja>
\begin{itemize}
-%<en>\item Blocks in Unicode~11.0.
-%<ja>\item Unicode~11.0のブロック.
-%<en>\item The \texttt{Adobe-Japan1-UCS2} mapping between a CID Adobe-Japan1-6 and Unicode.
-%<ja>\item Adobe-Japan1-6のCIDとUnicodeの間の対応表\texttt{Adobe-Japan1-UCS2}.
+%<en>\item Blocks in Unicode~12.0.0.
+%<ja>\item Unicode~12.0のブロック.
+%<en>\item The \texttt{Adobe-Japan1-UCS2} mapping between a CID Adobe-Japan1- and Unicode.
+%<ja>\item Adobe-Japan1-7のCIDとUnicodeの間の対応表\texttt{Adobe-Japan1-UCS2}.
%<en>\item The \Pkg{PXbase} bundle for \upTeX\ by Takayuki Yato.
%<ja>\item 八登崇之氏による\upTeX 用の\Pkg{PXbase}バンドル.
\end{itemize}
%<*en>
-Now we describe these eight ranges. The superscript ``J'' or ``A'' after the
+Now we describe these nine 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.
these eight ranges belongs to the character range~217.
%</en>
%<*ja>
-以下ではこれら8つの文字範囲について記述する.添字のアルファベット「J」「A」
+以下ではこれら9つの文字範囲について記述する.添字のアルファベット「J」「A」
は,その文字範囲内の文字が\textbf{JAchar}か\textbf{ALchar}かを表している.これらの初期設定は
\texttt{PXbase}バンドルで定義されている\texttt{prefercjk}と類似のものであるが,
8ビットフォント使用時のトラブルを防ぐために \texttt{U+0080}--\texttt{U+00FF} の文字は全部
\textbf{ALchar}としている.
-なお,\texttt{U+0080} 以降でこれら8つの文字範囲に属さない文字は,217番の文字範囲に属することになっている.
+なお,\texttt{U+0080} 以降でこれら9つの文字範囲に属さない文字は,217番の文字範囲に属することになっている.
%</ja>
\begin{description}
%<*en>
-
\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:
+ (Latin-1 Supplement) and JIS~X~0208 (a basic character set for Japanese).
+ The character list is indicated in \autoref{tab:rng8}.
%</en>
%<*ja>
\item[範囲8${}^{\text{A}}$] ISO~8859-1の上位領域(ラテン1補助)と
- JIS~X~0208の共通部分.この文字範囲は
- 以下の文字で構成される:
+ JIS~X~0208の共通部分.文字のリストは\autoref{tab:rng8}を参照.
%</ja>
-\begin{multicols}{2}
-\begin{itemize}
-\def\ch#1#2{\item \char"#1\ (\texttt{U+00#1}, #2)}%"
-\ch{A7}{Section Sign}
-\ch{A8}{Diaeresis}
-\ch{B0}{Degree sign}
-\ch{B1}{Plus-minus sign}
-\ch{B4}{Spacing acute}
-\ch{B6}{Paragraph sign}
-\ch{D7}{Multiplication sign}
-\ch{F7}{Division Sign}
-\end{itemize}
-\end{multicols}
+\begin{table}[!tb]
+%<en>\caption{Characters in predefined character range~8.}\medskip
+%<ja>\caption{文字範囲8に指定されている文字.}
+\label{tab:rng8}
+\centering\footnotesize
+\def\ch#1{\char"#1~(\texttt{U+00#1})}%"
+\begin{tabular}{llll}
+\ch{A7}&{Section Sign}&
+\ch{A8}&{Diaeresis}\\
+\ch{B0}&{Degree sign}&
+\ch{B1}&{Plus-minus sign}\\
+\ch{B4}&{Spacing acute}&
+\ch{B6}&{Paragraph sign}\\
+\ch{D7}&{Multiplication sign}&
+\ch{F7}&{Division Sign}
+\end{tabular}
+\end{table}
%<*en>
-\item[Range~1${}^{\text{A}}$] Latin characters that some of them are included in Adobe-Japan1-6.
-This range consists of the following Unicode ranges, \emph{except characters in the range~8 above}:
+\item[Range~1${}^{\text{A}}$] Latin characters that some of them are included in Adobe-Japan1-7.
+ This range consists of the Unicode ranges indicated in \autoref{tab:rng1},
+ \emph{except characters in the range~8 above}.
%</en>
%<*ja>
-\item[範囲1${}^{\text{A}}$] ラテン文字のうち,Adobe-Japan1-6との共通部分があるもの.
- この範囲は以下のUnicodeのブロックのうち
- \emph{ç¯\84å\9b²8ã\82\92é\99¤ã\81\84ã\81\9f}é\83¨å\88\86ã\81§æ§\8bæ\88\90ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8bï¼\9a
+\item[範囲1${}^{\text{A}}$] ラテン文字のうち,Adobe-Japan1-7との共通部分があるもの.
+ この範囲は\autoref{tab:rng1}で示したUnicodeのブロックのうち
+ \emph{ç¯\84å\9b²8ã\82\92é\99¤ã\81\84ã\81\9f}é\83¨å\88\86ã\81§æ§\8bæ\88\90ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8bï¼\8e
%</ja>
-\begin{multicols}{2}
-\begin{itemize}
-\item \texttt{U+0080}--\texttt{U+00FF}: Latin-1 Supplement
-\item \texttt{U+0100}--\texttt{U+017F}: Latin Extended-A
-\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
-%<en>\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
-%<ja>\par\
-\end{itemize}
-\end{multicols}
+\begin{table}[!tb]
+%<en>\caption{Unicode blocks in predefined character range~1.}\medskip
+%<ja>\caption{文字範囲1に指定されているUnicodeブロック.}
+\label{tab:rng1}
+\centering\footnotesize
+\begin{tabular}{llll}
+ \texttt{U+0080}--\texttt{U+00FF}&Latin-1 Supplement&
+ \texttt{U+0100}--\texttt{U+017F}&Latin Extended-A\\
+ \texttt{U+0180}--\texttt{U+024F}& Latin Extended-B&
+ \texttt{U+0250}--\texttt{U+02AF}& IPA Extensions\\
+ \texttt{U+02B0}--\texttt{U+02FF}& Spacing Modifier Letters&
+ \texttt{U+0300}--\texttt{U+036F}& Combining Diacritical Marks\\
+ \texttt{U+1E00}--\texttt{U+1EFF}&Latin Extended Additional
+\end{tabular}
+\end{table}
%<*en>
\item[Range~2${}^{\text{\kern.1emJ}}$] Greek and Cyrillic letters. JIS~X~0208 (hence most of Japanese
fonts) has some of these characters.
\end{itemize}
\end{multicols}
%<*en>
-\item[Range~3${}^{\text{\kern.1emJ}}$] Punctuations and Miscellaneous symbols. The block list is
+\item[Range~3${}^{\text{\kern.1emJ}}$] Miscellaneous symbols. The block list is
indicated in \autoref{tab:rng3}.
%</en>
%<*ja>
-\item[範囲3${}^{\text{\kern.1emJ}}$] 句読点と記号類.ブロックのリストは\autoref{tab:rng3}%
+\item[範囲3${}^{\text{\kern.1emJ}}$] 記号類.ブロックのリストは\autoref{tab:rng3}%
に示してある.
%</ja>
\begin{table}[!tb]
\catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
\centering\footnotesize
\begin{tabular}{llll}
-"2000--"206F&General Punctuation&
"2070--"209F&Superscripts and Subscripts\\
"20A0--"20CF&Currency Symbols&
"20D0--"20FF&Comb.\ Diacritical Marks for Symbols\\
\end{tabular}
\end{table}
%<*en>
+\item[Range~9${}^{\text{J}}$] The intersection of the ``General Punctuation'' block
+ (\texttt{U+2000}--\texttt{U+206F})
+ and Adobe-Japan1-7 character collection.
+ This character range characters in \autoref{tab:rng9}.
+%</en>
+%<*ja>
+\item[範囲9${}^{\text{J}}$] Unicodeの「一般句読点」ブロック(\texttt{U+2000}--\texttt{U+206F})と
+ Adobe-Japan1-7の共通部分.
+ この文字範囲は\autoref{tab:rng9}に示した文字で構成される.
+%</ja>
+\begin{table}[!tb]
+%<en>\caption{Characters in predefined character range~9.}\medskip
+%<ja>\caption{文字範囲9に指定されている文字.}
+\label{tab:rng9}
+\centering\footnotesize
+\def\ch#1{%
+ {\fboxsep0pt\fcolorbox{cyan}{white}%
+ {\normalsize\KOZM\UTF{20#1}}}\ (\texttt{U+20#1})} %"
+% 13: JIS X0213, AJ, Adobe-Japan-1 only
+\begin{tabular}{ll>{\color{white}}lll>{\color{white}}l}
+ \ch{02}&{En space}&AJ&
+ \ch{10}&{Hyphen}&\\
+ \ch{11}&{Non-breaking hyphen}&AJ&
+ \ch{13}&{En dash}&13\\
+ \ch{14}&{Em dash}&&
+ \ch{15}&{Horizontal bar}&\\
+ \ch{16}&{Double vertical line}&&
+ \ch{18}&{Left single quotation mark}&\\
+ \ch{19}&{Right single quotation mark}&&
+ \ch{1A}&{Single low-9 quotation mark}&AJ\\
+ \ch{1C}&{Left double quotation mark}&&
+ \ch{1D}&{Right double quotation mark}&\\
+ \ch{1E}&{Double low-9 quotation mark}&AJ&
+ \ch{20}&{Dagger}&\\
+ \ch{21}&{Double dagger}&&
+ \ch{22}&{Bullet}&13\\
+ \ch{25}&{Two dot leader}&&
+ \ch{26}&{Horizontal ellipsis}&\\
+ \ch{30}&{Per mille sign}&&
+ \ch{32}&{Prime}&\\
+ \ch{33}&{Double prime}&&
+ \ch{39}&{Single left-pointing angle quot.}&AJ\\
+ \ch{3A}&{Single right-pointing angle quot.}&AJ&
+ \ch{3B}&{Reference mark}&\\
+ \ch{3C}&{Double exclamation mark}&13&
+ \ch{3E}&{Overline}&\\
+ \ch{3F}&{Undertie}&13&
+ \ch{42}&{Asterism}&13\\
+ \ch{44}&{Fraction slash}&AJ&
+ \ch{47}&{Double question mark}&13\\
+ \ch{48}&{Question exclamation mark}&13&
+ \ch{49}&{Exclamation question mark}&13\\
+ \ch{51}&{Two asterisks aligned vertically}&13
+\end{tabular}
+\end{table}
+%<*en>
\item[Range~4${}^{\text{A}}$] Characters usually not in Japanese fonts. This range consists
of almost all Unicode blocks which are not in other
predefined ranges. Hence, instead of showing the block list,
- we put the definition of this range itself:
+ we put the definition of this range itself.
%</en>
%<*ja>
\item[範囲4${}^{\text{A}}$] 通常和文フォントには含まれていない文字.
この範囲は他の範囲にないほとんど全てのUnicodeブロック
で構成されている.したがって,ブロックのリストを示す
- 代ã\82\8fã\82\8aã\81«ï¼\8cç¯\84å\9b²ã\81®å®\9a義ã\81\9dã\81®ã\82\82ã\81®ã\82\92示ã\81\99ï¼\9a
+ 代ã\82\8fã\82\8aã\81«ï¼\8cç¯\84å\9b²ã\81®å®\9a義ã\81\9dã\81®ã\82\82ã\81®ã\82\92示ã\81\99ï¼\8e
%</ja>
-\begin{lstlisting}
+\begin{lstlisting}[escapechar=\!]
\ltjdefcharrange{4}{%
"500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
"2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A95F, "A980-"ABFF, "E000-"F8FF,
"FB00-"FE0F, "FE20-"FE2F, "FE70-"FEFF, "10000-"1AFFF, "1B170-"1F0FF,
- "1F300-"1FFFF
+ "1F300-"1FFFF, ... !\rmfamily (and characters in \texttt{U+2000}--\texttt{U+206F} which are not in range 9)!
} % non-Japanese
\end{lstlisting}
%<en>\item[Range~5${}^{\text{A}}$] Surrogates and Supplementary Private Use Areas.
"{1F}100--"{1F}1FF&Enclosed Alphanumeric Supp.&
"{1F}200--"{1F}2FF&Enclosed Ideographic Supp.\\
"{20}000--"{2F}FFF&(Supp. Ideographic Plane)&
+"{30}000--"{3F}FFF&(Tert. Ideographic Plane)\\
"{E0}100--"{E0}1EF&Variation Selectors Supp.
\end{tabular}
\end{table}
%<*en>
-\item[Range~7${}^{\text{\kern.1emJ}}$] Characters used in CJK languages, but not included in Adobe-Japan1-6.
+\item[Range~7${}^{\text{\kern.1emJ}}$] Characters used in CJK languages, but not included in Adobe-Japan1-7.
The block list is indicated in \autoref{tab:rng7}.
%</en>
%<*ja>
-\item[範囲7${}^{\text{\kern.1emJ}}$] CJK言語で用いられる文字のうち,Adobe-Japan1-6に
+\item[範囲7${}^{\text{\kern.1emJ}}$] CJK言語で用いられる文字のうち,Adobe-Japan1-7に
含まれていないもの.
ブロックのリストは\autoref{tab:rng7}に示す.
%</ja>
\end{LTXexample}
%</ja>
+%<*ja>
+\paragraph{絵文字など,複数コードポイントの列で表現される字形をを利用する場合の注意}
+(\Pkg{luaotfload}による)OpenType機能や合字等の処理は,\LuaTeX-jaが
+段落・水平ボックスの中身全体に対して「この文字は\textbf{JAchar}だから和文フォントで組む」と
+フォントを置き換えた後に適用される.
+そのため,異体字セレクタや絵文字といった複数のコードポイントの列で表現される文字を
+組む場合には,列全体で\textbf{JAchar}の範囲か\textbf{ALchar}の範囲かが
+統一されていないといけない.
+
+例えば,CJK統合漢字(とその拡張達)と
+IVS用の異体字セレクタ(\texttt{U+E0100}--\texttt{U+E01EF})は標準では
+どちらも同じ文字範囲6であるため,(フォントがサポートしていれば)IVSは正しく機能する.
+しかし,下の例のように異体字セレクタを\textbf{ALchar}の文字範囲(4)に移動させると,
+IVSは機能しなくなる:
+\ltjdefcharrange{4}{"E0100-"E01EF}
+\begin{LTXexample}
+\ltjdefcharrange{4}{"E0100-"E01EF}
+葛󠄀城市,葛󠄁飾区,葛西
+\end{LTXexample}
+\ltjdefcharrange{6}{"E0100-"E01EF}
+
+また,標準では絵文字として使われる可能性が大きい一部の文字が\textbf{JAchar}となっている
+\footnote{同じUnicodeブロック内にAdobe-Japan1-6の文字があったため.}.
+絵文字を用いる場合にはこの点に留意する必要がある.
+
+\begin{center}
+ \begin{minipage}{.5\textwidth}\small\ttfamily
+\verb!\ltjsetparameter{jacharrange={+3}}!\\
+\verb!\font\nce=NotoColorEmoji.ttf:mode=harf\nce!\\
+\IVSA 1F469\UCSB{ZW}{J}\UCSA 2764\UCSB{VS}{16}\UCSB{ZW}J\IVSA 1F48B\UCSB{ZW}J\IVSA 1F468\
+ \textcolor{green}{\% U+2764: JAchar}\\
+\verb!\ltjsetparameter{jacharrange={-3}}!\\
+\IVSA 1F469\UCSB{ZW}{J}\UCSA 2764\UCSB{VS}{16}\UCSB{ZW}J\IVSA 1F48B\UCSB{ZW}J\IVSA 1F468\
+ \textcolor{green}{\% U+2764: ALchar}
+ \end{minipage}%
+ \begin{minipage}{.5\textwidth}
+\ltjsetparameter{jacharrange={+3}}
+\font\nce=NotoColorEmoji.ttf:mode=harf\nce
+👩❤️💋👨
+\ltjsetparameter{jacharrange={-3}}
+👩❤️💋👨
+ \end{minipage}
+\end{center}
+\ltjsetparameter{jacharrange={+3}}
+%</ja>
+
%<en>\subsection{\Param{kanjiskip} and \Param{xkanjiskip}}
%<ja>\subsection{\Param{kanjiskip}と\Param{xkanjiskip}}
It is not desirable that \Param{xkanjiskip} is inserted into every
boundary between \textbf{JAchar}s and \textbf{ALchar}s. For example,
\Param{xkanjiskip} should not be inserted after opening parenthesis
-(\textit{e.g.}, compare ``(あ'' and ``(\hskip\ltjgetparameter{xkanjiskip}あ'').
+(\textit{e.g.}, compare ``(あ'' and ``(\+あ'').
\LuaTeX-ja can control whether \Param{xkanjiskip} can be inserted
before/after a character, by changing \Param{jaxspmode} for \textbf{JAchar}s and
\Param{alxspmode} parameters \textbf{ALchar}s respectively.
%<*ja>
\Param{xkanjiskip}がすべての\textbf{JAchar}と\textbf{ALchar}の境界に
挿入されるのは望ましいことではない.例えば,\Param{xkanjiskip}は開き括弧の
-後には挿入されるべきではない(「(あ」と「(\hskip\ltjgetparameter{xkanjiskip}あ」を
+後には挿入されるべきではない(「(あ」と「(\+あ」を
比べてみよ).
\LuaTeX-jaでは\Param{xkanjiskip}をある文字の前/後に挿入するかどうかを,
\textbf{JAchar}に対しては\Param{jaxspmode}を,\textbf{ALchar}に対しては
%<en>\subsection{Shifting the baseline}
%<ja>\subsection{ベースラインの移動}
+\label{ssec:baseline}
%<*en>
To make a match between a Japanese font and an alphabetic font, sometimes
shifting of the baseline of one of the pair is needed. In \pTeX, this is achieved
\paragraph{数式における挙動:\pTeX との違い}
\textbf{ALchar}のベースラインを補正する\Param{yalbaselineshift}, \Param{talbaselineshift}パラメータは
ほぼ\pTeX における \cs{ybaselineshift}, \cs{tbaselineshift} に対応しているものであるが,
-数式中の挙動は異なっているので注意が必要である.
-例えば,\autoref{tab:math_bsa}のように,数式中に明示的に現れた \cs{hbox},~\cs{vbox} は,横組において
+数式中の挙動は異なっているので注意が必要である(\autoref{tab:math_bsa}参照).
\begin{itemize}
- \item 2015年以前の\pTeX では,ボックス全体が \cs{ybaselineshift} だとシフトされるので,
- \autoref{tab:math_bsa}中の``い''のように,ボックス中の和文文字は
- \ \cs{ybaselineshift} だけシフトされ,一方,``for all''のように,
- ボックス内の欧文文字は2重にシフトされることになる.
- \item 一方,\LuaTeX-jaではそのようなことはおこらず,
- 数式中に明示的に現れた \cs{hbox},~\cs{vbox} はシフトしない.そのため,
- \autoref{tab:math_bsa}中の``い''も``for all''も,それぞれ本文中に
- 書かれたときと同じ上下位置に組まれる.
-
- なお,\TeX~Live~2016以降の\pTeX では改修がなされ,\LuaTeX-jaと
- 近い挙動になるようにしているが,数式中に直に書かれた``あ''のベースラインについては
- まだ違いが見られる.
+ \item バージョン20221002.0以降では,
+ \pTeX~4.0.0と同様に数式が\Param{yalbaselineshift}だけシフトされる.
+
+ しかしそれでは数式中に直に書かれた\cs{hbox},~\cs{vbox}中の欧文には
+ \Param{yalbaselineshift}が二重に適用されることになるので,
+ 数式中に直に書かれた\cs{hbox},~\cs{vbox}には
+ \Param{yalbaselineshift}を打ち消す補正をしている.
+
+ なお,\cs{vcenter}によるボックスにはこの「打ち消す補正」は行われないので注意.
+\item \pTeX では数式のスタイルごとに「打ち消す補正」の割合を\cs{textbaselineshiftfactor},
+ \cs{scriptbaselineshiftfactor}, \cs{scriptscriptbaselineshiftfactor}で
+ 指定できるようにしたが,\LuaTeX-jaでは2番の数式ファミリ(\cs{fam2})に使われているフォントの
+ 大きさから自動で計算する.
+
+\item 数式中に直に書かれた和文文字(\autoref{tab:math_bsa}中の``あ'')については
+ \pTeX と\LuaTeX-jaで違いが見られる.
+ \pTeX では,欧文文字と変わらず欧文ベースライン補正(\cs{ybaselineshift})がかかり,
+ また周囲に和欧文間空白(\cs{xkanjiskip})が入りうる.
+ その一方,\LuaTeX-jaでは「和文ベースライン補正(\Param{yjabaselineshift})がかかる」見た目に
+ なり,また周囲に和欧文間空白は入らない.
\end{itemize}
-
-なお,バージョン20170401.0以降の\LuaTeX-jaでは,\cs{vcenter} によるボックスには
-全体が\Param{yalbaselineshift}, \Param{talbaselineshift} パラメータが反映されるようにしている.
-その方が結果が自然であることによる変更なのだが,結果的に\cs{vcenter} については\pTeX と同じ挙動となった.
-
\begin{table}
\small\centering
\caption{数式関係のベースライン補正($\Param{yalbaselineshift}=10\,\textrm{pt}$)}
\label{tab:math_bsa}
\newdimen\origbaselineskip
\origbaselineskip=\baselineskip
-\begin{tabular}{lp{30\zw}}
+\begin{tabular}{lp{35\zw}}
\toprule
\emph{入力}&\vspace*{\dimexpr-\origbaselineskip-\smallskipamount}
\begin{lstlisting}
数式abc: $あa\hbox{い}$, $\int_0^x t\,dt=x^2/2$,
-$\Phi\vdash F(x)\ \hbox{for all}\ x\in A$
+$\Phi\vdash F(x)\ \hbox{for all}\ x\in A$,
+$\sqrt{A}-\underline{X}+\frac{あ3}{2あ}-\vcenter{\hbox{aお}}$
\end{lstlisting}\\
\noalign{\vskip-\origbaselineskip}
\midrule
-\emph{\pTeX~(--2015)}&
+\emph{\pTeX~(p4.0.0)}&
{\ltjsetparameter{yalbaselineshift=10pt}%
-数式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}\\\noalign{\vskip-\origbaselineskip}\midrule
-\emph{\pTeX~(2016--)}&
-{\ltjsetparameter{yalbaselineshift=10pt}%
-数式abc: $\lower10pt\hbox{あ}a\hbox{い}$, $\int_0^x t\,dt=x^2/2$,
+\protected\def\>{\hskip\ltjgetparameter{xkanjiskip}}
+数式abc: $\lower10pt\hbox{あ}\>a\hbox{い}$, $\int_0^x t\,dt=x^2/2$,
$\Phi\vdash F(x)\ \hbox{for all}\ x\in A$
+$\sqrt{A}-\underline{X}
+ +\frac{\lower10pt\hbox{\scalebox{0.7}{あ}}\>3}{2\>\lower10pt\hbox{\scalebox{0.7}{あ}}}-\vcenter{\hbox{aお}}$
\par}\\\noalign{\vskip-\origbaselineskip}\midrule
\emph{\LuaTeX-ja}&
{\ltjsetparameter{yalbaselineshift=10pt}%
数式abc: $あa\hbox{い}$, $\int_0^x t\,dt=x^2/2$,
-$\Phi\vdash F(x)\ \hbox{for all}\ x\in A$
+$\Phi\vdash F(x)\ \hbox{for all}\ x\in A$,
+$\sqrt{A}-\underline{X}+\frac{あ\>3}{2あ}-\vcenter{\hbox{aお}}$
\par}\\
\noalign{\vskip-\origbaselineskip}
\bottomrule
``ア'', not 20.
%</en>
%<*ja>
-\subsection{禁則処理関連パラメータとOpenTypeのfont feature}
+\subsection{禁則処理関連パラメータとOpenType機能}
禁則処理や \Param{kanjiskip}, \Param{xkanjiskip} の挿入に関連したパラメータのうち
\begin{quote}
\Param{jaxspmode},~\Param{alxspmode}, \Param{prebreakpenalty},
は,文字コードごとに設定する量である.
\Pkg{fontspec}パッケージを使う(\ref{ssec:fontspec}節)場合など,
-各種のOpenType featureを適用することもあると思うが,前段落に述べたパラメータ類は,
-\emph{OpenType featureの適用前の文字コードによって適用される.}
+各種のOpenType機能を適用することもあると思うが,前段落に述べたパラメータ類は,
+\emph{OpenType機能の適用前の文字コードによって適用される.}
例えば,以下の例において10行目の「ア」は,\verb+hwid+ featureの適用により半角カタカナの「ア」
に置き換わる.しかし,その直後に挿入される \Param{postbreakpenalty}は,置換前の「ア」に対する値10である.
%</ja>
%</ja>
%<*en>
-Default setting of \cs{catcode} of Unicode characters are located in
-\begin{description}
- \item[plain \LuaTeX] \texttt{luatex-unicode-letters.tex}, which is based on \texttt{unicode-letters.tex}
-(for \XeTeX).
- \item[\LuaLaTeX] now included in \LaTeX\ kernel as~\texttt{unicode-letters.def}.
-\end{description}
-However, the default setting of \cs{catcode} differs
-between \XeTeX\ and \LuaTeX, by the following reasons:
-\begin{itemize}
- \item (plain format) \texttt{luatex-unicode-letters.tex} is based on old \texttt{unicode-letters.tex}.
- \item The latter half of \texttt{unicode-letters.tex}~and~\texttt{unicode-letters.def}
-sets\cs{catcode} of several characters to 11, via setting \cs{XeTeXcharclass}.
-However, this latter half does not exist (plain case), or not executed (\LaTeX~case) in \LuaTeX.
-\end{itemize}
-In other words,
-\begin{description}
-\item[plain \LuaTeX]
-Kanji nor kana characters cannot be used in
-a control word, in the default setting of plain \LuaTeX.
-\item[\LuaLaTeX]
-In recent (2015-10-01 or later) \LuaLaTeX, Kanji and kana characters in a control word is supported (these catcode are 11),
-but not fullwidth alphanumerics and several other characters.
-\end{description}
-
-This would be inconvenient for \pTeX~users to shifting to \LuaTeX-ja,
-since several control words containing Kanji or other fullwidth characters, such as
-\verb+\西暦+~or~\verb+\1年目西暦+ are used in \pTeX.
-Hence, \LuaTeX-ja have a counterpart of \texttt{unicode-letters.tex}
-for \LuaTeX, \emph{to match the \cs{catcode} setting with that of \XeTeX.}
+Default setting of \cs{catcode} of Unicode characters with \LuaTeX\ is slightly inconvenient
+for \pTeX~users to shifting to \LuaTeX-ja,
+because several fullwidth characters which can be used in a control word with \pTeX,
+such as ``\texttt{1}''~(FULLWIDTH DIGIT ONE), cannnot be used in a control word with \LuaTeX.
+Hence, \LuaTeX-ja changes the \cs{catcode} of some characters%
+---whose line breaking class is ``ID''~(Ideographic) in UAX~\#14---,
+to allow these characters in the control word.
%</en>
%<*ja>
-ネイティブにUnicode全部の文字を扱える\XeTeX や\LuaTeX では,
-文字が制御綴内で使用できるかは通常の欧文文字と同じく\cs{catcode}%
-で指定することとなる.plain \XeTeX における\cs{catcode}の初期設定は%
-\texttt{unicode-letters.tex}中に記述されており,plain \LuaTeX ではそれを
-元にした\texttt{luatex-unicode-letters.tex}を用いている.
-\LaTeX では\cs{catcode}の設定はカーネルに\texttt{unicode-letters.def}として統合され.
-このファイルを\XeLaTeX, \LuaLaTeX の両方が用いている.
+最近の(2015-10-01以降の)\LuaLaTeX では漢字や仮名を制御綴内に
+使用することが可能であるが,全角英数字は使用できない.
+これでは\pTeX で使用できた\cs{1年目西暦}\footnote{科研費\LaTeX で使用されているそうです.}などが使えないため,
+\LuaTeX-jaへの移行で手間が生じることになる.
-だが,\XeTeX における\cs{catcode}の初期設定と
-\LuaTeX におけるそれは一致していない:
-\begin{itemize}
- \item \texttt{luatex-unicode-letters.tex} の元になった
- \texttt{unicode-letters.tex}が古い
- \item \texttt{unicode-letters.tex} 後半部や\texttt{unicode-letters.def}後半部では
-\cs{XeTeXcharclass}の設定を行なっており,
-それによって漢字や仮名,および全角英数字の\cs{catcode}が11に設定されている.
-しかし,\texttt{luatex-unicode-letters.tex}ではこの「後半部」が
-まるごと省略されており,また\LuaLaTeX でも\texttt{unicode-letters.def}後半部は実行されな
- い.
-\end{itemize}
-言い換えると,
-\begin{description}
- \item[plain \LuaTeX] 漢字や仮名を制御綴内に
-使用することはできない.
- \item[\LuaLaTeX] 最近の(2015-10-01以降の)
-\LuaLaTeX では漢字や仮名を制御綴内に
-使用することが可能になったが,全角英数字は相変わらず使用できない,
-\end{description}
-これでは\pTeX で使用できた\verb+\1年目西暦+\footnote{科研費\LaTeX で使用されているそうです.}などが使えないこととなり,
-\LuaTeX-jaへの移行で手間が生じる.そのため,\LuaTeX-jaでは
-\texttt{unicode-letters.tex}の後半部にあたる内容を自前でパッチし,
-結果として\emph{\XeTeX における初期設定と同じになるようにしている.}
+そのため,\LuaTeX-jaでは全角英数字など一部の文字
+\footnote{正確には,Unicodeの行分割アルゴリズム(UAX~\#14)で``ID''~(Ideographic)と指定されている文字.}の
+\cs{catcode}を11に変更し,これらの文字を制御綴中で使用可能にしている.
%</ja>
\begin{table}
\def\D#1#2#3#4{%
{\fboxsep0pt\fcolorbox{cyan}{white}%
{\large\char"#1#2#3#4}}\ (\texttt{U+#1#2#3#4})} %"
-\leavevmode\hbox to 0pt{\hss\begin{tabular}{cccccc}
+\leavevmode\hbox to 0pt{\hss\begin{tabular}[t]{cccccc}
\toprule
%<en>&\textbf{row}&\textbf{col.}&\textbf{\pTeX}&\textbf{\upTeX}&\textbf{\LuaTeX-ja}\\
%<ja>&\emph{区}&\emph{点}&\emph{\pTeX}&\emph{\upTeX}&\emph{\LuaTeX-ja}\\
\D FF3E&1&16&N&N&Y\\
\D FFE3&1&17&N&N&Y\\
\D FF3F&1&18&N&N&Y\\
-%\D 30FD&1&19&N&Y&Y\\
-%\D 30FE&1&20&N&Y&Y\\
-%\D 309D&1&21&N&Y&Y\\
-%\D 309E&1&22&N&Y&Y\\
+\D 30FD&1&19&N&Y&Y\\
+\D 30FE&1&20&N&Y&Y\\
+\D 309D&1&21&N&Y&Y\\
+\D 309E&1&22&N&Y&Y\\
\D 3003&1&23&N&N&Y\\
\D 4EDD&1&24&N&Y&Y\\
\D 3005&1&25&N&N&Y\\
\D 3006&1&26&N&N&Y\\
\D 3007&1&27&N&N&Y\\
\D 30FC&1&28&N&Y&Y\\
-\D FF0F&1&31&N&N&Y\\
-\D FF3C&1&32&N&N&Y\\
\bottomrule
\end{tabular}\qquad
-\begin{tabular}{cccccc}
+\begin{tabular}[t]{cccccc}
\toprule
%<en>&\textbf{row}&\textbf{col.}&\textbf{\pTeX}&\textbf{\upTeX}&\textbf{\LuaTeX-ja}\\
%<ja>&\emph{区}&\emph{点}&\emph{\pTeX}&\emph{\upTeX}&\emph{\LuaTeX-ja}\\
\midrule
+\D FF0F&1&31&N&N&Y\\
+\D FF3C&1&32&N&N&Y\\
+\D FF5E&1&33&N&N&Y\\
\D FF5C&1&35&N&N&Y\\
\D FF0B&1&60&N&N&Y\\
\D FF1D&1&65&N&N&Y\\
%<*en>
\subsection{Non-kanji characters in a control word}
+{\def\D#1{%
+ {\fboxsep0pt\fcolorbox{cyan}{white}{#1}}}%
Because the engine differ, so non-kanji JIS~X~0208 characters
which can be used in a control word differ in \pTeX, in \upTeX,~and~in \LuaTeX-ja.
\autoref{tab:kcat-diff} shows the difference.
-Except for four characters ``・'',~``゛'', ``゜'',~``゠'',
-\LuaTeX-ja admits more characters in a control word than \upTeX.
+Except for three characters \D{・},~\D{゛},~and~`\D{゜},
+\LuaTeX-ja admits more characters in a control word than \upTeX.}
Difference becomes larger, if we consider
non-kanji JIS~X~0213 characters.
エンジンが異なるので,\pTeX, \upTeX, \LuaTeX-ja
において制御綴中に使用可能なJIS~X~0208の文字は異なる.
異なっているところだけを載せると,\autoref{tab:kcat-diff}のようになる.
-ã\80\8cã\83»ã\80\8dã\80\8cã\82\9bã\80\8dã\80\8cã\82\9cã\80\8dã\80\8cã\82 ã\80\8dã\82\92é\99¤ã\81\91ã\81°ï¼\8c\LuaTeX-jaã\81§ã\81¯\upTeX ã\82\88ã\82\8aå¤\9aã\81\8fã\81®æ\96\87å\97ã\81\8c
+「・」「゛」「゜」を除けば,\LuaTeX-jaでは\upTeX より多くの文字が
制御綴に使用可能になっている.
JIS~X~0213の範囲に広げると,差異はさらに大きくなる.
%
\put(4,7.2){\line(0,1){1.8}}
\put(11,7.2){\line(0,1){1.8}}
- \put(8,8){\vector(-1,0){0.5}\vector(1,0){3}}
- \put(7,8){\vector(-1,0){3}\vector(1,0){0.5}}
+ \put(8,8){\vector(-1,0){0.5}}\put(8,8){\vector(1,0){3}}
+ \put(7,8){\vector(-1,0){3}}\put(7,8){\vector(1,0){0.5}}
\put(9.25,8.2){\makebox(0,0)[b]{$H_{\mathrm{T}}$}}
\put(5.75,8.2){\makebox(0,0)[b]{$D_{\mathrm{T}}$}}
%
%
\put(4,7.2){\line(0,1){1.8}}
\put(11,7.2){\line(0,1){1.8}}
- \put(7.5,8){\vector(-1,0){3.5}\vector(1,0){3.5}}
+ \put(7.5,8){\vector(-1,0){3.5}}\put(7.5,8){\vector(1,0){3.5}}
\put(13,8){\vector(-1,0){2}}
\put(7.5,8.2){\makebox(0,0)[b]{$H_{\mathrm{D}}$}}
\put(12,8.2){\makebox(0,0)[b]{$D_{\mathrm{D}}$}}
\put(11.2,0){\line(1,0){3.8}}
%
\put(2,7){\line(1,0){1.8}}
- \put(3,3.5){\vector(0,1){3.5}\vector(0,-1){3.5}}
+ \put(3,3.5){\vector(0,1){3.5}}\put(3,3.5){\vector(0,-1){3.5}}
\put(2.8,3.5){\makebox(0,0)[r]{$H_{\mathrm{Y}}$}}
\put(3,-2){\vector(0,1){2}}
\put(2.8,-1){\makebox(0,0)[r]{$D_{\mathrm{Y}}$}}
%
\put(4,7.2){\line(0,1){1.8}}
\put(11,7.2){\line(0,1){1.8}}
- \put(6.5,8){\vector(-1,0){2.5}\vector(1,0){2.5}}
- \put(10,8){\vector(-1,0){1}\vector(1,0){1}}
+ \put(6.5,8){\vector(-1,0){2.5}}\put(6.5,8){\vector(1,0){2.5}}
+ \put(10,8){\vector(-1,0){1}}\put(10,8){\vector(1,0){1}}
\put(10,8.2){\makebox(0,0)[b]{$H_{\mathrm{T}}$}}
\put(6.5,8.2){\makebox(0,0)[b]{$D_{\mathrm{T}}$}}
%
%
\put(4,7.2){\line(0,1){1.8}}
\put(11,7.2){\line(0,1){1.8}}
- \put(5,8){\vector(-1,0){1}\vector(1,0){1}}
- \put(8.5,8){\vector(-1,0){2.5}\vector(1,0){2.5}}
+ \put(5,8){\vector(-1,0){1}}\put(5,8){\vector(1,0){1}}
+ \put(8.5,8){\vector(-1,0){2.5}}\put(8.5,8){\vector(1,0){2.5}}
\put(5,8.2){\makebox(0,0)[b]{$H_{\mathrm{D}}$}}
\put(8.5,8.2){\makebox(0,0)[b]{$D_{\mathrm{D}}$}}
%
one have to use the following commands instead of \cs{wd} wtc.
\begin{cslist}
- \item[\cs{ltjgetwd}<num>\textrm{, }\cs{ltjgetht}<num>\textrm{, }%
- \cs{ltjgetdp}<num>]
-These commands return \emph{an internal dimension} of \cs{box<num>} with respect to
+ \item[\cs{ltjgetwd}\meta{num}\textrm{, }\cs{ltjgetht}\meta{num}\textrm{, }%
+ \cs{ltjgetdp}\meta{num}]
+These commands return \emph{an internal dimension} of \cs{box\meta{num}} with respect to
the current direction. One can use these in \cs{dimexpr} primitive, as the followings.
\begin{lstlisting}
\dimexpr 2\ltjgetwd42-3pt\relax, \the\ltjgetwd1701
\the\ltjgetht32767, \\ \the\ltjgetdp32767.}
\end{LTXexample}
- \item[\cs{ltjsetwd}<num>=<dimen>\textrm{, }\cs{ltjsetht}<num>=<dimen>\textrm{, }%
- \cs{ltjsetdp}<num>=<dimen>]
-These commands set the dimension of \cs{box<num>}. One does not need
- to group the argument <num>; four calls of \cs{ltjsetwd} below have the same meaning.
+ \item[\cs{ltjsetwd}\meta{num}=\meta{dimen}\textrm{, }\cs{ltjsetht}\meta{num}=\meta{dimen}\textrm{, }%
+ \cs{ltjsetdp}\meta{num}=\meta{dimen}]
+These commands set the dimension of \cs{box\meta{num}}. One does not need
+ to group the argument \meta{num}; four calls of \cs{ltjsetwd} below have the same meaning.
\begin{lstlisting}
\ltjsetwd42 20pt, \ltjsetwd42=20pt, \ltjsetwd=42 20pt, \ltjsetwd=42=20pt
\end{lstlisting}
%</en>
%<*ja>
\paragraph{\cs{wd} 達と組方向}
-ボックスレジスタ \cs{box}<num> にセットされているボックスの幅・高さ・深さの取得や
+ボックスレジスタ \cs{box}\meta{num} にセットされているボックスの幅・高さ・深さの取得や
変更にはそれぞれ \cs{wd},~\cs{ht},~\cs{dp} プリミティブを用いるのであった.
\pTeX ではこれらのプリミティブは,「現在の組方向におけるボックスの寸法」を指すもので,
-同じボックスに対しても現在の組方向によって返る値は異なるもであった.
+å\90\8cã\81\98ã\83\9cã\83\83ã\82¯ã\82¹ã\81«å¯¾ã\81\97ã\81¦ã\82\82ç\8f¾å\9c¨ã\81®çµ\84æ\96¹å\90\91ã\81«ã\82\88ã\81£ã\81¦è¿\94ã\82\8bå\80¤ã\81¯ç\95°ã\81ªã\82\8bã\82\82ã\81®ã\81§ã\81\82ã\81£ã\81\9fï¼\8e
\LuaTeX-jaにおいては状況が異なり,\cs{wd},~\cs{ht},~\cs{dp} が返す値は
現在の組方向には依存しない.下の例のように,横組のボックスが格納されていれば
\begin{cslist}
- \item[\cs{ltjgetwd}<num>\textrm{, }\cs{ltjgetht}<num>\textrm{, }%
- \cs{ltjgetdp}<num>]
+ \item[\cs{ltjgetwd}\meta{num}\textrm{, }\cs{ltjgetht}\meta{num}\textrm{, }%
+ \cs{ltjgetdp}\meta{num}]
現在の組方向に応じたボックスの寸法の取得を行う.結果は内部長さであるため,
\begin{lstlisting}
\dimexpr 2\ltjgetwd42-3pt\relax, \the\ltjgetwd1701
\end{lstlisting}
-のように \cs{wd}<num> の代わりとして扱うことができる.
+のように \cs{wd}\meta{num} の代わりとして扱うことができる.
使用例は以下の通りである.
\begin{LTXexample}[width=0.3\textwidth]
\parindent0pt
\the\ltjgetht32767, \\ \the\ltjgetdp32767.}
\end{LTXexample}
- \item[\cs{ltjsetwd}<num>=<dimen>\textrm{, }\cs{ltjsetht}<num>=<dimen>\textrm{, }%
- \cs{ltjsetdp}<num>=<dimen>]
+ \item[\cs{ltjsetwd}\meta{num}=\meta{dimen}\textrm{, }\cs{ltjsetht}\meta{num}=\meta{dimen}\textrm{, }%
+ \cs{ltjsetdp}\meta{num}=\meta{dimen}]
現在の組方向に応じたボックスの寸法の設定を行う.\cs{afterassignment} を2回利用して
実装しているので,次の4通りは全て同じ意味である.
\begin{lstlisting}
\ltjsetwd42 20pt, \ltjsetwd42=20pt, \ltjsetwd=42 20pt, \ltjsetwd=42=20pt
\end{lstlisting}
-設定値は「横組」「縦組及びutod方向」「dtou方向」
+設定値は「横組」「縦組またはutod方向」「dtou方向」
の3種ごとに独立して記録される.参考として,Gitリポジトリ内の
\verb+test/test55-boxdim_diffdir.{tex,pdf}+ を挙げておく.
%<*en>
\subsection{Getting current direction}
The \Param{direction} parameter returns the current direction, and
-the \Param{boxdir} parameter (with the argument <num>)
-returns the direction of a box register \cs{box}<num>.
+the \Param{boxdir} parameter (with the argument \meta{num})
+returns the direction of a box register \cs{box}\meta{num}.
The returned value of these parameters are a \emph{string}:
\begin{center}
\small
%</en>
%<*ja>
\subsection{組方向の取得}
-「現在の組方向」や「<num>番のボックスの組方向」は,
-\pTeX では \cs{ifydir} や \cs{ifybox}<num> といった条件判断文を使って
+「現在の組方向」や「\meta{num}番のボックスの組方向」は,
+\pTeX では \cs{ifydir} や \cs{ifybox}\meta{num} といった条件判断文を使って
判断することができた.
しかし,\LuaTeX-jaはあくまでも\TeX マクロとLuaコードで
記述されており,それでは新たな条件判断命令を作るのは難しい.
\LuaTeX-jaでは,\Param{direction}パラメータで現在の組方向を,
-\Param{boxdir}パラメータ(と追加の引数<num>)によって
-\cs{box}<num>の組方向をそれぞれ取得できるようにした.
+\Param{boxdir}パラメータ(と追加の引数\meta{num})によって
+\cs{box}\meta{num}の組方向をそれぞれ取得できるようにした.
戻り値は文字列である:
\begin{center}
\small
%</ja>
%<*en>
-\subsection{Overridden box primitives}
-To cope with multiple directions, the following primitives are
-overridden by \LuaTeX-ja, using~\verb+\protected\def+.
+\section{Redefined primitives by \LuaTeX-ja}
+The following primitives are redefined by \LuaTeX-ja (using~\verb+\protected\def+),
+for supporting Japanese typesetting and multiple directions:
\begin{cslist}[style=standard]
- \item[\cs{unhbox}<num>\textrm{, }\cs{unvbox}<num>\textrm{, }\cs{unhcopy}<num>\textrm{, }\cs{unvcopy}<num>]
- \item[\cs{vadjust}\{<material>\}]
- \item[\cs{insert}<number>\{<material>\}]
+ \item[\cs{/}]
+ \item[\cs{unhbox}\meta{num}\textrm{, }\cs{unvbox}\meta{num}\textrm{, }\cs{unhcopy}\meta{num}\textrm{, }\cs{unvcopy}\meta{num}]
+ \item[\cs{vadjust}\{\meta{material}\}]
+ \item[\cs{insert}\meta{number}\{\meta{material}\}]
\item[\cs{lastbox}]
- \item[\cs{raise}<dimen><box>\textrm{, }\cs{lower}<dimen><box>\textrm{\ etc., }\cs{vcenter}]
- \item[\cs{vcenter}]
+ \item[\cs{raise}\meta{dimen}\meta{box}\textrm{, }\cs{lower}\meta{dimen}\meta{box}\textrm{, }
+ \cs{moveleft}\meta{dimen}\meta{box}\textrm{, }\cs{moveright}\meta{dimen}\meta{box}\textrm{, }]
+ \item[\cs{split}\meta{number}to\meta{dimen}\textrm{, }\cs{vcenter}\{\meta{material}\}]
\end{cslist}
+
+On each primitive \cs{\meta{primitive}} in the list above,
+its meaning just before loading \LuaTeX-ja is backed up into \cs{ltj@@orig@\meta{primitive}},
+and the meaning after redefinition by \LuaTeX-ja is stored in \cs{ltj@@\meta{primitive}}.
+For example, \autoref{fig:primitive_meaning} shows the situation of \cs{vadjust} primitive.
%</en>
%<*ja>
-\subsection{プリミティブの再定義}
-異なる組方向に対応するために,以下に挙げるプリミティブは
-\LuaTeX-jaによる前処理もしくは後処理が行われるように
-\ \verb+\protected\def+ により再定義してある.
+\section{プリミティブの再定義}
+\LuaTeX-jaでは和文組版や異なる組方向に対応するために,以下に挙げるプリミティブは
+\ \verb+\protected\def+ により再定義を行っている.
\begin{cslist}
- \item[\cs{unhbox}<num>\textrm{, }\cs{unvbox}<num>\textrm{, }\cs{unhcopy}<num>\textrm{, }\cs{unvcopy}<num>]
+ \item[\cs{/}]
+ 和文フォントに対するイタリック補正のサポートが追加されている.
+ \item[\cs{unhbox}\meta{number}\textrm{, }\cs{unvbox}\meta{number}\textrm{, }\cs{unhcopy}\meta{number}\textrm{, }\cs{unvcopy}\meta{number}]
ボックスの組方向が現在のリストと異なる場合は事前にエラーメッセージを出力する.
- \pTeX と異なり,エラーを無視して無理矢理 \cs{unhbox}, \cs{unvbox} を
+ \pTeX と異なり,エラーを無視して無理矢理 \cs{unhbox}, \cs{unvbox} 等を
続行させることもできるが,その場合の組版結果は保証しない.
- \item[\cs{vadjust}\{<material>\}] 一旦プリミティブ本来の挙動を行う.その後,<material>の組方向が
+ \item[\cs{vadjust}\{\meta{material}\}] 一旦プリミティブ本来の挙動を行う.その後,\meta{material}の組方向が
周囲の垂直リストの組方向と一致しない場合にエラーを出力し,
該当の \cs{vadjust} を無効にする.
- \item[\cs{insert}<number>\{<material>\}]
- 一旦プリミティブ本来の挙動を行い,その後<material>内の各ボックス・罫線の直前に組方向を示
+ \item[\cs{insert}\meta{number}\{\meta{material}\}]
+ 一旦プリミティブ本来の挙動を行い,その後\meta{material}内の各ボックス・罫線の直前に組方向を示
すdirection whatsitを挿入する.
\item[\cs{lastbox}] ボックスの「中身」を現在の組方向に合わせるためのノード
(\textit{dir\_box}という)を必要ならば除去し,
正しく「中身」のボックスが返されるように前処理をする.
- \item[\cs{raise}<dimen><box>\textrm{, }\cs{lower}<dimen><box>\textrm{\ etc., }\cs{vcenter}]
- 一方,こちらでは必要に応じて\textit{dir\_box}を作成する前処理を追加している.
+ \item[\cs{raise}\meta{dimen}\meta{box}\textrm{, }\cs{lower}\meta{dimen}\meta{box}\textrm{, }
+ \cs{moveleft}\meta{dimen}\meta{box}\textrm{, }\cs{moveright}\meta{dimen}\meta{box}\textrm{, }]
+ \leavevmode\vspace{-\baselineskip}
+ \item[\cs{split}\meta{number}to\meta{dimen}\textrm{, }\cs{vcenter}\{\meta{material}\}]
+ これらのプリミティブについては必要に応じて\textit{dir\_box}を作成する前処理を追加している.
\end{cslist}
+
+上記の一覧中にあるプリミティブ\cs{\meta{primitive}}については,
+\LuaTeX-ja読み込み前の意味が\cs{ltj@@orig@\meta{primitive}}に,
+そして\LuaTeX-jaによる再定義後の意味が\cs{ltj@@\meta{primitive}}に保存される.
+例えば,\cs{vadjust}については\autoref{fig:primitive_meaning}のようになっている.
%</ja>
+\begin{figure}
+\begin{LTXexample}[width=.55\textwidth]
+\makeatletter\scriptsize\ttfamily
+\meaning\vadjust \\ % current
+\meaning\ltj@@vadjust \\ % LuaTeX-ja
+\meaning\ltj@@orig@vadjust % original
+\end{LTXexample}
+\caption{Redefining \cs{vadjust} primitive by \LuaTeX-ja}
+\label{fig:primitive_meaning}
+\end{figure}
+
+%<*en>
+\subsection{Suppressing redefinitions}
+Sometimes redefining primitives by \LuaTeX-ja causes a problem.
+For example, the \Pkg{breqn} package~(v0.98k) assumes that \cs{vadjust}~and~\cs{insert} have
+their primitive meanings.
+So, this package cannot by loaded after \LuaTeX-ja by default.
+
+\LuaTeX-ja version~20210517.0 has features for that problem. Namely:
+\begin{itemize}
+ \item Primitives which is listed in \cs{ltj@stop@overwrite@primitive} are
+ retain their meanings at just before loading \LuaTeX-ja.
+ \item After loading \LuaTeX-ja,
+ one can specify primitives to \cs{ltj@overwrite@primitive}, to redefine them by \LuaTeX-ja.
+\end{itemize}
+See \autoref{fig:primitive_overwrite} for an example.
+%</en>
+%<*ja>
+\subsection{再定義の抑制}
+場合によっては\LuaTeX-jaによるプリミティブの再定義が不都合を起こすこともある.
+たとえば,\Pkg{breqn}パッケージ(少なくともv0.98k, 2020\nobreakdash-09\nobreakdash-24))は
+読み込み時に\cs{vadjust}, \cs{insert}がプリミティブのままであることを要請するので,
+このままでは\LuaTeX-jaの後で読み込むことはできない.
+
+この状況に対応するため,バージョン20210517.0以降では
+\begin{itemize}
+ \item 制御綴\cs{ltj@stop@overwrite@primitive}内に並べられたプリミティブは,
+ \LuaTeX-ja読み込み直前時の意味のままとなる.
+ \item \LuaTeX-ja読み込み後に
+ \cs{ltj@overwrite@primitive}に引数として与えたプリミティブを与えることで,
+ それらを「\LuaTeX-jaによって再定義する」際の意味に再定義する
+\end{itemize}
+機能を導入した.使用例については\autoref{fig:primitive_overwrite}を参照.
+%</ja>
+\begin{figure}
+\begin{lstlisting}
+\makeatletter
+\def\ltj@stop@overwrite@primitive{\insert\vadjust\/\unhbox\vcenter\fontseries}
+\makeatother
+ %% Keep the meaning of \insert, \vadjust, \/, \unhbox and \vcenter.
+ %% \fontseries will still be redefined by \LuaTeX-ja, because it is not primitive.
+\usepackage{luatexja}
+...
+\usepackage{breqn}
+...
+\makeatletter
+\ltj@overwrite@primitive\expandafter{\insert\vadjust\/\unhbox\vcenter}
+\makeatother
+ %% Redefine \insert, \vadjust, \/, \unhbox and \vcenter.
+\end{lstlisting}
+\caption{\cs{ltj@stop@overwrite@primitive} and \cs{ltj@overwrite@primitive}}
+\label{fig:primitive_overwrite}
+\end{figure}
%<en>\section{Font Metric and Japanese Font}
%<ja>\section{フォントメトリックと和文フォント}
TrueType/OpenTypeフォントにfeatureを指定したものを和文フォントとして用いる
ことができる:
%</ja>
-\begin{LTXexample}[width=0.3\textwidth]
-\jfont\tradgt={file:KozMinPr6N-Regular.otf:script=latn;%
+\begin{LTXexample}[width=0.25\textwidth]
+\jfont\tradmc={IPAexMincho:script=latn;%
+trad;-kern;jfm=ujis} at 14pt
-\tradgt 当/体/医/区
+\tradmc 当/体/医/区
\end{LTXexample}
%<*en>
+It is required to specify a (horizontal) \emph{JFM} in at each calling of \cs{jfont}.
+A JFM is a Lua script which contains
+measurements of characters and glues/kerns that are automatically
+inserted for Japanese typesetting.
+The structure of JFM will be described in the next subsection.
+%</en>
+%<*ja>
+\cs{jfont}命令の実行ごとにどの(横組用)JFMを用いるのかを指定する必要がある.
+JFMは文字の寸法情報と和文組版で自動的に挿入される
+グルー/カーンの寸法情報を持っているLuaスクリプトで,その構造は次の節で述べる.
+%</ja>
+
+%<*en>
Note that the defined control sequence
-(\cs{tradgt} in the example above) using \cs{jfont} is not a
+(\cs{tradmc} in the example above) using \cs{jfont} is not a
\textit{font\_def} token, but a macro.
-Hence the input like \verb+\fontname\tradgt+
+Hence the input like \verb+\fontname\tradmc+
causes a error. We denote control sequences which are defined in
-\cs{jfont} by <jfont\_cs>.
+\cs{jfont} by \meta{jfont\_cs}.
%</en>
%<*ja>
-なお,\cs{jfont} で定義された制御綴(上の例だと \cs{tradgt})
-は\textit{font\_def}トークンではなくマクロである.従って,\verb+\fontname\tradgt+ のような
+なお,\cs{jfont} で定義された制御綴(上の例だと \cs{tradmc})
+は\textit{font\_def}トークンではなくマクロである.従って,\verb+\fontname\tradmc+のような
入力はエラーとなる.以下では \cs{jfont} で定義された
-制御綴を<jfont\_cs>で表す.
+制御綴を\meta{jfont\_cs}で表す.
%</ja>
-\paragraph{JFM}
+%<en>\paragraph{Specifying JFM}
+%<ja>\paragraph{JFMの指定}
+%<en> The general scheme for specifying a JFM is the following:
+%<ja> JFMの一般的な指定は次のようになっている:
+\begin{quote}
+ \cs{jfont}\meta{jfont\_cs}\texttt{=...;jfm=}\meta{JFM name}[\texttt{/\{}\meta{JFM features}\texttt{\}}]%
+ \texttt{;...;}[\texttt{jfmvar=}\meta{identifier}]\texttt{;...}
+\end{quote}
+
+\begin{figure}
+\begin{LTXexample}[width=0.3\textwidth]
+\ltjsetparameter{differentjfm=both}
+\jfont\F=HaranoAjiMincho-Regular:jfm=ujis
+\jfont\G=HaranoAjiGothic-Medium:jfm=ujis
+\jfont\H=HaranoAjiGothic-Medium:jfm=ujis;jfmvar=hoge
+\F ){\G 【】}( % halfwidth space
+ ){\H 『』}( % fullwidth space
+
+ほげ,{\G 「ほげ」}(ほげ)\par
+ほげ,{\H 「ほげ」}(ほげ)% pTeX-like
+
+\ltjsetparameter{differentjfm=paverage}
+\end{LTXexample}
+\caption{Example of \texttt{jfmvar} key}
+\label{fig:jfmvar}
+\end{figure}
+
%<*en>
-a JFM has measurements of characters and
-glues/kerns that are automatically inserted for Japanese
-typesetting. The structure of JFM will be described in the next
-subsection. At the calling of \cs{jfont}, you must specify
-which JFM will be used for this font by the following keys:
+\begin{description}
+\item[\meta{JFM name}]
+ The name of a (horizontal) JFM. \LuaTeX-ja searches and loads \texttt{jfm-\meta{JFM name}.lua}
+ \footnote{When \LuaTeX-ja (version~20230409 or later)
+ is used under \LaTeXe, \LuaTeX-ja searches a JFM also in directories
+ which are specified in \cs{input@path}.}.
+\item[\meta{JFM features}]
+ An optional comma-separated list of JFM options.
+ Enclosing braces (\verb+{}+) are optional, but this does not escape any characters.
+ The contents of this list can be accessed by a table \texttt{luatexja.jfont.jfm\_feature}
+ from a JFM, at its loading. See \autoref{fig:jfmfeat} for an example.
+
+ Note that any JFM files which is shipped with \LuaTeX-ja does not use this feature.
+\item[\meta{identifier}]
+ An optional string.
+\end{description}
+
+LuaTeX-ja ``does not distinguish'' two Japanese fonts which uses same JFM and are the same size.
+Here ``uses same JFM'' means that all~of \meta{JFM name}, \meta{JFM features}~and~\meta{identifier} of two fonts
+agree.
+
+For example, The first ``)'' and ``【'' in \autoref{fig:jfmvar} are typeset in different real fonts.
+However, because they use the same JFMs and their size are same,
+\LuaTeX-ja inserts penalties, glues and kerns as if these two character are typeset in a same font.
+Namely, the glue between these characters is halfwidth, as in ``)\nobreak【''.
+However, this does not applies with \cs{F}~and~\cs{H} in \autoref{fig:jfmvar},
+because their \meta{identifier} are different.
%</en>
%<*ja>
-JFMは文字と和文組版で自動的に挿入される
-グルー/カーンの寸法情報を持っている.JFMの構造は次の節で述べる.
-\cs{jfont} 命令の呼び出しの際には,どのJFMを用いるのかを以下のキーで
-指定する必要がある:
+\begin{description}
+\item[\meta{JFM name}]
+ (横組用)JFMの名称.\LuaTeX-jaは\texttt{jfm-\meta{JFM name}.lua}というファイルを探索して読み込む
+ \footnote{\LuaTeX-ja 20230409.0以降では,\LaTeXe 下で読み込まれた場合には
+ \cs{input@path}で指定された箇所も加えてJFMを探索する.}.
+\item[\meta{JFM features}]
+ 省略可能なコンマ区切りリスト.全体を囲む \verb+{}+ は省略可能であるが,
+ 囲ったからといって\meta{JFM features}の中で使用可能な文字が増えるわけではない.
+ \meta{JFM features}で指定された内容は,テーブル\texttt{luatexja.jfont.jfm\_feature}として
+ JFM読み込み時に(JFMから)アクセス可能である.\autoref{fig:jfmfeat}に使用例を載せた.
+
+ なお,\LuaTeX-jaが標準で提供するJFMではこの機能は用いられていない.
+\item[\meta{identifier}]
+ 省略可能な文字列.
+\end{description}
+
+\LuaTeX-jaはJFMとサイズが同じで,
+ 実フォントだけが異なる2つの和文フォントは「区別されない」.
+ここで「JFMが同じ」とは,両フォントの\meta{JFM name}, \meta{JFM features}, \meta{identifier}が
+全て一致することである.
+
+例えば\autoref{fig:jfmvar}において,最初の「)」と「【」の実フォントは異なるが,
+JFMもサイズも同じなので,普通に「)\nobreak【」と入力した時と同じように組まれる,つまり両文字の間は半角空きとなる.
+
+しかし,JFMとサイズが同じであっても,\texttt{jfmvar}キーの値\meta{identifier}の異なる
+2つの和文フォント,例えば\autoref{fig:jfmvar}で言う\cs{F}と\cs{H},
+は「区別される」.異なる和文フォントに異なる \texttt{jfmvar}キーを割り当て,
+かつ\Param{differentjfm}パラメータを\texttt{both}に設定すれば,
+\pTeX と似た状況で組版されることになる.
%</ja>
+\def\T#1{\texttt{#1}}
+\def\printjfmfeat#1{%
+ \relax\texttt{\string#1}:
+ \directlua{%
+ if myjfm then
+ for i,v in pairs(myjfm) do
+ tex.sprint('[\string\\T{' .. i .. '}]${}={}$')
+ if type(v)=='string' then
+ tex.sprint('``\string\\T{' .. tostring(v) .. "}'', ")
+ else
+ tex.sprint(tostring(v) ..', ')
+ end
+ end
+ else tex.sprint('(nil)')
+ end
+ }\par
+}
+\begin{figure}
+\begin{LTXexample}[pos=t]
+\small\ltjsetparameter{differentjfm=both}\tabcolsep=.5\zw
+ % \printjfmfeat is defined in the source of this document
+\jfont\A=HaranoAjiMincho-Regular:jfm=testf at 9pt \printjfmfeat\A
+\jfont\B=HaranoAjiMincho-Bold:jfm=testf/kern=0.5,-ps,+kana at 9pt \printjfmfeat\B
+\jfont\C=HaranoAjiGothic-Regular:jfm=testf/kern=0.5,down=0.2 at 9pt \printjfmfeat\C
+\jfont\D=HaranoAjiGothic-Bold:jfm=testf/down=0.2,kern=0.5 at 9pt \printjfmfeat\D
+\def\TEST#1{\string#1&{#1あ漢}{\A イ字}&{#1あ漢}{\B イ字}&{#1あ漢}{\C イ字}&{#1あ漢}{\D イ字}}
+\vspace{-4\baselineskip}\hfill\ttfamily
+\begin{tabular}{lllll}
+ &\string\A&\string\B&\string\C&\string\D\\\TEST\A\\\TEST\B\\\TEST\C\\\TEST\D\\
+\end{tabular}
+ % No space between ``漢'' and ``イ'' iff two Japanese fonts uses same JFM
+\ltjsetparameter{differentjfm=paverage}
+\end{LTXexample}
+
+\caption{Example of JFM features}
+\label{fig:jfmfeat}
+\end{figure}
+%<en>\paragraph{Horizontal JFMs}
+%<ja>\paragraph{横組用JFM}
\begin{table}[t]
%<en>\caption{Differences between horizontal JFMs shipped with \LuaTeX-ja}
%<ja>\caption{\LuaTeX-ja に同梱されている横組用JFMの違い}
\def\r#1#2{%
\hbox{\Large\vrule
\parbox[b]{7\zw}{%
- \addjfontfeatures{YokoFeatures={Opacity=0.5, Color=#2, JFM=#1}}\noindent
+ \addjfontfeatures{YokoFeatures={JFM=#1}}\noindent
+ \color{#2}\transparent{0.5}%
◆◆◆◆◆◆◆
ある日モモちゃんがお使いで迷子になって泣きました.
}\vrule}}
\def\s#1#2{%
\Large
\parbox[b]{7\zw}{%
- \addjfontfeatures{YokoFeatures={Opacity=0.5, Color=#2, JFM=#1}}\noindent
+ \addjfontfeatures{YokoFeatures={JFM=#1}}\noindent
+ \color{#2}\transparent{0.5}
ちょっと!何
}}
\def\t#1#2#3{\hbox to 0pt{\hss%
\ltjsetparameter{jacharrange={-3}}
\end{table}
-\begin{cslist}
-\item[jfm=<name>]
-%<*en>
-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 horizontal JFMs are shipped with \LuaTeX-ja:
-%</en>
-%<*ja>
-用いる(横組用)JFMの名前を指定する.もし以前に指定されたJFMが読み込まれていなければ,
-\texttt{jfm-<name>.lua}を読み込む.以下の横組用JFMが\LuaTeX-jaには同梱されている:
-%</ja>
+%<en> The following horizontal JFMs are shipped with \LuaTeX-ja.
+%<ja> 以下の横組用JFMが\LuaTeX-jaには同梱されている:
\begin{description}
%<*en>
-\item[\tt jfm-ujis.lua] A standard horizontal JFM in \LuaTeX-ja. This JFM is
+\item[\texttt{jfm-ujis.lua}] A standard horizontal JFM of \LuaTeX-ja. This file 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.
+ is used in \upTeX. When you are going to use the \Pkg{luatexja-otf} package, you should use this JFM.
%</en>
%<*ja>
-\item[\tt jfm-ujis.lua] \LuaTeX-jaの標準JFMである.このJFMは\upTeX で
+\item[\texttt{jfm-ujis.lua}] \LuaTeX-jaの標準JFMファイルであり,このJFMは\upTeX で
用いられるUTF/OTFパッケージ用の和文用TFMである \verb+upnmlminr-h.tfm+ を
元にしている.\Pkg{luatexja-otf}パッケージを使うときはこのJFMを指定するべきである.
%</ja>
%<*en>
-\item[\tt jfm-jis.lua] A counterpart for \verb+jis.tfm+, ``JIS font
+\item[\texttt{jfm-jis.lua}] A counterpart for \verb+jis.tfm+, ``JIS font
metric'' which is widely used in \pTeX. A major difference between
\texttt{jfm-ujis.lua} and this \texttt{jfm-jis.lua} is that
most characters under \texttt{jfm-ujis.lua} are square-shaped,
rectangles.
%</en>
%<*ja>
-\item[\tt jfm-jis.lua] \pTeX で広く用いられている「JISフォントメトリック」
+\item[\texttt{jfm-jis.lua}] \pTeX で広く用いられている「JISフォントメトリック」
\verb+jis.tfm+ に相当するJFMである.\texttt{jfm-ujis.lua} とこの
\texttt{jfm-jis.lua} の主な違いは,\texttt{jfm-ujis.lua} ではほとんどの文字が
正方形状であるのに対し,\texttt{jfm-jis.lua} では横長の長方形状であることと,
\texttt{jfm-ujis.lua} では「?」「!」の直後に半角空白が挿入されることである.
%</ja>
%<*en>
-\item[\tt jfm-min.lua] A counterpart for \verb+min10.tfm+, which is one
+\item[\texttt{jfm-min.lua}] A counterpart for \verb+min10.tfm+, which is one
of the default Japanese font metric shipped with \pTeX.
%</en>
%<*ja>
-\item[\tt jfm-min.lua] \pTeX に同梱されているデフォルトの和文用TFM
+\item[\texttt{jfm-min.lua}] \pTeX に同梱されているデフォルトの和文用TFM
(\verb+min10.tfm+)に相当し,行末で文字が揃うようにするために「っ」など一部の文字幅が変わっ
ている.\verb+min10.tfm+ については\cite{min10}が詳しい.
%</ja>
-\end{description}
%<*en>
-The difference among these three~JFMs is shown in \autoref{tab-difjfm}.
+\item[\texttt{jfm-prop.lua}] A JFM for proportional typesetting.
+ This JFM doesn't have any information of character dimension (width, height, depth), nor glues/kerns information.
%</en>
%<*ja>
-これら3つのJFMの違いは\autoref{tab-difjfm}に示した.表中の文例の一部には,
-\cite{min10}の図3,~4のものを用いた.
+\item[\texttt{jfm-prop.lua}] プロポーショナル組用のJFM.
+ 文字幅・高さ・深さの情報も自動挿入されるグルー・カーンの情報は持たない(つまりグリフの文字幅をそのまま採用する).
%</ja>
-
-\begin{figure}
-\begin{LTXexample}[width=0.3\textwidth]
-\ltjsetparameter{differentjfm=both}
-\jfont\F=file:KozMinPr6N-Regular.otf:jfm=ujis
-\jfont\G=file:KozGoPr6N-Medium.otf:jfm=ujis
-\jfont\H=file:KozGoPr6N-Medium.otf:jfm=ujis;jfmvar=hoge
-\F ){\G 【】}( % halfwidth space
- ){\H 『』}( % fullwidth space
-
-ほげ,{\G 「ほげ」}(ほげ)\par
-ほげ,{\H 「ほげ」}(ほげ)% pTeX-like
-
-\ltjsetparameter{differentjfm=paverage}
-\end{LTXexample}
-\caption{Example of \texttt{jfmvar} key}
-\label{fig:jfmvar}
-\end{figure}
-
%<*en>
-\item[jfmvar=<string>]
-Sometimes there is a need that \ldots.
+\item[\texttt{jfm-propw.lua}] Another JFM for proportional typesetting.
+ In contrast to \texttt{jfm-prop.lua}, this JFM has informations of character height and depth.
%</en>
%<*ja>
-\item[jfmvar=<string>]
-標準では,JFMとサイズが同じで,
- 実フォントだけが異なる2つの和文フォントは「区別されない」.例えば
-\autoref{fig:jfmvar}において,最初の「)」と「【」の実フォントは異なるが,
-JFMもサイズも同じなので,普通に「)【」と入力した時と同じように半角空きとなる.
-
-しかし,JFMとサイズが同じであっても,\texttt{jfmvar} キーの異なる
-2つの和文フォント,例えば\autoref{fig:jfmvar}で言う \cs{F} と \cs{H},
-は「区別される」.異なる和文フォントに異なる \texttt{jfmvar} キーを割り当て,
-かつ\Param{differentjfm}パラメータを \texttt{both} に設定すれば,
-\pTeX と似た状況で組版されることになる.
+\item[\texttt{jfm-propw.lua}] プロポーショナル組用のさらなるJFM.
+ \texttt{jfm-prop.lua}と異なり,高さ・深さの情報は持っている.
+%</ja>
+\end{description}
+%<*en>
+See \autoref{tab-difjfm} for the difference among \texttt{jfm-ujis.lua}, \texttt{jfm-jis.lua},
+\texttt{jfm-min.lua}.
+%</en>
+%<*ja>
+\texttt{jfm-ujis.lua}, \texttt{jfm-jis.lua},
+\texttt{jfm-min.lua}の違いは\autoref{tab-difjfm}に示した.表中の文例の一部には,
+\cite{min10}の図3,~4のものを用いた.
%</ja>
-\end{cslist}
\begin{figure}
\begin{LTXexample}[pos=t]
\newcommand\test{\vrule ダイナミックダイクマ\vrule\\}
-\jfont\KMFW = KozMinPr6N-Regular:jfm=prop;-kern at 17pt
-\jfont\KMFK = KozMinPr6N-Regular:jfm=prop at 17pt % kern is activated
-\jfont\KMPW = KozMinPr6N-Regular:jfm=prop;script=dflt;+pwid;-kern at 17pt
-\jfont\KMPK = KozMinPr6N-Regular:jfm=prop;script=dflt;+pwid;+kern at 17pt
+\jfont\KMFW = HaranoAjiMincho-Regular:jfm=prop;-kern at 17.28pt
+\jfont\KMFK = HaranoAjiMincho-Regular:jfm=prop at 17.28pt % kern is activated
+\jfont\KMPW = HaranoAjiMincho-Regular:jfm=prop;script=dflt;+palt;-kern at 17.28pt
+\jfont\KMPK = HaranoAjiMincho-Regular:jfm=prop;script=dflt;+palt;+kern at 17.28pt
\begin{multicols}{2}
\ltjsetparameter{kanjiskip=0pt}
{\KMFW\test \KMFK\test \KMPW\test \KMPK\test}
%<*en>
Some fonts have information for inter-glyph spacing.
\LuaTeX-ja 20140324.0 or later treats kerning spaces like an italic correction;
-any glue and/or kern from the JFM and a kerning space can coexist.
+any glue and/or kern from the JFM and a kerning space from the font can coexist.
See \autoref{fig:kern-jfm} for detail.
-Note that in \cs{setmainjfont} etc.\ which are provided by \Pkg{luatexja-fontspec}
-package, kerning option is set \emph{off} (\texttt{Kerning=Off}) by default,
-because of the compatibility with previous versions of \LuaTeX-ja.
+At version~20220411.0, defaults Japanese fonts which are defined
+at the loading of \LuaTeX-ja, \Pkg{ltjclasses},~and~\Pkg{ltjsclasses}
+do not insert font-derived kerning spaces by default.
+This is because standard JFMs do not expect font-derived kerning spaces
+between Japanese characters.
+
+Also note that in \cs{setmainjfont} etc.\ which are provided by \Pkg{luatexja-fontspec}
+package, kerning option is set \emph{off} (\texttt{Kerning=Off}) by default.
+This means the following two lines have the same meaning:
+\begin{lstlisting}
+\setmainjfont{HaranoAjiMincho-Regular}
+\setmainjfont[Kerning=Off]{HaranoAjiMincho-Regular}
+\end{lstlisting}
+
%</en>
%<*ja>
いくつかのフォントはグリフ間のスペースについての情報を持っている.
このカーニング情報は以前の\LuaTeX-ja とはあまり相性が良くなかったが,
バージョン20140324.0以降ではカーニングによる空白はイタリック補正と同様に扱うことになっている.
-ã\81¤ã\81¾ã\82\8aï¼\8cã\82«ã\83¼ã\83\8bã\83³ã\82°ç\94±æ\9d¥ã\81®ç©ºç\99½ã\81¨JFMç\94±æ\9d¥ã\81®ã\82°ã\83«ã\83¼ã\83»ã\82«ã\83¼ã\83³ã\81¯å\90\8cæ\99\82ã\81«å\85¥ã\82\8aã\81\86る.
+ã\81¤ã\81¾ã\82\8aï¼\8cã\82«ã\83¼ã\83\8bã\83³ã\82°ç\94±æ\9d¥ã\81®ç©ºç\99½ã\81¨JFMç\94±æ\9d¥ã\81®ã\82°ã\83«ã\83¼ã\83»ã\82«ã\83¼ã\83³ã\81¯å\90\8cæ\99\82ã\81«å\85¥ã\82\8bã\81\93ã\81¨ã\81\8cã\81\82る.
\autoref{fig:kern-jfm}を参照.
\begin{itemize}
- \item \emph{\cs{jfont} や,
-NFSS2用の命令(\ref{ssec:chgfnt}節,\ref{ssec:nfsspat}節)における指定では
-カーニング情報は標準で使用する}ことになっているようである.
-言い換えれば,カーニング情報を使用しない設定にするには,面倒でも
+ \item \emph{\cs{jfont} や,NFSS2用の命令(\ref{ssec:chgfnt}節,\ref{ssec:nfsspat}節)では,
+カーニング情報を使用する設定(OpenType機能\texttt{kern})はとくに指定しなくても有効になる}.
+すなわち,以下の2行目と3行目,5行目と6行目はそれぞれ等価である:
+\begin{lstlisting}[numbers=left]
+\jfont\hoge=hogem:jfm=ujis;-kern at 3.5mm % ==> kern 無効(明示)
+\jfont\hoge=hogem:jfm=ujis at 3.5mm % ==> kern 有効(暗黙)
+\jfont\hoge=hogem:jfm=ujis;+kern at 3.5mm % ==> kern 有効(明示)
+\DeclareFontShape{JY3}{fuga}{m}{n}{<-> s*hogem:jfm=-ujis}{} % ==> kern 無効(明示)
+\DeclareFontShape{JY3}{fuga}{m}{n}{<-> s*hogem:jfm=ujis}{} % ==> kern 有効(暗黙)
+\DeclareFontShape{JY3}{fuga}{m}{n}{<-> s*hogem:jfm=ujis+kern}{}% ==> kern 有効(明示)
+\end{lstlisting}
+
+\item バージョン20220411.0以降では,\LuaTeX-ja読み込み時や,\Pkg{ltjclasses}, \Pkg{ltjsclasses}において
+ 和文フォントを
\begin{lstlisting}
-\jfont\hoge=KozMinPr6N-Regular:jfm=ujis;-kern at 3.5mm
-\DeclareFontShape{JY3}{fuga}{m}{n} {<-> s*KozMinPr6N-Regular:jfm=ujis;-kern}{}
+\jfont\tenmin=\ltj@stdmcfont:-kern;jfm=\ltj@stdyokojfm\space at 9.62216pt
+\DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[\ifdefined\Cjascale\Cjascale\else 0.962216\fi]
+ \ltj@stdmcfont:-kern;jfm=\ltj@stdyokojfm}{}
\end{lstlisting}
-のように,\texttt{-kern} という指定を自分で追加しなければいけない.
+ とOpenType機能\texttt{kern}を明示的に無効化した状態で定義する.
+ これは標準JFM(\texttt{jfm-ujis.lua}, \texttt{jfm-ujisv.lua})が
+ フォント由来のカーニングが入ることを期待していないためである.
+
\item
一方,\emph{\Pkg{luatexja-fontspec} の提供する \cs{setmainjfont}\
-などの命令の標準設定ではカーニング情報は使用しない}(\texttt{Kerning=Off})
-ことになっている.これは以前のバージョンの\LuaTeX-jaとの互換性のためである.
+などの命令の標準設定ではカーニング情報は使用しない}(\texttt{Kerning=Off}).
+すなわち,次の2行は等価である:
+\begin{lstlisting}
+\setmainjfont{HaranoAjiMincho-Regular}
+\setmainjfont[Kerning=Off]{HaranoAjiMincho-Regular}
+\end{lstlisting}
+これは前項目の理由の他に,以前のバージョンの\LuaTeX-jaとの互換性のためもある.
\end{itemize}
%</ja>
%<*ja>
\paragraph{\texttt{extend}と\texttt{slant}}
-OpenType font featureと見かけ上同じような形式で指定できるものに,
+OpenType機能と見かけ上同じような形式で指定できるものに,
\begin{description}
-\item[\texttt{extend=}<extend>] 横方向に<extend>倍拡大する.
-\item[\texttt{slant=}<slant>] <slant>に指定された割合だけ傾ける.
+\item[\texttt{extend=}\meta{extend}] 横方向に\meta{extend}倍拡大する.
+\item[\texttt{slant=}\meta{slant}] \meta{slant}に指定された割合だけ傾ける.
\end{description}
の2つがある.
\texttt{extend}や\texttt{slant}を指定した場合は,それに応じたJFMを指定すべきである%
\paragraph{\texttt{extend} and \texttt{slant}}
The following setting can be specified as OpenType font features:
\begin{cslist}[style=standard]
-\item[\texttt{extend=}<extend>] expand the font horizontally by <extend>.
-\item[\texttt{slant=}<slant>] slant the font.
+\item[\texttt{extend=}\meta{extend}] expand the font horizontally by \meta{extend}.
+\item[\texttt{slant=}\meta{slant}] slant the font.
\end{cslist}
Note that \LuaTeX-ja doesn't adjust JFMs by these \texttt{extend} and \texttt{slant}
-settings; you have to write new JFMs on purpose.
+settings; one have to write new JFMs on purpose.
For example, the following example uses the standard JFM \texttt{jfm-ujis.lua}, hence
-letter-spacing and the width of italic correction are not correct:
+the letterspacing and the width of italic corrections are not correct:
%</en>
\begin{LTXexample}[width=0.3\textwidth]
-\jfont\E=KozMinPr6N-Regular:extend=1.5;jfm=ujis;-kern
-\E あいうえお
-
-\jfont\S=KozMinPr6N-Regular:slant=1;jfm=ujis;-kern
-\S あいう\/ABC
+\jfont\E=HaranoAjiMincho-Regular:extend=1.5;jfm=ujis;-kern
+\jfont\S=HaranoAjiMincho-Regular:slant=1;jfm=ujis;-kern
+\E あいうえお \S あいう\/ABC
\end{LTXexample}
%<*ja>
-\paragraph{\texttt{ltjksp} 指定}
+\paragraph{\texttt{ltjksp}「機能」}
\label{pg:ltjksp}
\LuaTeX-ja標準では,
-JFM中における \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
+JFM中における\texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
\texttt{kanjiskip\_shrink}キー(\pageref{pg:ksp_nat}ページ)の使用によって,
「JFM由来のグルーの他に,\Param{kanjiskip}の自然長/伸び量/縮み量の一部が
同じ場所に挿入される」という状況が起こりうる.
-この機能を無効化し,バージョン20150922.0以前と同じような組版を得るためには
-他のOpenType機能と同じように\ \texttt{-ltjksp}\ 指定を行えば良い.
-\begin{LTXexample}[width=16\zw]
-\leavevmode
-\ltjsetparameter{kanjiskip=0pt plus 3\zw}
-\vrule\hbox to 15\zw{あ「い」う,えお}\vrule
-
-\jfont\G=file:KozMinPr6N-Regular.otf%
- :jfm=ujis;-ltjksp at 9.2487pt
-\G\leavevmode%
-\vrule\hbox to 15\zw{あ「い」う,えお}\vrule
-\end{LTXexample}
+この機能を無効化し,バージョン20150922.0以前と同じような組版を得るためには,
+他のOpenType機能と同じように\>\mbox{\texttt{-ltjksp}}\>指定を行えば良い(\autoref{fig:ltjksp}参照).
なお,
\begin{lstlisting}
- \jfont\G=file:KozMinPr6N-Regular.otf:jfm=ujis;-ltjksp;+ltjksp at 9.2487pt
+ \jfont\G=HaranoAjiMincho-Regular:jfm=ujis;-ltjksp;+ltjksp at \zw
\end{lstlisting}
-のように \texttt{+ltjksp} 指定を行った場合は,\texttt{kanjiskip\_natural} など
-3キーは再び有効化される.\texttt{-ltjksp}, \texttt{+ltjksp} を複数回指定した場合は,
+のように\texttt{+ltjksp}指定を行った場合は,\texttt{kanjiskip\_natural}など
+3キーは再び有効化される.\texttt{-ltjksp}, \texttt{+ltjksp}を複数回指定した場合は,
最後に指定したものが有効となる.
%</ja>
%<*en>
-\paragraph{\texttt{ltjksp}}
+\paragraph{\texttt{ltjksp} ``feature''}
\label{pg:ltjksp}
\texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
\texttt{kanjiskip\_shrink} keys (Page~\pageref{pg:ksp_nat}) makes tha
\LuaTeX-ja inserts not only a glue which is specified by a JFM, and also
the natural width/stretch part/shrink part of \Param{kanjiskip}.
-
-This functionality is disabled by \texttt{-ltjksp} specification.
+This functionality is disabled by \mbox{\texttt{-ltjksp}} specification,
+as shown in~\autoref{fig:ltjksp}.
+%</en>
+\begin{figure}
\begin{LTXexample}[width=16\zw]
\leavevmode
\ltjsetparameter{kanjiskip=0pt plus 3\zw}
-\vrule\hbox to 15\zw{あ「い」う,えお}\vrule
-
-\jfont\G=file:KozMinPr6N-Regular.otf%
- :jfm=ujis;-ltjksp at 9.2487pt
+\vrule\hbox to 15\zw{あ「い」う,えお}\vrule\\
+\jfont\G=HaranoAjiMincho-Regular%
+ :jfm=ujis;-ltjksp at \zw
\G\leavevmode%
\vrule\hbox to 15\zw{あ「い」う,えお}\vrule
\end{LTXexample}
-%</en>
+\caption{\texttt{ltjksp} ``feature''}
+\label{fig:ltjksp}
+\end{figure}
+%<*ja>
+\paragraph{\texttt{ltjpci}「機能」}
+\label{pg:ltjpci}
+\Pkg{luaotfload}~v3.19以降では,標準でUnicode(文字から作られるノードたち)がNFCに正規化される
+ようになっている.これにより,ソース中でたとえば「か」と合成用濁点(\texttt{U+3099})を続けて入力した場合,
+両者それぞれからノードが生成されるが,結果的には「が」を表す1ノードになるわけである.
+しかし,NFCに正規化することで,
+たとえば「\UTF{FA19}」(\texttt{U+FA19})が「神」(\texttt{U+795E})にというふうに,
+CJK互換漢字がCJK統合漢字に変換されてしまうという問題がある.
+異体字セレクタを用いればこのようなことは起きないが,古くからあるフォントでは異体字セレクタをサポートしていない.
+以上の事情に対応するため,\LuaTeX-jaでは,標準で
+\emph{CJK互換漢字・CJK互換漢字補助の文字には\Pkg{luaotfload}パッケージによる処理は働かない}ようにしている.
+この機能を無効化するには,他のOpenType機能と同じように\texttt{-ltjpci}指定を行えば良い(\autoref{fig:ltjpci}参照).
+\texttt{ltjksp}と同様に,\texttt{-ltjpci}, \texttt{+ltjpci}を複数回指定した場合は,
+最後に指定したものが有効となる.
+%</ja>
+%<*en>
+\paragraph{\texttt{ltjpci} ``feature''}
+\label{pg:ltjpci}
+By default, The \Pkg{luaotfload} package (since v3.19) normalizes Unicode sequences to NFC.
+However, this normalization converts CJK compatibility ideographs to their canonical equivalents,
+such as ``\UTF{FA19}''~(\texttt{U+FA19}) to ``神''. One can use variation selectors,
+but old fonts does not support them.
+
+So, \emph{\LuaTeX-ja now protects CJK compatibility ideographs from processing
+ by the \Pkg{luaotfload} package by defualt}.
+This functionality is disabled by \mbox{\texttt{-ltjpci}} specification,
+as shown in~\autoref{fig:ltjpci}.
+%</en>
+\begin{figure}
+\begin{LTXexample}[width=12\zw]
+\def\TEST{\leavevmode\char"FA10\char"FA12\char"FA15
+ \char"FA19.か\char"3099.は\char"309A.\par}
+\jfont\A=HaranoAjiMincho-Regular:jfm=ujis; at 15pt
+\A\TEST % default
+\jfont\G=HaranoAjiMincho-Regular:jfm=ujis;-ltjpci at 15pt
+\G\TEST % ltjpci off
+\jfont\H=HaranoAjiMincho-Regular:jfm=ujis;-normalize at 15pt
+\H\TEST % normalization off
+\end{LTXexample}
+\caption{\texttt{ltjpci} ``feature''}
+\label{fig:ltjpci}
+\end{figure}
%<en>\subsection{\cs{tfont}}
%<ja>\subsection{\cs{tfont} 命令}
-
+\label{ssec: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 の違い}
\def\r#1#2{%
\hbox{\tate\Large\vrule
\parbox{7\zw}{%
- \addjfontfeatures{TateFeatures={Opacity=0.5, Color=#2, JFM=#1}}\noindent
+ \addjfontfeatures{TateFeatures={JFM=#1}}\noindent
+ \color{#2}\transparent{0.5}
◆◆◆◆◆◆◆
ある日モモちゃんが「お使い」で迷子になって泣きました。
}\vrule}}
\def\s#1#2{%
\hbox{\tate\Large
\parbox{7\zw}{%
- \addjfontfeatures{TateFeatures={Opacity=0.5, Color=#2, JFM=#1}}\noindent
+ \addjfontfeatures{TateFeatures={JFM=#1}}\noindent
+ \color{#2}\transparent{0.5}
ちょっと!何
}}}
\def\t#1#2#3{\hbox to 0pt{\hss%
\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}.
+This command admits the same syntax as in \cs{font}~and~\cs{jfont}.
A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont}:
\begin{itemize}
\item OpenType Feature~\texttt{vrt2}%
- \footnote{If the font does not define \texttt{vrt2} feature,
- use \texttt{vert} instead.} is automatically activated,
- unless \texttt{vert}~and//or~\texttt{vrt2} are explicitly activated
+ \footnote{If the font does not define the \texttt{vrt2} feature,
+ \texttt{vert} is used instead.} is automatically activated,
+ unless \texttt{vert}~and//or~\texttt{vrt2} features are explicitly activated
or deactivated (as the second line in the example below).
\begin{lstlisting}
-\tfont\S=file:KozMinPr6N-Regular.otf:jfm=ujisv % vrt2 is automatically activated
-\tfont\T=file:KozMinPr6N-Regular.otf:jfm=ujisv;-vert % vert and vrt2 are not activated
+\tfont\S=HaranoAjiMincho-Regular:jfm=ujisv % vrt2 is automatically activated
+\tfont\T=HaranoAjiMincho-Regular:jfm=ujisv;-vert % vert and vrt2 are not activated
\tfont\U=file:ipaexm.ttf:jfm=ujisv
% vert is automatically activated, since this font does not have vrt2
\end{lstlisting}
In this situation, \LuaTeX-ja performs all replacements which is defined in~\texttt{vert}
feature for \emph{some} scripts for \emph{some} languages.
- \item Furthermore, a glyph is automatically rotated 90~degrees,
- if it is not replaced by \texttt{vert} feature for \emph{any} script
- for \emph{any} language, and if it is marked as `r''~or~``Tr'' in UAX~\#50.
- \item One have to specify the name of vertical JFM in \texttt{jfm=<name>}.
+ \item \cs{tfont} uses a vertical JFM instead of a horizontal JFM.
\LuaTeX-ja ships following vertical JFMs:
\begin{description}
-\item[\tt jfm-ujisv.lua] A standard vertical JFM in \LuaTeX-ja. This JFM is
+\item[\texttt{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
+\item[\texttt{jfm-tmin.lua}] A counterpart for \verb+tmin10.tfm+, which is one
of the default Japanese font metric shipped with \pTeX.
\end{description}
+\begin{figure}[!tb]
+\begin{LTXexample}[pos=b]
+\jfont\X=[HaranoAjiMincho-Regular.otf]:jfm=ujis
+\tfont\U=[HaranoAjiMincho-Regular.otf]:jfm=ujisv
+\tfont\V=[HaranoAjiMincho-Regular.otf]:jfm=ujisv;jpotf
+\def\TEST#1#2{\leavevmode\hbox{#1#2\string#2 “引用,と句読点.”}}
+\ttfamily\centering\TEST\yoko\X \quad \TEST\tate\U \quad \TEST\tate\V
+\end{LTXexample}
+\caption{\texttt{jpotf} ``feature''}
+\label{fig:jpotf}
+\end{figure}
+
+ \item If \texttt{vert}~and/or~\texttt{vrt2} features are activated,
+ one can specify \texttt{jpotf} to additional substitutions.
+ By default, it substitutes ideographic comma/period for fullwidth comma/period,
+ and double prime quotation marks for double quotation marks
+ (See~\autoref{fig:jpotf}).
+ One can customize substitutions by lua~function \verb+luatexja.jfont.register_vert_replace+\ %
+ (see Japanese version of this manual).
\end{itemize}
%</en>
%<*ja>
\cs{tfont} はフォントを縦組用の和文フォントとして読み込む命令であり,
-\cs{tfont} ã\81®æ\96\87æ³\95ã\81¯ \cs{jfont} ã\81¨å\90\8cã\81\98ã\81§ã\81\82ã\82\8bï¼\8e
-\cs{tfont} で定義された縦組用和文フォントは,
-以下の点が \cs{jfont} による横組用和文フォントとは異なる:
+\cs{tfont}ã\81®æ§\8bæ\96\87ã\81¯\cs{jfont}ã\81¨å\90\8cæ§\98ã\81§ã\81\82ã\82\8bï¼\8e
+\cs{tfont}で定義された縦組用和文フォントは,
+以下の点が\cs{jfont}による横組用和文フォントとは異なる:
\begin{itemize}
- \item 明示的に \texttt{vert}, \texttt{vrt2}(のいずれか)の
- 有効・無効を指定した場合を除き,自動的に OpenType feature~\texttt{vrt2} の有効化が
+ \item 明示的にOpenType機能\texttt{vert}, \texttt{vrt2}(のいずれか)の
+ 有効・無効を指定した場合を除き,自動的にOpenType機能\texttt{vrt2}の有効化が
指定されたものとみなされる
\footnote{もしフォントが\texttt{vrt2}を定義していなかった場合,代わりに
\texttt{vert}を用いる.}.
\begin{lstlisting}
-\tfont\S=file:KozMinPr6N-Regular.otf:jfm=ujisv % vrt2 is automatically activated
-\tfont\T=file:KozMinPr6N-Regular.otf:jfm=ujisv;-vert % vert and vrt2 are not activated
+\tfont\S=HaranoAjiMincho-Regular:jfm=ujisv % vrt2 is automatically activated
+\tfont\T=HaranoAjiMincho-Regular:jfm=ujisv;-vert % vert and vrt2 are not activated
\tfont\U=file:ipaexm.ttf:jfm=ujisv
% vert is automatically activated, since this font does not have vrt2
\end{lstlisting}
- \item \texttt{vert}, \texttt{vrt2} の少なくとも一つの有効を指定した場合にも関わらず,
+ \item \texttt{vert}, \texttt{vrt2}の少なくとも一つの有効を指定した場合にも関わらず,
script tagとlanguage system identifierの値の組み合わせによって
実際には有効にならなかった場合,\LuaTeX-jaは
\begin{quote}
このscript,~languageの組み合わせを指定することはできないので,
\Pkg{luaotfload}そのままでは\texttt{vert}を適用させることはできない.
}.
- \item さらに,「いかなるscript,~languageでも\texttt{vert}により置換されない」グリフ
- のうち,UAX~\#50で``r''もしくは``Tr''と指定されているものは90度自動回転させる.
+ \item さらに,置換前と置換後のグリフがどちらも「UAX~\#50で``r''もしくは``Tr''と指定されている」ものは90度自動回転させる.
\item \ref{ssec:math}節で述べる,数式中の和文フォントには縦組用和文フォントは指定できない.
- \item \texttt{jfm=<name>}\ の部分には縦組用JFMを指定する.
+ \item \meta{JFM name}には縦組用JFMを指定する.
以下の縦組用JFMが\LuaTeX-jaには同梱されている.%おり,違いを\autoref{tab-difjfm-tate}に示した.
\begin{description}
-\item[\tt jfm-ujisv.lua] \LuaTeX-jaの標準縦組用JFMである.このJFMは\upTeX で
+\item[\texttt{jfm-ujisv.lua}] \LuaTeX-jaの標準縦組用JFMである.このJFMは\upTeX で
用いられるUTF/OTFパッケージ用の和文用TFMである \verb+upnmlminr-v.tfm+ を
元にしている.
-\item[\tt jfm-tmin.lua] \pTeX に同梱されているデフォルトの和文用縦組TFM
+\item[\texttt{jfm-tmin.lua}] \pTeX に同梱されているデフォルトの和文用縦組TFM
である \verb+tmin10.tfm+ に相当し,\texttt{min10.tfm} と同様に
「っ」など一部の文字幅が狭められている.
\end{description}
+
+\begin{figure}[!tb]
+\begin{LTXexample}[pos=r,width=.4\textwidth]
+\jfont\X=[HaranoAjiMincho-Regular.otf]:jfm=ujis
+\tfont\U=[HaranoAjiMincho-Regular.otf]:jfm=ujisv
+\tfont\V=[HaranoAjiMincho-Regular.otf]:jfm=ujisv;jpotf
+\def\TEST#1#2{\leavevmode
+ \hbox{#1#2\string#2 “引用,と句読点.”}}
+\ttfamily\centering
+\TEST\yoko\X\quad \TEST\tate\U\quad
+\TEST\tate\V
+\end{LTXexample}
+\caption{\texttt{jpotf} ``feature''}
+\label{fig:jpotf}
+\end{figure}
+\begin{table}[t]
+ \def\D#1#2#3#4{%
+ {\fboxsep0pt\fcolorbox{cyan}{white}%
+ {\large\lower-\cdp\hbox{\tate\ltjjachar"#1#2#3#4}}}\ (\texttt{U+#1#2#3#4})%"
+ }
+ \caption{\texttt{jpotf}が指定された際に行われる追加の縦組形への置換}
+ \label{tab:vert_replace_jpotf}\small\centering
+ \begin{tabular}{*{2}{l@{}>{${}\longmapsto{}$}c@{}l}}
+ \toprule
+ \D FF0C&&\D 3001&\D FF0E&&\D 3002\\
+ \D 201C&&\D 301D&\D 201D&&\D 301F\\
+ \bottomrule
+ \end{tabular}
+\end{table}
+
+ \item \texttt{vert}, \texttt{vrt2}の少なくとも片方が(明示的・自動的を問わず)
+ 有効になっていた場合,さらに\texttt{jpotf}を指定することで
+ 「通常では行わない縦組用字形への置換」を行うことができる.
+
+ 標準では,\autoref{tab:vert_replace_jpotf}に示した置換が登録されている
+ \footnote{%
+ \texttt{jpotf}という名前にしたのは,
+ OTFパッケージの縦組用和文TFMでほぼ同じの処理(そちらではさらに一重引用符を
+ 「シングルミニュート」に置換する機能もあった)を行っていたことに由来する.
+ }.実行例は\autoref{fig:jpotf}を参照.
+
+ ユーザ側で「置換」をカスタマイズしたい場合,
+ \verb+luatexja.jfont.register_vert_replace+関数に変更内容を記したテーブルを渡す.
+ 例えば置換$i_1\longmapsto v_1$, $i_2\longmapsto v_2$,~$\dots$を登録する場合は
+ \begin{lstlisting}[escapechar=\!]
+\directlua{luatexja.jfont.register_vert_replace{[!$i_1$!]=!$v_1$!, [!$i_2$!]=!$v_2$!, ...}}
+ \end{lstlisting}
+ を実行する.
+ \verb+luatexja.jfont.register_vert_replace+による変更はこの関数の\emph{実行後}に定義される
+ フォントについてのみ有効である.
+
\end{itemize}
なお,\pTeX では,\cs{font},~\cs{jfont},~\cs{tfont}のどれでも欧文フォント・横組用和文フォン
\item[\cs{ltj@stdyokojfm}]
%<en>The default JFM for horizontal direction.
%<ja>標準で用いる横組用JFM.
- \item[\cs{ltj@stdyokojfm}]
+ \item[\cs{ltj@stdtatejfm}]
%<en>The default JFM for vertical direction.
%<ja>標準で用いる縦組用JFM.
\end{cslist}
\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.
+Harano Aji fonts.
+%IPAex~Mincho and IPAex~Gothic.
-This feature is intended for classes which use special JFMs
+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>\subsection{\texttt{psft}プリフィックス}
\label{ssec:psft}
%<*en>
-Besides ``\texttt{file:}''\ and ``\texttt{name:}''\ prefixes which
+Besides ``\texttt{file}''\ and ``\texttt{name}''\ prefixes which
are introduced in the \Pkg{luaotfload} package,
-\LuaTeX-ja adds ``\texttt{psft:}''\ prefix in \cs{jfont} (and~\cs{font}),
+\LuaTeX-ja adds ``\texttt{psft}''\ prefix in \cs{jfont} (and~\cs{font}),
to specify a ``name-only'' Japanese font which
will not be embedded to PDF.
Note that these non-embedded fonts under current \LuaTeX\ has Identity-H encoding,
and this violates the standard ISO32000-1:2008~(\cite{pdfstd}).
-\emph{OpenType font features, such as ``{\tt +jp90}'',
-have no meaning in name-only fonts using ``{\tt psft:}''\ prefix,
+\emph{OpenType font features, such as ``\texttt{+jp90}'',
+have no meaning in name-only fonts using ``\texttt{psft}''\ prefix,
because we can't expect what fonts are actually used by the PDF reader.}
Note that \texttt{extend}~and~\texttt{slant} settings (see~above) are supported
with \texttt{psft} prefix, because they are only simple linear transformations.
%</en>
%<*ja>
\Pkg{luaotfload}で使用可能になった
-\texttt{file:}\ と \texttt{name:}\ のプリフィックスに加えて,
+\texttt{file}\ と \texttt{name}\ のプリフィックスに加えて,
\cs{jfont}(と \cs{font} プリミティブ)では
-\texttt{psft:}プリフィックスを用いることができる.
+\texttt{psft}\ プリフィックスを用いることができる.
このプリフィックスを用いることで,PDFには埋め込まれない「名前だけの」
和文フォントを指定することができる.
なお,現行の\LuaTeX で非埋め込みフォントを作成するとPDF内でのエンコーディングが
ので注意してほしい.
\emph{\texttt{psft} プリフィックスの下では
-\texttt{+jp90} などのOpenType font featureの効力はない.
+\texttt{+jp90} などのOpenType機能の効力はない.
非埋込フォントをPDFに使用すると,実際にどのようなフォントが
表示に用いられるか予測できないからである.}\
\texttt{extend} と \texttt{slant} 指定は単なる変形のため
\label{para-cid}
%<*en>
-The default font defined by using \texttt{psft:} prefix is for Japanese typesetting;
-it is Adobe-Japan1-6 CID-keyed font.
+The default font defined by using \texttt{psft} prefix is for Japanese typesetting;
+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.
%</en>
%<*ja>
-標準で\texttt{psft:}プリフィックスで定義されるフォントは日本語用のもので
-あり,Adobe-Japan1-6のCIDに対応したものとなる.しかし,\LuaTeX-jaは中国語
+標準で\texttt{psft}\ プリフィックスで定義されるフォントは日本語用のもので
+あり,Adobe-Japan1-7のCIDに対応したものとなる.しかし,\LuaTeX-jaは中国語
の組版にも威力を発揮することが分かり,日本語フォントでない非埋込フォント
の対応も必要となった.そのために追加されたのが\texttt{cid}キーである.
\texttt{cid}キーに値を指定すると,そのCIDを持った非埋込フォントを定義することができる:
%</ja>
\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\testG={psft:SimSun:cid=Adobe-GB1-5;jfm=jis} % Simplified Chinese
-\jfont\testK={psft:Batang:cid=Adobe-Korea1-2;jfm=jis} % Korean
+\jfont\testJ={psft:Ryumin-Light:cid=Adobe-Japan1-7;jfm=jis} % Japanese
+\jfont\testD={psft:Ryumin-Light:jfm=jis} % default: Adobe-Japan1-7
+\jfont\testC={psft:AdobeMingStd-Light:cid=Adobe-CNS1-7;jfm=jis}% Traditional Chinese
+\jfont\testG={psft:SimSun:cid=Adobe-GB1-6;jfm=jis} % Simplified Chinese
+\jfont\testK={psft:Batang:cid=Adobe-Korea1-2;jfm=jis} % Korean
+\jfont\testKR={psft:SourceHanSerifAKR9:cid=Adobe-KR-9;jfm=jis} % Korean
\end{lstlisting}
%<*en>
Note that the code above specifies \texttt{jfm-jis.lua}, which is for Japanese fonts,
%</ja>
%<*en>
-At present, \LuaTeX-ja supports only 4 values written in the sample code above.
+At present, \LuaTeX-ja supports only 5 values written in the sample code above.
Specifying other values, e.g.,
%</en>
%<*ja>
-今のところ,\LuaTeX-jaは上のサンプルコード中に書いた4つの値しかサポートしていない.
+今のところ,\LuaTeX-jaは上のサンプルコード中に書いた5つの値しかサポートしていない.
%</ja>
\begin{lstlisting}
\jfont\test={psft:Ryumin-Light:cid=Adobe-Japan2;jfm=jis}
%<*ja>
実際のデータは上で \verb+{ ... }+ で示されたテーブルの中に格納されている.
以下ではこのテーブルの構造について記す.
-なお,JFMファイル中の長さは全てdesign-sizeを単位とする浮動小数点数であることに
+なお,JFMファイル中の長さは全てdesign sizeを単位とする浮動小数点数であることに
注意する.
%</ja>
\begin{cslist}[style=standard]
-\item[version=<version>]
+\item[version=\meta{version}]
%<en>(optional, default value is~1)
%<ja>(任意,既定値は1)
JFMのバージョン.1,~2,~3がサポートされる.
%</ja>
-\item[dir=<direction>]
+\item[dir=\meta{direction}]
%<en>(required)
%<ja>(必須)
JFMの書字方向.\texttt{'yoko'}(横組)と \texttt{'tate'}(縦組)がサポートされる.
%</ja>
-\item[zw=<length>]
+\item[zw=\meta{length}]
%<en>(required)
%<ja>(必須)
\LuaTeX-jaではここで指定する.
%</ja>
-\item[zh=<length>]
+\item[zh=\meta{length}]
%<en>(required)
%<ja>(必須)
\LuaTeX-jaではここで指定する.
%</ja>
-\item[kanjiskip=\{<natural>, <stretch>, <shrink>\}]
+\item[kanjiskip=\{\meta{natural}, \meta{stretch}, \meta{shrink}\}]
%<en>(optional)
%<ja>(任意)
in Subsection~\ref{subs-kskip}, if the parameter
\Param{kanjiskip} is \cs{maxdimen}, the value specified
in this field is actually used (if this field is not specified in
- JFM, it is regarded as 0\,pt). Note that <stretch> and <shrink>
+ JFM, it is regarded as 0\,pt). Note that \meta{stretch} and \meta{shrink}
fields are in design-size unit too.
%</en>
%<*ja>
理想的な\Param{kanjiskip}の量を指定する.\ref{subs-kskip}節で述べたように,
もし\Param{kanjiskip}が \cs{maxdimen} の値ならば,このフィールドで指定された
-値が実際には用いられる(指定なしは0\,ptとして扱われる).<stretch>と<shrink>のフィールドもdesign-size
+値が実際には用いられる(指定なしは0\,ptとして扱われる).\meta{stretch}と\meta{shrink}のフィールドもdesign size
が単位であることに注意せよ.
%</ja>
-\item[xkanjiskip=\{<natural>, <stretch>, <shrink>\}]
+\item[xkanjiskip=\{\meta{natural}, \meta{stretch}, \meta{shrink}\}]
%<en>(optional)
%<ja>(任意)
%</ja>
\begin{cslist}[style=standard]
-\item[chars=\{<character>, ...\}]
+\item[chars=\{\meta{character}, ...\}]
%<en>(required except character class~0)
%<ja>(文字クラス0を除いて必須)
\end{itemize}
%</ja>
-\item[width=<length>, height=<length>, depth=<length>, italic=<length>]
+\item[width=\meta{length}, height=\meta{length}, depth=\meta{length}, italic=\meta{length}]
%<en>(required)
%<ja>(必須)
すれば,これによってプロポーショナル組を行うことができる.
%</ja>
-\item[left=<length>, down=<length>, align=<align>]\
+\item[left=\meta{length}, down=\meta{length}, align=\meta{align}]\
%<*en>
These fields are for adjusting the position of the ``real'' glyph. Legal
\label{fig:pos-tate}
\end{figure}
-\item[kern={\{[$j$]=<kern>, [$j'$]=\{<kern>, [ratio=<ratio>]\}, ...\}}]
+\item[kern={\{[$j$]=\meta{kern}, [$j'$]=\{\meta{kern}, [ratio=\meta{ratio}]\}, ...\}}]
\nopagebreak
-\item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>, [ratio=<ratio>, ...]\}, ...\}}]\leavevmode
+\item[glue={\{[$j$]=\{\meta{width}, \meta{stretch}, \meta{shrink}, [ratio=\meta{ratio}, ...]\}, ...\}}]\leavevmode
%<*ja>
文字クラス$i$の文字と$j$の文字の間に挿入されるカーンやグルーの量を指定する.
-<ratio>は,グルーの自然長のうちどれだけの割合が「後の文字」由来かを示す量で,
+\meta{ratio}は,グルーの自然長のうちどれだけの割合が「後の文字」由来かを示す量で,
$0$から$+1$の実数値をとる.省略時の値は$0.5$である.
このフィールドの値は\Param{differentjfm}の値が
\texttt{pleft},~\texttt{pright},~\texttt{paverage}の値のときのみ実際に用いられる.
例えば,\cite{x4051}では,句点と中点の間には,
句点由来の二分空きと中点由来の四分空きが挿入されるが,この場合には
\begin{itemize}
-\item <width>には$0.5+0.25=0.75$を指定する.
-\item <ratio>には$0.25/(0.5+0.25)=1/3$を指定する.
+\item \meta{width}には$0.5+0.25=0.75$を指定する.
+\item \meta{ratio}には$0.25/(0.5+0.25)=1/3$を指定する.
\end{itemize}
%</ja>
%<*en>
Specifies the amount of kern or glue which will be inserted
between characters in character class~$i$ and those in character class~$j$.
-<ratio> specifies how much the glue is originated in the ``right'' character.
+\meta{ratio} specifies how much the glue is originated in the ``right'' character.
It is a real number between 0 and 1, and treated as 0.5 if omitted. For example,
The width of a glue between an ideographic full stop ``。''
and a fullwidth middle dot ``・'' is three-fourth of fullwidth,
namely halfwidth from the ideographic full stop, and
quarter-width from the fullwidth middle dot. In this case,
-we specify <ratio> to $0.25/(0.5+0.25)=1/3$.
+we specify \meta{ratio} to $0.25/(0.5+0.25)=1/3$.
%</en>
%<*ja>
グルーの指定においては,上記に加えて各 \texttt{[$j$]} の各サブテーブル内に
次のキーを指定できる,
\begin{cslist}[style=standard]
-\item[priority=<priority>]
+\item[priority=\meta{priority}]
\Pkg{luatexja-adjust}による優先順位付き
行長調整(\ref{ssec:adj}節)において,このグルーの優先度を指定する.許される値は以下の通り:
\begin{description}
\item[バージョン1] $-4$から$+3$の間の整数
- \item[バージョン2以降] $-4$から$+3$の間の整数の2つ組\texttt{\{<stretch>, <shrink>\}}か,
- または$-4$から$+3$の間の整数.<stretch>, <shrink>はそれぞれこのグルーが伸びるときの優先度,縮むときの
+ \item[バージョン2以降] $-4$から$+3$の間の整数の2つ組\texttt{\{\meta{stretch}, \meta{shrink}\}}か,
+ または$-4$から$+3$の間の整数.\meta{stretch}, \meta{shrink}はそれぞれこのグルーが伸びるときの優先度,縮むときの
優先度であり,単に整数$i$が指定された場合は\texttt{\{$i$, $i$\}}であると解釈される.
\end{description}
ここで指定する値は,大きい値ほど「先に伸ばされる」「先に縮ませる」ことを意味しており,省略時の値
は0である.範囲外の値が指定されたときの動作は未定義である.
-\item[kanjiskip\_natural=<num>\textrm{, }%
- kanjiskip\_stretch=<num>\textrm{, }kanjiskip\_shrink=<num>]\leavevmode
+\item[kanjiskip\_natural=\meta{num}\textrm{, }%
+ kanjiskip\_stretch=\meta{num}\textrm{, }kanjiskip\_shrink=\meta{num}]\leavevmode
\label{pg:ksp_nat}
JFMによって本来挿入されるグルーの他に
\Param{kanjiskip}分の空白を自然長(\texttt{kanjiskip\_natural}),伸び量(\texttt{kanjiskip\_stretch}),
-縮み量(\texttt{kanjiskip\_shrink})ごとに挿入する\footnote{本来\Param{xkanjiskip}が挿入される場所においては
- \Param{xkanjiskip}分の空白を自然長・伸び量・縮み量ごとに.追加できる.}%
+縮み量(\texttt{kanjiskip\_shrink})ごとに挿入する
+% \footnote{本来\Param{xkanjiskip}が挿入される場所においては\Param{xkanjiskip}分の空白を自然長・伸び量・縮み量ごとに}%
ための指定である.いずれも省略された場合のデフォルト値は0(追加しない)である.
例えば,\LuaTeX-jaの横組標準JFMの \texttt{jfm-ujis.lua} では,
\item 通常の文字「あ」と開き括弧類の間に入るグルーは,自然長・縮み量半角,伸び量0のグルー
となっているが,さらに\Param{kanjiskip}の伸び量に \texttt{kanjiskip\_stretch}(ここでは1)を掛け
た分だけ伸びることが許される.
- \item 同様に,閉じ括弧類(全角コンマ「,」も含む)と通常の文字「う」「え」の間にも
-自然長・縮み量半角,伸び量0のグルー
+ \item 同様に,閉じ括弧類(全角コンマ「,」も含む)と和文文字「う」「え」,
+ 閉じ括弧類と「f」の間も自然長・縮み量半角,伸び量0のグルー
となっているが,さらに\Param{kanjiskip}の伸び量に \texttt{kanjiskip\_stretch}(ここでは1)を掛け
た分だけ伸びることが許される.
\item 一方,開き括弧類と通常の文字の間,また通常の文字と閉じ括弧類の間は
となっている.従って,以下のような組版結果を得る.
\medskip
-\begin{LTXexample}[width=16\zw]
-\leavevmode
-\ltjsetparameter{kanjiskip=0pt plus 3\zw}
-\vrule\hbox to 15\zw{あ「い」う,えお}\vrule
+\begin{LTXexample}[width=18\zw]
+\leavevmode\let\V=\vrule
+\ltjsetparameter{kanjiskip=0pt plus 5\zw}
+\ltjsetparameter{xkanjiskip=0pt plus 0.5\zw}
+\V\hbox spread 7\zw{aあ「い」う,えお」f}\V
-\vrule\hbox{ã\81\82ã\80\8cã\81\84ã\80\8dã\81\86ï¼\8cã\81\88ã\81\8a}\vrule\par
+\vrule\hbox{ã\81\82ã\81\82ã\80\8cã\81\84ã\80\8dã\81\86ï¼\8cã\81\88ã\81\8aã\80\8df}\V\par
\ltjsetparameter{kanjiskip=0pt minus \zw}
-\vrule\hbox to 6.5\zw{あ「い」う,えお}\vrule
+\V\hbox spread -2.5\zw{aあ「い」う,えお」f}\V
\end{LTXexample}
-
\end{cslist}
%</ja>
%<*en>
In case of glue, one can specify following additional keys in each \texttt{[$j$]}
subtable:
\begin{cslist}[style=standard]
-\item[priority=<priority>]
+\item[priority=\meta{priority}]
An integer in $[-4,3]$ (treated as 0 if omitted), or
-a pair of these integers \texttt{\{<stretch>, <shrink>\}} (version 2~or~later).
+a pair of these integers \texttt{\{\meta{stretch}, \meta{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,
and is also easy to shrink.
-\item[kanjiskip\_natural=<num>\textrm{, }%
- kanjiskip\_stretch=<num>\textrm{, }kanjiskip\_shrink=<num>]\leavevmode
+\item[kanjiskip\_natural=\meta{num}\textrm{, }%
+ kanjiskip\_stretch=\meta{num}\textrm{, }kanjiskip\_shrink=\meta{num}]\leavevmode
-These keys specifies the amount of the natural width of \Param{kanjiskip}
+These keys specifies the amount of the natural width of \Param{kanjiskip}%
(the stretch/shrink part, respectively) which will be inserted
in addition to the original JFM glue. Default values of them are all 0.
zero. However, this glue also can be stretched
as much as the stretch part of \Param{kanjiskip} times the value of
\texttt{kanjiskip\_stretch} key (1 in this case).
- \item Between an ideographic closeing brackets (the ideographic comma ``,''
- is included) and an ordinal letter, we have the same glue.
+ \item Between an ideographic closeing brackets (including the ideographic comma ``,'')
+ and an ordinal letter (including an \textbf{ALchar} ``f\/''), we have the same glue.
Again, this glue also can be stretched
as much as the stretch part of \Param{kanjiskip} times the value of
\texttt{kanjiskip\_stretch} key (1 in this case).
Hence we have the following result:
\medskip
-\begin{LTXexample}[width=16\zw]
-\leavevmode
-\ltjsetparameter{kanjiskip=0pt plus 3\zw}
-\vrule\hbox to 15\zw{あ「い」う,えお}\vrule
+\begin{LTXexample}[width=18\zw]
+\leavevmode\let\V=\vrule
+\ltjsetparameter{kanjiskip=0pt plus 5\zw}
+\ltjsetparameter{xkanjiskip=0pt plus 0.5\zw}
+\V\hbox spread 7\zw{aあ「い」う,えお」f}\V
-\vrule\hbox{あ「い」う,えお}\vrule\par
+\vrule\hbox{aあ「い」う,えお」f}\V\par
\ltjsetparameter{kanjiskip=0pt minus \zw}
-\vrule\hbox to 6.5\zw{あ「い」う,えお}\vrule
+\V\hbox spread -2.5\zw{aあ「い」う,えお」f}\V
\end{LTXexample}
\end{cslist}
%</en>
-\item[end\_stretch=<kern>, end\_shrink=<kern>]
+\item[end\_stretch=\meta{kern}, end\_shrink=\meta{kern}]
%<*ja>
(任意,バージョン1のみ)
(optional, version~1 only)
%</en>
- \item[end\_adjust=\{<kern>, <kern>, ...\}]
+ \item[end\_adjust=\{\meta{kern}, \meta{kern}, ...\}]
%<*ja>
(任意,バージョン2以降)
(optional, version~2 or~later)
%</en>
+ \item[round\_threshold=\meta{float}]
+%<*ja>
+(任意,バージョン3以降,文字クラス0のみ)
+
+「実際のグリフの幅に合わせて文字幅を整数倍する」際のしきい値を指定する.
+より正確に述べると,次のようになる.このフィールドに正の数$r$が指定されていたとし,
+JFM中で「文字クラス0の文字幅」と指定されている値が$w$,文字クラス0に属する文字のあるグリフの実際の幅が$w'$であったとする.
+$n=\nint(w'/w)$とした
+\footnote{ここで,$\nint(a)=\lfloor a+0.5\rfloor$は$a$に「もっとも近い整数」を表す.}
+とき,もし$w'>w$かつ$\lvert w'/w-n\rvert \char`<r$であれば,JFMで文字幅$nw$が指定されたものとして扱う.
+
+この機能は,ほとんど源ノ明朝・源ノ角ゴシックにおける2倍角・3倍角ダッシュの合字のために実装されたと
+言ってもよい(この場合$w'=2$,~$3$である).これらのグリフは\LuaTeX 内部ではUnicodeの私用領域に割り当てられるので,
+JFM側で番号を指定することができない.
+%</ja>
+%<*en>
+(optional, version~3 or~later, only available in character class~0)
+%</en>
+
+
\end{cslist}
%<*ja>
%<ja>ここで,次のような入力とその実行結果を考える:
%<en>Now consider the following input/output:
\begin{LTXexample}[width=0.3\textwidth]
-\jfont\a=file:KozMinPr6N-Regular.otf:jfm=test;+hwid
-\setbox0\hbox{\a ヒ漢}
-\the\wd0
+\jfont\a=IPAexMincho:jfm=test;+hwid
+\setbox0\hbox{\a ヒ漢}\the\wd0
\end{LTXexample}
%<*en>
Now we look why the above source outputs 15\,pt.
\item JFMによれば,この「ヒ」のグリフの文字クラスは2000である.
\item 以上により文字クラス2000とみなされるため,結果として「ヒ」の幅は半角だと認識される.
\end{enumerate}
-この例は,\emph{文字クラスの決定はfont featureの適用によるグリフ置換の結果に基づく}ことを
+この例は,\emph{文字クラスの決定はOpenType機能の適用によるグリフ置換の結果に基づく}ことを
示している.
%</ja>
但し,JFMによって決まる置換後のグリフの文字クラスが0である場合は,置換前の文字クラスを採用する.
%</ja>
\begin{LTXexample}[width=0.3\textwidth]
-\jfont\a=file:KozMinPr6N-Regular.otf:jfm=test;+vert
+\jfont\a=HaranoAjiMincho-Regular:jfm=test;+vert
\a 漢。\inhibitglue 漢
\end{LTXexample}
%<*en>
%<*ja>
ここで,句点「。」(\texttt{U+3002})の文字クラスは,以下のようにして決まる.
\begin{enumerate}
-\item \Pkg{luaotfload} によって縦組用句点のグリフに置き換わる.
+\item \Pkg{luaotfload}によって縦組用句点のグリフに置き換わる.
\item 置換後のグリフは \texttt{U+FE12} であり,JFMに従えば文字クラスは\emph{0}と判定される.
\item この場合,置換前の横組用句点のグリフによって文字クラスを判定する.
\item 結果として,上の出力例中の句点の文字クラスは2000となる.
%<ja>\paragraph{仮想的な文字}
%<en>\paragraph{Imaginary characters}
%<*en>
-As described before, you can specify several \emph{imaginary characters} in
+As described before, one can specify several ``imaginary characters'' in
\texttt{chars} field. The most of these characters are regarded as the
characters of class 0 in \pTeX.
As a result, \LuaTeX-ja can control typesetting finer than \pTeX.
%%<ja>JFMやサイズが異なる2つの\textbf{JAchar}の間の境界として用いられる.
\item['boxbdd']
-%<en>The beginning/ending of a hbox, and the beginning of a noindented (i.e., began by \cs{noindent}) paragraph.
-%<ja>hboxの先頭と末尾,及びインデントされていない(\cs{noindent} で開始された)段落の先頭を表す.
+%<*en>
+The beginning/ending of a hbox, and the beginning of a noindented (i.e., began by \cs{noindent}) paragraph.
+If a hbox~$b$ begins (resp.~ends) a glue or kern between this ``charater'' and a \textbf{JAchar},
+\textbf{JAglue} won't be inserted before(resp.~after) the hbox~$b$.
+\Param{kanjiskip}~and~\Param{xkanjiskip} around a hbox.
+%</en>
+%<*ja>
+hboxの先頭と末尾,及びインデントされていない(\cs{noindent} で開始された)段落の先頭を表す.
+この「文字」との間に設定したグルー・カーンがボックス$b$の先頭(もしくは末尾)に来た場合,
+ そのボックス$b$の直前(もしくは直後)には和文処理グルーは入らない.
+%</ja>
\item['parbdd']
%<en>The beginning of an (indented) paragraph.
\texttt{'parbdd'}を入れれば全角下がりとなる.
\begin{LTXexample}[width=0.4\textwidth]
-\jfont\g=KozMinPr6N-Regular:jfm=test \g
+\jfont\g=HaranoAjiMincho-Regular:jfm=test \g
\parindent1\zw\noindent{}◆◆◆◆◆
\par 「◆◆←二分下がり
\par 【◆◆←全角下がり
\autoref{tab-math} shows counterparts to \TeX's primitives for math
font families. There is no relation between the value of
\cs{fam} and that of \cs{jfam}; with appropriate settings,
-you can set both \cs{fam} and \cs{jfam} to the same value.
-Here <jfont\_cs> in the argument of \Param{jatextfont} etc.\ is
+one can set both \cs{fam} and \cs{jfam} to the same value.
+Here \meta{jfont\_cs} in the argument of \Param{jatextfont} etc.\ is
a control sequence which is defined by \cs{jfont}, i.e.,
a \emph{horizontal} Japanese font.
%</en>
\autoref{tab-math}は数式フォントファミリに対する \TeX のプリミティブと対応する
ものを示している.\cs{fam} と \cs{jfam} の値の間には関係はなく,
適切な設定の下では \cs{fam} と \cs{jfam} の両方に同じ値を設定することができる.
-\Param{jatextfont} 他の第2引数<jfont\_cs>は,\cs{jfont} で定義された
+\Param{jatextfont} 他の第2引数\meta{jfont\_cs}は,\cs{jfont} で定義された
\emph{横組用}和文フォントである.\cs{tfont} で定義された
\emph{縦組用}和文フォントを指定することは想定していない.
%</ja>
%<ja>\bf 和文フォント&\bf 欧文フォント\\
\midrule
\cs{jfam}${}\in [0,256)$&\cs{fam}\\
-\tt\Param{jatextfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\cs{textfont}<fam>=<font\_cs>\\
-\tt\Param{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\cs{scriptfont}<fam>=<font\_cs>\\
-\tt\Param{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\cs{scriptscriptfont}<fam>=<font\_cs>\\
+\ttfamily\Param{jatextfont}\,=\{\meta{jfam},\meta{jfont\_cs}\}&\ttfamily\cs{textfont}\meta{fam}=\meta{font\_cs}\\
+\ttfamily\Param{jascriptfont}\,=\{\meta{jfam},\meta{jfont\_cs}\}&\ttfamily\cs{scriptfont}\meta{fam}=\meta{font\_cs}\\
+\ttfamily\Param{jascriptscriptfont}\,=\{\meta{jfam},\meta{jfont\_cs}\}&\ttfamily\cs{scriptscriptfont}\meta{fam}=\meta{font\_cs}\\
\bottomrule
\end{tabular}
\end{table}
%<en>\item[\texttt{luatexja.load\_jfm} callback]
%<ja>\item[\texttt{luatexja.load\_jfm}コールバック]
%<*en>
-With this callback you can overwrite JFMs.
+With this callback, one can overwrite JFMs.
This callback is called when a new JFM is loaded.
%</en>
%<*ja>
The default value is the empty string.
\item[\texttt{chars}]
The mapping table from character codes to its character classes.\\
-The specification \texttt{[i].chars=\{<character>, ...\}} in the JFM will be stored in this
- field as \texttt{chars=\{[<character>]=\,$i$, ...\}}.
+The specification \texttt{[i].chars=\{\meta{character}, ...\}} in the JFM will be stored in this
+ field as \texttt{chars=\{[\meta{character}]=\,$i$, ...\}}.
\item[\texttt{char\_type}]
For $i\in\omega$, \texttt{char\_type[$i$]} is information of characters whose class is
$i$, and has the following fields:
scaled value of those specified by the JFM, by the font size.
\item \texttt{align} is a number which is determined from \texttt{align}~field in the JFM:
\[
- \begin{cases}
- 0&\text{\texttt{'left'} (default)}\\0.5&\text{\tt 'middle'}\\1&\text{\tt 'right'}
- \end{cases}
+ \begin{cases*}
+ 1&(\texttt{'right'} in JFM),\\
+ 0.5&(\texttt{'middle'} in JFM),\\
+ 0&(otherwise).
+ \end{cases*}
\]
\end{itemize}
For $i$,~$j\in \omega$, \texttt{char\_type[$i$][$j$]} stores a kern or a glue which will be inserted
\cs{jfont},~\cs{tfont} で指定された \texttt{jfmvar} キーの値(未指定のときは空文字列).
\item[chars]
文字コードから文字クラスへの対応が記述されたテーブル.\\
-JFM内の \texttt{[i].chars=\{<character>, ...\}} という指定は\
-\texttt{chars=\{[<character>]=\,$i$, ...\}} という形式に変換されている.
+JFM内の \texttt{[i].chars=\{\meta{character}, ...\}} という指定は\
+\texttt{chars=\{[\meta{character}]=\,$i$, ...\}} という形式に変換されている.
\item[char\_type]
$i\in\omega$に対して,\texttt{char\_type[$i$]} は文字クラス$i$の文字の寸法を格納しており,
以下のフィールドを持つ.
JFMで指定されているそれぞれの値をスケーリングしたものである.
\item \texttt{align} はJFMで指定されている値によって,
\[
- \begin{cases}
- 0&\text{\texttt{'left'}や省略時}\\0.5&\text{\tt 'middle'}\\1&\text{\tt 'right'}
- \end{cases}
+ \begin{cases*}
+ 1&(\texttt{'right'} in JFM),\\
+ 0.5&(\texttt{'middle'} in JFM),\\
+ 0&(otherwise).
+ \end{cases*}
\]
のいずれかの値をとる.
\end{itemize}
$i$,~$j\in \omega$に対して,\texttt{char\_type[$i$][$j$]} は
-文字クラス$i$の文字と$j$の文字の間に挿入されるグルーやカーンを格納している.
-\begin{itemize}
- \item 間に入るものがカーンであれば,この値は\
-\texttt{[$j$]=\{[1]=<kern\_node>, ratio=<ratio>\}} であり,
-<kern\_node>はカーンを表すノードそのものである\footnote{%
-バージョン20150420.0以降ではノードのアクセス手法にdirect access
- modelを用いている.そのため,例えば\LuaTeX\ beta-0.78.2では,単なる自然数のようにし
- か見えないことに注意.
-}.
- \item グルーであれば,この値は以下のキーを持つテーブルである.
- \begin{description}
- \item[\texttt{width}, \texttt{stretch}, \texttt{shrink}]
- グルーのそれぞれ自然長,伸び量,縮み量をsp単位で表したもの.
- \item[\texttt{priority}] バ(ージョン2以降の)JFMでの指定 \texttt{\{<stretch>,<shrink>\}} を
- \[
- (\text{<stretch>}+4)\cdot 8+\text{<shrink>}+4
- \]
- として0--63の整数にパックしたもの.
- \item[\texttt{ratio}, \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch}, \texttt{kanjiskip\_shrink}]
- JFM中の同名のフィールドの値がそのまま使われている.
- \end{description}
-\end{itemize}
-\item[ascent\textrm{, }descent]
-……
+文字クラス$i$の文字と$j$の文字の間に挿入されるグルーやカーンの情報を格納している.
+
+間に入るものがカーンであれば,この値は%
+\texttt{[$j$]=\{\meta{kern}, ratio=\meta{ratio}\}}であり,
+\meta{kern}はカーンの値をsp単位で表したものである.
+
+一方,間に入るものがグルーであれば,この値は以下のキーを持つテーブルである.
+\begin{description}
+ \item[{[1], [2], [3]}]
+ グルーのそれぞれ自然長,伸び量,縮み量をsp単位で表したもの.
+ \item[\texttt{priority}] (バージョン2以降の)JFMでの指定 \texttt{\{\meta{stretch},\meta{shrink}\}} を
+ \[
+ (\text{\meta{stretch}}+4)\cdot 8+\text{\meta{shrink}}+4
+ \]
+ として0--63の整数にパックしたもの.
+ \item[\texttt{ratio}, \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch}, \texttt{kanjiskip\_shrink}]
+ JFM中の同名のフィールドの値がそのまま使われている.
+\end{description}
\item[chars\_cbcache]
文字クラス決定の処理で.キャッシュとして使われる.
\end{cslist}
このコールバックで呼び出される関数は次の形をしていなければならない:
%</ja>
\begin{lstlisting}[numbers=left]
-function (<number> char_class, <table> jfont_info, <number> chr_code)
+function (<number> char_class, <table> jfont_info, <number> char_code)
if char_class~=0 then return char_class
else
....
%<*en>
\cs{ltjsetparameter} and \cs{ltjglobalsetparameter} are commands
-for assigning parameters. These take one argument which is a
-\texttt{<key>=<value>} list.
+for assigning parameters. These take one argument which is a key-value list.
The difference between these two commands is the
scope of assignment;
\cs{ltjsetparameter} does a local assignment and
-\cs{ltjglobalsetparameter} does a global one.
+\cs{ltjglobalsetparameter} does a global one by default.
They also obey the value of \cs{globaldefs}, like other assignments.
%</en>
%<*ja>
\cs{ltjsetparameter} と \cs{ltjglobalsetparameter} はパラメータを
-指定するための命令で,\texttt{<key>=<value>}のリストを
-引数としてとる.両者の違いはスコープであり,
+指定するための命令で,key-valueリストを
+引数としてとる.両者の違いはスコープであり,標準では
\cs{ltjsetparameter} はローカルな設定を行うのに対し,
\cs{ltjglobalsetparameter} はグローバルな設定を行う.
また,他のパラメータ指定と同様に \cs{globaldefs} の値にも従う.
\end{itemize}
\begin{cslist}[style=standard]
-\item[\DParam{jcharwidowpenalty}\,=<penalty>$^\ast$] [\cs{jcharwidowpenalty}]\
+\item[\DParam{jcharwidowpenalty}\,=\meta{penalty}$^\ast$] [\cs{jcharwidowpenalty}]\
%<*en>
Penalty value for suppressing orphans. This penalty is inserted just
挿入される.
%</ja>
-\item[\DParam{kcatcode}\,=\{<chr\_code>,<natural number>\}$^\ast$]\
+\item[\DParam{kcatcode}\,=\{\meta{char\_code},\meta{natural number}\}$^\ast$]\
%<*en>
-An additional attributes which each character whose character code is <chr\_code> has.
-At version~20120506.0 or later, the lowermost bit of <natural number> indicates
+An additional attributes which each character whose character code is \meta{char\_code} has.
+At version~20120506.0 or later, the lowermost bit of \meta{natural number} indicates
whether the character is considered as a punctuation mark
(see the description of \Param{jcharwidowpenalty} above).
%</en>
%<*ja>
-文字コードが<chr\_code>の文字が持つ付加的な属性値.
-バージョン20120506.0以降では,<natural number>の最下位ビットが,その文字が句読点と
+文字コードが\meta{char\_code}の文字が持つ付加的な属性値.
+バージョン20120506.0以降では,\meta{natural number}の最下位ビットが,その文字が句読点と
みなされるかどうかを表している(上の\Param{jcharwidowpenalty}の記述を参照).
%</ja>
-\item[\DParam{prebreakpenalty}\,=\{<chr\_code>,<penalty>\}$^\ast$] [\cs{prebreakpenalty}]\
+\item[\DParam{prebreakpenalty}\,=\{\meta{char\_code},\meta{penalty}\}$^\ast$] [\cs{prebreakpenalty}]\
%<*ja>
-文字コード<chr\_code>の\textbf{JAchar}が行頭にくることを抑止するために,
+文字コード\meta{char\_code}の\textbf{JAchar}が行頭にくることを抑止するために,
この文字の前に挿入/追加されるペナルティの量を指定する.
例えば閉じ括弧「〗」は絶対に行頭にきてはならないので,
という制限があったが,\LuaTeX-jaではこれらの制限は解消されている.
%</ja>
%<*en>
-Set a penalty which is inserted automatically before the character <chr\_code>,
+Set a penalty which is inserted automatically before the character \meta{char\_code},
to prevent a line starts from this character. For example, a line cannot started
with one of closing brackets ``〗'', so \LuaTeX-ja sets
\begin{lstlisting}
\end{itemize}
%</en>
-\item[\DParam{postbreakpenalty}\,=\{<chr\_code>,<penalty>\}$^\ast$]
+\item[\DParam{postbreakpenalty}\,=\{\meta{char\_code},\meta{penalty}\}$^\ast$]
[\cs{postbreakpenalty}]\
%<*ja>
-文字コード<chr\_code>の\textbf{JAchar}が行末にくることを抑止するために,
+文字コード\meta{char\_code}の\textbf{JAchar}が行末にくることを抑止するために,
この文字の後に挿入/追加されるペナルティの量を指定する.
%</ja>
%<*en>
-Set a penalty which is inserted automatically after the character <chr\_code>,
+Set a penalty which is inserted automatically after the character \meta{char\_code},
to prevent a line ends with this character.
%</en>
-\item[\DParam{jatextfont}\,=\{<jfam>,<jfont\_cs>\}$^\ast$]
+\item[\DParam{jatextfont}\,=\{\meta{jfam},\meta{jfont\_cs}\}$^\ast$]
%<en>[\cs{textfont} in \TeX]
%<ja>[\TeX の \cs{textfont}]
-\item[\DParam{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}$^\ast$]
+\item[\DParam{jascriptfont}\,=\{\meta{jfam},\meta{jfont\_cs}\}$^\ast$]
%<en>[\cs{scriptfont} in \TeX]
%<ja>[\TeX の \cs{scriptfont}]
-\item[\DParam{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}$^\ast$]
+\item[\DParam{jascriptscriptfont}\,=\{\meta{jfam},\meta{jfont\_cs}\}$^\ast$]
%<en>[\cs{scriptscriptfont} in \TeX]
%<ja>[\TeX の \cs{scriptscriptfont}]
-\item[\DParam{yjabaselineshift}\,=<dimen>]\
-\item[\DParam{yalbaselineshift}\,=<dimen>] [\cs{ybaselineshift}]
-\item[\DParam{tjabaselineshift}\,=<dimen>]\
-\item[\DParam{talbaselineshift}\,=<dimen>] [\cs{tbaselineshift}]
+\item[\DParam{yjabaselineshift}\,=\meta{dimen}]\
+\item[\DParam{yalbaselineshift}\,=\meta{dimen}] [\cs{ybaselineshift}]
+\item[\DParam{tjabaselineshift}\,=\meta{dimen}]\
+\item[\DParam{talbaselineshift}\,=\meta{dimen}] [\cs{tbaselineshift}]
-\item[\DParam{jaxspmode}\,=\{<chr\_code>,<mode>\}$^\ast$]\
+\item[\DParam{jaxspmode}\,=\{\meta{char\_code},\meta{mode}\}$^\ast$]\
%<*en>
-Set whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is <chr\_code>.
-The followings are allowed for <mode>:
+Set whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is \meta{char\_code}.
+The followings are allowed for \meta{mode}:
%</en>
%<*ja>
-文字コードが<chr\_code>の\textbf{JAchar}の前/後ろに\Param{xkanjiskip}の
+文字コードが\meta{char\_code}の\textbf{JAchar}の前/後ろに\Param{xkanjiskip}の
挿入を許すかどうかの設定.
-以下の<mode>が許される:
+以下の\meta{mode}が許される:
%</ja>
\begin{description}
%<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
このパラメータは\pTeX の \cs{inhibitxspcode} プリミティブと似ているが,
互換性はない.
%</ja>
-\item[\DParam{alxspmode}\,=\{<chr\_code>,<mode>\}$^\ast$] [\cs{xspcode}]\
+\item[\DParam{alxspmode}\,=\{\meta{char\_code},\meta{mode}\}$^\ast$] [\cs{xspcode}]\
%<*en>
Set whether inserting \Param{xkanjiskip} is allowed before/after a
- \textbf{ALchar} whose character code is <chr\_code>.
- The followings are allowed for <mode>:
+ \textbf{ALchar} whose character code is \meta{char\_code}.
+ The followings are allowed for \meta{mode}:
%</en>
%<*ja>
-文字コードが<chr\_code>の\textbf{ALchar}の前/後ろに\Param{xkanjiskip}の
+文字コードが\meta{char\_code}の\textbf{ALchar}の前/後ろに\Param{xkanjiskip}の
挿入を許すかどうかの設定.
-以下の<mode>が許される:
+以下の\meta{mode}が許される:
%</ja>
\begin{description}
%<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
これら2つのパラメータは互いの別名となっていることに注意する.
%</ja>
-\item[\DParam{autospacing}\,=<bool>] [\cs{autospacing}]
-\item[\DParam{autoxspacing}\,=<bool>] [\cs{autoxspacing}]
-\item[\DParam{kanjiskip}\,=<skip>$^\ast$] [\cs{kanjiskip}]\
+\item[\DParam{autospacing}\,=\meta{bool}] [\cs{autospacing}]
+\item[\DParam{autoxspacing}\,=\meta{bool}] [\cs{autoxspacing}]
+\item[\DParam{kanjiskip}\,=\meta{skip}$^\ast$] [\cs{kanjiskip}]\
%<*ja>
デフォルトで2つの\textbf{JAchar}の間に挿入されるグルーである.
the value which is specified in the JFM for current Japanese font (See Subsection~\ref{ssec:jfm-str}).
%</en>
-\item[\DParam{xkanjiskip}\,=<skip>$^\ast$] [\cs{xkanjiskip}]\
+\item[\DParam{xkanjiskip}\,=\meta{skip}$^\ast$] [\cs{xkanjiskip}]\
%<*ja>
デフォルトで\textbf{JAchar}と\textbf{ALchar}の間に挿入されるグルーである.
%</en>
-\item[\DParam{differentjfm}\,=<mode>$^\dagger$]\
+\item[\DParam{differentjfm}\,=\meta{mode}$^\dagger$]\
%<*en>
Specify how glues/kerns between two \textbf{JAchar}s whose JFM (or size) are different.
各々の値による差異の詳細は\ref{ssec:cluster-wa}節の「『右空白』の算出」を参照してほしい.
%</ja>
-\item[\DParam{jacharrange}\,=<ranges>]
-\item[\DParam{kansujichar}\,=\{<digit>, <chr\_code>\}$^\ast$] [\cs{kansujichar}]
+\item[\DParam{jacharrange}\,=\meta{ranges}]
+\item[\DParam{kansujichar}\,=\{\meta{digit}, \meta{char\_code}\}$^\ast$] [\cs{kansujichar}]
-\item[\DParam{direction}\,=<dir>\ \hbox{\rm (always local)}]\
+\item[\DParam{direction}\,=\meta{dir}\ \hbox{\normalfont\rmfamily (always local)}]\
%<*en>
Assigning to this parameter has the same effect as
-\cs{yoko}~(if $\hbox{<dir>}=4$), \cs{tate}~(if $\hbox{<dir>}=3$),
-\cs{dtou}~(if $\hbox{<dir>}=1$) or \cs{utod}~(if $\hbox{<dir>}=11$).
-If the argument <dir> is not one of 4,~3, 1~nor~11,
+\cs{yoko}~(if $\hbox{\meta{dir}}=4$), \cs{tate}~(if $\hbox{\meta{dir}}=3$),
+\cs{dtou}~(if $\hbox{\meta{dir}}=1$) or \cs{utod}~(if $\hbox{\meta{dir}}=11$).
+If the argument \meta{dir} is not one of 4,~3, 1~nor~11,
the behavior of this assignment is undefined.
%</en>
%<*ja>
-組方向を変更する \cs{yoko}~(if $\hbox{<dir>}=4$), \cs{tate}~(if $\hbox{<dir>}=3$),
-\cs{dtou}~(if $\hbox{<dir>}=1$), \cs{utod}~(if $\hbox{<dir>}=11$) と同じ役割を持つ.
-利用可能な状況もこれら4命令と同一である.引数<dir>が4,~3, 1,~11のいずれでも無いときの
+組方向を変更する \cs{yoko}~(if $\hbox{\meta{dir}}=4$), \cs{tate}~(if $\hbox{\meta{dir}}=3$),
+\cs{dtou}~(if $\hbox{\meta{dir}}=1$), \cs{utod}~(if $\hbox{\meta{dir}}=11$) と同じ役割を持つ.
+利用可能な状況もこれら4命令と同一である.引数\meta{dir}が4,~3, 1,~11のいずれでも無いときの
動作は未定義である.
%</ja>
\item
%<*en>
-\verb+\ltjgetparameter{jacharrange}{+<range>\verb+}+ returns \texttt{0}
-if ``characters which belong to the character range~<range> are \textbf{JAchar}'',
+\verb+\ltjgetparameter{jacharrange}{+\meta{range}\verb+}+ returns \texttt{0}
+if ``characters which belong to the character range~\meta{range} are \textbf{JAchar}'',
\texttt{1} if ``\dots~are \textbf{ALchar}''.
-Although there is no character range~$-1$, specifying $-1$ to <range> does not cause an
+Although there is no character range~$-1$, specifying $-1$ to \meta{range} does not cause an
error (returns 1).
%</en>
%<*ja>
-\verb+\ltjgetparameter{jacharrange}{+<range>\verb+}+ は,<range>が\textbf{JAchar}達の
-範囲ならば0を,そうでなければ1を返す.「$-1$番の文字範囲」は存在しないが,<range>に$-1$を
+\verb+\ltjgetparameter{jacharrange}{+\meta{range}\verb+}+ は,\meta{range}が\textbf{JAchar}達の
+範囲ならば0を,そうでなければ1を返す.「$-1$番の文字範囲」は存在しないが,\meta{range}に$-1$を
指定してもエラーは発生しない(1を返す).
%</ja>
\item
%<*en>
-For an integer~<digit> between 0~and~9,
- \verb+\ltjgetparameter{kansujichar}{+<digit>\verb+}+ returns the character code
-of the result of \cs{kansuji}<digit>.
+For an integer~\meta{digit} between 0~and~9,
+ \verb+\ltjgetparameter{kansujichar}{+\meta{digit}\verb+}+ returns the character code
+of the result of \cs{kansuji}\meta{digit}.
%</en>
%<*ja>
-0--9の数<digit>に対して,
-\verb+\ltjgetparameter{kansujichar}{+<digit>\verb+}+ は,\cs{kansuji}<digit>で出力され
+0--9の数\meta{digit}に対して,
+\verb+\ltjgetparameter{kansujichar}{+\meta{digit}\verb+}+ は,\cs{kansuji}\meta{digit}で出力され
る文字の文字コードを返す.
%</ja>
%<*en>
\verb+\ltjgetparameter{adjustdir}+ returns a integer which represents
the direction of the surrounding vertical list.
-As \Param{direction}, the return value 1 means \emph{down-to-up} direction,
+As \Param{direction}, the return value 1 means \emph{dtou} direction,
3 means \emph{tate} direction (vertical typesetting),
and 4 means \emph{yoko} direction (horizontal typesetting).
%</en>
\item
%<*en>
-For an integer~<reg\_num> between 0~and~65535,
-\verb+\ltjgetparameter{boxdim}{+<reg\_num>\verb+}+ returns the direction of
-\cs{box}<reg\_num>. If this box register is void, the returned value is zero.
+For an integer~\meta{register} between 0~and~65535,
+\verb+\ltjgetparameter{boxdir}{+\meta{register}\verb+}+ returns the direction of
+\cs{box}\meta{register}. If this box register is void, the returned value is zero.
%</en>
%<*ja>
-0--65535の数<reg\_num>に対して,
-\verb+\ltjgetparameter{boxdim}{+<reg\_num>\verb+}+ は,\cs{box}<reg\_num>に
+0--65535の数\meta{register}に対して,
+\verb+\ltjgetparameter{boxdir}{+\meta{register}\verb+}+ は,\cs{box}\meta{register}に
格納されているボックスの組方向を表す.もしこのレジスタが空の場合は,0が返される.
%</ja>
\item
%<*en>
-\verb+\ltjgetparameter{chartorange}{+<chr\_code>\verb+}+ returns
-the range number which <chr\_code> belongs to
+\verb+\ltjgetparameter{chartorange}{+\meta{char\_code}\verb+}+ returns
+the range number which \meta{char\_code} belongs to
(although there is no parameter named ``chartorange'').
-If <chr\_code> is between 0 and 127, this <chr\_code> does not belong to
+If \meta{char\_code} is between 0 and 127, this \meta{char\_code} does not belong to
any character range. In this case,
- \verb+\ltjgetparameter{chartorange}{+<chr\_code>\verb+}+
+ \verb+\ltjgetparameter{chartorange}{+\meta{char\_code}\verb+}+
returns $-1$.
-Hence, one can know whether <chr\_code> is \textbf{JAchar} or not
+Hence, one can know whether \meta{char\_code} is \textbf{JAchar} or not
by the following:
%</en>
%<*ja>
-\verb+\ltjgetparameter{chartorange}{+<chr\_code>\verb+}+ によって
-<chr\_code>の属する文字範囲の番号を知ることができる.
+\verb+\ltjgetparameter{chartorange}{+\meta{char\_code}\verb+}+ によって
+\meta{char\_code}の属する文字範囲の番号を知ることができる.
-<chr\_code>に0--127の値を指定した場合(このとき,<chr\_code>が属する
+\meta{char\_code}に0--127の値を指定した場合(このとき,\meta{char\_code}が属する
文字範囲は存在しない)は$-1$が返る.
-そのため,<chr\_code>が\textbf{JAchar}か\textbf{ALchar}かは
+そのため,\meta{char\_code}が\textbf{JAchar}か\textbf{ALchar}かは
次で知ることができる:
%</ja>
\begin{quote}
\ttfamily \verb+\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{+%
- <chr\_code>\verb+}}+\\\null\hfill\verb+% 0 if JAchar, 1 if ALchar+
+ \meta{char\_code}\verb+}}+\\\null\hfill\verb+% 0 if JAchar, 1 if ALchar+
\end{quote}
%<*en>
\cs{ltj@setpar@global}を直前に実行せず,単独で
\cs{ltjsetkanjiskip}, \cs{ltjsetxkanjiskip}を実行することは想定されていないので注意.
-
-
-\paragraph{ベースライン補正量の設定}
-\pLaTeX の\Pkg{ascmac}パッケージでは,縦組の欧文ベースライン補正量の一時待避・復帰処理に
-\ \cs{@saveybaselineshift}\ という寸法レジスタを用い
-\begin{lstlisting}
-\@savetbaselineshift\tbaselineshift\tbaselineshift\z@
-...
-\tbaselineshift\@savetbaselineshift
-\end{lstlisting}
-という処理を行っている.
-
-これを\LuaTeX-ja 用に \cs{ltjsetparameter} を使って書き直すと,
-\begin{lstlisting}
-\@savetbaselineshift\ltjgetparameter{talbaselineshift}
-\ltjsetparameter{talbaselineshift=\z@}
-...
-\ltjsetparameter{talbaselineshift=\@savetbaselineshift}
-\end{lstlisting}
-となる.
-
-さて,縦組の欧文ベースライン補正量\Param{talbaselineshift}は,
-実際には \cs{ltj@tablshift} という属性レジスタに格納されている
-(\ref{sec-para}\nobreak 節参照).属性レジスタは長さではなく整数値を格納する\footnote{%
- 従って,\texttt{\textbackslash @savetbaselineshift=\textbackslash ltj@tablshift}\
- のように記述することはできない.属性レジスタを \cs{tbaselineshift} という名称にしなかっ
- たのはそのためである.
-}ものであり,\cs{ltj@tablshift} は補正量を sp 単位で保持することから,
-上記のコードと同じ内容をより速い以下のコードで実現することができる.
-\begin{lstlisting}
-\@savetbaselineshift\ltj@tablshift sp%
-\ltj@tablshift\z@
-...
-\ltj@tablshift\@savetbaselineshift
-\end{lstlisting}
-この手法は \Pkg{ascmac} パッケージの\LuaTeX-ja対応パッチ \Pkg{lltjp-tascmac.sty} で
-実際に用いられている.\Pkg{lltjp-tascmac.sty} は自動的に読み込まれるので,
-ユーザは何も気にせず普通に \Pkg{ascmac} パッケージを \cs{usepackage} で読みこめば良い.
%</ja>
%</en>
-\subsection{\cs{inhibitglue}}
+\subsection{\cs{inhibitglue}, \cs{disinhibitglue}}
%<*en>
-\cs{inhibitglue} suppresses the insertion of \textbf{JAglue}.
+\cs{inhibitglue} suppresses the insertion of a glue/kern soecified in JFM at the place.
The following is an example, using a special JFM that there will be a glue between
the beginning of a box and ``あ'', and also between ``あ''~and~``ウ''.
%</en>
%<*ja>
-\cs{inhibitglue} は\textbf{JAglue}の挿入を抑制する.
+\cs{inhibitglue} は発行箇所でのJFM由来グルー/カーンの挿入を抑制する.
以下は,ボックスの始めと「あ」の間,「あ」「ウ」の間にグルーが入る特別なJFMを用いた例で
ある.
%</ja>
\begin{LTXexample}[width=0.4\textwidth]
-\jfont\g=file:KozMinPr6N-Regular.otf:jfm=test \g
+\jfont\g=HaranoAjiMincho-Regular:jfm=test \g
\fbox{\hbox{あウあ\inhibitglue ウ}}
\inhibitglue\par\noindent あ1
\par\inhibitglue\noindent あ2
\par\noindent\inhibitglue あ3
+\par )4)\inhibitglue 5
\par\hrule\noindent あoff\inhibitglue ice
\end{LTXexample}
%</ja>
%<*en>
+\item \cs{inhibitglue} does \emph{not} suppress \Param{kanjiskip} or \cs{xkanjiskip}.
+%</en>
+%<*ja>
+\item \cs{inhibitglue}は\Param{kanjiskip}, \Param{xkanjiskip}の挿入は抑制しない.
+ 例えば上の例の6行目では,「)」と「5」の間には本来はJFM由来の半角空きが挿入されるはずだが,
+ それが\cs{inhibitglue}で無効になったため,\Param{xkanjiskip}が代わりに挿入されている.
+%</ja>
+
+%<*en>
\item The call of \cs{inhibitglue} in the (restricted) horizontal
mode is only effective on the spot; does not get over boundary of
paragraphs. Moreover, \cs{inhibitglue} cancels ligatures and
kernings, as shown in the last line of above example.
-%</en>
+%</en>i
%<*ja>
\item \cs{inhibitglue} の(制限された)水平モード中での呼び出しはその場でのみ
有効であり,段落の境界を乗り越えない.
%</ja>
\end{itemize}
+%<*en>
+\cs{disinhibitglue} suppresses the effect of \cs{inhbitglue}.
+In other words, \cs{disinhibitglue} allows the insertion of a glue/kern specified by JFM.
+If \cs{inhibitglue}~and~\cs{disinhibitglue} both specified at the same time,
+the latest one is effective.
+This commans is added in the version 20201224.0.
+
+Note that \cs{disinhibitglue} also cancels ligatures and kernings.
+%</en>
+%<*ja>
+\cs{disinhibitglue}は\cs{inhibitglue}の効果を無効化する.
+言い換えれば,(\cs{inhibitglue}で抑制されたはずの))JFM由来グルー/カーンの挿入を許可する.
+同じ箇所に\cs{inhibitglue}と\cs{disinhibitglue}が両方ある場合は,後ろの指定が有効になる.
+この命令はバージョン20201224.0で追加された.
+
+なお,\cs{disinhibitglue}もリガチャやカーニングを打ち消すことに注意されたい.これは
+(\cs{inhibitglue}と同様に)whatsitノードを使って実装されていることによる.
+%</ja>
\subsection{\cs{ltjfakeboxbdd}, \cs{ltjfakeparbegin}}
%<*en>
\end{LTXexample}
+\subsection{\cs{insertxkanjiskip}, \cs{insertkanjiskip}}
+%<*en>
+There are some situations which one wants to insert \Param{xkanjiskip} manually.
+A simple approach is to use \cs{hskip}\cs{ltjgetparameter\{xkanjiskip\}}, but this approach has
+several weak points. To cope with these weak points, \LuaTeX-ja defines a command \cs{insertxkanjiskip} which
+inserts \Param{xkanjiskip} glue manually, from the version 20201224.0.
+\begin{itemize}
+ \item ``\cs{insertxkanjiskip}'' (without any keyword) uses the value of \Param{xkanjiskip} at the place.
+ \item ``\cs{insertxkanjiskip late}'' (with ``\texttt{late}''~keyword) uses the value of \Param{xkanjiskip}
+ at the end of a paragraph/hbox.
+\end{itemize}
+See the example below.
+%</en>
+%<*ja>
+\TeX で日本語の文章を作成していると,
+しばしば「手動で和欧文間空白\Param{xkanjiskip}を挿入したい」という状況に遭遇する.
+このような場合,\cs{hskip}\cs{ltjgetparameter\{xkanjiskip\}}\+とするのがよくある対応であったが,これらには
+次のような難点がある:
+\begin{itemize}
+ \item \cs{xkanjiskip}は「段落やhboxでの終端での値がその段落/hbox全体で用いられる」となっているため,
+ \cs{hskip}\cs{ltjgetparameter\{xkanjiskip\}}\+以降に\Param{xkanjiskip}の値が変わる場合に対応できない.
+ \item \LuaTeX-jaでは,\cs{xkanjiskip}の自然長が$\cs{maxdimen}=(2^{30}-1)\,\mbox{sp}$であった場合,
+ JFMで指定された値を実際に利用することになっているが,それに対応できていない.
+ \item \Pkg{luatexja-adjust}(\ref{ssec:adj}節)による優先度行長調整では,
+ \cs{hskip}\cs{ltjgetparameter\{xkanjiskip\}}\+は手動で挿入したグルーであるから,
+ 自動で挿入された\Param{xkanjiskip}とは
+ 伸縮の優先順序が異なってしまう.
+\end{itemize}
+
+これらの難点に対処した,\Param{xkanjiskip}をグルーとして手動挿入する命令が\cs{insertxkanjiskip}である.
+これはバージョン20201224.0で追加された.
+以下の実行例に示すように,
+\begin{itemize}
+ \item 単独で\cs{insertxkanjiskip}とした場合は,その時点での\Param{xkanjiskip}の値を使用する
+ \item 「\cs{insertxkanjiskip~late}」と\texttt{late}キーワードを後置した場合は,
+ 段落/hbox終了時にそのときの\Param{xkanjiskip}の値に自動設定される
+ (段落/hbox途中での値は未定義)
+ \item どちらであっても,実行箇所に本来なら自動挿入されるはずのJFM由来グルー/カーンは挿入されない
+\end{itemize}
+となっている.
+%</ja>
+\begin{LTXexample}[width=0.3333\textwidth]
+\ltjsetparameter{xkanjiskip=0.25\zw}
+あ(% 0.5\zw (from JFM)
+あ\insertxkanjiskip (% 0.25\zw (xkanjiskip at here)
+あ\insertxkanjiskip late (% 0.25\zw (xkanjiskip at EOP)
+あa% 1.25\zw (xkanjiskip at EOP)
+\\%
+\ltjsetparameter{xkanjiskip=1.25\zw}
+あ\insertxkanjiskip (% 1.25\zw (xkanjiskip at here)
+あa% 1.25\zw (xkanjiskip at EOP)
+%% At the end of the paragraph (EOP), xkanjiskip is 1.25\zw.
+\end{LTXexample}
+
+%<*en>
+There is a similar command \cs{insertkanjiskip} (\Param{kanjiskip} instead~of \Param{xkanjiskip}) is also defined.
+Note that any shorthand form of \cs{insert}[\texttt{x}]\texttt{kanjiskip} are not defined by \LuaTeX-ja.
+%</en>
+%<*ja>
+\cs{insertxkanjiskip}(または\texttt{late}つき)の短縮形
+\footnote{ちょうど\cs{inhibitglue}の短縮形\cs{\ltjalchar`\<}\+に対応するもの.}は
+\LuaTeX-jaでは定義していない.短縮形を使いたい人は,面倒でも各自で
+\begin{lstlisting}
+ \protected\def\+{\insertxkanjiskip late}
+\end{lstlisting}
+などと定義してほしい.
+
+最後になるが,以上の説明の\Param{xkanjiskip}をすべて標準の和文間空白\Param{kanjiskip}に置き換えた
+\cs{insertkanjiskip}命令も準備されている.
+%</ja>
+
\subsection{\cs{ltjdeclarealtfont}}
\label{ssec:altfont}
%<*en>
Using \cs{ltjdeclarealtfont}, one can ``compose'' more than one Japanese fonts.
This \cs{ltjdeclarealtfont} uses in the following form:
\begin{quote}
-\ttfamily \textbackslash ltjdeclarealtfont<base\_font\_cs><alt\_font\_cs>\{<range>\}
+\ttfamily \textbackslash ltjdeclarealtfont\meta{base\_font\_cs}\meta{alt\_font\_cs}\{\meta{range}\}
\end{quote}
-where <base\_font\_cs>~and~<alt\_font\_cs> are defined by \cs{jfont}.
+where \meta{base\_font\_cs}~and~\meta{alt\_font\_cs} are defined by \cs{jfont}.
Its meaning is
\begin{quote}
-If the current Japanese font is <base\_font\_cs>, characters which belong to <range>
-is typeset by another Japanese font <alt\_font\_cs>, instead of <base\_font\_cs>.
+If the current Japanese font is \meta{base\_font\_cs}, characters which belong to \meta{range}
+is typeset by another Japanese font \meta{alt\_font\_cs}, instead of \meta{base\_font\_cs}.
\end{quote}
-Here <range> is a comma-separated list of character codes, but also accepts negative integers:
+Here \meta{range} 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 <base\_font\_cs>. Note that characters which do not exist in <alt\_font\_cs> are
+by \meta{base\_font\_cs}. Note that characters which do not exist in \meta{alt\_font\_cs} are
ignored.
For example, if \cs{hoge} uses \texttt{jfm-ujis.lua}, the standard JFM of \LuaTeX-ja,
and characters in class~1 (ideographic opening brackets)
are typeset by \cs{piyo}.
\end{quote}
+
+Note that specifying negative numbers needs specification like \verb+{-1}-{-1}+,
+because simple ``\texttt{-1}'' is treated as the range between 0~and~1.
%</en>
%<*ja>
\cs{jfont} の書式を見ればわかるように,基本的には\LuaTeX-jaにおける1つの和文フォントに
\cs{ltjdeclarealtfont} は以下の書式で使用する:
\begin{quote}
-\ttfamily \textbackslash ltjdeclarealtfont<base\_font\_cs><alt\_font\_cs>\{<range>\}
+\ttfamily \textbackslash ltjdeclarealtfont\meta{base\_font\_cs}\meta{alt\_font\_cs}\{\meta{range}\}
\end{quote}
-これは「現在の和文フォント」が<base\_font\_cs>であるとき,
-<range>に属する文字は<alt\_font\_cs>を用いて組版される,という意味である.
+これは「現在の和文フォント」が\meta{base\_font\_cs}であるとき,
+\meta{range}に属する文字は\meta{alt\_font\_cs}を用いて組版される,という意味である.
\begin{itemize}
- \item <base\_font\_cs>, <alt\_font\_cs>は
+ \item \meta{base\_font\_cs}, \meta{alt\_font\_cs}は
\cs{jfont} によって定義された和文フォントである.
- \item <range>は文字コードの範囲を表すコンマ区切りのリストであるが,
- 例外として負数$-n$は「<base\_font\_cs>のJFMの文字クラス$n$に属する全ての文字」
+ \item \meta{range}は文字コードの範囲を表すコンマ区切りのリストであるが,
+ 例外として負数$-n$は「\meta{base\_font\_cs}のJFMの文字クラス$n$に属する全ての文字」
を意味する.
-<range>中に<alt\_font\_cs>中に実際には存在しない文字が指定された場合は,
+\meta{range}中に\meta{alt\_font\_cs}中に実際には存在しない文字が指定された場合は,
その文字に対する設定は無視される.
\end{itemize}
%<*ja>
\subsection{\cs{ltjalchar} と \cs{ltjjachar}}
-文字コードが$\text{<chr\_code>}~(\geq 128=\mathtt{0x80})$の文字を
-\ \cs{char} プリミティブを使い \cs{char}<chr\_code> として出力させると,
+文字コードが$\text{\meta{char\_code}}~(\geq 128=\mathtt{0x80})$の文字を
+\ \cs{char} プリミティブを使い \cs{char}\meta{char\_code} として出力させると,
その文字の属する文字範囲(\ref{ssec:setrange}節参照)によって
\textbf{ALchar}か\textbf{JAchar}か,つまり欧文フォントで出力されるか和文フォントで出力され
るかが決まる.
-文字範囲の設定を無視し,文字コードが$\text{<chr\_code>}~(\geq 128=\mathtt{0x80})$の文字を強制的に
+文字範囲の設定を無視し,文字コードが\meta{char\_code}の文字を強制的に
\textbf{ALchar}, \textbf{JAchar}で出力する命令がそれぞれ
\ \cs{ltjalchar},~\cs{ltjjachar} である.使用方法は \cs{char} と同じく
-\ \cs{ltjalchar}<chr\_code>, \cs{ltjjachar}<chr\_code>とすればよい.
-<chr\_code>が127以下の場合は,\cs{ltjjachar} であっても\textbf{ALchar}として出力されること
-に注意.
+\ \cs{ltjalchar}\meta{char\_code}, \cs{ltjjachar}\meta{char\_code}とすればよい.
+\LuaTeX-ja~20190926.0から,\meta{char\_code}が127以下の場合でも\cs{ltjjachar}\meta{char\_code}が
+\textbf{JAchar}として出力されるようになっている.
-以下は\ref{ssec:setrange}節に載せた例に,\cs{char} の動作を追加したものである.
+以下は\ref{ssec:setrange}節に載せた例に,\cs{char} の動作などを追加したものである.
+%</ja>
\begin{LTXexample}[width=0.25\textwidth]
-\gtfamily\large % default, ALchar, JAchar
-¶, \char`¶, \ltjalchar`¶, \ltjjachar`¶\\ % default: ALchar
-α, \char`α, \ltjalchar`α, \ltjjachar`α % default: JAchar
+\gtfamily\large
+¶,\char`¶,\ltjalchar`¶,\ltjjachar`¶\\ % default: ALchar
+α,\char`α,\ltjalchar`α,\ltjjachar`α\\ % default: JAchar
+g,\char`g,\ltjalchar`g,\ltjjachar`g % ALchar unless \ltjjachar
\end{LTXexample}
-%</ja>
%<en>\section{Commands for \LaTeXe}
%<ja>\section{\LaTeXe 用の命令}
%<*en>
\subsection{Loading Japanese fonts in \LaTeXe}
\label{ssec:ltx-jfm}
-From versoin~20190107,
+From version~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,
+ \item \cs{selectfont} loads (and chooses) only the Japanese font for the 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).
%<*ja>
を定義している.なお,\cs{cwd} と \cs{zw},また
\cs{cHT} と \cs{zh} は一致しない可能性がある.なぜなら,
-\cs{cwd},~\cs{cHT} は「あ」の寸法から決定されるのに対し,
+\cs{cwd},~\cs{cHT} は文字クラス0の和文文字の寸法から決定されるのに対し,
\cs{zw} と \cs{zh} はJFMに指定された値に過ぎないからである.
%</ja>
%<*en>
Note that \cs{cwd}~and~\cs{cHT} may differ from \cs{zw}~and~\cs{zh}
respectively.
-On the one hand the former dimensions are determined from the character ``あ'',
+On the one hand the former dimensions are determined from
+a character whose character class is zero,
but on the other hand \cs{zw}~and~\cs{zh} are specified by JFM.
%</en>
-\item[\cs{DeclareYokoKanjiEncoding}\{<encoding>\}\{<text-settings>\}\{<math-settings>\}]
+\item[\cs{DeclareYokoKanjiEncoding}\{\meta{encoding}\}\{\meta{text-settings}\}\{\meta{math-settings}\}]
%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
%<ja>\ \\[\dimexpr-2\baselineskip\relax]
-\item[\cs{DeclareTateKanjiEncoding}\{<encoding>\}\{<text-settings>\}\{<math-settings>\}]
+\item[\cs{DeclareTateKanjiEncoding}\{\meta{encoding}\}\{\meta{text-settings}\}\{\meta{math-settings}\}]
%<*en>
In NFSS2 under \LuaTeX-ja, distinction between alphabetic fonts
それぞれ定義する.
%</ja>
-\item[\cs{DeclareKanjiEncodingDefaults}\{<text-settings>\}\{<math-settings>\}]
+\item[\cs{DeclareKanjiEncodingDefaults}\{\meta{text-settings}\}\{\meta{math-settings}\}]
%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
%<ja>\ \\[\dimexpr-2\baselineskip\relax]
-\item[\cs{DeclareKanjiSubstitution}\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}]
+\item[\cs{DeclareKanjiSubstitution}\{\meta{encoding}\}\{\meta{family}\}\{\meta{series}\}\{\meta{shape}\}]
%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
%<ja>\ \\[\dimexpr-2\baselineskip\relax]
-\item[\cs{DeclareErrorKanjiFont}\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}\{<size>\}]
+\item[\cs{DeclareErrorKanjiFont}\{\meta{encoding}\}\{\meta{family}\}\{\meta{series}\}\{\meta{shape}\}\{\meta{size}\}]
%<*en>
The above 3~commands are just the counterparts for \cs{DeclareFontEncodingDefaults} and~others.
上記3つのコマンドはちょうどNFSS2 の \cs{DeclareFontEncodingDefaults} などに対応するものである.
%</ja>
-\item[\cs{reDeclareMathAlphabet}\{<unified-cmd>\}\{<al-cmd>\}\{<ja-cmd>\}]
+\item[\cs{reDeclareMathAlphabet}\{\meta{unified-cmd}\}\{\meta{al-cmd}\}\{\meta{ja-cmd}\}]
% ToDo: en
%<*ja>
和文・欧文の数式用フォントファミリを一度に変更する命令を作成する.
-具体的には,欧文数式用フォントファミリ変更の命令<al-cmd>(\cs{mathrm} 等)と,和文数式用フォ
- ントファミリ変更の命令<ja-cmd>(\cs{mathmc} 等)の2つを同時に行う命令として
- <unified-cmd>を(再)定義する.実際の使用では<unified-cmd>と
- <al-cmd>に同じものを指定する,すなわち,<al-cmd>で和文側も変
+具体的には,欧文数式用フォントファミリ変更の命令\meta{al-cmd}(\cs{mathrm} 等)と,和文数式用フォ
+ ントファミリ変更の命令\meta{ja-cmd}(\cs{mathmc} 等)の2つを同時に行う命令として
+ \meta{unified-cmd}を(再)定義する.実際の使用では\meta{unified-cmd}と
+ \meta{al-cmd}に同じものを指定する,すなわち,\meta{al-cmd}で和文側も変
更させるようにするのが一般的と思われる.
本命令は
-\begin{center}\tt
-<unified-cmd>\{<arg>\}\quad$\longrightarrow$\quad
-(<al-cmd>の1段展開結果)\{<ja-cmd>の1段展開結果)\{<arg>\}\}
+\begin{center}
+\meta{unified-cmd}\texttt{\{}\meta{arg}\texttt{\}}\quad$\longrightarrow$\quad
+(\meta{al-cmd}の1段展開結果)\texttt{\{}\meta{ja-cmd}の1段展開結果)\texttt{\{\meta{arg}\}\}}
\end{center}
と定義を行うので,使用には注意が必要である:
%<en>\vspace{-\medskipamount}
\begin{itemize}
-\item <al-cmd>,~<ja-cmd>は既に定義されていなければならない.
+\item \meta{al-cmd},~\meta{ja-cmd}は既に定義されていなければならない.
\cs{reDeclareMathAlphabet}\\の後に
-両命令の内容を再定義しても,<unified-cmd>の内容にそれは反映されない.
-\item <al-cmd>,~<ja-cmd>に\verb+\@mathrm+などと \texttt{@} をつけた命令を指定した時の動作は保証できない.
+両命令の内容を再定義しても,\meta{unified-cmd}の内容にそれは反映されない.
+\item \meta{al-cmd},~\meta{ja-cmd}に\verb+\@mathrm+などと \texttt{@} をつけた命令を指定した時の動作は保証できない.
\end{itemize}
%</ja>
-\item[\cs{DeclareRelationFont}\{<ja-encoding>\}\{<ja-family>\}\{<ja-series>\}\{<ja-shape>\}\\*
- \null\hfill\{<al-encoding>\}\{<al-family>\}\{<al-series>\}\{<al-shape>\}]
+\item[\cs{DeclareRelationFont}\{\meta{ja-encoding}\}\{\meta{ja-family}\}\{\meta{ja-series}\}\{\meta{ja-shape}\}\\*
+ \null\hfill\{\meta{al-encoding}\}\{\meta{al-family}\}\{\meta{al-series}\}\{\meta{al-shape}\}]
%<*en>
This command sets the ``accompanied'' alphabetic font (given by the latter 4~arguments)
with respect to a Japanese font given by the former 4~arguments.
\item[\cs{adjustbaseline}]
%<*en>
In \pLaTeXe, \cs{adjustbaseline} sets \cs{tbaselineshift}
-to match the vertical center of ``M'' and that of ``あ'' in vertical typesetting:
+to match the vertical center of ``M'' and that of ``漢'' in vertical typesetting:
\[
\text{\cs{tbaselineshift}} \leftarrow
-\frac{(h_{\text{M}}+d_{\text{M}}) - (h_{\text{あ}}+d_{\text{あ}})}2
- + d_{\text{あ}} - d_{\text{M}},
+\frac{(h_{\text{M}}+d_{\text{M}}) - (h_{\text{漢}}+d_{\text{漢}})}2
+ + d_{\text{漢}} - d_{\text{M}},
\]
where $h_{a}$~and~$d_{a}$ denote the height of ``$a$'' and the depth, respectively.
In \LuaTeX-ja, this \cs{adjustbaseline} does similar task, namely setting the
- \Param{talbaselineshift} parameter.
-If the \LaTeX\ is 2015/10/01 release or later, \LuaTeX-ja use a Japanese
-character whose character class is zero, instead of `あ'.
+ \Param{talbaselineshift} parameter
+(a Japanese character whose character class is zero is used, instead of `漢' ).
%</en>
%<*ja>
-\pLaTeXe では,\cs{adjustbaseline} は縦組時に「M」と「あ」の中心線を一致させるために,
-\cs{tbaselineshift} ã\82\92è¨å®\9aã\81\99ã\82\8bå½¹å\89²ã\82\92æ\8c\81ã\81£ã\81¦ã\81\84ã\81\9f:
+\pLaTeXe では,\cs{adjustbaseline} は縦組時に「M」と「漢」の中心線を一致させるために,
+\cs{tbaselineshift} ã\82\92è¨å®\9aã\81\99ã\82\8bå½¹å\89²ã\82\92æ\8c\81ã\81£ã\81¦ã\81\84ã\82\8b:
\[
\text{\cs{tbaselineshift}} \leftarrow
-\frac{(h_{\text{M}}+d_{\text{M}}) - (h_{\text{あ}}+d_{\text{あ}})}2
- + d_{\text{あ}} - d_{\text{M}},
+\frac{(h_{\text{M}}+d_{\text{M}}) - (h_{\text{漢}}+d_{\text{漢}})}2
+ + d_{\text{漢}} - d_{\text{M}},
\]
ここで,$h_{a}$,~$d_{a}$はそれぞれ「$a$」の高さ・深さを表す.
-\LuaTeX-jaにおいても\cs{adjustbaseline} は同様に\Param{talbaselineshift}パラメータの調整処
- 理を行っている.
-
-同時に,これも\pLaTeXe の \cs{adjustbaseline} で同様の処理が行われていたが,
-「漢」の寸法を元に(本節の最初に述べた,小文字で始まる)\cs{cht}, \cs{cwd}
-といった長さ変数を設定する.
+\LuaTeX-jaにおいても,同じように\cs{adjustbaseline}は\Param{talbaselineshift}パラメータの調整処
+ 理を行っている(但し「漢」でなく「文字クラス0の和文文字」を用いる).
-なお,\LaTeX が2015/10/01版以降の場合は,「あ」「漢」の代わりに
-「文字クラス0の和文文字」を用いる.
+\pLaTeXe では,\cs{adjustbaseline}で(本節の最初に述べた,小文字で始まる)\cs{cht}, \cs{cwd}%の
+ 設定処理も行っていたが,\LuaTeX-jaでも全く同様である.
%</ja>
-\item[\cs{fontfamily}\{<family>\}]
+\item[\cs{fontfamily}\{\meta{family}\}]
%<*en>
As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both})
-to <family>. See Subsection~\ref{ssec:fontfamilycmd} for detail.
+to \meta{family}. See Subsection~\ref{ssec:fontfamilycmd} for detail.
%</en>
%<*ja>
元々の\LaTeXe におけるものと同様に,このコマンドは現在のフォントファミリ(欧文,
-和文,\emph{もしくは両方})を<family>に変更する.詳細は\ref{ssec:fontfamilycmd}節を参照すること.
+和文,\emph{もしくは両方})を\meta{family}に変更する.詳細は\ref{ssec:fontfamilycmd}節を参照すること.
+%</ja>
+
+\item[\cs{fontshape}\{\meta{shape}\}\textrm{, }\cs{fontshapeforce}\{\meta{shape}\}]
+%<*en>
+As in \LaTeXe, this command changes current alphabetic font shape
+according to shape change rules.
+
+Traditionally, \cs{fontshape} changes also current Japanese font shape always.
+However, this leads a lot of \LaTeX\ font warning like
+\begin{verbatim}
+ Font shape `JY3/mc/m/it' undefined
+ using `JY3/mc/m/n' instead on ....
+\end{verbatim}
+when \cs{itshape} is called,
+because almost all Japanese fonts only have shape ``\texttt{n}'', and \cs{itshape} calls \cs{fontshape}.
+
+\LuaTeX-ja~20200323.0 change the behavior. Namely,
+\cs{fontshape\{\meta{shape}\}}~and~\cs{fontshapeforce\{\meta{shape}\}} change current Japanese font shape, only if
+the required shape (according to shape changing rules) or \meta{shape} is avaliable in current Japanese font family/series.
+When this is not the case, an info such as
+\begin{verbatim}
+ Kanji font shape JY3/mc/m/it' undefined
+ No change on ...
+\end{verbatim}
+is issued instead of a warning.
+%</en>
+%<*ja>
+元々の\LaTeXe におけるものと同様に,このコマンドは現在の欧文フォントシェイプを
+\cs{DeclareFontShapeChangeRule}によるシェイプ更新規則によって変更する.
+
+伝統的には,\cs{fontshape}は無条件に和文フォントシェイプも変更した.しかし,例えば多くの和文フォントは
+シェイプが``\texttt{n}''しか持たないことと\cs{itshape}が\cs{fontshape}を呼び出すことから,
+\begin{verbatim}
+ Font shape `JY3/mc/m/it' undefined
+ using `JY3/mc/m/n' instead on ....
+\end{verbatim}
+といった警告をもたらしてしまっていた.
+
+一方,\LuaTeX-ja 20200323.0以降では,
+\cs{fontshape\{\meta{shape}\}}, \cs{fontshapeforce\{\meta{shape}\}}が和文フォントシェイプを更新するのは,
+シェイプ更新規則に基づいた値や\meta{shape}の少なくとも一つが現在の和文フォントファミリ・シリーズで利用可能なときに限られる.
+どちらでもなく,和文フォントシェイプが変更されなかった場合には
+\begin{verbatim}
+ Kanji font shape JY3/mc/m/it' undefined
+ No change on ...
+\end{verbatim}
+というinfo(警告でなく)を出力する.
+%</ja>
+
+\item[\cs{kanjishape}\{\meta{shape}\}\textrm{, }\cs{kanjishapeforce}\{\meta{shape}\}]
+%<*en>
+\cs{kanjishape\{\meta{shape}\}} changes current Japanese font shape according to shape change rules, and
+\cs{kanjishapeforce\{\meta{shape}\}} changes current Japanese font shape to \meta{shape}, regardless of the rules.
+Hence \cs{kanjishape\{it\}} produces a warning
+\begin{verbatim}
+ Font shape `JY3/mc/m/it' undefined
+ using `JY3/mc/m/n' instead on ....
+\end{verbatim}
+which is not produced by \cs{fontshape\{it\}}.
+%</en>
+%<*ja>
+ ...
%</ja>
\begin{figure}[!tb]
\begin{LTXexample}[pos=b]
\DeclareKanjiFamily{JY3}{edm}{}
-\DeclareFontShape{JY3}{edm}{m}{n} {<-> s*KozMinPr6N-Regular:jfm=ujis;}{}
-\DeclareFontShape{JY3}{edm}{m}{green}{<-> s*KozMinPr6N-Regular:jfm=ujis;color=007F00}{}
-\DeclareFontShape{JY3}{edm}{m}{blue} {<-> s*KozMinPr6N-Regular:jfm=ujis;color=0000FF}{}
-\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{green}{"4E00-"67FF,{-2}-{-2}}
-\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{blue}{ "6800-"9FFF}
+\DeclareFontShape{JY3}{edm}{m}{n} {<-> s*HaranoAjiMincho-Regular:jfm=ujis}{}
+\DeclareFontShape{JY3}{edm}{m}{fb} {<-> s*HaranoAjiGothic-Regular:jfm=ujis;color=003FFF}{}
+\DeclareFontShape{JY3}{edm}{m}{fb2} {<-> s*HaranoAjiGothic-Regular:jfm=ujis;color=FF1900}{}
+\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{fb}{ "4E00-"67FF,{-2}-{-2}}
+\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{fb2}{"6800-"9FFF}
{\kanjifamily{edm}\selectfont
日本国民は、正当に選挙された国会における代表者を通じて行動し、……}
\end{LTXexample}
\label{fig:altkanji}
\end{figure}
-\item[\cs{DeclareAlternateKanjiFont}\{<base-encoding>\}\{<base-family>\}\{<base-series>\}\{<base-shape>\}\\
- \null\hfill\{<alt-encoding>\}\{<alt-family>\}\{<alt-series>\}\{<alt-shape>\}\{<range>\}]
+\item[\cs{DeclareAlternateKanjiFont}\\
+ \{\meta{base-encoding}\}\{\meta{base-family}\}\{\meta{base-series}\}\{\meta{base-shape}\}\\
+ \{\meta{alt-encoding}\}\{\meta{alt-family}\}\{\meta{alt-series}\}\{\meta{alt-shape}\}\{\meta{range}\}]
%<*ja>
\ref{ssec:altfont}節の\
\cs{ltjdeclarealtfont} と同様に,前半の4引数の
-和文フォント(基底フォント)のうち<range>中の文字を
+和文フォント(基底フォント)のうち\meta{range}中の文字を
第5から第8引数の和文フォントを使って組むように指示する.
使用例を図\nobreak\ref{fig:altkanji}に載せた.
\begin{itemize}
\item
\cs{ltjdeclarealtfont} では基底フォント・置き換え先和文フォントはあらかじめ定義されてい
- ã\81ªã\81\84ã\81¨ã\81\84ã\81\91ã\81ªã\81\84ï¼\88ã\81\9dã\81®ä»£ã\82\8fã\82\8aå\8d³æ\99\82ç\99ºå\8a¹ï¼\89ã\81§ã\81\82ã\81£ã\81\9fã\81\8cï¼\8c
+ ないといけない(その代わり即時発効)たが,
\cs{DeclareAlternateKanjiFont} の設定が
実際に効力が発揮するのは,書体変更やサイズ変更を行った時,
あるいは(これらを含むが)\cs{selectfont} が実行された時である.
\item
段落やhboxの最後での設定値が段落/hbox全体にわたって通用する点や,
-<range>に負数$-n$を指定した場合,それが「基底フォントの文字クラス$n$に属する文字全体」
+\meta{range}に負数$-n$を指定した場合,それが「基底フォントの文字クラス$n$に属する文字全体」
と解釈されるのは \cs{ltjdeclarealtfont} と同じである.
\end{itemize}%
%</ja>
%<*en>
As \cs{ltjdeclarealtfont}~(Subsection~\ref{ssec:altfont}),
-characters in <range> of the Japanese font (we say the \emph{base font})
+characters in \meta{range} of the Japanese font (we say the \emph{base font})
which specified by first 4 arguments are typeset
by the Japanese font which specified by fifth to eighth arguments
(we say the \emph{alternate font}).
%<ja>\subsection{\cs{fontfamily}コマンドの詳細}
\label{ssec:fontfamilycmd}
%<*en>
-In this subsection, we describe when \cs{fontfamily}<family> changes current
+In this subsection, we describe when \cs{fontfamily}\meta{family} changes current
Japanese/alphabetic font family. Basically, current Japanese fotn family is changed to
-<family> if it is recognized as a Japanese font family, and similar with alphabetic font
+\meta{family} 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
-<family>, and another case that <family> isn't recognized as a Japanese/alphabetic font
+\meta{family}, and another case that \meta{family} isn't recognized as a Japanese/alphabetic font
family either.
\paragraph{Recognition as Japanese font family}
We use an auxiliary list~$N_{\mathrm{J}}$.
%</en>
%<*ja>
-本節では,\cs{fontfamily}<family> がいつ和文/欧文フォントファミリを変更するかについて解説
-する.基本的には,<family>が和文フォントファミリだと認識されれば和文側が,欧文フォントファ
+本節では,\cs{fontfamily}\meta{family} がいつ和文/欧文フォントファミリを変更するかについて解説
+する.基本的には,\meta{family}が和文フォントファミリだと認識されれば和文側が,欧文フォントファ
ミリだと認識されれば欧文側が変更される.どちらとも認識されれば和文・欧文の両方が変わるこ
とになるし,当然どちらとも認識されないこともある.
\paragraph{和文フォントファミリとしての認識}
-まず,<family>が和文フォントファミリとして認識されるかは以下の順序で決定される.
+まず,\meta{family}が和文フォントファミリとして認識されるかは以下の順序で決定される.
これは\pLaTeXe の \cs{fontfamily} にとても似ているが,ここではLuaによって実装している.
補助的に「和文フォントファミリではないと認識された」ファミリを格納したリスト$N_{\mathrm{J}}$を用いる.
%</ja>
\begin{enumerate}
%<*en>
-\item If the family~<family> has been defined already by \cs{DeclareKanjiFamily},
- <family> is recognized as a Japanese font family.
- Note that <family> need not be defined under \emph{current} Japanese font encoding.
+\item If the family~\meta{family} has been defined already by \cs{DeclareKanjiFamily},
+ \meta{family} is recognized as a Japanese font family.
+ Note that \meta{family} need not be defined under \emph{current} Japanese font encoding.
%</en>
%<*ja>
-\item ファミリ<family>が既に \cs{DeclareKanjiFamily} によって定義されている場合,
- <family>は和文フォントファミリであると認識される.
- ここで,<family>は現在の和文フォントエンコーディングで定義されていなくてもよい.
+\item ファミリ\meta{family}が既に \cs{DeclareKanjiFamily} によって定義されている場合,
+ \meta{family}は和文フォントファミリであると認識される.
+ ここで,\meta{family}は現在の和文フォントエンコーディングで定義されていなくてもよい.
%</ja>
%<*en>
-\item If the family~<family> has been listed in a list~$N_{\mathrm{J}}$, this means
- that <family> is not a Japanese font family.
+\item If the family~\meta{family} has been listed in a list~$N_{\mathrm{J}}$, this means
+ that \meta{family} is not a Japanese font family.
%</en>
%<*ja>
-\item ファミリ<family>がリスト$N_{\mathrm{J}}$に既に含まれていれば,それは
- <family>が和文フォントファミリではないことを意味する.
+\item ファミリ\meta{family}がリスト$N_{\mathrm{J}}$に既に含まれていれば,それは
+ \meta{family}が和文フォントファミリではないことを意味する.
%</ja>
%<*en>
-\item If the \Pkg{luatexja-fontspec} package is loaded, we stop here, and <family> is not
+\item If the \Pkg{luatexja-fontspec} package is loaded, we stop here, and \meta{family} 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~<enc> such that
- a font definition named \texttt{<enc><family>.fd} (the file name is
- all lowercase) exists. If so, <family> is recognized as a Japanese font family (the font definition file won't be loaded here).
- If not, <family> is not a Japanese font family, and
- <family> is appended to the list~$N_{\mathrm{J}}$.
+now \LuaTeX-ja looks whether there exists a Japanese font encoding~\meta{enc} such that
+ a font definition named \texttt{\meta{enc}\meta{family}.fd} (the file name is
+ all lowercase) exists. If so, \meta{family} is recognized as a Japanese font family (the font definition file won't be loaded here).
+ If not, \meta{family} is not a Japanese font family, and
+ \meta{family} is appended to the list~$N_{\mathrm{J}}$.
%</en>
%<*ja>
\item もし\Pkg{luatexja-fontspec}パッケージが読み込まれていれば,ここで終了であり,
-<family>は和文フォントファミリとして認識されないことになる.
+\meta{family}は和文フォントファミリとして認識されないことになる.
-もし\Pkg{luatexja-fontspec}パッケージが読み込まれていなければ,和文エンコーディング<enc>で
-フォント定義ファイル\texttt{<enc><family>.fd}(ファイル名は全て小文字)が存在するようなも
+もし\Pkg{luatexja-fontspec}パッケージが読み込まれていなければ,和文エンコーディング\meta{enc}で
+フォント定義ファイル\texttt{\meta{enc}\meta{family}.fd}(ファイル名は全て小文字)が存在するようなも
のがあるかどうかを調べる.
-存在すれば,<family>は和文フォントファミリと認識される(フォント定義ファイルは読み込まれな
+存在すれば,\meta{family}は和文フォントファミリと認識される(フォント定義ファイルは読み込まれな
い).
-存在しなければ,<family>は和文フォントファミリでないと認識され,リスト$N_{\mathrm{J}}$に<family>を追加することでそれを記憶する.
+存在しなければ,\meta{family}は和文フォントファミリでないと認識され,リスト$N_{\mathrm{J}}$に\meta{family}を追加することでそれを記憶する.
%</ja>
\end{enumerate}
%</en>
%<*ja>
\paragraph{欧文フォントファミリとしての認識}
-同様に,<family>が和文フォントファミリとして認識されるかは以下の順序で決定される.
+同様に,\meta{family}が和文フォントファミリとして認識されるかは以下の順序で決定される.
補助的に「欧文フォントファミリと既に認識された」ファミリのリスト$F_{\textrm{A}}$と,
「欧文フォントファミリではないと認識された」ファミリを格納したリスト$N_{\mathrm{A}}$を用いる.
%</ja>
\begin{enumerate}
%<*en>
-\item If the family~<family> has been listed in a list~$F_{\mathrm{A}}$,
- <family> is recognized as an alphabetic font family.
+\item If the family~\meta{family} has been listed in a list~$F_{\mathrm{A}}$,
+ \meta{family} is recognized as an alphabetic font family.
%</en>
%<*ja>
-\item ファミリ<family>がリスト$F_{\mathrm{A}}$に既に含まれていれば,
- <family>は欧文フォントファミリと認識される.
+\item ファミリ\meta{family}がリスト$F_{\mathrm{A}}$に既に含まれていれば,
+ \meta{family}は欧文フォントファミリと認識される.
%</ja>
%<*en>
-\item If the family~<family> has been listed in a list~$N_{\mathrm{A}}$, this means
- that <family> is not an alphabetic font family.
+\item If the family~\meta{family} has been listed in a list~$N_{\mathrm{A}}$, this means
+ that \meta{family} is not an alphabetic font family.
%</en>
%<*ja>
-\item ファミリ<family>がリスト$N_{\mathrm{A}}$に既に含まれていれば,それは
- <family>が欧文フォントファミリではないことを意味する.
+\item ファミリ\meta{family}がリスト$N_{\mathrm{A}}$に既に含まれていれば,それは
+ \meta{family}が欧文フォントファミリではないことを意味する.
%</ja>
%<*en>
-\item If there exists an alphabetic font encoding such that the family~<family> has been
- defined under it, <family> is recognized as an alphabetic font family, and
- to memorize this, <family> is appended to the list~$F_{\mathrm{A}}$.
+\item If there exists an alphabetic font encoding such that the family~\meta{family} has been
+ defined under it, \meta{family} is recognized as an alphabetic font family, and
+ to memorize this, \meta{family} is appended to the list~$F_{\mathrm{A}}$.
%</en>
%<*ja>
-\item ある欧文フォントエンコーディング下でファミリ<family>が定義されていれば,
- <family>は欧文フォントファミリと認識され,リスト$F_{\mathrm{A}}$に<family>を追加することでこのことを記憶する.
+\item ある欧文フォントエンコーディング下でファミリ\meta{family}が定義されていれば,
+ \meta{family}は欧文フォントファミリと認識され,リスト$F_{\mathrm{A}}$に\meta{family}を追加することでこのことを記憶する.
%</ja>
%<*en>
-\item Now \LuaTeX-ja looks whether there exists an alphabetic font encoding~<enc> such that
- a font definition named \texttt{<enc><family>.fd} (the file name is
+\item Now \LuaTeX-ja looks whether there exists an alphabetic font encoding~\meta{enc} such that
+ a font definition named \texttt{\meta{enc}\meta{family}.fd} (the file name is
all lowercase) exists. If so, current alphabetic font family will be changed to
- <family>~(the font definition file won't be loaded here).
+ \meta{family}~(the font definition file won't be loaded here).
If not, current alphabetic font family won't be changed, and
- <family> is appended to the list~$N_{\mathrm{A}}$.
+ \meta{family} is appended to the list~$N_{\mathrm{A}}$.
%</en>
%<*ja>
-\item 最終段階では,欧文エンコーディング<enc>で
-フォント定義ファイル\texttt{<enc><family>.fd}(ファイル名は全て小文字)が存在するようなも
+\item 最終段階では,欧文エンコーディング\meta{enc}で
+フォント定義ファイル\texttt{\meta{enc}\meta{family}.fd}(ファイル名は全て小文字)が存在するようなも
のがあるかどうかを調べる.
-存在すれば,<family>は欧文フォントファミリと認識される(フォント定義ファイルは読み込まれない).
-存在しなければ,<family>は欧文フォントファミリと認識されないので,リスト$N_{\mathrm{A}}$に
- <family>を追加してそのことを記憶する.
+存在すれば,\meta{family}は欧文フォントファミリと認識される(フォント定義ファイルは読み込まれない).
+存在しなければ,\meta{family}は欧文フォントファミリと認識されないので,リスト$N_{\mathrm{A}}$に
+ \meta{family}を追加してそのことを記憶する.
%</ja>
\end{enumerate}
%<en>\paragraph{Remarks}
%<ja>\paragraph{注意}
%<*en>
-Of course, there is a case that <family> is not recognized as a Japanese font family, nor
+Of course, there is a case that \meta{family} is not recognized as a Japanese font family, nor
an alphabetic font family.
-In this case, \LuaTeX-ja treats ``the argument <family> is wrong'', so
-set both current alphabetic and Japanese font family to <family>,
+In this case, \LuaTeX-ja treats ``the argument \meta{family} is wrong'', so
+set both current alphabetic and Japanese font family to \meta{family},
to use the default family for font substitution.
%</en>
%<*ja>
さて,引数によっては,「和文フォントファミリとも欧文フォントファミリも認識されなかった」
という事態もあり得る.
- この場合,引数<family>は不正だった,ということになるので,
-和文・欧文の両方のフォントファミリを<family>に設定し,代用フォントが使われるに任せることにする.
+ この場合,引数\meta{family}は不正だった,ということになるので,
+和文・欧文の両方のフォントファミリを\meta{family}に設定し,代用フォントが使われるに任せることにする.
%</ja>
%<*en>
%</ja>
%<*en>
+\section{expl3 interface}
+This section describes expl3 interfaces provided by \LuaTeX-ja.
+All of them belong to te \texttt{platex} module, since they are provided for compatibility with Japanese \pLaTeX.
+Note that commands which are marked with dagger (``\dagger'') are additions by \LuaTeX-ja.
+%</en>
+%<*ja>
+\section{expl3形式の命令}
+expl3の文法に沿った組方向変更命令や組方向による条件判断文である.
+これらは\pLaTeX との互換性の為に用意されているので,\texttt{platex}モジュールとして定義されている.
+なお,``\dagger''がついている命令は\LuaTeX-ja独自のものである.
+%</ja>
+\begin{cslist}
+ \item[\cs{platex\_direction\_yoko:}\textrm{, }\cs{platex\_direction\_tate:}\textrm{, }\cs{platex\_direction\_dtou:}]
+%<ja> それぞれ\cs{yoko},~\cs{tate},~\cs{dtou}と同義.
+%<en> Synonyms for \cs{yoko},~\cs{tate}~and~\cs{dtou}, respectively.
+ \item[\cs{platex\_if\_direction\_yoko\_p:}]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+ \item[\cs{platex\_if\_direction\_yoko:\underline{\textsl{TF}}} \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> 現在の組方向が横組であるか否かをテストする.
+%<en> Tests if the current direction is \emph{yoko} (horizontal writing).
+ \item[\cs{platex\_if\_direction\_tate\_nomath\_p:}$^\dagger$]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+ \item[\cs{platex\_if\_direction\_tate\_nomath:\underline{\textsl{TF}}}$^\dagger$ \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> 現在の組方向が縦組であるか否かをテストする.
+%<en> Tests if the current direction is \emph{tate} (vertical writing).
+ \item[\cs{platex\_if\_direction\_tate\_math\_p:}$^\dagger$]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+ \item[\cs{platex\_if\_direction\_tate\_math:\underline{\textsl{TF}}}$^\dagger$ \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> 現在の組方向がutod方向(\pTeX でいう「縦数式ディレクション」)であるか否かをテストする.
+%<en> Tests if the current direction is \emph{utod}.
+ \item[\cs{platex\_if\_direction\_tate\_p:}]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+ \item[\cs{platex\_if\_direction\_tate:\underline{\textsl{TF}}} \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> 現在の組方向が縦組またはutod方向であるか否かをテストする.
+%<en> Tests if the current direction is \emph{tate}~or~\emph{utod}.
+ \item[\cs{platex\_if\_direction\_dtou\_p:}]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+ \item[\cs{platex\_if\_direction\_dtou:\underline{\textsl{TF}}} \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> 現在の組方向がdtou方向であるか否かをテストする.
+%<en> Tests if the current direction is \emph{dtou}.
+ \item[\cs{platex\_if\_box\_yoko\_p:N} \meta{box}]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+ \item[\cs{platex\_if\_box\_yoko:N\underline{\textsl{TF}}} \meta{box} \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> ボックス\meta{box}の組方向が横組であるか否かをテストする.
+%<en> Tests if the direction of \meta{box} is \emph{yoko}.
+ \item[\cs{platex\_if\_box\_tate\_nomath\_p:N}$^\dagger$ \meta{box}]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+ \item[\cs{platex\_if\_box\_tate\_nomath:N\underline{\textsl{TF}}}$^\dagger$ \meta{box} \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> ボックス\meta{box}の組方向が縦組であるか否かをテストする.
+%<en> Tests if the direction of \meta{box} is \emph{tate}.
+ \item[\cs{platex\_if\_box\_tate\_math\_p:N}$^\dagger$ \meta{box}]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+ \item[\cs{platex\_if\_box\_tate\_math:N\underline{\textsl{TF}}}$^\dagger$ \meta{box} \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> ボックス\meta{box}の組方向がutod方向であるか否かをテストする.
+%<en> Tests if the direction of \meta{box} is \emph{utod}.
+ \item[\cs{platex\_if\_box\_tate\_p:N} \meta{box}]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+ \item[\cs{platex\_if\_box\_tate:N\underline{\textsl{TF}}} \meta{box} \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> ボックス\meta{box}の組方向が縦組またはutod方向であるか否かをテストする.
+%<en> Tests if the direction of \meta{box} is \emph{tate}~or~\emph{utod}.
+ \item[\cs{platex\_if\_box\_dtou\_p:N} \meta{box}]
+%<en>\ \\[\dimexpr-\medskipamount-2\baselineskip\relax]
+%<ja>\ \\[\dimexpr-2\baselineskip\relax]
+\item[\cs{platex\_if\_box\_dtou:N\underline{\textsl{TF}}} \meta{box} \{\meta{true code}\} \{\meta{false code}\}]
+%<ja> ボックス\meta{box}の組方向がdtou方向であるか否かをテストする.
+%<en> Tests if the direction of \meta{box} is \emph{dtou}.
+\end{cslist}
+
+
+%<*en>
\section{Addon packages}
\LuaTeX-ja has several addon packages.
These addons are written as \LaTeX\ packages, but
\begin{cslist}
-\item[CID=<name>\textrm{, }JFM=<name>\textrm{, }JFM-var=<name>]
+\item[CID=\meta{name}\textrm{, }JFM=\meta{name}\textrm{, }JFM-var=\meta{name}]
%<*en>
These 3 keys correspond to \texttt{cid}, \texttt{jfm} and
\begin{figure}[!tb]
\begin{LTXexample}[width=0.25\textwidth]
\jfontspec[
- YokoFeatures={Color=007F00}, TateFeatures={Color=00007F},
- TateFont=KozGoPr6N-Regular
-]{KozMinPr6N-Regular}
+ YokoFeatures={Color=FF1900}, TateFeatures={Color=003FFF},
+ TateFont=HaranoAjiGothic-Regular
+]{HaranoAjiMincho-Regular}
\hbox{\yoko 横組のテスト}\hbox{\tate 縦組のテスト}
-\addjfontfeatures{Color=FF0000}
+\addjfontfeatures{Color=00AF00}
\hbox{\yoko 横組}\hbox{\tate 縦組}
\end{LTXexample}
%<ja>\caption{\texttt{TateFeatures} 等の使用例}
\label{fig:yokotate-fontspec}
\end{figure}
-\item[Kanjiskip=<bool>]
+\item[Kanjiskip=\meta{bool}]
%<*ja>
\pageref{pg:ltjksp}ページで説明した \verb+\jfont+ 中での \texttt{ltjksp} 指定と
同一の効力を持ち,
標準値は \texttt{true} である.
%</ja>
-\item[TateFeatures=\{<features>\}\textrm{, }TateFont=<font>]
+\item[TateFeatures=\{\meta{features}\}\textrm{, }TateFont=\meta{font}]
%<*en>
The \texttt{TateFeatures} key specifies font features which are only turned~on in
vertical writing, such as \texttt{Style=VerticalKana}~(\texttt{vkna} feature).
指定する.使用例は\autoref{fig:yokotate-fontspec}参照.
%</ja>
-\item[YokoFeatures=\{<features>\}]
+\item[YokoFeatures=\{\meta{features}\}]
%<*en>
The \texttt{YokoFeatures} key specifies font features which are only turned~on in
horizontal writing,.
\begin{LTXexample}[pos=b]
\jfontspec[
AltFont={
- {Range="4E00-"67FF, Color=007F00},
- {Range="6800-"9EFF, Color=0000FF},
- {Range="3040-"306F, Font=KozGoPr6N-Regular},
+ {Range="4E00-"67FF, Font=HaranoAjiGothic-Regular, Color=003FFF},
+ {Range="6800-"9EFF, Color=FF1900},
+ {Range="3040-"306F, Font=HaranoAjiGothic-Regular, Color=35A16B},
}
-]{KozMinPr6N-Regular}
+]{HaranoAjiMincho-Regular}
日本国民は、正当に選挙された国会における代表者を通じて行動し、われらとわれらの子孫のために、
諸国民との協和による成果と、わが国全土にわたつて自由のもたらす恵沢を確保し、……
\end{LTXexample}
\begin{lstlisting}[escapechar=\#]
AltFont = {
...
- { Range=#\LARG range>#, #\LARG features>#},
- { Range=#\LARG range>#, Font=#\LARG font~name>#, #\LARG features># },
- { Range=#\LARG range>#, Font=#\LARG font~name># },
+ { Range=#\meta{range}#, #\meta{features}#},
+ { Range=#\meta{range}#, Font=#\meta{font~name}#, #\meta{features}# },
+ { Range=#\meta{range}#, Font=#\meta{font~name}># },
...
}
\end{lstlisting}
%<*ja>
なお,\Pkg{luatexja-fontspec} 読み込み時には和文フォント定義ファイル%
-\texttt{<ja-enc><family>.fd}は全く参照されなくなる.
+\texttt{\meta{ja-enc}\meta{family}.fd}は全く参照されなくなる.
%</ja>
\begin{lstlisting}
AltFont = {
{ Font=HogeraMin-Light, BoldFont=HogeraMin-Bold,
- Range="3000-"30FF, BoldFeatures={Color=007F00} }
+ Range="3000-"30FF, BoldFeatures={Color=FF1900} }
}
\end{lstlisting}
does \emph{not} work. Instead, one have to write
AltFont = { { Font=HogeraMin-Light, Range="3000-"30FF, } },
},
BoldFeatures = {
- AltFont = { { Font=HogeraMin-Bold, Range="3000-"30FF, Color=007F00 } },
+ AltFont = { { Font=HogeraMin-Bold, Range="3000-"30FF, Color=FF1900 } },
}
\end{lstlisting}
\begin{lstlisting}
AltFont = {
{ Font=HogeraMin-Light, BoldFont=HogeraMin-Bold,
- Range="3000-"30FF, BoldFeatures={Color=007F00} }
+ Range="3000-"30FF, BoldFeatures={Color=FF1900} }
}
\end{lstlisting}
のように指定することは出来ず,
AltFont = { { Font=HogeraMin-Light, Range="3000-"30FF, } },
},
BoldFeatures = {
- AltFont = { { Font=HogeraMin-Bold, Range="3000-"30FF, Color=007F00 } },
+ AltFont = { { Font=HogeraMin-Bold, Range="3000-"30FF, Color=FF1900 } },
}
\end{lstlisting}
のように指定しなければならない.
指定することは可能であり.また\ \texttt{YokoFeatures},~\texttt{TateFeatures} キーの
中身に \texttt{AltFont} を指定することができる.
-また,\autoref{fig:yokotate-fontspec}後半部では6行目の色の指定が効かず,
-2行目で指定した\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ による色の指定が有効になっ
+また,\autoref{fig:yokotate-fontspec}後半部では6行目の疑似太字無効化の指定が効かず,
+2行目で指定した\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ による疑似太字の指定が有効になっ
たままである.これは\emph{\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ による
OpenType機能指定は
組方向に依存しないOpenType機能の指定より後に解釈される}からである.
\Pkg{luatexja-otf}は以下の2つの低レベルコマンドを提供する:
%</ja>
\begin{cslist}
-\item[\cs{CID}\{<number>\}]
+\item[\cs{CID}\{\meta{number}\}]
%<*en>
-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,
+Typeset a glyph whose CID number is \meta{number}.
+If the Japanese font is neither Adobe-Japan1,~Adobe-GB1, Adobe-CNS1,
+Adobe-Korea1,~nor~Adobe-KR CID-keyed font,
+\LuaTeX-ja treats that \meta{number} is a CID number of Adobe-Japan1 character collection,
and tries to typeset a ``most suitable glyph''.
+
+Note that if the Japanese font is loaded using the HarfBuzz library, this \cs{CID}
+command does not work.
%</en>
%<*ja>
-CID番号が<number>の文字を出力する.
-もし現在の和文フォントがAdobe-Japan1,~Adobe-GB1, Adobe-CNS1,~Adobe-Korea1の
- いずれのCID-keyed fontでもない場合,<number>はAdobe-Japan1のCID番号であると解釈し
+CID番号が\meta{number}の文字を出力する.
+もし現在の和文フォントがAdobe-Japan1,~Adobe-GB1, Adobe-CNS1, Adobe-Korea1,~Adobe-KRの
+ いずれのCID-keyed fontでもない場合,\meta{number}はAdobe-Japan1のCID番号であると解釈し
「適切なグリフ」\footnote{%
- 例えばフォントにIVDコレクションAdobe-Japan1が含まれていれば,その情報を用いて
+ 特に縦組用グリフのCID番号を指定した場合は(LuaTeX-ja 20190504.0以降では若干改良されているが)
+ 意図しない結果になる可能性が高い.
+ なお,バージョン20190708.0以降では,CIDからグリフへの選択にグリフ名の情報を使用していない.
+ また,フォントにAdobe-Japan1のIVSが含まれていれば,その情報を用いて
グリフを選択する.
}を出力する.
+
+なお,現在の和文フォントがHarfBuzzを用いて読み込まれた場合には,\cs{CID}は正しく動作しない.
%</ja>
-\item[\cs{UTF}\{<hex\_number>\}]
+\item[\cs{UTF}\{\meta{hex\_number}\}]
%<*en>
-Typeset a character whose character code is <hex\_number> (in hexadecimal).
-This command is similar to \verb+\char"+<hex\_number>,\ %"
+Typeset a character whose character code is \meta{hex\_number} (in hexadecimal).
+This command is similar to \verb+\char"+\meta{hex\_number},\ %"
but please remind remarks below.
%</en>
%<*ja>
-文字コードが(16進で)<hex\_number>の文字を出力する.
-このコマンドは \verb+\char"+<hex\_number>と似ているが,下の注意を参照すること.%"
+文字コードが(16進で)\meta{hex\_number}の文字を出力する.
+このコマンドは \verb+\char"+\meta{hex\_number}と似ているが,下の注意を参照すること.%"
%</ja>
\end{cslist}
\item 常に\textbf{JAchar}として扱われる.
%</ja>
%<*en>
-\item Processing codes for supporting OpenType features (\textit{e.g.},
+\item In vertical direction, \texttt{vert}/\texttt{vrt2} feature are automatically applied to
+ characters by \cs{UTF}, regardless these feature are not activated in current Japanese font.
+%</en>
+%<*ja>
+\item 縦組時には,現在の縦組用和文フォントで \texttt{vert}/\texttt{vrt2} 機能が
+ 有効か無効かを問わず,\cs{UTF} で出力される文字にはこれらのOpenType機能が働いた字形になる.
+%</ja>
+%<*en>
+\item Processes for supporting other OpenType features (for example,
glyph replacement and kerning) by the \Pkg{luaotfload} package
is not performed to these characters.
%</en>
%<*ja>
-\item OpenType機能(例えばグリフ置換やカーニング)をサポートするための
- \Pkg{luaotfload}ã\83\91ã\83\83ã\82±ã\83¼ã\82¸ã\81®ã\82³ã\83¼ã\83\89はこれらの文字には働かない.
+\item その他のOpenType機能(例えばグリフ置換やカーニング)をサポートするための
+ \Pkg{luaotfload}ã\83\91ã\83\83ã\82±ã\83¼ã\82¸ã\81«ã\82\88ã\82\8bå\87¦ç\90\86はこれらの文字には働かない.
%</ja>
\end{itemize}
\item $d\ge\cs{lineskiplimit}$の場合,
標準の行送り\cs{baselineskip}で組んでも十分な間隔があると判断され,
2行の間には長さ$d$の空白が挿入される.つまり行送りは\cs{baselineskip}.
- \item {\catcode`\<=12$d<\cs{lineskiplimit}$}の場合,
+ \item $d<\cs{lineskiplimit}$の場合,
2行の間には長さ\cs{lineskip}の空白が挿入される.
そのため(設定値によるが,多くの場合)行送りは\cs{baselineskip}より広がる.
\end{itemize}
\item \cs{prevdepth}の値とその$h'$の深さの値が一致している
\end{itemize}
場合にのみ発動するようにしている.
- \item 行の中身に水平ボックス$h''$が入ってくることもあるが,その場合は$h''$の中身までは参照しない.
+ \item 行の中身に水平ボックス$h''$が入ってくることもあるが,その場合は$h''$の中身の高さ・深さまでは
+ 参照せず,あくまでも$h''$自身の高さ・深さのみを参照する.
参照するようにしてしまうと,\cs{smash}など手動で行った高さ・深さ調整の意味がなくなってしまうからである.
\end{itemize}
場合によっては行送りを「\cs{baselineskip}の整数倍」などと切りのいい値に揃えたいという状況が
考えられなくもない.
- \Pkg{luatexja-adjust}パッケージでは,{\catcode`\<=12$d<\cs{lineskiplimit}$}のときに
+ \Pkg{luatexja-adjust}パッケージでは,$d<\cs{lineskiplimit}$のときに
行送りを\cs{baselineskip}の\Param{linestep\_factor}倍ずつ増減させて
\begin{quote}
行間が\cs{lineskip}以上となるような,
\begin{cslist}
\item[\cs{ltjenableadjust[...]}]
\verb+...+ に指定したkey-valueリストに従い,「行末文字の位置調整」「優先順位付きの行長調整」
- 「『中身までみた』行送り計算」「段階的な行送り調整」を有効化/無効化する.
+ 「『中身までみた』行送り計算」「段階的な行送り調整」%「濁点・半濁点付き仮名文字の正規化」
+ を有効化/無効化する.
指定できるキーは以下の通り.
\begin{description}
\item[\texttt{lineend=[false,true,extended]}]
行末文字の位置調整の機能を無効化(\texttt{false}),「行分割後に調整」の形で有効化(\texttt{true}),
- 「行分割の仮定で考慮」の形で有効化(\texttt{extended})する.
+ 「行分割の過程で考慮」の形で有効化(\texttt{extended})する.
\item[\texttt{priority=[false,true]}]
優先順位付きの行長調整を無効化(\texttt{false}),または有効化(\texttt{true}).
\item[\texttt{profile=[false,true]}]
「中身までみた」行送り計算を無効化(\texttt{false}),または有効化(\texttt{true}).
\item[\texttt{linestep=[false,true]}]
段階的な行送り調整を無効化(\texttt{false}),または有効化(\texttt{true}).
+% \item[\texttt{composekana=[false,true]}]
+% 濁点・半濁点付き仮名文字の正規化を無効化(\texttt{false}),または有効化(\texttt{true}).
\end{description}
どのキーともキー名のみを指定した場合は値として\texttt{true}が指定されたものと扱われる.
また,次のパラメータが\cs{ltjsetparameter}内で
追加される.いずれもグローバルに効力を発揮する.
\begin{cslist}[style=standard]
-\item[\DParam{stretch\_priority}\,=\{<list>\}]
+\item[\DParam{stretch\_priority}\,=\{\meta{list}\}]
\Param{kanjiskip}, \Param{xkanjiskip},および「\textbf{JAglue}以外のグルー」を,
「行を自然長より伸ばす」場合の調整に用いる優先度を指定する.
-指定方法は,<list>の中にkey-value listの形で
+指定方法は,\meta{list}の中にkey-value listの形で
\begin{lstlisting}
stretch_priority={kanjiskip=-35,xkanjiskip=-25,others=50}
\end{lstlisting}
\end{lstlisting}
であり,「優先度$-4$」と指定されているJFMグルーが最も伸びにくいようになっている.
-\item[\DParam{shrink\_priority}\,=\{<list>\}]
+\item[\DParam{shrink\_priority}\,=\{\meta{list}\}]
同様に,「行を自然長より縮める」場合の調整に用いる優先度を指定する.
それ以外は\Param{stretch\_priority}と指定の形式は変わらない(初期値も変わらない).
- \item[\DParam{linestep\_factor}\,=<float>]
+ \item[\DParam{linestep\_factor}\,=\meta{float}]
段階的な行送り調整の際,\cs{baselineskip}の自然長の何倍単位で行送りを変えるかを指定する.
0を指定すると無効になるのと変わらない.また負数を指定すると,
その絶対値が指定されたかのように扱われる.
初期値は0.5(つまり半行単位)である.
- \item[\DParam{profile\_hgap\_factor}\,=<float>]
+ \item[\DParam{profile\_hgap\_factor}\,=\meta{float}]
「中身まで見た」行送り計算の際,
前の行にある深さが大きいものと次の行にある高さが大きいものが
水平方向にどれだけ離れていないといけないかを
負数を指定すると,その絶対値が指定されたかのように扱われる.
初期値は1(つまり\cs{lineskip}(の自然長))である.
\end{cslist}
+
+さらに,バージョン20220211.0以降では次の命令が提供される.
+\begin{cslist}
+ \item[\cs{ltjghostbeginjachar}]
+ \LuaTeX-ja本体が提供している\cs{ltjfakeparbegin}, \cs{ltjfakeboxbdd}と類似の命令である.
+ 実行された箇所が(限定・非限定を問わず)水平モードであった場合に,実行された箇所は
+ 「文字クラス0の\textbf{JAchar}」の直前であると,
+ \LuaTeX-jaの和文処理グルー挿入処理に認識させる.以下の実行例を参照.
+
+\medskip
+\begin{LTXexample}[width=18\zw]
+\ltjsetparameter{kanjiskip=14pt,xkanjiskip=50pt}
+\let\LG=\ltjghostbeforejachar
+A\LG B \par% ==> ALchar--(xkanjiskip)--\LG
+A\LG 字 \par% ==> ALchar--(xkanjiskip)--\LG
+漢\LG B \par% ==> JAchar--(kanjiskip)--\LG
+漢\LG 字 \par% ==> JAchar--(kanjiskip)--\LG
+\end{LTXexample}
+
+ \item[\cs{ltjghostafterjachar}]
+ \cs{ltjghostbeginjachar}と対を成す命令で,実行された箇所は
+ 「文字クラス0の\textbf{JAchar}」の直後であると,
+ \LuaTeX-jaの和文処理グルー挿入処理に認識させる.以下の実行例を参照.
+
+\medskip
+\begin{LTXexample}[width=18\zw]
+\ltjsetparameter{kanjiskip=14pt,xkanjiskip=50pt}
+\let\LG=\ltjghostafterjachar
+A\LG B \par% ==> \LG--(xkanjiskip)--ALchar
+漢\LG B \par% ==> \LG--(xkanjiskip)--ALchar
+A\LG 字 \par% ==> \LG--(kanjiskip)--JAchar
+漢\LG 字 \par% ==> \LG--(kanjiskip)--JAchar
+\end{LTXexample}
+\end{cslist}
+なお,バージョン20220207.0で追加された\cs{ltjghostjachar}は実装にバグがあったのと「両側」
+という点が扱いづらかったので,将来は削除する予定である.
+
+両命令の主な仕様用途は和文ゴーストでの使用である.\Pkg{BXghost}パッケージ(\cite{bxghost})などでは
+伝統的に全角空白(\texttt{U+3000})と\verb+\kern-1\zw+を組み合わせた方法が使われてきたが,
+\LuaTeX-jaでは全角空白を使っただけではうまくいかない可能性があるため,新たに命令が用意された.
+
%</ja>
\subsection{\Pkg{luatexja-ruby}}
それを\LuaTeX-ja用に書きなおしたものが本追加パッケージ \Pkg{lltjext} である.
従来の \Pkg{plext} パッケージとの違いは,
-{\catcode`\<=12
\begin{itemize}
\item 組方向オプション \texttt{<y>}(横組),\texttt{<t>}(縦組),
\texttt{<z>}\ の他に\ \texttt{<d>}(dtou方向),\texttt{<u>}(utod方向)を追加した.
\item 連数字用命令 \cs{rensuji} における位置合わせオプション \texttt{[l]}, \texttt{[c]},
\texttt{[r]} の挙動を若干変更した.
\end{itemize}
-}
%</ja>
%<*en>
\item[d] dtou方向
\item[u] utod方向
\end{description}
-\item[\cs{parbox}\<<dir>\>{[<pos>]}\{<width>\}\{<contents>\}]
+\item[\cs{parbox}<\meta{dir}>{[\meta{pos}]}\{\meta{width}\}\{\meta{contents}\}]
\cs{parbox} 命令も同様に,組方向の指定ができるように拡張されている.
-\item[\cs{pbox}\<<dir>\>{[<width>][<pos>]}\{<contents>\}]
-組方向<dir>で<contents>の中身をLRモードで組む命令である.
-<width>が正の値であるときは,ボックス全体の幅がその値となる.
-その際,中身は<pos>の値に従い,左寄せ(\texttt{l}),右揃え(\texttt{r}),
+\item[\cs{pbox}<\meta{dir}>{[\meta{width}][\meta{pos}]}\{\meta{contents}\}]
+組方向\meta{dir}で\meta{contents}の中身をLRモードで組む命令である.
+\meta{width}が正の値であるときは,ボックス全体の幅がその値となる.
+その際,中身は\meta{pos}の値に従い,左寄せ(\texttt{l}),右揃え(\texttt{r}),
中央揃え(それ以外)される.
\item[picture環境]
図表作成に用いる\texttt{picture}環境も,
\cs{put},~\cs{line}, \cs{vector}, \cs{dashbox}, \cs{oval},~\cs{circle}も
ベースライン補正を受けないように再定義されている.
-\item[\cs{rensuji}{[<pos>]}\{<contents>\}\textrm{, }\cs{rensujiskip}]
+\item[\cs{rensuji}{[\meta{pos}]}\{\meta{contents}\}\textrm{, }\cs{rensujiskip}]
-\item[\cs{Kanji}\{<counter\_name>\}]
+\item[\cs{Kanji}\{\meta{counter\_name}\}]
-\item[\cs{kasen}\{<contents>\}\textrm{, }\cs{bou}\{<contents>\}\textrm{,
+\item[\cs{kasen}\{\meta{contents}\}\textrm{, }\cs{bou}\{\meta{contents}\}\textrm{,
}\cs{boutenchar}]
\item[参照番号]
\item[d] \emph{dtou} direction
\item[u] \emph{utod} direction
\end{description}
-\item[\cs{parbox}\<<dir>\>{[<pos>]}\{<width>\}\{<contents>\}]
-\cs{parbox} command is also extended by \texttt{\<<dir>\>}.
+\item[\cs{parbox}<\meta{dir}>{[\meta{pos}]}\{\meta{width}\}\{\meta{contents}\}]
+\cs{parbox} command is also extended by \texttt{<\meta{dir}>}.
-\item[\cs{pbox}\<<dir>\>{[<width>][<pos>]}\{<contents>\}]
-This commands typeset <contents> in LR-mode, in <dir> direction.
-If <width> is positive, the width of the box becomes this <width>.
-In this case, <contents> will be aligned to left (when <pos> is \texttt{l}),
+\item[\cs{pbox}<\meta{dir}>{[\meta{width}][\meta{pos}]}\{\meta{contents}\}]
+This commands typeset \meta{contents} in LR-mode, in \meta{dir} direction.
+If \meta{width} is positive, the width of the box becomes this \meta{width}.
+In this case, \meta{contents} will be aligned to left (when \meta{pos} is \texttt{l}),
center (\texttt{c}), or~right (\texttt{r}).
\item[picture\textrm{\ environment}]
-\texttt{picture} environment also extended by \texttt{\<<dir>\>}, as follows:
+\texttt{picture} environment also extended by \texttt{<\meta{dir}>}, as follows:
\begin{lstlisting}
\begin{picture}<dir>(x_size, y_size)(x_offset,y_offset)
...
\end{picture}
\end{lstlisting}
-\item[\cs{rensuji}{[<pos>]}\{<contents>\}\textrm{, }\cs{rensujiskip}]
+\item[\cs{rensuji}{[\meta{pos}]}\{\meta{contents}\}\textrm{, }\cs{rensujiskip}]
-\item[\cs{Kanji}\{<counter\_name>\}]
+\item[\cs{Kanji}\{\meta{counter\_name}\}]
-\item[\cs{kasen}\{<contents>\}\textrm{, }\cs{bou}\{<contents>\}\textrm{,
+\item[\cs{kasen}\{\meta{contents}\}\textrm{, }\cs{bou}\{\meta{contents}\}\textrm{,
}\cs{boutenchar}]
\item[参照番号]
%<*ja>
横組・縦組専用仮名を用いる.また,\cs{rubyfamily} でルビ用仮名が使用可能となる\footnote{%
\cs{rubyfamily}とはいいつつ,実際にはフォントファミリを切り替えるのではない(通常では
- font featureの追加,\texttt{nfssonly} 指定時にはシェイプを \texttt{rb} に切り替え).
+ OpenType機能の有効化であり,\texttt{nfssonly} 指定時にはシェイプを \texttt{rb} に切り替える).
}.
%</ja>
\item[bold]
%<*en>
-Substitute bold series of gothic for bold series of mincho.
+Substitute bold series of gothic for medium series of gothic and bold series of mincho.
If \texttt{nodeluxe} option is enabled, medium series of gothic is also changed,
since we use same font for both series of gothic.
%</en>
%<*ja>
-「明朝の太字」をゴシック体の太字によって代替する.
-もし\texttt{nodeluxe}オプションが指定されている場合は,ゴシック体は1ウェイトしか使用されな
- いため,
-「ゴシック体の中字」も同時に変更されることになる.
+\texttt{nodeluxe}オプション指定時には,「明朝の太字」をゴシック体と同じフォントにする.
+\texttt{deluxe}オプション指定時には,「明朝の太字」「ゴシック体の中字」をゴシック体の太字と同じフォントにする.
%</ja>
\item[jis90\textrm{,~}90jis]
%<en>Use JIS~X~0208:1990 glyph variants if possible.
\item[jis2004\textrm{,~}2004jis]
%<en>Use JIS~X~0213:2004 glyph variants if possible.
%<ja>出来る限りJIS~X~0213:2004の字形を使う.
-\item[jfm\_yoko=<jfm>]
+\item[jfm\_yoko=\meta{jfm}]
%<*en>
-Use the JFM \texttt{jfm-<jfm>.lua} for horizontal direction, instead of \texttt{jfm-ujis.lua}~(default JFM).
+Use the JFM \texttt{jfm-\meta{jfm}.lua} for horizontal direction, instead of \texttt{jfm-ujis.lua}~(default JFM).
%</en>
%<*ja>
-横組用和文フォントで用いるJFMを\texttt{jfm-<jfm>.lua}にする.このオプションがない時は
+横組用和文フォントで用いるJFMを\texttt{jfm-\meta{jfm}.lua}にする.このオプションがない時は
\LuaTeX\nobreakdash -ja標準の\texttt{jfm-ujis.lua}が用いられる.
%</ja>
-\item[jfm\_tate=<jfm>]
+\item[jfm\_tate=\meta{jfm}]
%<*en>
-Use the JFM \texttt{jfm-<jfm>.lua} for vertical direction, instead of \texttt{jfm-ujisv.lua}~(default JFM).
+Use the JFM \texttt{jfm-\meta{jfm}.lua} for vertical direction, instead of \texttt{jfm-ujisv.lua}~(default JFM).
%</en>
%<*ja>
-縦用和文フォントで用いるJFMを\texttt{jfm-<jfm>.lua}にする.このオプションがない時は
+縦用和文フォントで用いるJFMを\texttt{jfm-\meta{jfm}.lua}にする.このオプションがない時は
\LuaTeX-ja標準の\texttt{jfm-ujisv.lua}が用いられる.
%</ja>
\item[jis]
%<en>Same as \texttt{jfm\_yoko=jis}.
-%<ja>\texttt{jfm\_yoko=jis}と同じ.ここで用いるJFM\texttt{jfm-jis.lua}はJISフォントメトリックを元にしたものである.
+%<ja>\texttt{jfm\_yoko=jis}と同じ.ここで用いるJFM~\texttt{jfm-jis.lua}はJISフォントメトリックを元にしたものである.
\end{cslist}
%<*en>
\label{sssec:ltjpreset-multi}
%<*en>
-Besides \texttt{bizud}, \texttt{morisawa-pro},~and~\texttt{morisawa-pr6n} presets,
+Besides \texttt{bizud}, \texttt{haranoaji}, \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}.
%</en>
%<*ja>
-\texttt{bizud}, \texttt{morisawa-pro}, \texttt{morisawa-pr6n}以外はフォントの指定は
+\texttt{bizud}, \texttt{haranoaji}, \texttt{morisawa-pro}, \texttt{morisawa-pr6n}以外はフォントの指定は
(ファイル名でなく)フォント名で行われる.
以下の表において,*\,つきのフォント(e.g.,~KozGo\dots-Regular)は,\emph{\texttt{deluxe}オプション指定時に}
ゴシック体中字として用いられるものを示している.
&KozGoPro-Medium&KozGoProVI-Medium&KozGoPr6N-Medium\\
\cmidrule(l){2-5}
%<en>\smash{\raisebox{2ex}{\textit{gothic}}}%
-%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}%
+%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}%
&bold&KozGoPro-Bold&KozGoProVI-Bold&KozGoPr6N-Bold\\
&extra bold&KozGoPro-Heavy&KozGoProVI-Heavy&KozGoPr6N-Heavy\\
\midrule
%<en>\textit{rounded gothic}
-%<ja>\gt 丸ゴシック
+%<ja>\textgt{丸ゴシック}
&&KozGoPro-Heavy&KozGoProVI-Heavy&KozGoPr6N-Heavy\\
\bottomrule
\end{tabular}
%<*en>
Hiragino fonts (except Hiragino~Mincho~W2) are bundled with Mac OS~X 10.5 or later.
-Some editions of a Japanese word-processor ``一太郎2012'' includes Hiragino ProN fonts.
Note that fonts for gothic extra~bold (HiraKakuStd[N]-W8) only contains characters in
Adobe-Japan1-3 character collection, while others contains those in
Adobe-Japan1-5 character collection.
%</en>
%<*ja>
-ヒラギノフォントは,Mac OS~X以外にも,一太郎2012の上位エディションにもバンドルされている.
極太ゴシック体として用いるヒラギノ角ゴW8は,Adobe-Japan1-3の範囲しかカバーしていない
Std/StdNフォントであり,その他はAdobe-Japan1-5対応である.
-ã\81ªã\81\8aï¼\8cæ\98\8eæ\9c\9dä½\93ç´°å\97ã\81¨ã\81\97ã\81¦ç\94¨ã\81\84ã\82\8bã\83\92ã\83©ã\82®ã\83\8eæ\98\8eæ\9c\9dä½\93W2ã\81¯OS~Xã\82\84ä¸\80太é\83\8eã\81«ã\81¯ã\83\90ã\83³ã\83\89ã\83«ã\81\95ã\82\8cã\81¦ã\81\8aã\82\89ã\81\9aï¼\8c
+なお,明朝体細字として用いるヒラギノ明朝体W2はOS~Xにはバンドルされておらず,
別途購入する必要がある.
%</ja>
\begin{center}\small
&Hiragino~Kaku~Gothic~Pro~W6&Hiragino~Kaku~Gothic~ProN~W6\\
\cmidrule(l){2-4}
%<en>\smash{\raisebox{2ex}{\textit{gothic}}}%
-%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}%
+%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}%
&bold&Hiragino~Kaku~Gothic~Pro~W6&Hiragino~Kaku~Gothic~ProN~W6\\
&extra bold&Hiragino~Kaku~Gothic~Std~W8&Hiragino~Kaku~Gothic~StdN~W8\\
\midrule
%<en>\textit{rounded gothic}
-%<ja>\gt 丸ゴシック
+%<ja>\textgt{丸ゴシック}
&&Hiragino~Maru~Gothic~Pro~W4&Hiragino~Maru~Gothic~ProN~W4\\
\bottomrule
\end{tabular}
\end{center}
-%<ja>\newpage
\item[bizud] BIZ UD fonts (by Morisawa Inc.) bundled with
Windows~10 October 2018 Update.
\begin{center}\small
&medium&BIZ-UDGothicR.ttc\\
\cmidrule(l){2-3}
%<en>\textit{gothic}%
-%<ja>\gt ゴシック
+%<ja>\textgt{ゴシック}
&bold&BIZ-UDGothicB.ttc\\
&extra bold&BIZ-UDGothicB.ttc\\
\midrule
%<en>\textit{rounded gothic}
-%<ja>\gt 丸ゴシック
+%<ja>\textgt{丸ゴシック}
&&BIZ-UDGothicB.ttc\\
\bottomrule
\end{tabular}
\midrule
&medium&A-OTF-RyuminPro-Light.otf&A-OTF-RyuminPr6N-Light.otf\\
%<en>\smash{\raisebox{1.5ex}{\textit{mincho}}}%
-%<ja>\smash{\raisebox{1.5ex}{\gt 明朝}}%
+%<ja>\smash{\raisebox{1.5ex}{\textgt{明朝}}}%
&bold&A-OTF-FutoMinA101Pro-Bold.otf&A-OTF-FutoMinA101Pr6N-Bold.otf\\
\midrule
&medium
&A-OTF-GothicBBBPro-Medium.otf&A-OTF-GothicBBBPr6N-Medium.otf\\
%<en>\textit{gothic}%
-%<ja>\gt ゴシック
+%<ja>\textgt{ゴシック}
&bold&A-OTF-FutoGoB101Pro-Bold.otf&A-OTF-FutoGoB101Pr6N-Bold.otf\\
&extra bold&A-OTF-MidashiGoPro-MB31.otf&A-OTF-MidashiGoPr6N-MB31.otf\\
\midrule
%<en>\textit{rounded gothic}
-%<ja>\gt 丸ゴシック
+%<ja>\textgt{丸ゴシック}
&&A-OTF-Jun101Pro-Light.otf&A-OTF-ShinMGoPr6N-Light.otf\\
\bottomrule
\end{tabular}
&YuGothic-Regular&YuGothic-Medium&YuGothic~Medium\\
\cmidrule(l){2-5}
%<en>\textit{gothic}%
-%<ja>\gt ゴシック
+%<ja>\textgt{ゴシック}
&bold&YuGothic-Bold&YuGothic-Bold&YuGothic~Bold\\
&extra bold&YuGothic-Bold&YuGothic-Bold&YuGothic~Bold\\
\midrule
%<en>\textit{rounded gothic}
-%<ja>\gt 丸ゴシック
+%<ja>\textgt{丸ゴシック}
&&YuGothic-Bold&YuGothic-Bold&YuGothic~Bold\\
\bottomrule
\end{tabular}
\midrule
&medium&Moga90Mincho&MogaMincho\\
%<en>\smash{\raisebox{1.5ex}{\textit{mincho}}}%
-%<ja>\smash{\raisebox{1.5ex}{\gt 明朝}}%
+%<ja>\smash{\raisebox{1.5ex}{\textgt{明朝}}}%
&bold&Moga90Mincho Bold&MogaMincho Bold\\
\midrule
&medium&Moga90Gothic&MogaGothic\\
%<en>\textit{gothic}%
-%<ja>\gt ゴシック
+%<ja>\textgt{ゴシック}
&bold&Moga90Gothic Bold&MogaGothic Bold\\
&extra bold&Moga90Gothic Bold&MogaGothic Bold\\
\midrule
%<en>\textit{rounded gothic}
-%<ja>\gt 丸ゴシック
+%<ja>\textgt{丸ゴシック}
&&Mobo90Gothic&MoboGothic\\
\bottomrule
\end{tabular}
\midrule
&medium&Ume Mincho\\
%<en>\smash{\raisebox{1.5ex}{\textit{mincho}}}%
-%<ja>\smash{\raisebox{1.5ex}{\gt 明朝}}%
+%<ja>\smash{\raisebox{1.5ex}{\textgt{明朝}}}%
&bold&Ume Mincho\\
\midrule
&&Ume Gothic*\\
&\smash{\raisebox{1.5ex}{medium}}&Ume Gothic O5\\
\cmidrule(l){2-3}
%<en>\textit{gothic}%
-%<ja>\gt ゴシック
+%<ja>\textgt{ゴシック}
&bold&Ume Gothic O5\\
&extra bold&Ume Gothic O5\\
\midrule
%<en>\textit{rounded gothic}
-%<ja>\gt 丸ゴシック
+%<ja>\textgt{丸ゴシック}
&&Ume Gothic O5\\
\bottomrule
\end{tabular}
&\AD{Sans}{Medium}\\
\cmidrule(l){2-4}
%<en>\smash{\raisebox{2ex}{\textit{gothic}}}%
-%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}%
+%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}%
&bold&\AD{Sans}{Bold}\\
&extra bold&\AD{Sans}{Heavy}\\
\midrule
%<en>\textit{rounded gothic}
-%<ja>\gt 丸ゴシック
-&&\AD{Sans}{Heavy}\\
+%<ja>\textgt{丸ゴシック}
+&&\AD{Sans}{Medium}\\
\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)
+ \item[noto-otf\textrm{, }noto] Noto Serif CJK and Noto Sans CJK fonts (Language-specific OTF)
+%<en> \\*[-\dimexpr\medskipamount+\baselineskip\relax]
+ \item[noto-jp] Noto Serif CJK and Noto Sans CJK fonts (Region-specific subset OTF)
\begin{center}\small
-\def\AD#1#2{Noto #1 CJK #2&Noto #1 CJK JP #2}%
+\def\AD#1#2{Noto #1 CJK #2&Noto #1 CJK JP #2&Noto #1 JP #2}%
\begin{tabular}{lllll}
\toprule
-\bf family&\bf series&\texttt{noto-otc}&\texttt{noto-otf}\\
+\bf family&\bf series&\texttt{noto-otc}&\texttt{noto-otf}, \texttt{noto}&\texttt{noto-jp}\\
\midrule
&light&\AD{Serif}{Light}\\
%<en>\textit{mincho}%
&&\AD{Sans}{Regular*}\\
&\smash{\raisebox{1.5ex}{medium}}
&\AD{Sans}{Medium}\\
-\cmidrule(l){2-4}
+\cmidrule(l){2-5}
%<en>\smash{\raisebox{2ex}{\textit{gothic}}}%
-%<ja>\smash{\raisebox{2ex}{\gt ゴシック}}%
+%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}%
&bold&\AD{Sans}{Bold}\\
&extra bold&\AD{Sans}{Black}\\
\midrule
%<en>\textit{rounded gothic}
-%<ja>\gt 丸ゴシック
-&&\AD{Sans}{Black}\\
+%<ja>\textgt{丸ゴシック}
+&&\AD{Sans}{Medium}\\
\bottomrule
\end{tabular}
\end{center}
+\item[haranoaji] Harano Aji Fonts.
+%<en>\par These fonts can be downloaded from\\\hfill \url{https://github.com/trueroad/HaranoAjiFonts}.
+%<ja>これらのフォントは \url{https://github.com/trueroad/HaranoAjiFonts} からダウンロードできる.
+%<*en>
+There is not rounded gothic family in Harano Aji Fonts.
+%</en>
+%<*ja>
+「原ノ味丸ゴシック」は存在しないので,便宜的に原ノ味角ゴシックHeavyによって代用している.
+%</ja>
+\begin{center}\small
+\begin{tabular}{lll}
+\toprule
+\bf family&\bf series&\texttt{haranoaji}\\
+\midrule
+ &light&HaranoAjiMincho-Light.otf\\
+%<en>\textit{mincho}%
+%<ja>\textgt{明朝}%
+ &medium&HaranoAjiMincho-Regular.otf\\
+ &bold&HaranoAjiMincho-Bold.otf\\
+\midrule
+ &&HaranoAjiGothic-Regular.otf*\\
+ &\smash{\raisebox{1.5ex}{medium}}
+ &HaranoAjiGothic-Medium.otf\\
+\cmidrule(l){2-3}
+%<en>\smash{\raisebox{2ex}{\textit{gothic}}}%
+%<ja>\smash{\raisebox{2ex}{\textgt{ゴシック}}}%
+ &bold&HaranoAjiGothic-Bold.otf\\
+ &extra bold&HaranoAjiGothic-Heavy.otf\\
+\midrule
+%<en>\textit{rounded gothic}
+%<ja>\textgt{丸ゴシック}
+&&HaranoAjiGothic-Medium.otf\\
+\bottomrule
+\end{tabular}
+\end{center}
\end{cslist}
+
%<en>\subsubsection{Presets which do not support multi weights}
%<ja>\subsubsection{単ウェイト用プリセット一覧}
\label{sssec:ltjpreset-single}
and use them by \cs{ltjapplypreset}. These two commands can only be used in the preamble.
%</en>
\begin{cslist}
- \item[\cs{ltjnewpreset}\{<name>\}\{<specification>\}]
+ \item[\cs{ltjnewpreset}\{\meta{name}\}\{\meta{specification}\}]
%<*ja>
- 新たに<name>という名称のプリセットを定義する.この名称は,
+ 新たに\meta{name}という名称のプリセットを定義する.この名称は,
すでに定義されているプリセット名や,
\ref{sssec:ltjpreset-general}で定義されているオプション,さらに
- 次の9つと重複してはならない.
+ 次の13個と重複してはならない.
\begin{quote}
\ttfamily
- mc mc-l mc-m mc-bx gt gt-m gt-bx gt-eb mg-m
+ mc mc-l mc-m mc-b mc-bx gt gt-u gt-d gt-m gt-b gt-bx gt-eb mg-m
\end{quote}
- <specification>は,プリセット名や以下のキー達のコンマ区切りリストを指定する:
+ \meta{specification}は,プリセット名や以下のキー達のコンマ区切りリストを指定する:
\begin{description}
- \item[\ttfamily mc-l=<font>] 明朝体細字(\cs{mcfamily}\cs{ltseries})
- \item[\ttfamily mc-m=<font>] 明朝体中字(\cs{mcfamily}\cs{mdseries})
- \item[\ttfamily mc-bx=<font>] 明朝体太字(\cs{mcfamily}\cs{bfseries})
- \item[\ttfamily gt-m=<font>] ゴシック体中字(\cs{gtfamily}\cs{mdseries})
- \item[\ttfamily gt-bx=<font>] ゴシック体太字(\cs{gtfamily}\cs{bfseries})
- \item[\ttfamily gt-eb=<font>] ゴシック体太字(\cs{gtfamily}\cs{ebseries})
- \item[\ttfamily mg-m=<font>] 丸ゴシック体(\cs{mgfamily})
- \item[\ttfamily mc=<font>] 明朝体の細字・中字・太字全部を設定.
+ \item[\ttfamily mc-l=\meta{font}] 明朝体細字(\cs{mcfamily}\cs{ltseries})
+ \item[\ttfamily mc-m=\meta{font}] 明朝体中字(\cs{mcfamily}\cs{mdseries})
+ \item[\ttfamily mc-b=\meta{font}] 明朝体太字(\cs{mcfamily}\cs{bfseries})
+ \item[\ttfamily mc-bx=\meta{font}] \texttt{mc-b=\meta{font}}と同義.
+ \item[\ttfamily gt-u=\meta{font}] \texttt{deluxe}オプション未指定時のゴシック体(\cs{gtfamily})・明朝体太字
+ \item[\ttfamily gt-d=\meta{font}] \texttt{deluxe}オプション指定時のゴシック体中字(\cs{gtfamily}\cs{mdseries})
+ \item[\ttfamily gt-m=\meta{font}] \texttt{deluxe}オプションの指定の有無に関係なく
+ ゴシック体中字(\cs{gtfamily}\cs{mdseries})を指定する.「\texttt{gt-u=\meta{font}, gt-d\meta{font}}」と同義.
+ \item[\ttfamily gt-b=\meta{font}] ゴシック体太字(\cs{gtfamily}\cs{bfseries})\\
+ なお,パッケージ読み込み時に\texttt{bold}オプションが指定された場合は,\texttt{mc-b=\meta{font}}を指定したことにもなる.
+ \item[\ttfamily gt-bx=\meta{font}] \texttt{gt-b=\meta{font}}と同義.
+ \item[\ttfamily gt-eb=\meta{font}] ゴシック体太字(\cs{gtfamily}\cs{ebseries})
+ \item[\ttfamily mg-m=\meta{font}] 丸ゴシック体(\cs{mgfamily})
+ \item[\ttfamily mc=\meta{font}] 明朝体の細字・中字・太字全部を設定.
以下を指定したことと同じである:
\begin{quote}
- \ttfamily mc-l=<font>, mc-m=<font>, mc-bx=<font>
+ \ttfamily mc-l=\meta{font}, mc-m=\meta{font}, mc-b=\meta{font}
\end{quote}
- \item[\ttfamily gt=<font>] ゴシック体の中字・太字・極太全部を設定.
+ \item[\ttfamily gt=\meta{font}] ゴシック体の中字・太字・極太全部を設定.
以下を指定したことと同じである:
\begin{quote}
- \ttfamily gt-m=<font>, gt-bx=<font>, gt-eb=<font>
+ \ttfamily gt-u=\meta{font}, gt-d=\meta{font}, gt-b=\meta{font}, gt-eb=\meta{font}
\end{quote}
\end{description}
- なお,パッケージ読み込み時に \texttt{deluxe} が有効でない場合は,
- 上記9キーのうち\texttt{mc}, \texttt{gt}しか実質的に意味を持たない.
%</ja>
%<*en>
- Define new preset~<name>. This <name> cannot be same as other presets,
+ Define new preset~\meta{name}. This <name> cannot be same as other presets,
options described in Subsubsection~\ref{sssec:ltjpreset-general}, nor
- following nine strings:
+ following 13~strings:
\begin{quote}
\ttfamily
- mc mc-l mc-m mc-bx gt gt-m gt-bx gt-eb mg-m
+ mc mc-l mc-m mc-b mc-bx gt gt-u gt-d gt-m gt-b gt-bx gt-eb mg-m
\end{quote}
- <specification> is a comma-separated list which consists of
+ \meta{specification} is a comma-separated list which consists of
other presets and/or the following keys:
\begin{description}
- \item[\ttfamily mc-l=<font>] mincho light
- \item[\ttfamily mc-m=<font>] mincho medium
- \item[\ttfamily mc-bx=<font>] mincho bold
- \item[\ttfamily gt-m=<font>] gothic medium
- \item[\ttfamily gt-bx=<font>] gothic bold
- \item[\ttfamily gt-eb=<font>] gothic extra~bold
- \item[\ttfamily mg-m=<font>] rounded gothic
- \item[\ttfamily mc=<font>] Same as
+ \item[\ttfamily mc-l=\meta{font}] mincho light
+ \item[\ttfamily mc-m=\meta{font}] mincho medium
+ \item[\ttfamily mc-b=\meta{font}] mincho bold
+ \item[\ttfamily mc-bx=\meta{font}] synonym for \texttt{mc-b=\meta{font}}
+ \item[\ttfamily gt-u=\meta{font}] gothic, when \texttt{deluxe}~option is not specified.
+ \item[\ttfamily gt-d=\meta{font}] gothic medium, when \texttt{deluxe}~option is specified.
+ \item[\ttfamily gt-m=\meta{font}] gothic medium. This key is equivalent to ``\texttt{gt-u=\meta{font}, gt-d\meta{font}}''.
+ \item[\ttfamily gt-b=\meta{font}] gothic bold\\
+ Note that this key also specifies mincho bold if \texttt{bold} option is specified.
+ \item[\ttfamily gt-bx=\meta{font}] synonym for \texttt{gt-b=\meta{font}}
+ \item[\ttfamily gt-eb=\meta{font}] gothic extra~bold
+ \item[\ttfamily mg-m=\meta{font}] rounded gothic
+ \item[\ttfamily mc=\meta{font}] Equivalent to
\begin{quote}
- \ttfamily mc-l=<font>, mc-m=<font>, mc-bx=<font>
+ \ttfamily mc-l=\meta{font}, mc-m=\meta{font}, mc-b=\meta{font}
\end{quote}
- \item[\ttfamily gt=<font>] Same as
+ \item[\ttfamily gt=\meta{font}] Equivalent to
\begin{quote}
- \ttfamily gt-m=<font>, gt-bx=<font>, gt-eb=<font>
+ \ttfamily gt-u=\meta{font}, gt-d=\meta{font}, gt-b=\meta{font}, gt-eb=\meta{font}
\end{quote}
\end{description}
- If \texttt{deluxe} is not specified at loading the package,
- only \texttt{mc}~and~\texttt{gt} keys (among above 9~keys) have a meaning.
%</en>
- \item[\cs{ltjnewpreset}*\{<name>\}\{<specification>\}]
+ \item[\cs{ltjnewpreset}*\{\meta{name}\}\{\meta{specification}\}]
%<*ja>
\cs{ltjnewpreset}とほぼ同じであるが,こちらはすでに定義されているプリセット名
- を<name>に指定した場合にはエラーを出さずに定義を置き換える.
+ を\meta{name}に指定した場合にはエラーを出さずに定義を置き換える.
%</ja>
%<*en>
- Almost same as \cs{ltjnewpreset}. However, if <name> matches a preset which already defined,
+ Almost same as \cs{ltjnewpreset}. However, if \meta{name} matches a preset which already defined,
this command simply overwrite it.
%</en>
- \item[\cs{ltjapplypreset}\{<name>\}]
-%<ja> <name>で指定されたプリセットを使って和文フォントを設定する.
-%<en> Set Japanese font families using preset~<name>.
+ \item[\cs{ltjapplypreset}\{\meta{name}\}]
+%<ja> \meta{name}で指定されたプリセットを使って和文フォントを設定する.
+%<en> Set Japanese font families using preset~\meta{name}.
\end{cslist}
%<*ja>
-なお,\cs{ltjnewpreset}の第二引数<specification>に含まれる
+なお,\cs{ltjnewpreset}の第二引数\meta{specification}に含まれる
プリセット名は\cs{ltjnewpreset}の時点で定義されている必要はなく,
\cs{ltjapplypreset}で実際に使うときに定義されていれば良い.
そのため,次のような記述も可能である:
\begin{lstlisting}
- \ltjnewpreset{hoge}{piyo,mc-bx=HiraMinProN-W6}
+ \ltjnewpreset{hoge}{piyo,mc-b=HiraMinProN-W6}
\ltjnewpreset{piyo}{mg-m=HiraMaruProN-W4}
\ltjapplypreset{hoge}
\end{lstlisting}
Note that \cs{ltjnewpreset} does not ``expand'' the definition to define a preset.
This means that one can write as the following:
\begin{lstlisting}
- \ltjnewpreset{hoge}{piyo,mc-bx=HiraMinProN-W6}
+ \ltjnewpreset{hoge}{piyo,mc-b=HiraMinProN-W6}
\ltjnewpreset{piyo}{mg-m=HiraMaruProN-W4}
\ltjapplypreset{hoge}
\end{lstlisting}
等しい.この \cs{jH} は \cs{jQ} と同じ寸法レジスタを指す.
%</ja>
-\dim{ltj@zw}
+\dim{ltj@dimen@zw}
%<*en>
A temporal register for the ``full-width'' of current Japanese font.
The command \cs{zw} sets this register to the correct value, and
「このレジスタ自体を返す」.
%</ja>
-\dim{ltj@zh}
+\dim{ltj@dimen@zh}
%<*en>
A temporal register for the ``full-height'' (usually the sum of height of imaginary body and its depth) of current Japanese font.
The command \cs{zh} sets this register to the correct value, and
\attr{ltj@yablshift}
%<*en>
The amount of shifting the baseline of alphabetic fonts in scaled point ($2^{-16}\,\textrm{pt}$).
+``unset'' means zero.
%</en>
%<*ja>
スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした欧文フォントのベースラインの移動量.
+この属性が「未設定」(\texttt{-"7FFFFFFF})のときは0であるとみなされる.\cs{ltj@ykblshift}他も同様.
%</ja>
\attr{ltj@ykblshift}
\attr{ltj@autospc}
%<*en>
Whether the auto insertion of \Param{kanjiskip} is allowed at the node.
+0 means ``not allowed'', and the other value (including ``unset'') means ``allowed''.
%</en>
%<*ja>
そのノードで\Param{kanjiskip}の自動挿入が許されるかどうか.
+0は「許可しない」,0以外の値(「未設定」も含む)は「許可する」.
%</ja>
\attr{ltj@autoxspc}
%<*en>
Whether the auto insertion of \Param{xkanjiskip} is allowed at the node.
+0 means ``not allowed'', and the other value (including ``unset'') means ``allowed''.
%</en>
%<*ja>
そのノードで\Param{xkanjiskip}の自動挿入が許されるかどうか.
+0は「許可しない」,0以外の値(「未設定」も含む)は「許可する」.
%</ja>
\attr{ltj@icflag}
Penalties inserted for the word-wrapping process (\emph{kinsoku shori}) of Japanese characters.
%</en>
%<ja>禁則処理のために挿入されたペナルティ.
-\item[\mathversion{bold}$(\textit{from\_jfm}-2)$--$(\textit{from\_jfm}+2)$~(4--8)]
+\item[\mathversion{bold}$\textit{from\_jfm}$--$(\textit{from\_jfm}+63)$~(4--67)]
%<en>Glues/kerns from JFM.
%<ja>JFM由来のグルー/カーン.
-\item[\textit{kanji\_skip}~(9), \textit{kanji\_skip\_jfm}~(10)]
+\item[\textit{kanji\_skip}~(68), \textit{kanji\_skip\_jfm}~(69)]
%<en>Glues from \Param{kanjiskip}.
%<ja>和文間空白\Param{kanjiskip}を表すグルー.
-\item[\textit{xkanji\_skip}~(11), \textit{xkanji\_skip\_jfm}~(12)]
+\item[\textit{xkanji\_skip}~(70), \textit{xkanji\_skip\_jfm}~(71)]
%<en>Glues from \Param{xkanjiskip}.
%<ja>和欧文間空白\Param{xkanjiskip}を表すグルー.
-\item[\textit{processed} (13)]
+\item[\textit{processed} (73)]
%<en>Nodes which is already processed by \ldots.
%<ja>\LuaTeX-ja の内部処理によって既に処理されたノード.
-\item[\textit{ic\_processed} (14)]
+\item[\textit{ic\_processed} (74)]
%<*en>
Glues from an italic correction, but already processed in the insertion process of \textbf{JAglue}s.
%</en>
%<ja>イタリック補正に由来するグルーであって,既に \textbf{JAglue} 挿入処理にかかったもの.
-\item[\textit{boxbdd} (15)]
+\item[\textit{boxbdd} (75)]
%<en>Glues/kerns that inserted just the beginning or the ending of an hbox or a paragraph.
%<ja>hboxか段落の最初か最後に挿入されたグルー/カーン.
+\item[\textit{special\_jaglue} (76)]
+%<en>Glues from \cs{insert}[\texttt{x}]\texttt{kanjiskip}.
+%<ja>\cs{insert}[\texttt{x}]\texttt{kanjiskip}由来のグルー.
\end{description}
%<*ja>
また,挿入処理の結果であるリストの最初のノードでは,\verb+\ltj@icflag+ の値に
-\textit{processed\_begin\_flag}~(128)が追加される.これによって,\cs{unhbox} が
+\textit{processed\_begin\_flag}~(4096)が追加される.これによって,\cs{unhbox} が
連続した場合でも「ボックスの境界」が識別できるようになっている.
%</ja>
\item[\textit{char\_by\_cid}]
%<*en>
-Nodes for \textbf{JAchar} which the callback process of
- \Pkg{luaotfload} won't be applied, and the character code is
+Nodes for \textbf{JAchar} which processes by \Pkg{luaotfload} won't be applied,
+ and the character code is
stored in the \texttt{value} field. Each node of this type are
converted to a \textit{glyph\_node} \emph{after}
- the callback process of luaotfload.
-Nodes of this type is used in \cs{CID}, \cs{UTF} and IVS support.
+ processes by luaotfload.
+Nodes of this type is used in \cs{CID}~and~\cs{UTF}.
%</en>
%<*ja>
-\Pkg{luaotfload}ã\81®ã\82³ã\83¼ã\83«ã\83\90ã\83\83ã\82¯ã\81«ã\82\88ã\82\8bå\87¦ç\90\86ã\81\8cé\81©ç\94¨ã\81\95ã\82\8cã\81ªã\81\84\textbf{JAchar}ã\81®ã\81\9fã\82\81ã\81®ã\83\8eã\83¼ã\83\89ã\81§ï¼\8c
+\Pkg{luaotfload}による処理が適用されない\textbf{JAchar}のためのノードで,
\texttt{value} フィールドに文字コードが格納されている.
この種類のノードはそれぞれが\Pkg{luaotfload}のコールバックの処理の
\emph{後で}\textit{glyph\_node}に変換される.
-\cs{CID}, \cs{UTF}ã\82\84IVS対å¿\9cå\87¦ç\90\86ã\81§ã\81\93ã\81®ç¨®é¡\9eã\81®ã\83\8eã\83¼ã\83\89ã\81\8cå\88©ç\94¨ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8bï¼\8e
+\cs{CID}, \cs{UTF}でこの種類のノードが利用されている.
%</ja>
\item[\textit{replace\_vs}]
\texttt{luatexja.isglobal}. Its meaning is the following.
\begin{align}
\texttt{luatexja.isglobal} =
-\begin{cases}
- \texttt{'global'}&\text{global}\\
- \texttt{''}&\text{local}
-\end{cases}
+\begin{cases*}
+ \texttt{'global'}&(global assignment),\\
+ \texttt{''}&(local assignment).
+\end{cases*}
\end{align}
This is determined not only by command name
(\cs{ltjsetparameter}~or~\cs{ltjglobalsetparameter}),
%</en>
%<*ja>
\paragraph{パラメータの設定}
-\cs{ltjsetparameter} と,\cs{ltjglobalsetparameter} の定義は\autoref{fig:setpar-def}の
+\cs{ltjsetparameter}と,\cs{ltjglobalsetparameter}の定義は\autoref{fig:setpar-def}の
のようになっている.
-本質的なのは最後の \cs{setkeys} で,これは\Pkg{xkeyval}パッケージの提供する命令である.
+本質的なのは最後の\cs{setkeys}で,これは\Pkg{xkeyval}パッケージの提供する命令である.
-このため,\cs{ltjsetparameter} に指定可能なパラメータを追加するには,
-<prefix>を \texttt{ltj},<family>を \texttt{japaram} としたキーを
+このため,\cs{ltjsetparameter}に指定可能なパラメータを追加するには,
+\meta{prefix}を\texttt{ltj},\meta{family}を\texttt{japaram}としたキーを
\begin{lstlisting}
\define@key[ltj]{japaram}{...}{...}
\end{lstlisting}
のように定義すれば良いだけである.
-なお,パラメータ指定がグローバルかローカルかどうかを示す \texttt{luatexja.isglobal} が,
+なお,パラメータ指定がグローバルかローカルかどうかを示す\texttt{luatexja.isglobal}が,
\begin{align}
\texttt{luatexja.isglobal} =
-\begin{cases}
- \texttt{'global'}&\text{パラメータ設定はグローバル}\\
- \texttt{''}&\text{パラメータ設定はローカル}
-\end{cases}
+\begin{cases*}
+ \texttt{'global'}&(パラメータ設定はグローバル),\\
+ \texttt{''}&(パラメータ設定はローカル).
+\end{cases*}
\end{align}
-として自動的にセットされる\footnote{命令が \cs{ltjglobalsetparameter} かどうかだけでは
-なく,実行時の \cs{globaldefs} の値にも依存して定まる.}.
+として自動的にセットされる\footnote{命令が\cs{ltjglobalsetparameter}かどうかだけでは
+なく,実行時の\cs{globaldefs}の値にも依存して定まる.}.
%</ja>
%<*en>
%</ja>
%<*ja>
+\subsection{濁点・半濁点付き仮名の正規化→\Pkg{luaotfload}~v3.19以降ではそちらで}
+\TeX~Live~2016以降の(u)\pTeX では,合成用濁点(\texttt{U+3099})・合成用半濁点(\texttt{U+309A})を用いて
+表現された平仮名・片仮名を合成済み文字に変換するという処理を行っている.
+この処理を行っている要因としては,
+\begin{itemize}
+ \item 無用なトラブルを避けるため.
+ 濁点・半濁点付きの仮名文字が「合成用濁点・半濁点を使って入力されているか」「最初から合成済み文字で入力されているか」を
+ 見た目から判別することは難しい.
+ \item \pTeX との互換性のため.\pTeX は内部コードがJIS~X~0208の範囲に限られるため,
+ 合成用濁点・半濁点は利用できない.そのため上記の変換処理はさらに前から行われていた.
+\end{itemize}
+
+\LuaTeX(-ja)では入力の変換は基本的に行わず,
+文字の合成は使用しているフォントのOpenType機能に委ねるという立場であったが,
+\Pkg{luaotfload}~v3.19以降では,標準でNFCへのUnicode正規化を行っている.
+そのため,バージョン2023****.0以降では,\LuaTeX-jaによる自前の変換\footnote{バージョン20220103.0で実装した.}は
+行わないようにしている.
+%</ja>
+%<*ja>
%<en>\section{Insertion of JFM glues, \Param{kanjiskip} and \Param{xkanjiskip}}
%<ja>\section{JFMグルーの挿入,\Param{kanjiskip}と\Param{xkanjiskip}}
\label{sec-jfmglue}
\LuaTeX-jaにおける \textbf{JAglue} の挿入方法は,\pTeX のそれとは全く異なる.
\pTeX では次のような仕様であった:
\begin{itemize}
-\item JFMグルーの挿入は,和文文字を表すトークンを元に水平リストに(文字を表す)<char\_node>を
+\item JFMグルーの挿入は,和文文字を表すトークンを元に水平リストに(文字を表す)\meta{char\_node}を
追加する過程で行われる.
\item \Param{xkanjiskip}の挿入は,hboxへのパッケージングや行分割前に行われる.
\item \Param{kanjiskip}はノードとしては挿入されない.パッケージングや行分割の計算時に
-「和文文字を表す2つの<char\_node>の間には\Param{kanjiskip}がある」ものとみなされる.
+「和文文字を表す2つの\meta{char\_node}の間には\Param{kanjiskip}がある」ものとみなされる.
\end{itemize}
しかし,\LuaTeX-jaでは,hboxへのパッケージングや行分割前に全ての
\textbf{JAglue},即ちJFMグルー・\Param{xkanjiskip}・\Param{kanjiskip}の
\]
として,前側の文字のJFMを使った時の空白(グルー/カーン)と,後側の文字のJFMを使った時のそれを求める.
-$\mathit{gb}$,~$\mathit{ga}$それぞれに対する<ratio>の値を$d_b$,~$d_a$とする.
+$\mathit{gb}$,~$\mathit{ga}$それぞれに対する\meta{ratio}の値を$d_b$,~$d_a$とする.
\begin{itemize}
\item
$\mathit{ga}$と$\mathit{gb}$の両方が未定義であるならば,JFM由来のグルーは挿入されず,
\Param{kanjiskip}を採用することとなる.
-どちらか片方のみが未定義であるならば,次のステップでその未定義の方は長さ0のkernで,<ratio>の値は0であるかのように扱われる.
+どちらか片方のみが未定義であるならば,次のステップでその未定義の方は長さ0のkernで,\meta{ratio}の値は0であるかのように扱われる.
\item
\Param{diffrentjfm}の値が \texttt{pleft}, \texttt{pright},
\texttt{paverage} のとき,
-<ratio>の指定に従って比例配分を行う.
+\meta{ratio}の指定に従って比例配分を行う.
JFM由来のグルー/カーンは以下の値となる:
\[
f\left(\frac{1-d_b}2\textit{gb} + \frac{1+d_b}2\textit{ga},
\]
ここで.$f(x,y)$は
\[
- f(x,y)=\begin{cases}
-x&\text{if\ }\Param{diffrentjfm}=\texttt{pleft};\\
-y&\text{if\ }\Param{diffrentjfm}=\texttt{pright};\\
-(x+y)/2&\text{if\ }\Param{diffrentjfm}=\texttt{paverage};
-\end{cases}.
+ f(x,y)=\begin{dcases*}
+x&($\Param{diffrentjfm}=\texttt{pleft}$),\\
+y&($\Param{diffrentjfm}=\texttt{pright}$),\\
+\frac{x+y}2&($\Param{diffrentjfm}=\texttt{paverage}$).
+\end{dcases*}
\]
\item
-\Param{differentjfm}がそれ以外の値の時は,<ratio>の値は無視され,JFM由来のグルー/カーンは以下の値となる:
+\Param{differentjfm}がそれ以外の値の時は,\meta{ratio}の値は無視され,JFM由来のグルー/カーンは以下の値となる:
\[
f(\textit{gb},\textit{ga})
\]
ここで.$f(x,y)$は
\[
- f(x,y)=\begin{cases}
-\min(x,y)&\text{if\ }\Param{diffrentjfm}=\texttt{small};\\
-\max(x,y)&\text{if\ }\Param{diffrentjfm}=\texttt{large};\\
-(x+y)/2&\text{if\ }\Param{diffrentjfm}=\texttt{average};\\
-x+y&\text{if\ }\Param{diffrentjfm}=\texttt{both};
-\end{cases}.
+ f(x,y)=\begin{dcases*}
+\min(x,y)&($\Param{diffrentjfm}=\texttt{small}$),\\
+\max(x,y)&($\Param{diffrentjfm}=\texttt{large}$),\\
+\frac{x+y}2&($\Param{diffrentjfm}=\texttt{average}$),\\
+x+y&($\Param{diffrentjfm}=\texttt{both}$).
+\end{dcases*}
\]
\end{itemize}
\end{enumerate}
という3ノードを考える(それぞれ単独でクラスタをなす).
この場合,$p$と$q$の間は,実フォントが異なるにもかかわらず2.の状況となる一方で,
$q$と$r$の間は(実フォントが同じなのに)\texttt{jfmvar} キーの内容が異なるので3.の状況となる.
+
+ なお,JFMで\texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
+\texttt{kanjiskip\_shrink}キーが指定されていた場合は,……
+
\item[\Param{kanjiskip}~{[K]}] 上の[M]において空白が定まらなかった場合,
以下で定めた量「右空白」として採用する.
この段階においては,\cs{inhibitglue} は効力を持たないため,
結果として,2つの\textbf{JAchar}間には常に何らかのグルー/カーンが挿入されることとなる.
\begin{enumerate}
\item 両クラスタ(厳密には$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$)の中身の文字コードに対する
-\Param{autospacing}パラメタが両方ともfalseだった場合は,長さ0のglueとする.
-\item ã\83¦ã\83¼ã\82¶å\81´ã\81\8bã\82\89è¦\8bã\81\9f\Param{kanjiskip}ã\83\91ã\83©ã\83¡ã\82¿ã\81®è\87ªç\84¶é\95·ã\81\8c$\cs{maxdimen}=(2^{30}-1)\,{\rm sp}$で
-なければ,\Param{kanjiskip}パラメタの値を持つglueを採用する.
+\Param{autospacing}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8c両æ\96¹ã\81¨ã\82\82falseã\81 ã\81£ã\81\9få ´å\90\88ã\81¯ï¼\8cé\95·ã\81\950ã\81®glueã\81¨ã\81\99ã\82\8bï¼\8e
+\item ã\83¦ã\83¼ã\82¶å\81´ã\81\8bã\82\89è¦\8bã\81\9f\Param{kanjiskip}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81®è\87ªç\84¶é\95·ã\81\8c$\cs{maxdimen}=(2^{30}-1)\,\mbox{sp}$で
+ã\81ªã\81\91ã\82\8cã\81°ï¼\8c\Param{kanjiskip}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81®å\80¤ã\82\92æ\8c\81ã\81¤glueã\82\92æ\8e¡ç\94¨ã\81\99ã\82\8bï¼\8e
\item 2.でない場合は,\textit{Nq}, \textit{Np}で使われているJFMに指定されている\Param{kanjiskip}の値を用いる.
どちらか片方のクラスタだけが\textbf{JAchar}(\textsf{和文A}・\textsf{和文B})のときは,そちらのクラスタで使われている
JFM由来の値だけを用いる.もし両者で使われているJFMが異なった場合は,上の[M]~3.と同様の方法を用いて調整する.
\item $\mathit{Np}.\mathit{id}$が\textit{id\_math}のとき(つまりクラスタ\textit{Np}が文中数式を表す)
ときは,$x=-1$.
\item \textit{Np}の中身の中身の文字コードについて,「直前への\Param{xkanjiskip}の挿入」が禁止されている
-(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが偶数)ときは,
+ï¼\88ã\81¤ã\81¾ã\82\8aï¼\8c\Param{jaxspmode}~(or \Param{alxspmode})ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8cå\81¶æ\95°ï¼\89ã\81¨ã\81\8dã\81¯ï¼\8c
$x=\text{\texttt{'nox\_alchar'}}$.
\item 以上のいずれでもないときは,$x=\text{\texttt{'alchar'}}$.
\end{itemize}
\begin{enumerate}
\item 以下のいずれかの場合は,\Param{xkanjiskip}の挿入は抑止される.しかし,実際には行分割を許容するために,長さ0のglueを採用する:
\begin{itemize}
-\item 両クラスタにおいて,それらの中身の文字コードに対する\Param{autoxspacing}パラメタが共にfalseである.
+\item 両ã\82¯ã\83©ã\82¹ã\82¿ã\81«ã\81\8aã\81\84ã\81¦ï¼\8cã\81\9dã\82\8cã\82\89ã\81®ä¸èº«ã\81®æ\96\87å\97ã\82³ã\83¼ã\83\89ã\81«å¯¾ã\81\99ã\82\8b\Param{autoxspacing}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8cå\85±ã\81«falseã\81§ã\81\82ã\82\8bï¼\8e
\item \textit{Nq}の中身の文字コードについて,「直後への\Param{xkanjiskip}の挿入」が禁止されている
-(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが2以上).
+ï¼\88ã\81¤ã\81¾ã\82\8aï¼\8c\Param{jaxspmode}~(or \Param{alxspmode})ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8c2以ä¸\8aï¼\89ï¼\8e
\item \textit{Np}の中身の文字コードについて,「直前への\Param{xkanjiskip}の挿入」が禁止されている
-(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが偶数).
+ï¼\88ã\81¤ã\81¾ã\82\8aï¼\8c\Param{jaxspmode}~(or \Param{alxspmode})ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8cå\81¶æ\95°ï¼\89ï¼\8e
\end{itemize}
-\item ã\83¦ã\83¼ã\82¶å\81´ã\81\8bã\82\89è¦\8bã\81\9f\Param{xkanjiskip}ã\83\91ã\83©ã\83¡ã\82¿ã\81®è\87ªç\84¶é\95·ã\81\8c$\cs{maxdimen}=(2^{30}-1)\,{\rm sp}$で
-なければ,\Param{xkanjiskip}パラメタの値を持つglueを採用する.
+\item ã\83¦ã\83¼ã\82¶å\81´ã\81\8bã\82\89è¦\8bã\81\9f\Param{xkanjiskip}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81®è\87ªç\84¶é\95·ã\81\8c$\cs{maxdimen}=(2^{30}-1)\,\textrm{sp}$で
+ã\81ªã\81\91ã\82\8cã\81°ï¼\8c\Param{xkanjiskip}ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81®å\80¤ã\82\92æ\8c\81ã\81¤glueã\82\92æ\8e¡ç\94¨ã\81\99ã\82\8bï¼\8e
\item 2.でない場合は,\textit{Nq}, \textit{Np}(\textsf{和文A}/\textsf{和文B}なのは片方だけ)
で使われているJFMに指定されている\Param{xkanjiskip}の値を用いる.
\end{enumerate}
\texttt{'nox\_alchar'}か\texttt{'alchar'}は
\begin{quote}
\textit{Nq}の中身の文字コードについて,「直後への\Param{xkanjiskip}の挿入」が禁止されている
-(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが2以上).
+ï¼\88ã\81¤ã\81¾ã\82\8aï¼\8c\Param{jaxspmode}~(or \Param{alxspmode})ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\81\8c2以ä¸\8aï¼\89ï¼\8e
\end{quote}
か否かで判断する.
\end{enumerate}
さて,\texttt{yoffset} の増減によって見かけのグリフ位置は上下に移動するが,
仮想ボディの高さ$h$,深さ$d$については
\begin{description}
-\catcode`\<=12\catcode`\>=12
\item[$\texttt{yoffset}\geq 0$のとき]
$h = \max(\texttt{height} + \texttt{yoffset}, 0)$,
$d = \max(\texttt{depth} - \texttt{yoffset}, 0)$,
% \textbf{JAchar}を名称の一部に含む制御綴は使用不可能}である.
% 例えば次のような入力を考えよう:
% %</ja>
-% \begin{verbatim*}
-% \begin{lstlisting}[escapechar=\#]
+% \begin{lstlisting}[showspaces][escapechar=\!]
+% !\cs{begin}!{lstlisting}[escapechar=\#]
% #\ほげ xぴよ#
+% !\cs{end}!{lstlisting}
% \end{lstlisting}
-% \end{verbatim*}
% %<en>The line~2 is transformed by the callback to
% %<ja>ここで,2行目は \verb+process_input_buffer+ の作用により,
% \begin{lstlisting}[showspaces, escapechar=\!]
\texttt{vsraw}は,ブール値の値をとるキーであり,標準ではfalseである.
\begin{itemize}
- \item trueの場合は,異体字セレクタは「直前の文字に続けて」出力される.
-もしもIVSサポート(\ref{ssec:ltjotf}節)が有効になっていた場合は,
-以下の例(左側は入力,右側はその出力)のようになる.
+ \item trueの場合は,異体字セレクタは「直前の文字に続けて」出力されるため,
+例えば以下の例(左側は入力,右側はその出力)のようになる.
%</ja>
-\begin{LTXexample}
+%%%% [preset=...]: workaround for lstlisting inside LTXexample
+\begin{LTXexample}[preset=\expandafter\def\csname @captype\endcsname{lstlisting}]
\begin{lstlisting}[vsraw=true]
葛󠄀城市,葛󠄁飾区,葛西
\end{lstlisting}
どのような形で出力されるかを規定するのが \texttt{vscmd} キーであり,
\Pkg{lltjp-listings} の標準設定では以下の例の右側のように出力される.
%</ja>
-\begin{LTXexample}
+\begin{LTXexample}[preset=\expandafter\def\csname @captype\endcsname{lstlisting}]
\begin{lstlisting}[vsraw=false,
vscmd=\ltjlistingsvsstdcmd]
葛󠄀城市,葛󠄁飾区,葛西
%<en> For example, the following code is the setting of the \texttt{vscmd} key in this document.
\begin{lstlisting}[numbers=left]
\def\IVSA#1#2#3#4#5{%
- \textcolor{blue}{\raisebox{3.5pt}{\tt%
- \fboxsep=0.5pt\fbox{\tiny \oalign{0#1#2\crcr#3#4#5\crcr}}}}%
+ \hbox to1em{\hss\textcolor{blue}{\raisebox{3.5pt}{\normalfont\ttfamily%
+ \fboxsep=0.5pt\fbox{\hbox to0.75em{\hss\tiny \oalign{0#1#2\crcr#3#4#5\crcr}\hss}}}}\hss}%
}
{\catcode`\%=11
\gdef\IVSB#1{\expandafter\IVSA\directlua{
「行末に$a_{i}$全角だけのカーンを追加した時の,\textit{glue\_set}の値」を
$b_{i}$とおく.式で書くと,
\[
-\catcode`\<=12
-b_{i} = \begin{cases}
- |\textit{total}-a_{i}\text{\cs{zw}}|/T^{+}
- &(\textit{total}-a_{i}\text{\cs{zw}}\geq 0)\\
- |\textit{total}-a_{i}\text{\cs{zw}}|/T^{-}
- &(\textit{total}-a_{i}\text{\cs{zw}}<0)
-\end{cases}.
+b_{i} = \begin{dcases*}
+ \frac{\lvert\textit{total}-a_{i}\text{\cs{zw}}\rvert}{T^{+}}
+ &($\textit{total}-a_{i}\text{\cs{zw}}\geq 0$),\\
+ \frac{\lvert\textit{total}-a_{i}\text{\cs{zw}}\rvert}{T^{-}}
+ &($\textit{total}-a_{i}\text{\cs{zw}}<0$).
+\end{dcases*}
\]
$b_{i}$達の最小値を与えるような$i$を$j$としたとき\footnote{%
そのような$i$が2つ以上あるときは,$|\textit{total}-a_{i}\cdot \text{\cs{zw}}|$,
\item \textit{total}が「(A)の伸び量の合計」以上ならば,(A)--(K)のどこまで負担すれば
\textit{total}以上になるかを計算する.
例えば,
-\[\catcode`\<=12
+\[
\textit{total} = (\text{(A)--(B)の伸び量の合計}) + p\cdot (\text{(C)の伸び量の合計}),
\qquad 0\le p<1
\]
%</ja>
%<*ja>
-\section{IVS対応}
-\verb+luatexja.otf.enable_ivs()+ を実行し,IVS対応を有効にした状態では,
-\verb+pre_linebreak_filter+ や \verb+hpack_filter+ コールバックには
-次の4つが順に実行される状態となっている:
-\begin{description}
-\item[\tt ltj.do\_ivs] \textit{glyph\_node}~$p$の直後に,異体字セレクタ(を表す\textit{glyph\_node})
-が連続した場合に,$p$のフォントに対応したが持つ「異体字情報」に従って出力するグリフを変える.
-
-しかし,単に$p.\textit{char}$を変更するだけでは,後から
-OpenType機能の適用(すぐ下)により置換される可能性がある.そのため,
-\cs{CID} や \cs{UTF} と同じように,\textit{glyph\_node}~$p$の代わりに
-\texttt{user\_id} が\textit{char\_by\_cid}であるようなuser-defined whatsitを用いている.
-\item[(\Pkg{luaotfload} によるfont featureの適用)]
-\item[\tt ltj.otf] \texttt{user\_id} が\textit{char\_by\_cid}であるようなuser-defined whatsitを
-きちんと\textit{glyph\_node}に変換する.この処理は,\cs{CID}, \cs{UTF}やIVSによる置換が,
-OpenType機能の適用で上書きされてしまうのを防止するためである.
-\item[\tt ltj.main\_process] \textbf{JAglue}の挿入処理(\ref{sec-jfmglue}章)と,
-JFMの指定に従って各\textbf{JAchar}の「寸法を補正」することを行う.
-\end{description}
-
-問題は各フォントの持っているIVS情報をどのように取得するか,である.
-\Pkg{luaotfload} はフォント番号<font\_number>の情報を\
-\texttt{fonts.hashes.identifiers[<font\_number>]} 以下に格納している.
-しかし,OpenTypeフォントのIVS情報は格納されていないようである%
-\footnote{TrueTypeフォントに関しては,
-\begin{center}
-\texttt{fonts.hashes.idenfiers[<font\_number>]%
- .resources.variants[<selector>][<base\_char>]}
-\end{center}
-に,<base\_char>番の文字の後に異体字セレクタ<selector>が続いた場合に
-出力すべきグリフが書かれてある.}.
-%例えば,小塚明朝Pr6N~Rでは,
-
-一方,\LuaTeX 内部の \texttt{fontloader} の返すテーブルには
-OpenTypeフォントでもTrueTypeフォントでもIVS情報が格納されている.
-具体的には……
-
-そのため,\LuaTeX-jaのIVS対応においては,\LuaTeX 内部の\
-\texttt{fontloader} を直接用いることで,フォントのIVS情報を取得している.
-20140114.0以降でキャッシュを用いるようにした要因はここにあり,
-\texttt{fontloader} の呼び出しでかなり時間を消費することから,
-%%% to_table を使わなくしたことで,メモリ使用量は減った
-IVS情報をキャッシュに保存することで2回目以降の実行時間を節約している.
-%</ja>
-
-
-%<*ja>
\section{複数フォントの「合成」(未完)}
\section{\LuaTeX-jaにおけるキャッシュ}
\Pkg{luaotfload}パッケージが,各TrueType・OpenTypeフォントの情報を
キャッシュとして保存しているのと同様の方法で,
\LuaTeX-jaもいくつかのキャッシュファイルを作成するようになった.
\begin{itemize}
- \item 通常,キャッシュは\texttt{\$TEXMFVAR/luatexja/}以下に保存され,
+ \item 通常,キャッシュは \texttt{\$TEXMFVAR/luatexja/} 以下に保存され,
そこから読み込みが行われる.
- \item 「通常の」テキスト形式のキャッシュ(拡張子は \texttt{.lua})以外にも,
+ \item 「通常の」テキスト形式のキャッシュ(拡張子は \texttt{.lua.gz},gzip圧縮されているため)以外にも,
それをバイナリ形式(バイトコード)に変換したものもサポートしている.
\begin{itemize}
- \item \LuaTeX とLuaJIT\TeX ではバイトコードの形式が異なるため,バイナリ形式の
-キャッシュは共有できない.\LuaTeX 用のバイナリキャッシュは \texttt{.luc},
-LuaJIT\TeX 用のは \texttt{.lub} と拡張子を変えることで対応している.
\item キャッシュを読み込む時,同名のバイナリキャッシュがあれば,
テキスト形式のものよりそちらを優先して読み込む.
\item テキスト形式のキャッシュが更新/作成される際は,そのバイナリ版も
同時に更新される.
また,(バイナリ版が見つからず)テキスト形式のキャッシュ側が読み込まれたときは,
\LuaTeX-jaはバイナリキャッシュを作成する.
+未圧縮のテキスト形式のキャッシュ(\texttt{hoge.lua})は20200802.0以降では利用しない.
\end{itemize}
\end{itemize}
%</ja>
\begin{itemize}
\item Cache files are usually stored in (and loaded from)
\texttt{\$TEXMFVAR/luatexja/}.
- \item In addition to caches of the text form (the extension is ``\texttt{.lua}''),
-caches of the \emph{binary}, precompiled form are supported.
+ \item In addition to caches of the text form (the extension is ``\texttt{.lua.gz}'',
+because they are compressed by gzip),
+caches of the \emph{binary}~(bytecode) form are supported.
\begin{itemize}
- \item We cannot share same binary cache for \LuaTeX\ and LuaJIT\TeX.
-Hence we distinguish them by their extension, ``\texttt{.luc}'' for \LuaTeX\
-and ``\texttt{.lub}'' for LuaJIT\TeX.
\item In loading a cache, the binary cache precedes
the text form.
- \item When \LuaTeX-ja updates a cache \texttt{hoge.lua},
+ \item When \LuaTeX-ja updates a compressed text cache \texttt{hoge.lua.gz},
its binary version is also updated.
\end{itemize}
\end{itemize}
%<*ja>
\subsection{キャッシュの使用箇所}
-\LuaTeX-ja では以下の3種類のキャッシュを使用している:
+\LuaTeX-ja では以下のキャッシュを使用している:
\begin{cslist}
-\item[ltj-cid-auto-adobe-japan1.lua]
+\item[ltj-cid-auto-adobe-japan1.\{lua.gz,luc\}]
Ryumin-Lightのような非埋め込みフォントの情報を格納しており,
(それらが\LuaTeX-jaの標準和文フォントなので)\LuaTeX-jaの読み込み時に自動で読まれる.
-生成には\texttt{UniJIS2004-UTF32-\{H, V\}}, \texttt{Adobe-Japan1-UCS2}という3つの
+生成には\texttt{UniJIS2004-UTF32-\{H,V\}}, \texttt{Adobe-Japan1-UCS2}という3つの
CMapが必要である.
\pageref{para-cid}ページで述べたように,\texttt{cid}キーを使って
非埋め込みの中国語・韓国語フォントを定義する場合,同様のキャッシュが生成される.
キャッシュの名称,必要となるCMapについては\autoref{tab:cid-cache}を参照して欲しい.
-
-\item[extra\_***.lua]
-フォント``\texttt{***}''における異体字セレクタの情報,縦組用字形への変換テーブル,そして
-縦組時における幅を格納している.構造は以下の通り:
%</ja>
%<*en>
\subsection{Use of cache}
\LuaTeX-ja uses the following cache:
\begin{cslist}
-\item[ltj-cid-auto-adobe-japan1.lua]
+\item[ltj-cid-auto-adobe-japan1.\{lua.gz,luc\}]
The font table of a CID-keyed non-embedded Japanese font.
This is loaded in every run.
It is created from three CMaps, \texttt{UniJIS2004-UTF32-\{H,V\}} and
if you specified \texttt{cid} key in \cs{jfont}
to use other CID-keyed non-embedded fonts for Chinese or Korean,
as in Page~\pageref{para-cid}.
-
-\item[extra\_***.lua]
-This file stores the table which stores the following.
-\begin{itemize}
- \item unicode variants in a font ``\texttt{***}''
- \item vertical width of glyphs, if it is not equal to the sum of
-the height of ascender and the depth of descender
- \item vertical variants
-\end{itemize}
-The following is the structure of the that table.
%</en>
\begin{table}[!tb]
\bf \texttt{cid} key&\bf name of the cache &
\multicolumn{2}{c}{\bf used CMaps}\\
\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-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\\
+Adobe-Japan1-*<j-cid-auto-adobe-japan1.\{lua.gz,luc\}&UniJIS2004-UTF32-*&Adobe-Japan1-UCS2\\
+Adobe-Korea1-*<j-cid-auto-adobe-korea1.\{lua.gz,luc\}&UniKS-UTF32-*&Adobe-Korea1-UCS2\\
+Adobe-KR-*<j-cid-auto-adobe-kr.\{lua.gz,luc\}&UniAKR-UTF32-*&Adobe-KR-UCS2\\
+Adobe-GB1-*<j-cid-auto-adobe-gb1.\{lua.gz,luc\}&UniGB-UTF32-*&Adobe-GB1-UCS2\\
+Adobe-CNS1-*<j-cid-auto-adobe-cns1.\{lua.gz,luc\}&UniCNS-UTF32-*&Adobe-CNS1-UCS2\\
\bottomrule
\end{tabular}
\end{table}
-\begin{lstlisting}
-return {
- {
- [10955]={ -- U+2ACB "Subset Of Above Not Equal To"
- [65024]=983879, -- <2ACB FE00>
- ["vwidth"]=0.98, -- vertical width
- },
- [37001]={ -- U+9089 "邉"
- [0]=37001, -- <9089 E0100>
- 991049, -- <9089 E0101>
- ...
- ["vform"]=995025, -- vertical variant
- },
- ...
- ["unicodes"]={
- ["aj102.pe.vert"]=984163, -- glyph name to unicode
- ...
- }
- },
- ["chksum"]="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", -- checksum of the fontfile
- ["version"]=11, -- version of the cache
-}
-\end{lstlisting}
%<*ja>
-\item[ltj-jisx0208.\{luc|lub\}]
-\LuaTeX-ja配布中の\texttt{ltj-jisx0208.lua}をバイナリ化したものである.
+\item[ltj-kinsoku\_default.\{lua.gz,luc\}]
+禁則処理,\Param{kansujichar}などの標準設定が格納されたファイルである.
+%</ja>
+%<*en>
+\item[ltj-kinsoku.luc]
+The bytecode cache which default \textit{kinsoku} parameters are stored.
+%</en>
+
+%<*ja>
+\item[ltj-jisx0208.luc]
+\LuaTeX-ja配布中の\texttt{ltj-jisx0208.lua}をバイトコード化したものである.
これはJIS~X~0208とUnicodeとの変換テーブルであり,
\pTeX との互換目的の文字コード変換命令で用いられる.
%</ja>
%<*en>
-\item[ltj-jisx0208.\{luc|lub\}]
-The binary version of \texttt{ltj-jisx0208.lua}.
+\item[ltj-jisx0208.luc]
+The bytecode version of \texttt{ltj-jisx0208.lua}.
This is the conversion table between JIS~X~0208 and Unicode
which is used in Kanji-code conversion commands for compatibility with \pTeX.
%</en>
+
+%<*ja>
+\item[ltj-ivd\_aj1.luc]
+\LuaTeX-ja配布中の\texttt{ltj-ivd\_aj1.lua}をバイトコード化したものである.
+これはUnicodeの漢字異体字データベースのAdobe-Japan1コレクションの内容を
+ 格納したテーブルであり,\Pkg{luatexja-otf}パッケージの\cs{CID}命令で使われることがある.
+%</ja>
+%<*en>
+\item[ltj-ivd\_aj1.luc]
+The bytecode version of \texttt{ltj-ivd\_aj1.lua}.
+%</en>
+
+%<*ja>
+\item[extra\_***.\{lua.gz,luc\}]
+フォント``\texttt{***}''における,グリフ番号からUnicode値への変換テーブル,縦組時のグリフ回転の有無を格納したテーブル,
+及び縦組時におけるグリフの原点位置・高さのテーブルを格納している.
+%</ja>
+%<*en>
+\item[extra\_***.\{lua.gz,luc\}]
+This file conains some information (especially for vertical typesetting) about the font `\texttt{***}''.
+%</en>
\end{cslist}
%<*en>
\subsection{Internal}
Cache management system of \LuaTeX-ja is stored in \texttt{luatexja.base}
(\texttt{ltj-base.lua}).
-There are three public functions for cache management in \texttt{luatexja.base},
-where <filename> stands for the file name \emph{without suffix}:
+There are four public functions for cache management in \texttt{luatexja.base},
+where \meta{filename} stands for the file name \emph{without suffix}:
\begin{cslist}
-\item[save\_cache(<filename>, <data>)]
-Save a non-nil table <data> into a cache <filename>.
-Both the text form <filename>\texttt{.lua} and its binary version
+\item[save\_cache(\meta{filename}, \meta{data})]
+Save a non-nil table \meta{data} into a cache \meta{filename}.
+Both the compressed text form \meta{filename}\texttt{.lua.gz} and its binary version
are created or updated.
-\item[save\_cache\_luc(<filename>, <data>{[, <serialized\_data>]})]
+\item[save\_cache\_luc(\meta{filename}, \meta{data}{[, \meta{serialized\_data}]})]
Same as \texttt{save\_cache}, except that only the binary cache is updated.
-The third argument <serialized\_data> is not usually given.
-But if this is given, it is treated as a string representation of <data>.
+The third argument \meta{serialized\_data} is not usually given.
+But if this is given, it is treated as a string representation of \meta{data}.
-\item[load\_cache(<filename>, <outdate>)]
-Load the cache <filename>.
-<outdate> is a function which takes one argument (the contents of the cache),
+\item[load\_cache(\meta{filename}, \meta{outdate})]
+Load the cache \meta{filename}.
+\meta{outdate} is a function which takes one argument (the contents of the cache),
and its return value is whether the cache is outdated.
\texttt{load\_cache} first tries to
-read the binary cache <filename>\texttt{.\{luc|lub\}}.
+read the binary cache \meta{filename}\texttt{.luc}.
If its contents is up-to-date, \texttt{load\_cache} returns the contents.
If the binary cache is not found or
its contents is outdated, \texttt{load\_cache} tries to
-read the text form <filename>\texttt{.lua}.
+read the compressed text form \meta{filename}\texttt{.lua.gz}.
Hence, the return value of \texttt{load\_cache} is non-nil,
if and only if the updated cache is found.
+
+\item[remove\_cache(\meta{filename})]
+Remove the cahce \meta{filename}.
\end{cslist}
%</en>
%<*ja>
\subsection{内部命令}
\LuaTeX-jaにおけるキャッシュ管理は,\texttt{luatexja.base}~(\texttt{ltj-base.lua})に
-実装しており,以下の3関数が公開されている.
-ここで,<filename>は保存するキャッシュのファイル名を\emph{拡張子なしで}指定する.
+実装しており,以下の関数が公開されている.
+ここで,\meta{filename}は保存するキャッシュのファイル名を\emph{拡張子なしで}指定する.
\begin{cslist}
-\item[save\_cache(<filename>, <data>)]
-nilでない<data>をキャッシュ<filename>に保存する.
-テキスト形式の<filename>\texttt{.lua}のみならず,
-そのバイナリ版も作成/更新される.
+\item[save\_cache(\meta{filename}, \meta{data})]
+nilでない\meta{data}をキャッシュ\meta{filename}に保存する.
+テキスト形式の\meta{filename}\texttt{.lua.gz}\footnote{拡張子からわかる通り,実際にはgzip圧縮される.}のみならず,
+そのバイナリ形式も作成・更新される.
-\item[save\_cache\_luc(<filename>, <data>{[, <serialized\_data>]})]
+\item[save\_cache\_luc(\meta{filename}, \meta{data}{[, \meta{serialized\_data}]})]
\texttt{save\_cache}と同様だが,バイナリキャッシュのみが更新される.
-第3引数<serialized\_data>が与えられた場合,それを
-<data>の文字列化表現として使用する.
-そのため,<serialized\_data>は普通は指定しないことになるだろう.
+第3引数\meta{serialized\_data}が与えられた場合,それを
+\meta{data}の文字列化表現として使用する.
+そのため,\meta{serialized\_data}は普通は指定しないことになるだろう.
-\item[load\_cache(<filename>, <outdate>)]
-キャッシュ<filename>を読み込む.
-<outdate>は1引数(キャッシュの中身)をとる関数であり,
+\item[load\_cache(\meta{filename}, \meta{outdate})]
+キャッシュ\meta{filename}を読み込む.
+\meta{outdate}は1引数(キャッシュの中身)をとる関数であり,
その戻り値は「キャッシュの更新が必要」かどうかを示すブール値でないといけない.
-\texttt{load\_cache}は,まずバイナリキャッシュ<filename>\texttt{.\{luc|lub\}}を
-読みこむ.もしその内容が「新しい」,つまり<outdate>の評価結果が \texttt{false} なら
+\texttt{load\_cache}は,まずバイナリキャッシュ\meta{filename}\texttt{.luc}を
+読みこむ.もしその内容が「新しい」,つまり\meta{outdate}の評価結果が \texttt{false} なら
\texttt{load\_cache}はこのバイナリキャッシュの中身を返す.
-もしバイナリキャッシュが見つからなかったか,「古すぎる」ならばテキスト版
- <filename>\texttt{.lua}を読み込み,その値を返す.
+もしバイナリキャッシュが見つからなかったか,「古すぎる」ならば(gzip圧縮された)テキスト形式の
+ \meta{filename}\texttt{.lua.gz}を読み込み,\meta{outdate}で再度評価する.
以上より,\texttt{load\_cache}自体がnilでない値を返すのは,ちょうど「新しい」キャッシュが
見つかった場合である.
+
+\item[remove\_cache(\meta{filename})]
+キャッシュ\meta{filename}を削除する.テキスト形式(gzip圧縮されているか否かを問わず)も
+バイナリ形式もまとめて削除する.
\end{cslist}
%</ja>
}
\]
のようになる.
+
+\subsection{縦組用字形の取得}
+縦組時には,「\hbox to \zw{、}」(\texttt{U+3001})から「\ltjjachar"FE11」(\texttt{U+FE11})%"
+のように縦組用字形への置き換えに関係する処理は,以下のようになっている.
+
+
+\begin{table}[t]
+ \def\D#1#2#3#4{%
+ {\fboxsep0pt\fcolorbox{cyan}{white}%
+ {\large\KOZM\ltjjachar"#1#2#3#4}}\ (\texttt{U+#1#2#3#4})%"
+ }
+ \def\DH#1#2#3#4{%
+ {\fboxsep0pt\fcolorbox{cyan}{white}%
+ {\large\ltjjachar"#1#2#3#4}}\ (\texttt{U+#1#2#3#4})%"
+ }
+ \caption{\LuaTeX-ja標準で行われる縦組形への置換}
+ \label{tab:vert_replace}\small\centering
+ \begin{tabular}{*{3}{l@{}>{${}\longmapsto{}$}c@{}l}}
+ \toprule
+ \D 3001&&\D FE11&\D 3002&&\D FE12&\D 3016&&\DH FE17\\
+ \D 3017&&\DH FE18&\D 2026&&\D FE19&\D 2025&&\D FE30\\
+ \D 2014&&\D FE31&\D 2013&&\D FE32&\D FF3F&&\D FE33\\
+ \D FF08&&\D FE35&\D FF09&&\D FE36&\D FF5B&&\D FE37\\
+ \D FF5D&&\D FE38&\D 3014&&\D FE39&\D 3015&&\D FE3A\\
+ \D 3010&&\D FE3B&\D 3011&&\D FE3C&\D 300A&&\D FE3D\\
+ \D 300B&&\D FE3E&\D 3008&&\D FE3F&\D 3009&&\D FE40\\
+ \D 300C&&\D FE41&\D 300D&&\D FE42&\D 300E&&\D FE43\\
+ \D 300F&&\D FE44&\D FF3B&&\D FE47&\D FF3D&&\D FE48\\
+ \bottomrule
+ \end{tabular}
+\end{table}
+\begin{itemize}
+ \item 各縦組用和文フォントは読み込み時に以下の属性が設定される:
+ \begin{description}
+ \item[\textit{vert\_activated}] 真となるのは,
+ 明示的に \texttt{-vert} も \texttt{-vrt2} のいずれも指定されていないちょうどその時.
+ \item[\textit{auto\_enable\_vrt2}] 真となるのは,
+ \texttt{vert}, \texttt{vrt2}のいずれについても有効・無効が指定されていないちょうどその時.
+ \end{description}
+ \textit{vert\_activated}については\texttt{luatexja.define\_jfont}コールバックで渡される引数
+ \texttt{jfont\_info}から取得可能である.
+
+ \item \textit{auto\_enable\_vrt2}が真の場合は,現在のscript tagとlanguage system identifierの値で
+ \texttt{vrt2}機能が利用可能か調べる.利用可能ならば\texttt{vrt2}を,そうでなければ
+ \texttt{vert}を有効化する.
+ \item また,各和文フォント読み込み時には,
+ 「OpenType機能による置換以前に行う縦組形への置換」を格納したテーブル\textit{vform}も作成する.
+ \begin{enumerate}
+ \item \autoref{tab:vert_replace}に示した各置換$i\longmapsto v$に対し,
+ 置換先$v$がフォント内に存在する文字コードであるならば,$i\longmapsto v$を\textit{vform}に登録する.
+ \item \ref{ssec:tfont}節にある\texttt{jpotf}が指定された場合,
+ \LuaTeX-ja内部の別のテーブル\textit{vert\_jpotf\_table}に登録されている各置換$i\longmapsto v$に対して
+ 置換先$v$がフォント内に存在する文字コードであるならば,$i\longmapsto v$を\textit{vform}に登録する.
+ \item もし\texttt{vert}も\texttt{vrt2}も現在のscript, languageでは有効にできない場合,
+ どこかのscript, languageにおける\texttt{vert}で定義されている
+ 置換$i\longmapsto v$をすべて\textit{vform}に登録する.
+ \end{enumerate}
+
+ あとで説明するように,\textit{vform}は\textit{vert\_activated}が真であるような縦組用和文フォントでしか
+ 利用されない.
+
+ \item 「現在の水平リスト」内の\textbf{JAchar}を(欧文フォントから)和文フォントへ置き換える処理において,
+ その時点での組方向が縦組であり,かつ処理対象の各ノードの縦組用フォントで
+ \textit{vert\_activated}が真である場合,\textit{vform}に従いグリフが置き換えられる.
+
+ \Pkg{luaotfload}が行う,OpenType機能に沿ったグリフ置換はこの後の処理となる.
+ \end{itemize}
%</ja>
\newpage
\bibitem{listings} C.\ Heinz, B.\ Moses. \newblock The \textsf{Listings} Package.
\bibitem{uptex} Takuji Tanaka. \newblock
upTeX---Unicode version of pTeX with CJK extensions,
-TUG 2013, October 2013.
-%<ja>\newblock
-%<en>\\\null\hfill
+TUG 2013, October 2013.\newblock
\url{http://tug.org/tug2013/slides/TUG2013_upTeX.pdf}
-\bibitem{jlisting} Thor Watanabe. \newblock Listings\ -\ MyTeXpert.
-%<en>\newblock
-%<ja>\\\null\hfill
+\bibitem{jlisting} Thor Watanabe. \newblock Listings\ -\ MyTeXpert.\newblock
\url{http://mytexpert.osdn.jp/index.php?Listings}
\bibitem{jlreq} W3C Japanese Layout Task Force~(ed). \newblock
Requirements for Japanese Text Layout (W3C Working Group Note), 2011, 2012. \newblock
\url{http://www.w3.org/TR/jlreq/}%
%<ja> \\日本語訳の書籍版:W3C日本語組版タスクフォース(編),『W3C技術ノート 日本語組版処理の要件』,東京電機大学出版局,2012.
-\bibitem{min10} 乙部厳己.「min10フォントについて」\\\null\hfill
+\bibitem{min10} 乙部厳己.「min10フォントについて」\newblock
\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 の出版への応用—縦組み機能の組み込み—」.
-\\\null\hfill\texttt{.../texmf-dist/doc/ptex/base/ptexdoc.pdf}
+\newblock\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.
\bibitem{pdfstd} International Organization for Standardization. \newblock
ISO 32000-1:2008, \textit{Document management -- Portable document format -- Part 1: PDF
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}
+\bibitem{tc18ltja} 北川弘典.「\LuaTeX-jaの近況」,\TeX Conf~2018.
+ \url{https://raw.githubusercontent.com/h-kitagawa/presentations/main/tc18ltja.pdf}
+\bibitem{bxghost} Takuto ASAKURA. \newblock The \textsf{BXghost} Package. \url{https://github.com/wtsnjp/BXghost}
\end{thebibliography}
+\makeatletter
+\let\ltj@@end=\@@end
+{\catcode`\%=12\relax\catcode`\~=12\relax
+\protected\gdef\@@end{%
+\typeout{attributes:}
+\directlua{
+ for i=0,65535 do
+ local a = tex.getattribute(i)
+ if a~=-0x7FFFFFFF then
+ texio.write_nl('term and log',
+ string.format('attr %6d, %d', i, a))
+ end
+ tex.setbox('global', i, nil)
+ end
+ print('IC', luatexja.inherit_na_count )
+}\ltj@@end}}
\end{document}
%</!showexpl>
%<*showexpl>