OSDN Git Service

updated doc.
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 16 May 2020 08:01:16 +0000 (17:01 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 16 May 2020 08:01:16 +0000 (17:01 +0900)
doc/luatexja-en.pdf
doc/luatexja-ja.pdf
doc/luatexja.dtx
src/ltj-jfont.lua
src/ltj-setwidth.lua
src/luatexja.sty

index 5d9d6fc..e86bfb9 100644 (file)
Binary files a/doc/luatexja-en.pdf and b/doc/luatexja-en.pdf differ
index c263107..c9a3ef9 100644 (file)
Binary files a/doc/luatexja-ja.pdf and b/doc/luatexja-ja.pdf differ
index 981adf2..9e8776f 100644 (file)
@@ -1,5 +1,6 @@
 %<*!showexpl>
 %#! lualatex -shell-escape
+%% KozMinPr6N-Regular.otf is needed to typeset this document.
 
 %%%%% section ==> 章
 %%%%% subsection => 節
@@ -33,6 +34,7 @@
 \usepackage{unicode-math}
 \setmonojfont{HaranoAjiGothic-Regular.otf}
 \setmathfont[Scale=MatchLowercase]{XITSMath}
+\newjfontface\KOZM{KozMinPr6N-Regular.otf}
 
 \setLaTeXa{\scshape a}
 %<*ja>
@@ -1966,7 +1968,7 @@ these eight ranges belongs to the character range~217.
 \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&
@@ -3465,7 +3467,7 @@ subsection. At the calling of \cs{jfont}, you must specify
 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を用いるのかを以下のキーで
 指定する必要がある:
@@ -3598,6 +3600,20 @@ The difference among these three~JFMs is  shown in \autoref{tab-difjfm}.
 \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.
@@ -4727,6 +4743,25 @@ Hence we have the following result:
 (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>
@@ -11366,10 +11401,11 @@ direction~whatsit内部のノードリストに,\textit{dir\_box}として格
 縦組時には,「\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
index 8d1ddc3..08d5599 100644 (file)
@@ -186,13 +186,17 @@ local update_jfm_cache
 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
@@ -215,13 +219,13 @@ do
             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
index c6fa235..c4a0961 100644 (file)
@@ -130,9 +130,9 @@ local function capsule_glyph_yoko(p, met, char_data, head, dir)
    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,
@@ -197,9 +197,9 @@ local function capsule_glyph_tate(p, met, char_data, head, dir)
    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)
index c2c8c45..68b11f7 100644 (file)
@@ -41,7 +41,7 @@
   \ProcessOptions\relax
 \fi                             %</LaTeX>
 %%%% VERSION
-\def\LuaTeXjaversion{20200412.0}
+\def\LuaTeXjaversion{20200517.0}
 
 \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs