ソースコードの管理場所
Revisão | 4e860e657fcc177e7d28cf83b79a1a8e8cdf55c5 (tree) |
---|---|
Hora | 2015-09-20 09:10:11 |
Autor | Hironori Kitagawa <h_kitagawa2001@yaho...> |
Commiter | Hironori Kitagawa |
Changed the syntax of JFM file (but the old way is still supported)
Note that luatexja-adjust is broken with this implementation...
@@ -139,10 +139,11 @@ | ||
139 | 139 | \DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\pTeX} |
140 | 140 | |
141 | 141 | %%%%%%%% other macros |
142 | -\newlist{cslist}{description}{1} | |
142 | +\newlist{cslist}{description}{2} | |
143 | 143 | \setlist[cslist]{% |
144 | 144 | style=nextline,font=\mdseries\ttfamily, |
145 | 145 | before*=\def\<{\char`\<}\def\>{\char`\>}\def\{{\char`\{}\def\}{\char`\}}, |
146 | + topsep=\medskipamount, | |
146 | 147 | %<ja> leftmargin=2\zw, |
147 | 148 | %<en> leftmargin=2em, |
148 | 149 | } |
@@ -4418,38 +4419,23 @@ Furthermore, the glyph is shifted according to values of fields | ||
4418 | 4419 | \label{fig-pos-tate} |
4419 | 4420 | \end{figure} |
4420 | 4421 | |
4421 | -\item[kern={\{[$j$]=<kern>, [$j'$]=\{<kern>, [<ratio>]\}, ...\}}] | |
4422 | +\item[kern={\{[$j$]=<kern>, [$j'$]=\{<kern>, [ratio=<ratio>]\}, ...\}}] | |
4422 | 4423 | |
4423 | -\item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>, [<priority>], [<ratio>]\}, ...\}}]\ | |
4424 | +\item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>, [ratio=<ratio>, ...]\}, ...\}}]\leavevmode | |
4424 | 4425 | %<*ja> |
4425 | 4426 | |
4426 | -文字クラス$i$の文字と$j$の文字の間に挿入されるkernやglueの量を指定する. | |
4427 | +文字クラス$i$の文字と$j$の文字の間に挿入されるカーンやグルーの量を指定する. | |
4427 | 4428 | |
4428 | - <priority>は \Pkg{luatexja-adjust} による優先順位付き | |
4429 | - 行長調整(\ref{ssec-adj}節)が有効なときのみ意味を持つ. | |
4430 | -このフィールドは省略可能であり,行調整処理におけるこのglueの優先 | |
4431 | - 度を$-2$から$+2$の間の整数で指定する.大きい値ほど「伸びやすく,縮みやすい」 | |
4432 | - ことを意味する.省略時の値 | |
4433 | - は0であり,範囲外の値が指定されたときの動作は未定義である. | |
4434 | - | |
4435 | -<ratio>も省略可能フィールドであり,$-1$から$+1$の実数値をとる.省略時の値は0である. | |
4436 | -\begin{itemize} | |
4437 | -\item $-1$はこのグルーが「前の文字」由来であることを示す. | |
4438 | -\item $+1$はこのグルーが「後の文字」由来であることを示す. | |
4439 | -\item それ以外の値は,「前の文字」由来のグルーと「後の文字」由来の | |
4440 | -グルーが混合されていることを示す. | |
4441 | -\end{itemize} | |
4442 | -なお,このフィールドの値は\Param{differentjfm}の値が | |
4429 | +<ratio>は,グルーの自然長のうちどれだけの割合が「後の文字」由来かを示す量で, | |
4430 | +$0$から$+1$の実数値をとる.省略時の値は$0.5$である. | |
4431 | +このフィールドの値は\Param{differentjfm}の値が | |
4443 | 4432 | \texttt{pleft},~\texttt{pright},~\texttt{paverage}の値のときのみ実際に用いられる. |
4444 | 4433 | |
4445 | 4434 | 例えば,\cite{x4051}では,句点と中点の間には, |
4446 | 4435 | 句点由来の二分空きと中点由来の四分空きが挿入されるが,この場合には |
4447 | 4436 | \begin{itemize} |
4448 | 4437 | \item <width>には$0.5+0.25=0.75$を指定する. |
4449 | -\item <ratio>には次の値を指定する. | |
4450 | -\[ | |
4451 | - -1\cdot \frac{0.5}{0.5+0.25} + 1 \cdot \frac{0.25}{0.5+0.25} = -\frac13 | |
4452 | -\] | |
4438 | +\item <ratio>には$0.25/(0.5+0.25)=1/3$を指定する. | |
4453 | 4439 | \end{itemize} |
4454 | 4440 | %</ja> |
4455 | 4441 | %<*en> |
@@ -4458,22 +4444,45 @@ Furthermore, the glyph is shifted according to values of fields | ||
4458 | 4444 | Specifies the width of kern or glue which will be inserted |
4459 | 4445 | between characters in character class~$i$ and those in character class~$j$. |
4460 | 4446 | |
4461 | -<priority> is an integer in $[-2,2]$ (treated as 0 if omitted), and this is | |
4462 | -used only in line adjustment with priority by \Pkg{luatexja-adjust} | |
4463 | -(see Subsection~\ref{ssec-adj}). Higher value means the glue is easy to shretch, | |
4464 | -and is also easy to shrink. | |
4465 | - | |
4466 | -<ratio> is also an optional value between $-1$ and 1. For example, | |
4447 | +<ratio> specifies how much the glue is originated in the ``right'' character. | |
4448 | +It is a real number between 0 and 1, and treated as 0.5 if omitted. For example, | |
4467 | 4449 | The width of a glue between an ideographic full stop ``。'' |
4468 | 4450 | and a fullwidth middle dot ``・'' is three-fourth of fullwidth, |
4469 | 4451 | namely halfwidth from the ideographic full stop, and |
4470 | 4452 | quarter-width from the fullwidth middle dot. In this case, |
4471 | -we specify <ratio> to | |
4472 | -\[ | |
4473 | - -1\cdot \frac{0.5}{0.5+0.25} + 1 \cdot \frac{0.25}{0.5+0.25} = -\frac13. | |
4474 | -\] | |
4453 | +we specify <ratio> to $0.25/(0.5+0.25)=1/3$. | |
4475 | 4454 | %</en> |
4476 | 4455 | |
4456 | +%<*ja> | |
4457 | +グルーの指定においては,上記に加えて各 \texttt{[$j$]} の各サブテーブル内に | |
4458 | +次のキーを指定できる, | |
4459 | +\begin{cslist}[style=standard] | |
4460 | +\item[priority=<priority>] | |
4461 | + \Pkg{luatexja-adjust} による優先順位付き | |
4462 | + 行長調整(\ref{ssec-adj}節)の際に使われる値であり, | |
4463 | +行調整処理におけるこのglueの優先 | |
4464 | + 度を$-2$から$+2$の間の整数で指定する.大きい値ほど「伸びやすく,縮みやすい」 | |
4465 | + ことを意味する.省略時の値 | |
4466 | + は0であり,範囲外の値が指定されたときの動作は未定義である. | |
4467 | +\item[ksp\_natural=<bool>] | |
4468 | +\item[ksp\_stretch=<bool>] | |
4469 | +\item[ksp\_shrink=<bool>] | |
4470 | +\end{cslist} | |
4471 | +%</ja> | |
4472 | +%<*en> | |
4473 | +In case of glue, one can specify following additional keys in each \texttt{[$j$]} | |
4474 | + subtable: | |
4475 | +\begin{cslist}[style=standard] | |
4476 | +\item[priority=<priority>] | |
4477 | +An integer in $[-2,2]$ (treated as 0 if omitted), and this is | |
4478 | +used only in line adjustment with priority by \Pkg{luatexja-adjust} | |
4479 | +(see Subsection~\ref{ssec-adj}). Higher value means the glue is easy to stretch, | |
4480 | +and is also easy to shrink. | |
4481 | +\item[ksp\_natural=<bool>] | |
4482 | +\item[ksp\_stretch=<bool>] | |
4483 | +\item[ksp\_shrink=<bool>] | |
4484 | +\end{cslist} | |
4485 | +%</en> | |
4477 | 4486 | |
4478 | 4487 | \item[end\_stretch=<kern>, end\_shrink=<kern>] |
4479 | 4488 | %<*ja> |
@@ -10,22 +10,22 @@ | ||
10 | 10 | luatexja.jfont.define_jfm { |
11 | 11 | dir = 'yoko', |
12 | 12 | zw = 1.0, zh = 1.0, |
13 | - kanjiskip = {0.0, 0.25, 0}, | |
14 | - xkanjiskip = {0.25, 0.25, .125}, | |
13 | + kanjiskip = { 0.0, 0.25, 0 }, | |
14 | + xkanjiskip = { 0.25, 0.25, .125 }, | |
15 | 15 | [0] = { |
16 | 16 | align = 'left', left = 0.0, down = 0.0, |
17 | 17 | width = 1.0, height = 0.88, depth = 0.12, italic=0.0, |
18 | 18 | glue = { |
19 | 19 | -- [index] = { width, stretch, shrink, [priority, [ratio]], |
20 | 20 | -- ksp_nat=t/f, ksp_stretch=t/f, ksp_shrink=t/f } |
21 | - [1] = { 0.5 , 0.0, 0.5, 0, 1, ksp_stretch=true }, | |
22 | - [2] = { 0, 0, 0 , ksp_shrink=true }, | |
23 | - [3] = { 0.25, 0.0, 0.25, 1, 1 }, | |
24 | - [4] = {0, 0, 0}, | |
25 | - [6] = {0, 0, 0}, | |
26 | - [7] = {0, 0, 0}, | |
27 | - [8] = {0, 0, 0}, | |
28 | - [9] = {0, 0, 0}, | |
21 | + [1] = { 0.5 , 0.0, 0.5, rario=1, ksp_stretch=true }, | |
22 | + [2] = { 0, 0, 0, ksp_shrink=true }, | |
23 | + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
24 | + [4] = { 0, 0, 0, ksp_shrink=true }, | |
25 | + [6] = { 0, 0, 0, ksp_shrink=true }, | |
26 | + [7] = { 0, 0, 0, ksp_shrink=true }, | |
27 | + [8] = { 0, 0, 0, ksp_shrink=true }, | |
28 | + [99] = { 0, 0, 0 }, | |
29 | 29 | } |
30 | 30 | }, |
31 | 31 |
@@ -38,16 +38,16 @@ luatexja.jfont.define_jfm { | ||
38 | 38 | width = 0.5, height = 0.88, depth = 0.12, italic=0.0, |
39 | 39 | glue = { |
40 | 40 | -- 3 のみ四分,あとは0 |
41 | - [0] = {0, 0, 0, ksp_shrink=true }, | |
42 | - [1] = {0, 0, 0}, | |
43 | - [2] = {0, 0, 0}, | |
44 | - [3] = { 0.25, 0.0, 0.25, 1 }, | |
45 | - [4] = {0, 0, 0}, | |
46 | - [5] = {0, 0, 0}, | |
47 | - [6] = {0, 0, 0}, | |
48 | - [7] = {0, 0, 0}, | |
49 | - [8] = {0, 0, 0}, | |
50 | - [9] = {0, 0, 0}, | |
41 | + [0] = { 0, 0, 0, ksp_shrink=true }, | |
42 | + [1] = { 0, 0, 0, ksp_shrink=true }, | |
43 | + [2] = { 0, 0, 0, ksp_shrink=true }, | |
44 | + [3] = { 0.25, 0.0, 0.25, priority=1 }, | |
45 | + [4] = { 0, 0, 0, ksp_shrink=true }, | |
46 | + [5] = { 0, 0, 0, ksp_shrink=true }, | |
47 | + [6] = { 0, 0, 0, ksp_shrink=true }, | |
48 | + [7] = { 0, 0, 0, ksp_shrink=true }, | |
49 | + [8] = { 0, 0, 0, ksp_shrink=true }, | |
50 | + [99] = { 0, 0, 0 }, | |
51 | 51 | } |
52 | 52 | }, |
53 | 53 |
@@ -60,16 +60,16 @@ luatexja.jfont.define_jfm { | ||
60 | 60 | width = 0.5, height = 0.88, depth = 0.12, italic=0.0, |
61 | 61 | glue = { |
62 | 62 | -- 3 は四分, 2, 4, 9 は0, あとは0.5 |
63 | - [0] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
64 | - [1] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
65 | - [2] = {0, 0, 0}, | |
66 | - [3] = { 0.25, 0.0, 0.25, 1, 1 }, | |
67 | - [4] = {0, 0, 0}, | |
68 | - [5] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
69 | - [6] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
70 | - [7] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
71 | - [8] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
72 | - [9] = {0, 0, 0}, | |
63 | + [0] = { 0.5 , 0.0, 0.5, rario=0, ksp_stretch=true }, | |
64 | + [1] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
65 | + [2] = { 0, 0, 0, ksp_shrink=true}, | |
66 | + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
67 | + [4] = { 0, 0, 0, ksp_shrink=true }, | |
68 | + [5] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
69 | + [6] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
70 | + [7] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
71 | + [8] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
72 | + [99] = { 0, 0, 0 }, | |
73 | 73 | } |
74 | 74 | }, |
75 | 75 |
@@ -80,16 +80,16 @@ luatexja.jfont.define_jfm { | ||
80 | 80 | --end_stretch = 0.25, |
81 | 81 | glue = { |
82 | 82 | -- 3 のみ 0.5,あとは0.25 |
83 | - [0] = { 0.25, 0.0, 0.25, 1, 1 }, | |
84 | - [1] = { 0.25, 0.0, 0.25, 1, 1 }, | |
85 | - [2] = { 0.25, 0.0, 0.25, 1, 1 }, | |
86 | - [3] = { 0.5 , 0.0, 0.5 , 1, 0 }, | |
87 | - [4] = { 0.25, 0.0, 0.25, 1, 1 }, | |
88 | - [5] = { 0.25, 0.0, 0.25, 1, 1 }, | |
89 | - [6] = { 0.25, 0.0, 0.25, 1, 1 }, | |
90 | - [7] = { 0.25, 0.0, 0.25, 1, 1 }, | |
91 | - [8] = { 0.25, 0.0, 0.25, 1, 1 }, | |
92 | - [9] = { 0.25, 0.0, 0.25, 1, 1 }, | |
83 | + [0] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
84 | + [1] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
85 | + [2] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
86 | + [3] = { 0.5 , 0.0, 0.5 , priority=1 }, | |
87 | + [4] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
88 | + [5] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
89 | + [6] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
90 | + [7] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
91 | + [8] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
92 | + [99] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
93 | 93 | } |
94 | 94 | }, |
95 | 95 |
@@ -99,14 +99,14 @@ luatexja.jfont.define_jfm { | ||
99 | 99 | width = 0.5, height = 0.88, depth = 0.12, italic=0.0, |
100 | 100 | glue = { |
101 | 101 | -- 3 は.75, 2, 4 は0, あとは0.5 |
102 | - [0] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
103 | - [1] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
104 | - [3] = { 0.75, 0.0, 0.25, 1, -1/3 }, | |
105 | - [5] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
106 | - [6] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
107 | - [7] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
108 | - [8] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
109 | - [9] = { 0.5 , 0.0, 0.5, 0, -1, ksp_stretch=true }, | |
102 | + [0] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
103 | + [1] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
104 | + [3] = { 0.75, 0.0, 0.25, priority=1, ratio=1/3, ksp_stretch=true }, | |
105 | + [5] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
106 | + [6] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
107 | + [7] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
108 | + [8] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
109 | + [99] = { 0.5 , 0.0, 0.5, ratio=0, ksp_stretch=true }, | |
110 | 110 | } |
111 | 111 | }, |
112 | 112 |
@@ -115,12 +115,12 @@ luatexja.jfont.define_jfm { | ||
115 | 115 | align = 'left', left = 0.0, down = 0.0, |
116 | 116 | width = 1.0, height = 0.88, depth = 0.12, italic=0.0, |
117 | 117 | glue = { |
118 | - [1] = { 0.5 , 0.0, 0.5, 0, 1, ksp_stretch=true }, | |
119 | - [2] = {0, 0, 0}, | |
120 | - [3] = { 0.25, 0.0, 0.25, 1, 1 }, | |
121 | - [4] = {0, 0, 0}, | |
122 | - [6] = {0, 0, 0}, | |
123 | - [9] = {0, 0, 0}, | |
118 | + [1] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true }, | |
119 | + [2] = { 0, 0, 0, ksp_shrink=true }, | |
120 | + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
121 | + [4] = { 0, 0, 0, ksp_shrink=true }, | |
122 | + [6] = { 0, 0, 0, ksp_shrink=true }, | |
123 | + [99] = { 0, 0, 0 }, | |
124 | 124 | }, |
125 | 125 | kern = { |
126 | 126 | [5] = 0.0 |
@@ -132,15 +132,15 @@ luatexja.jfont.define_jfm { | ||
132 | 132 | align = 'left', left = 0.0, down = 0.0, |
133 | 133 | width = 1.0, height = 0.88, depth = 0.12, italic=0.0, |
134 | 134 | glue = { |
135 | - [0] = { 0.5 , 0.0, 0.5, 0, 1, ksp_stretch=true }, | |
136 | - [1] = { 0.5 , 0.0, 0.5, 0, 1, ksp_stretch=true }, | |
137 | - [2] = {0, 0, 0}, | |
138 | - [3] = { 0.75, 0.0, 0.25, 1, 1 }, | |
139 | - [4] = {0, 0, 0}, | |
140 | - [6] = {0, 0, 0}, | |
141 | - [7] = { 0.5 , 0.0, 0.5, 0, 1, ksp_stretch=true}, | |
142 | - [8] = {0, 0, 0}, | |
143 | - [9] = {0, 0, 0}, | |
135 | + [0] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true }, | |
136 | + [1] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true }, | |
137 | + [2] = { 0, 0, 0, ksp_shrink=true }, | |
138 | + [3] = { 0.75, 0.0, 0.25, priority=1, ratio=1 }, | |
139 | + [4] = { 0, 0, 0, ksp_shrink=true }, | |
140 | + [6] = { 0, 0, 0, ksp_shrink=true }, | |
141 | + [7] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true }, | |
142 | + [8] = { 0, 0, 0, ksp_shrink=true }, | |
143 | + [99] = { 0, 0, 0 }, | |
144 | 144 | }, |
145 | 145 | kern = { |
146 | 146 | [5] = 0.0 |
@@ -172,14 +172,14 @@ luatexja.jfont.define_jfm { | ||
172 | 172 | align = 'left', left = 0.0, down = 0.0, |
173 | 173 | width = 0.5, height = 0.88, depth = 0.12, italic=0.0, |
174 | 174 | glue = { |
175 | - [1] = { 0.5 , 0.0, 0.5, 0, 1, ksp_stretch=true }, | |
176 | - [2] = {0, 0, 0}, | |
177 | - [3] = { 0.25, 0.0, 0.25, 1, 1 }, | |
178 | - [4] = {0, 0, 0}, | |
179 | - [6] = {0, 0, 0}, | |
180 | - [7] = {0, 0, 0}, | |
181 | - [8] = {0, 0, 0}, | |
182 | - [9] = {0, 0, 0}, | |
175 | + [1] = { 0.5 , 0.0, 0.5, ratio=1, ksp_stretch=true }, | |
176 | + [2] = { 0, 0, 0, ksp_shrink=true }, | |
177 | + [3] = { 0.25, 0.0, 0.25, priority=1, ratio=1 }, | |
178 | + [4] = { 0, 0, 0, ksp_shrink=true }, | |
179 | + [6] = { 0, 0, 0, ksp_shrink=true}, | |
180 | + [7] = { 0, 0, 0, ksp_shrink=true }, | |
181 | + [8] = { 0, 0, 0, ksp_shrink=true}, | |
182 | + [99] = { 0, 0, 0 }, | |
183 | 183 | } |
184 | 184 | }, |
185 | 185 |
@@ -206,11 +206,11 @@ luatexja.jfont.define_jfm { | ||
206 | 206 | width = 1.0, height = 0.88, depth = 0.12, italic=0.0, |
207 | 207 | glue = { |
208 | 208 | [1] = { 0.5 , 0.0, 0.5, 0, 1, ksp_stretch=true }, |
209 | - [2] = {0, 0, 0}, | |
209 | + [2] = { 0, 0, 0, ksp_shrink=true }, | |
210 | 210 | [3] = { 0.25, 0.0, 0.25, 1, 1 }, |
211 | - [4] = {0, 0, 0}, | |
212 | - [6] = {0, 0, 0}, | |
213 | - [9] = {0, 0, 0}, | |
211 | + [4] = { 0, 0, 0, ksp_shrink=true }, | |
212 | + [6] = { 0, 0, 0, ksp_shrink=true }, | |
213 | + [99] = {0, 0, 0}, | |
214 | 214 | }, |
215 | 215 | kern = { |
216 | 216 | [8] = 0.0 |
@@ -221,7 +221,7 @@ luatexja.jfont.define_jfm { | ||
221 | 221 | [99] = { -- box末尾 |
222 | 222 | chars = {'boxbdd', 'parbdd'}, |
223 | 223 | glue = { |
224 | - [3] = { 0.25, 0.0, 0.25, 1 }, | |
224 | + [3] = { 0.25, 0.0, 0.25, priority=1 }, | |
225 | 225 | } |
226 | 226 | }, |
227 | 227 |
@@ -688,21 +688,21 @@ local function new_jfm_glue(m, bc, ac, ks) | ||
688 | 688 | if g then |
689 | 689 | if g[1] then |
690 | 690 | local f = node_new(id_glue) |
691 | - set_attr(f, attr_icflag, g[4]) | |
691 | + set_attr(f, attr_icflag, g.priority) | |
692 | 692 | local fs = node_copy(g[2]) |
693 | 693 | if g.ksp_natural then |
694 | 694 | setfield(fs, 'width', getfield(fs,'width')+getfield(ks, 'width')) |
695 | 695 | end |
696 | - if g.ksp_stretch then | |
696 | + if false and g.ksp_stretch then | |
697 | 697 | setfield(fs, 'stretch', getfield(fs,'stretch')+getfield(ks, 'stretch')) |
698 | 698 | end |
699 | 699 | if g.ksp_shrink then |
700 | 700 | setfield(fs, 'shrink', getfield(fs,'shrink')+getfield(ks, 'shrink')) |
701 | 701 | end |
702 | 702 | setfield(f, 'spec', fs) |
703 | - return f, g[3] | |
703 | + return f, g.ratio | |
704 | 704 | else |
705 | - return node_copy(g[2]), g[3] | |
705 | + return node_copy(g[2]), g.ratio | |
706 | 706 | end |
707 | 707 | end |
708 | 708 | return nil, 0 |
@@ -770,8 +770,8 @@ do | ||
770 | 770 | local bk_ak = 2*id_kern - id_kern |
771 | 771 | |
772 | 772 | calc_ja_ja_aux = function (gb,ga, db, da) |
773 | - local rbb, rab = 0.5*(1-db), 0.5*(1-da) -- 「前の文字」由来のグルーの割合 | |
774 | - local rba, raa = 0.5*(1+db), 0.5*(1+da) -- 「前の文字」由来のグルーの割合 | |
773 | + local rbb, rab = 1-db, 1-da -- 「前の文字」由来のグルーの割合 | |
774 | + local rba, raa = db, da -- 「後の文字」由来のグルーの割合 | |
775 | 775 | if diffmet_rule ~= math.two_pleft and diffmet_rule ~= math.two_pright |
776 | 776 | and diffmet_rule ~= math.two_paverage then |
777 | 777 | rbb, rab, rba, raa = 1,0,0,1 |
@@ -111,14 +111,16 @@ function define_jfm(t) | ||
111 | 111 | v.chars = nil |
112 | 112 | end |
113 | 113 | v.kern = v.kern or {}; v.glue = v.glue or {} |
114 | - for j in pairs(v.glue) do | |
114 | + for j,x in pairs(v.glue) do | |
115 | + x.ratio, x[5] = (x.ratio or (x[5] and 0.5*(1+x[5]) or 0.5)), nil | |
116 | + x.priority, x[4] = (x.priority or x[4] or 0), nil | |
115 | 117 | if v.kern[j] then defjfm_res= nil; return end |
116 | 118 | end |
117 | 119 | for j,x in pairs(v.kern) do |
118 | 120 | if type(x)=='number' then |
119 | - v.kern[j] = {x, 0} | |
121 | + v.kern[j] = {x, 0.5} | |
120 | 122 | elseif type(x)=='table' then |
121 | - v.kern[j] = {x[1], x[2] or 0} | |
123 | + v.kern[j] = { x[1], ratio=x.ratio or x[2] or 0.5 } | |
122 | 124 | end |
123 | 125 | end |
124 | 126 | t.char_type[i] = v |
@@ -162,8 +164,9 @@ do | ||
162 | 164 | for k,w in pairs(v.glue) do |
163 | 165 | local h = node_new(id_glue_spec) |
164 | 166 | v[k] = { |
165 | - true, h, (w[5] and w[5]/sz or 0), | |
166 | - FROM_JFM + (w[4] and w[4]/sz or 0), | |
167 | + true, h, | |
168 | + ratio=w.ratio/sz, | |
169 | + priority=FROM_JFM + w.priority/sz, | |
167 | 170 | ksp_natural = w.ksp_natural, |
168 | 171 | ksp_stretch = w.ksp_stretch, |
169 | 172 | ksp_shrink = w.ksp_shrink, |
@@ -179,7 +182,7 @@ do | ||
179 | 182 | setfield(g, 'kern', w[1]) |
180 | 183 | setfield(g, 'subtype', 1) |
181 | 184 | set_attr(g, attr_icflag, FROM_JFM) |
182 | - v[k] = {false, g, w[2]/sz} | |
185 | + v[k] = {false, g, ratio=w[2]/sz} | |
183 | 186 | end |
184 | 187 | end |
185 | 188 | v.glue, v.kern = nil, nil |