• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: コミット

ソースコードの管理場所


コミットメタ情報

リビジョン2c45f80f79b73ade1d0fdfcb66734ba4ccd44838 (tree)
日時2020-05-17 10:30:39
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
コミッターHironori Kitagawa

ログメッセージ

updated doc.

変更サマリ

差分

Binary files a/doc/luatexja-en.pdf and b/doc/luatexja-en.pdf differ
Binary files a/doc/luatexja-ja.pdf and b/doc/luatexja-ja.pdf differ
--- a/doc/luatexja.dtx
+++ b/doc/luatexja.dtx
@@ -153,6 +153,7 @@
153153 \theoremstyle{definition}
154154 %<en>\newtheorem{defn}{Definition}
155155 %<ja>\newtheorem{defn}{定義}
156+\DeclareMathOperator\nint{nint}
156157
157158 %%%%%%%% logo
158159 \usepackage{metalogo}
@@ -3542,7 +3543,7 @@ The following horizontal JFMs are shipped with \LuaTeX-ja:
35423543 %<*en>
35433544 \item[\texttt{jfm-ujis.lua}] A standard horizontal JFM in \LuaTeX-ja. This JFM is
35443545 based on \verb+upnmlminr-h.tfm+, a metric for UTF/OTF package that
3545- is used in \upTeX. When you use the \Pkg{luatexja-otf} package, you should use this JFM.
3546+ is used in \upTeX. When you are going to use the \Pkg{luatexja-otf} package, you should use this JFM.
35463547 %</en>
35473548 %<*ja>
35483549 \item[\texttt{jfm-ujis.lua}] \LuaTeX-jaの標準JFMである.このJFMは\upTeX で
@@ -3608,7 +3609,7 @@ The difference among these three~JFMs is shown in \autoref{tab-difjfm}.
36083609 \footnote{プロポーショナル組の状況でルビをつけたい,などという状況では\texttt{jfm-propw.lua}が有用かもしれない.}.
36093610 %</ja>
36103611 %<*en>
3611-Furthermore, \LuaTeX-ja also ship two JFMs, namely \texttt{jfm-prop.lua}~and~\emph{\texttt{jfm-propw.lua}},
3612+Furthermore, \LuaTeX-ja also ship two JFMs, namely \texttt{jfm-prop.lua}~and~\texttt{jfm-propw.lua},
36123613 for ``proportional typesetting''.
36133614 Both JFMs don't have any character width information, nor glues/kerns information.
36143615 \texttt{jfm-prop.lua} also also not have character height and depth information, while \texttt{jfm-propw.lua} has them.
@@ -3689,6 +3690,7 @@ NFSS2用の命令(\ref{ssec:chgfnt}節,\ref{ssec:nfsspat}節)における
36893690 %</ja>
36903691
36913692 %<*ja>
3693+\newpage
36923694 \paragraph{\texttt{extend}と\texttt{slant}}
36933695 OpenType機能と見かけ上同じような形式で指定できるものに,
36943696 \begin{description}
@@ -3709,7 +3711,7 @@ The following setting can be specified as OpenType font features:
37093711 \item[\texttt{slant=}<slant>] slant the font.
37103712 \end{cslist}
37113713 Note that \LuaTeX-ja doesn't adjust JFMs by these \texttt{extend} and \texttt{slant}
3712-settings; you have to write new JFMs on purpose.
3714+settings; one have to write new JFMs on purpose.
37133715 For example, the following example uses the standard JFM \texttt{jfm-ujis.lua}, hence
37143716 letter-spacing and the width of italic correction are not correct:
37153717 %</en>
@@ -3720,30 +3722,21 @@ letter-spacing and the width of italic correction are not correct:
37203722 \end{LTXexample}
37213723
37223724 %<*ja>
3723-\paragraph{\texttt{ltjksp} 指定}
3725+\paragraph{\texttt{ltjksp}指定}
37243726 \label{pg:ltjksp}
37253727 \LuaTeX-ja標準では,
3726-JFM中における \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
3728+JFM中における\texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
37273729 \texttt{kanjiskip\_shrink}キー(\pageref{pg:ksp_nat}ページ)の使用によって,
37283730 「JFM由来のグルーの他に,\Param{kanjiskip}の自然長/伸び量/縮み量の一部が
37293731 同じ場所に挿入される」という状況が起こりうる.
37303732 この機能を無効化し,バージョン20150922.0以前と同じような組版を得るためには
3731-他のOpenType機能と同じように\ \texttt{-ltjksp}\ 指定を行えば良い.
3732-\begin{LTXexample}[width=16\zw]
3733-\leavevmode
3734-\ltjsetparameter{kanjiskip=0pt plus 3\zw}
3735-\vrule\hbox to 15\zw{あ「い」う,えお}\vrule\\
3736-\jfont\G=HaranoAjiMincho-Regular%
3737- :jfm=ujis;-ltjksp at \zw
3738-\G\leavevmode%
3739-\vrule\hbox to 15\zw{あ「い」う,えお}\vrule
3740-\end{LTXexample}
3733+他のOpenType機能と同じように\texttt{-ltjksp}指定を行えば良い(\autoref{fig:ltjksp}参照).
37413734 なお,
37423735 \begin{lstlisting}
37433736 \jfont\G=HaranoAjiMincho-Regular:jfm=ujis;-ltjksp;+ltjksp at \zw
37443737 \end{lstlisting}
3745-のように \texttt{+ltjksp} 指定を行った場合は,\texttt{kanjiskip\_natural} など
3746-3キーは再び有効化される.\texttt{-ltjksp}, \texttt{+ltjksp} を複数回指定した場合は,
3738+のように\texttt{+ltjksp}指定を行った場合は,\texttt{kanjiskip\_natural}など
3739+3キーは再び有効化される.\texttt{-ltjksp}, \texttt{+ltjksp}を複数回指定した場合は,
37473740 最後に指定したものが有効となる.
37483741 %</ja>
37493742 %<*en>
@@ -3753,8 +3746,10 @@ JFM中における \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
37533746 \texttt{kanjiskip\_shrink} keys (Page~\pageref{pg:ksp_nat}) makes tha
37543747 \LuaTeX-ja inserts not only a glue which is specified by a JFM, and also
37553748 the natural width/stretch part/shrink part of \Param{kanjiskip}.
3756-
3757-This functionality is disabled by \texttt{-ltjksp} specification.
3749+This functionality is disabled by \texttt{-ltjksp} specification,
3750+as shown in~\autoref{fig:ltjksp}.
3751+%</en>
3752+\begin{figure}
37583753 \begin{LTXexample}[width=16\zw]
37593754 \leavevmode
37603755 \ltjsetparameter{kanjiskip=0pt plus 3\zw}
@@ -3764,7 +3759,9 @@ This functionality is disabled by \texttt{-ltjksp} specification.
37643759 \G\leavevmode%
37653760 \vrule\hbox to 15\zw{あ「い」う,えお}\vrule
37663761 \end{LTXexample}
3767-%</en>
3762+\caption{\texttt{ltjksp}}
3763+\label{fig:ltjksp}
3764+\end{figure}
37683765
37693766
37703767
@@ -3828,7 +3825,7 @@ A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont
38283825 \begin{itemize}
38293826 \item OpenType Feature~\texttt{vrt2}%
38303827 \footnote{If the font does not define \texttt{vrt2} feature,
3831- use \texttt{vert} instead.} is automatically activated,
3828+ \texttt{vert} is used instead.} is automatically activated,
38323829 unless \texttt{vert}~and//or~\texttt{vrt2} are explicitly activated
38333830 or deactivated (as the second line in the example below).
38343831 \begin{lstlisting}
@@ -3873,6 +3870,8 @@ A font defined by~\cs{tfont} differs the following points from that by~\cs{jfont
38733870 By default, it substitutes ideographic comma/period for fullwidth comma/period,
38743871 and double prime quotation marks for double quotation marks
38753872 (See~\autoref{fig:jpotf}).
3873+ One can customize substitutions by lua~function \verb+luatexja.jfont.register_vert_replace+\ %
3874+ (see Japanese version of this manual).
38763875 \end{itemize}
38773876 %</en>
38783877 %<*ja>
@@ -4750,8 +4749,9 @@ Hence we have the following result:
47504749 「実際のグリフの幅に合わせて文字幅を整数倍する」際のしきい値を指定する.
47514750 より正確に述べると,次のようになる.このフィールドに正の数$r$が指定されていたとし,
47524751 文字クラス0で指定されている文字幅が$w$,文字クラス0に属する文字のグリフの幅が$w'$であったとする.
4753-$n$を$w/w'$に「もっとも近い整数」($\lfloor w/w'+0.5\rfloor$)としたとき,
4754-もし$|w/w'-n|\char`<r$であれば,JFMで文字幅$nw$が指定されたものとして扱う.
4752+$n=\nint(w/w')$とした
4753+\footnote{ここで,$\nint(a)=\lfloor a+0.5\rfloor$は$a$に「もっとも近い整数」を表す.}
4754+とき,もし$w'>w$かつ$|w/w'-n|\char`<r$であれば,JFMで文字幅$nw$が指定されたものとして扱う.
47554755
47564756 この機能は,ほとんど源ノ明朝・源ノ角ゴシックにおける2倍角・3倍角ダッシュの合字のために実装されたと
47574757 言ってもよい.これらのグリフは\LuaTeX 内部ではUnicodeの私用領域に割り当てられるので,
@@ -4852,7 +4852,7 @@ as follows:
48524852 %<ja>\paragraph{仮想的な文字}
48534853 %<en>\paragraph{Imaginary characters}
48544854 %<*en>
4855-As described before, you can specify several ``imaginary characters'' in
4855+As described before, one can specify several ``imaginary characters'' in
48564856 \texttt{chars} field. The most of these characters are regarded as the
48574857 characters of class 0 in \pTeX.
48584858 As a result, \LuaTeX-ja can control typesetting finer than \pTeX.
@@ -5002,7 +5002,7 @@ an external package is needed to support this in plain \TeX\ and
50025002 \autoref{tab-math} shows counterparts to \TeX's primitives for math
50035003 font families. There is no relation between the value of
50045004 \cs{fam} and that of \cs{jfam}; with appropriate settings,
5005-you can set both \cs{fam} and \cs{jfam} to the same value.
5005+one can set both \cs{fam} and \cs{jfam} to the same value.
50065006 Here <jfont\_cs> in the argument of \Param{jatextfont} etc.\ is
50075007 a control sequence which is defined by \cs{jfont}, i.e.,
50085008 a \emph{horizontal} Japanese font.
@@ -5053,7 +5053,7 @@ be accessed via \verb+luatexbase.add_to_callback+ function and so on, as other c
50535053 %<en>\item[\texttt{luatexja.load\_jfm} callback]
50545054 %<ja>\item[\texttt{luatexja.load\_jfm}コールバック]
50555055 %<*en>
5056-With this callback you can overwrite JFMs.
5056+With this callback, one can overwrite JFMs.
50575057 This callback is called when a new JFM is loaded.
50585058 %</en>
50595059 %<*ja>
--- a/src/ltj-setwidth.lua
+++ b/src/ltj-setwidth.lua
@@ -129,10 +129,12 @@ local function capsule_glyph_yoko(p, met, char_data, head, dir)
129129
130130 local q
131131 head, q = node_remove(head, p)
132- if char_data.round_threshold then
133- local frac = pwidth / fwidth
134- local quot = floor(frac+0.5)
135- if abs(frac-quot) <char_data.round_threshold then fwidth = fwidth * quot end
132+ if pwidth > fwidth then
133+ if char_data.round_threshold then
134+ local frac = pwidth / fwidth
135+ local quot = floor(frac+0.5)
136+ if abs(frac-quot) <char_data.round_threshold then fwidth = fwidth * quot end
137+ end
136138 end
137139 local xo, yo = getoffsets(p)
138140 setoffsets(p, xo + char_data.align*(fwidth-pwidth) - fshift.left,
@@ -196,7 +198,7 @@ local function capsule_glyph_tate(p, met, char_data, head, dir)
196198 pwidth, ascender = feir.vheight[pc]*met.size, feir.vorigin[pc]*met.size
197199 end
198200 fwidth = fwidth or pwidth
199- if fwidth~=pwidth and char_data.round_threshold then
201+ if pwidth>fwidth and char_data.round_threshold then
200202 local frac = pwidth / fwidth
201203 local quot = floor(frac+0.5)
202204 if abs(frac-quot) <char_data.round_threshold then fwidth = fwidth * quot end
旧リポジトリブラウザで表示