リビジョン | 50f709afa3325f2eaca91741e6dc238a5b29c4d2 (tree) |
---|---|
日時 | 2020-05-16 17:01:16 |
作者 | Hironori Kitagawa <h_kitagawa2001@yaho...> |
コミッター | Hironori Kitagawa |
updated doc.
@@ -1,5 +1,6 @@ | ||
1 | 1 | %<*!showexpl> |
2 | 2 | %#! lualatex -shell-escape |
3 | +%% KozMinPr6N-Regular.otf is needed to typeset this document. | |
3 | 4 | |
4 | 5 | %%%%% section ==> 章 |
5 | 6 | %%%%% subsection => 節 |
@@ -33,6 +34,7 @@ | ||
33 | 34 | \usepackage{unicode-math} |
34 | 35 | \setmonojfont{HaranoAjiGothic-Regular.otf} |
35 | 36 | \setmathfont[Scale=MatchLowercase]{XITSMath} |
37 | +\newjfontface\KOZM{KozMinPr6N-Regular.otf} | |
36 | 38 | |
37 | 39 | \setLaTeXa{\scshape a} |
38 | 40 | %<*ja> |
@@ -1966,7 +1968,7 @@ these eight ranges belongs to the character range~217. | ||
1966 | 1968 | \centering\footnotesize |
1967 | 1969 | \def\ch#1{% |
1968 | 1970 | {\fboxsep0pt\fcolorbox{cyan}{white}% |
1969 | - {\normalsize\char"20#1}}\ (\texttt{U+20#1})} %" | |
1971 | + {\normalsize\KOZM\UTF{20#1}}}\ (\texttt{U+20#1})} %" | |
1970 | 1972 | % 13: JIS X0213, AJ, Adobe-Japan-1 only |
1971 | 1973 | \begin{tabular}{ll>{\color{white}}lll>{\color{white}}l} |
1972 | 1974 | \ch{02}&{En space}&AJ& |
@@ -3465,7 +3467,7 @@ subsection. At the calling of \cs{jfont}, you must specify | ||
3465 | 3467 | which JFM will be used for this font by the following keys: |
3466 | 3468 | %</en> |
3467 | 3469 | %<*ja> |
3468 | -JFMは文字と和文組版で自動的に挿入される | |
3470 | +JFMは文字の寸法情報と和文組版で自動的に挿入される | |
3469 | 3471 | グルー/カーンの寸法情報を持っている.JFMの構造は次の節で述べる. |
3470 | 3472 | \cs{jfont} 命令の呼び出しの際には,どのJFMを用いるのかを以下のキーで |
3471 | 3473 | 指定する必要がある: |
@@ -3598,6 +3600,20 @@ The difference among these three~JFMs is shown in \autoref{tab-difjfm}. | ||
3598 | 3600 | \label{fig:jfmvar} |
3599 | 3601 | \end{figure} |
3600 | 3602 | |
3603 | +%<*ja> | |
3604 | +また,プロポーショナル組用に\texttt{jfm-prop.lua}と\texttt{jfm-propw.lua}も用意されている. | |
3605 | +どちらのJFMも文字幅の情報と自動挿入されるグルー・カーンの情報は持たない(つまりグリフの文字幅をそのまま採用する). | |
3606 | +\texttt{jfm-prop.lua}と\texttt{jfm-propw.lua}の差は,前者が | |
3607 | +文字の高さ・深さ情報も持たないのに対し,後者は持っている点である | |
3608 | +\footnote{プロポーショナル組の状況でルビをつけたい,などという状況では\texttt{jfm-propw.lua}が有用かもしれない.}. | |
3609 | +%</ja> | |
3610 | +%<*en> | |
3611 | +Furthermore, \LuaTeX-ja also ship two JFMs, namely \texttt{jfm-prop.lua}~and~\emph{\texttt{jfm-propw.lua}}, | |
3612 | + for ``proportional typesetting''. | |
3613 | +Both JFMs don't have any character width information, nor glues/kerns information. | |
3614 | +\texttt{jfm-prop.lua} also also not have character height and depth information, while \texttt{jfm-propw.lua} has them. | |
3615 | +%</en> | |
3616 | + | |
3601 | 3617 | %<*en> |
3602 | 3618 | \item[jfmvar=<string>] |
3603 | 3619 | Sometimes there is a need that \ldots. |
@@ -4727,6 +4743,25 @@ Hence we have the following result: | ||
4727 | 4743 | (optional, version~2 or~later) |
4728 | 4744 | %</en> |
4729 | 4745 | |
4746 | + \item[round\_threshold=<float>] | |
4747 | +%<*ja> | |
4748 | +(任意,バージョン3以降,文字クラス0のみ) | |
4749 | + | |
4750 | +「実際のグリフの幅に合わせて文字幅を整数倍する」際のしきい値を指定する. | |
4751 | +より正確に述べると,次のようになる.このフィールドに正の数$r$が指定されていたとし, | |
4752 | +文字クラス0で指定されている文字幅が$w$,文字クラス0に属する文字のグリフの幅が$w'$であったとする. | |
4753 | +$n$を$w/w'$に「もっとも近い整数」($\lfloor w/w'+0.5\rfloor$)としたとき, | |
4754 | +もし$|w/w'-n|\char`<r$であれば,JFMで文字幅$nw$が指定されたものとして扱う. | |
4755 | + | |
4756 | +この機能は,ほとんど源ノ明朝・源ノ角ゴシックにおける2倍角・3倍角ダッシュの合字のために実装されたと | |
4757 | +言ってもよい.これらのグリフは\LuaTeX 内部ではUnicodeの私用領域に割り当てられるので, | |
4758 | +JFM側で番号を指定することができない. | |
4759 | +%</ja> | |
4760 | +%<*en> | |
4761 | +(optional, version~3 or~later, only available in character class~0) | |
4762 | +%</en> | |
4763 | + | |
4764 | + | |
4730 | 4765 | \end{cslist} |
4731 | 4766 | |
4732 | 4767 | %<*ja> |
@@ -11366,10 +11401,11 @@ direction~whatsit内部のノードリストに,\textit{dir\_box}として格 | ||
11366 | 11401 | 縦組時には,「\hbox to \zw{、}」(\texttt{U+3001})から「\ltjjachar"FE11」(\texttt{U+FE11})%" |
11367 | 11402 | のように縦組用字形への置き換えに関係する処理は,以下のようになっている. |
11368 | 11403 | |
11404 | + | |
11369 | 11405 | \begin{table}[t] |
11370 | 11406 | \def\D#1#2#3#4{% |
11371 | 11407 | {\fboxsep0pt\fcolorbox{cyan}{white}% |
11372 | - {\large\char"#1#2#3#4}}\ (\texttt{U+#1#2#3#4})%" | |
11408 | + {\large\KOZM\ltjjachar"#1#2#3#4}}\ (\texttt{U+#1#2#3#4})%" | |
11373 | 11409 | } |
11374 | 11410 | \caption{\LuaTeX-ja標準で行われる縦組形への置換} |
11375 | 11411 | \label{tab:vert_replace}\small\centering |
@@ -186,13 +186,17 @@ local update_jfm_cache | ||
186 | 186 | do |
187 | 187 | local floor = math.floor |
188 | 188 | local function myround(a) return floor(a+0.5) end |
189 | + local mult_ignore_key = { | |
190 | + round_threshold=true, kanjiskip_natural=true, kanjiskip_stretch=true, kanjiskip_shrink=true, | |
191 | + raio=true, priority=true | |
192 | + } | |
189 | 193 | local function mult_table(old,scale) -- modified from table.fastcopy |
190 | 194 | if old then |
191 | 195 | local new = { } |
192 | 196 | for k,v in next, old do |
193 | 197 | if type(v) == "table" then |
194 | 198 | new[k] = mult_table(v,scale) |
195 | - elseif type(v) == "number" then | |
199 | + elseif type(v) == "number" and not mult_ignore_key[k] then | |
196 | 200 | new[k] = myround(v*scale) |
197 | 201 | else |
198 | 202 | new[k] = v |
@@ -215,13 +219,13 @@ do | ||
215 | 219 | for k,w in pairs(v.glue) do |
216 | 220 | v[k] = { |
217 | 221 | nil, |
218 | - ratio=w.ratio/sz, | |
219 | - priority=FROM_JFM + w.priority/sz, | |
222 | + ratio=w.ratio, | |
223 | + priority=FROM_JFM + w.priority, | |
220 | 224 | width = w[1], stretch = w[2], shrink = w[3], |
221 | - kanjiskip_natural = w.kanjiskip_natural and w.kanjiskip_natural/sz, | |
222 | - kanjiskip_stretch = w.kanjiskip_stretch and w.kanjiskip_stretch/sz, | |
223 | - kanjiskip_shrink = w.kanjiskip_shrink and w.kanjiskip_shrink/sz, | |
224 | - round_threshold = w.round_threshold and w.round_threshold/zw, | |
225 | + kanjiskip_natural = w.kanjiskip_natural, | |
226 | + kanjiskip_stretch = w.kanjiskip_stretch, | |
227 | + kanjiskip_shrink = w.kanjiskip_shrink, | |
228 | + round_threshold = w.round_threshold, | |
225 | 229 | } |
226 | 230 | end |
227 | 231 | for k,w in pairs(v.kern) do |
@@ -130,9 +130,9 @@ local function capsule_glyph_yoko(p, met, char_data, head, dir) | ||
130 | 130 | local q |
131 | 131 | head, q = node_remove(head, p) |
132 | 132 | if char_data.round_threshold then |
133 | - local frac = abs(pwidth / fwidth); | |
134 | - local quot = floor(frac) | |
135 | - if frac-quot <char_data.round_threshold then fwidth = fwidth * quot end | |
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 | |
136 | 136 | end |
137 | 137 | local xo, yo = getoffsets(p) |
138 | 138 | setoffsets(p, xo + char_data.align*(fwidth-pwidth) - fshift.left, |
@@ -197,9 +197,9 @@ local function capsule_glyph_tate(p, met, char_data, head, dir) | ||
197 | 197 | end |
198 | 198 | fwidth = fwidth or pwidth |
199 | 199 | if fwidth~=pwidth and char_data.round_threshold then |
200 | - local frac = abs(pwidth / fwidth); | |
201 | - local quot = floor(frac) | |
202 | - if frac-quot <char_data.round_threshold then fwidth = fwidth * quot end | |
200 | + local frac = pwidth / fwidth | |
201 | + local quot = floor(frac+0.5) | |
202 | + if abs(frac-quot) <char_data.round_threshold then fwidth = fwidth * quot end | |
203 | 203 | end |
204 | 204 | fshift.down = char_data.down; fshift.left = char_data.left |
205 | 205 | fshift = call_callback("luatexja.set_width", fshift, met, char_data) |
@@ -41,7 +41,7 @@ | ||
41 | 41 | \ProcessOptions\relax |
42 | 42 | \fi %</LaTeX> |
43 | 43 | %%%% VERSION |
44 | -\def\LuaTeXjaversion{20200412.0} | |
44 | +\def\LuaTeXjaversion{20200517.0} | |
45 | 45 | |
46 | 46 | \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs |
47 | 47 |