%<*!showexpl>
%#! lualatex -shell-escape
+%% KozMinPr6N-Regular.otf is needed to typeset this document.
%%%%% section ==> 章
%%%%% subsection => 節
\usepackage{unicode-math}
\setmonojfont{HaranoAjiGothic-Regular.otf}
\setmathfont[Scale=MatchLowercase]{XITSMath}
+\newjfontface\KOZM{KozMinPr6N-Regular.otf}
\setLaTeXa{\scshape a}
%<*ja>
\centering\footnotesize
\def\ch#1{%
{\fboxsep0pt\fcolorbox{cyan}{white}%
- {\normalsize\char"20#1}}\ (\texttt{U+20#1})} %"
+ {\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&
which JFM will be used for this font by the following keys:
%</en>
%<*ja>
-JFMは文字と和文組版で自動的に挿入される
+JFMã\81¯æ\96\87å\97ã\81®å¯¸æ³\95æ\83\85å ±ã\81¨å\92\8cæ\96\87çµ\84ç\89\88ã\81§è\87ªå\8b\95ç\9a\84ã\81«æ\8c¿å\85¥ã\81\95ã\82\8cã\82\8b
グルー/カーンの寸法情報を持っている.JFMの構造は次の節で述べる.
\cs{jfont} 命令の呼び出しの際には,どのJFMを用いるのかを以下のキーで
指定する必要がある:
\label{fig:jfmvar}
\end{figure}
+%<*ja>
+また,プロポーショナル組用に\texttt{jfm-prop.lua}と\texttt{jfm-propw.lua}も用意されている.
+どちらのJFMも文字幅の情報と自動挿入されるグルー・カーンの情報は持たない(つまりグリフの文字幅をそのまま採用する).
+\texttt{jfm-prop.lua}と\texttt{jfm-propw.lua}の差は,前者が
+文字の高さ・深さ情報も持たないのに対し,後者は持っている点である
+\footnote{プロポーショナル組の状況でルビをつけたい,などという状況では\texttt{jfm-propw.lua}が有用かもしれない.}.
+%</ja>
+%<*en>
+Furthermore, \LuaTeX-ja also ship two JFMs, namely \texttt{jfm-prop.lua}~and~\emph{\texttt{jfm-propw.lua}},
+ for ``proportional typesetting''.
+Both JFMs don't have any character width information, nor glues/kerns information.
+\texttt{jfm-prop.lua} also also not have character height and depth information, while \texttt{jfm-propw.lua} has them.
+%</en>
+
%<*en>
\item[jfmvar=<string>]
Sometimes there is a need that \ldots.
(optional, version~2 or~later)
%</en>
+ \item[round\_threshold=<float>]
+%<*ja>
+(任意,バージョン3以降,文字クラス0のみ)
+
+「実際のグリフの幅に合わせて文字幅を整数倍する」際のしきい値を指定する.
+より正確に述べると,次のようになる.このフィールドに正の数$r$が指定されていたとし,
+文字クラス0で指定されている文字幅が$w$,文字クラス0に属する文字のグリフの幅が$w'$であったとする.
+$n$を$w/w'$に「もっとも近い整数」($\lfloor w/w'+0.5\rfloor$)としたとき,
+もし$|w/w'-n|\char`<r$であれば,JFMで文字幅$nw$が指定されたものとして扱う.
+
+この機能は,ほとんど源ノ明朝・源ノ角ゴシックにおける2倍角・3倍角ダッシュの合字のために実装されたと
+言ってもよい.これらのグリフは\LuaTeX 内部ではUnicodeの私用領域に割り当てられるので,
+JFM側で番号を指定することができない.
+%</ja>
+%<*en>
+(optional, version~3 or~later, only available in character class~0)
+%</en>
+
+
\end{cslist}
%<*ja>
縦組時には,「\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\char"#1#2#3#4}}\ (\texttt{U+#1#2#3#4})%"
+ {\large\KOZM\ltjjachar"#1#2#3#4}}\ (\texttt{U+#1#2#3#4})%"
}
\caption{\LuaTeX-ja標準で行われる縦組形への置換}
\label{tab:vert_replace}\small\centering
do
local floor = math.floor
local function myround(a) return floor(a+0.5) end
+ local mult_ignore_key = {
+ round_threshold=true, kanjiskip_natural=true, kanjiskip_stretch=true, kanjiskip_shrink=true,
+ raio=true, priority=true
+ }
local function mult_table(old,scale) -- modified from table.fastcopy
if old then
local new = { }
for k,v in next, old do
if type(v) == "table" then
new[k] = mult_table(v,scale)
- elseif type(v) == "number" then
+ elseif type(v) == "number" and not mult_ignore_key[k] then
new[k] = myround(v*scale)
else
new[k] = v
for k,w in pairs(v.glue) do
v[k] = {
nil,
- ratio=w.ratio/sz,
- priority=FROM_JFM + w.priority/sz,
+ ratio=w.ratio,
+ priority=FROM_JFM + w.priority,
width = w[1], stretch = w[2], shrink = w[3],
- kanjiskip_natural = w.kanjiskip_natural and w.kanjiskip_natural/sz,
- kanjiskip_stretch = w.kanjiskip_stretch and w.kanjiskip_stretch/sz,
- kanjiskip_shrink = w.kanjiskip_shrink and w.kanjiskip_shrink/sz,
- round_threshold = w.round_threshold and w.round_threshold/zw,
+ kanjiskip_natural = w.kanjiskip_natural,
+ kanjiskip_stretch = w.kanjiskip_stretch,
+ kanjiskip_shrink = w.kanjiskip_shrink,
+ round_threshold = w.round_threshold,
}
end
for k,w in pairs(v.kern) do
local q
head, q = node_remove(head, p)
if char_data.round_threshold then
- local frac = abs(pwidth / fwidth);
- local quot = floor(frac)
- if frac-quot <char_data.round_threshold then fwidth = fwidth * quot end
+ local frac = pwidth / fwidth
+ local quot = floor(frac+0.5)
+ if abs(frac-quot) <char_data.round_threshold then fwidth = fwidth * quot end
end
local xo, yo = getoffsets(p)
setoffsets(p, xo + char_data.align*(fwidth-pwidth) - fshift.left,
end
fwidth = fwidth or pwidth
if fwidth~=pwidth and char_data.round_threshold then
- local frac = abs(pwidth / fwidth);
- local quot = floor(frac)
- if frac-quot <char_data.round_threshold then fwidth = fwidth * quot end
+ local frac = pwidth / fwidth
+ local quot = floor(frac+0.5)
+ if abs(frac-quot) <char_data.round_threshold then fwidth = fwidth * quot end
end
fshift.down = char_data.down; fshift.left = char_data.left
fshift = call_callback("luatexja.set_width", fshift, met, char_data)
\ProcessOptions\relax
\fi %</LaTeX>
%%%% VERSION
-\def\LuaTeXjaversion{20200412.0}
+\def\LuaTeXjaversion{20200517.0}
\directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs