OSDN Git Service
(root)
/
luatex-ja
/
luatexja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ad38999
)
\ltjghostja{before,after}jachar; \ltjghostjachar will be removed
author
Hironori Kitagawa
<h_kitagawa2001@yahoo.co.jp>
Wed, 9 Feb 2022 13:02:26 +0000
(22:02 +0900)
committer
Hironori Kitagawa
<h_kitagawa2001@yahoo.co.jp>
Wed, 9 Feb 2022 13:02:26 +0000
(22:02 +0900)
src/addons/luatexja-adjust.sty
patch
|
blob
|
history
src/ltj-adjust.lua
patch
|
blob
|
history
src/ltj-jfmglue.lua
patch
|
blob
|
history
src/ltj-ruby.lua
patch
|
blob
|
history
test/test17-priority.pdf
patch
|
blob
|
history
test/test17-priority.tex
patch
|
blob
|
history
diff --git
a/src/addons/luatexja-adjust.sty
b/src/addons/luatexja-adjust.sty
index
5d37eb6
..
bf66d8f
100644
(file)
--- a/
src/addons/luatexja-adjust.sty
+++ b/
src/addons/luatexja-adjust.sty
@@
-137,13
+137,18
@@
\define@key[ltj]{japaram}{profile_hgap_factor}{%
\directlua{luatexja.adjust.profile_hgap_factor = math.abs(#1)}\relax}
\define@key[ltj]{japaram}{profile_hgap_factor}{%
\directlua{luatexja.adjust.profile_hgap_factor = math.abs(#1)}\relax}
-\newluafunction\ltj@@ghost@jachar@inner
-\typeout{\the\ltj@@ghost@jachar@inner.}
+\newluafunction\ltj@@ghost@jachar@inner@both
+\newluafunction\ltj@@ghost@jachar@inner@before
+\newluafunction\ltj@@ghost@jachar@inner@after
\directlua{
local t = lua.get_functions_table(); local cgj = luatexja.adjust.create_ghost_jachar_node;
\directlua{
local t = lua.get_functions_table(); local cgj = luatexja.adjust.create_ghost_jachar_node;
- t[\the\ltj@@ghost@jachar@inner] = function() cgj(0) end
+ t[\the\ltj@@ghost@jachar@inner@both] = function() cgj(0) end;
+ t[\the\ltj@@ghost@jachar@inner@before] = function() cgj(1) end;
+ t[\the\ltj@@ghost@jachar@inner@after] = function() cgj(2) end
}%
}%
-\protected\def\ltjghostjachar{\ifhmode\relax\luafunction\ltj@@ghost@jachar@inner\fi}
+\protected\def\ltjghostjachar{\ifhmode\relax\luafunction\ltj@@ghost@jachar@inner@both\fi}
+\protected\def\ltjghostbeforejachar{\ifhmode\relax\luafunction\ltj@@ghost@jachar@inner@before\fi}
+\protected\def\ltjghostafterjachar{\ifhmode\relax\luafunction\ltj@@ghost@jachar@inner@after\fi}
%%------------------ all done
%%------------------ all done
diff --git
a/src/ltj-adjust.lua
b/src/ltj-adjust.lua
index
87c85dd
..
a82a4ef
100644
(file)
--- a/
src/ltj-adjust.lua
+++ b/
src/ltj-adjust.lua
@@
-565,11
+565,22
@@
do
setfield(tn, 'value', cl)
node_write(tn)
end
setfield(tn, 'value', cl)
node_write(tn)
end
+ local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
+ local attr_curtfnt = luatexbase.attributes['ltj@curtfnt']
+ local dir_tate = luatexja.dir_table.dir_tate
+ local get_dir_count = ltjd.get_dir_count
+ local function get_current_jfont(n)
+ return has_attr(n, (get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt)
+ end
+ local ltjf_font_metric_table = ltjf.font_metric_table
local function whatsit_callback(Np, lp, Nq)
if Np and Np.nuc then return Np
elseif Np and getfield(lp, 'user_id') == GHOST_JACHAR then
local function whatsit_callback(Np, lp, Nq)
if Np and Np.nuc then return Np
elseif Np and getfield(lp, 'user_id') == GHOST_JACHAR then
- Np.first = lp; Np.nuc = lp; Np.last = lp; Np.class = getfield(lp,'value')
- if Nq then Np.met = Nq.met; Np.pre = 0; Np.post = 0; Np.xspc = 3 end
+ Np.first = lp; Np.nuc = lp; Np.last = lp; Np.class = 0
+ if getfield(lp,'value')<2 then
+ if Nq and Nq.met then Np.met = Nq.met; else Np.met = ltjf_font_metric_table[get_current_jfont(lp)] end
+ Np.pre = 0; Np.post = 0; Np.xspc = 3
+ else Np.met, Np.pre = nil, nil; end
Np.auto_kspc, Np.auto_xspc = (has_attr(lp, attr_autospc)==1), (has_attr(lp, attr_autoxspc)==1)
return Np
else return Np end
Np.auto_kspc, Np.auto_xspc = (has_attr(lp, attr_autospc)==1), (has_attr(lp, attr_autoxspc)==1)
return Np
else return Np end
@@
-578,7
+589,11
@@
do
if not s and getfield(Nq.nuc, 'user_id') == GHOST_JACHAR then
local x, y = node_prev(Nq.nuc), Nq.nuc
Nq.first, Nq.nuc, Nq.last = x, x, x
if not s and getfield(Nq.nuc, 'user_id') == GHOST_JACHAR then
local x, y = node_prev(Nq.nuc), Nq.nuc
Nq.first, Nq.nuc, Nq.last = x, x, x
- if Np then Nq.met = Np.met end
+ if getfield(y,'value')%2==0 then
+ if Np and Np.met then Nq.met = Np.met
+ else Nq.met = ltjf_font_metric_table[get_current_jfont(y)] end
+ Nq.pre = 0; Nq.post = 0; Nq.xspc = 3
+ else Nq.met, Nq.pre = nil, nil; end
s = node_remove(head, y); node_free(y)
end
return s
s = node_remove(head, y); node_free(y)
end
return s
diff --git
a/src/ltj-jfmglue.lua
b/src/ltj-jfmglue.lua
index
2adcd7c
..
7ada763
100644
(file)
--- a/
src/ltj-jfmglue.lua
+++ b/
src/ltj-jfmglue.lua
@@
-3,7
+3,7
@@
--
luatexbase.provides_module({
name = 'luatexja.jfmglue',
--
luatexbase.provides_module({
name = 'luatexja.jfmglue',
- date = '2022-0
1-02
',
+ date = '2022-0
2-03
',
description = 'Insertion process of JFM glues, [x]kanjiskip and others',
})
luatexja.jfmglue = luatexja.jfmglue or {}
description = 'Insertion process of JFM glues, [x]kanjiskip and others',
})
luatexja.jfmglue = luatexja.jfmglue or {}
diff --git
a/src/ltj-ruby.lua
b/src/ltj-ruby.lua
index
f038d70
..
320b730
100644
(file)
--- a/
src/ltj-ruby.lua
+++ b/
src/ltj-ruby.lua
@@
-3,7
+3,7
@@
--
luatexbase.provides_module({
name = 'luatexja.ruby',
--
luatexbase.provides_module({
name = 'luatexja.ruby',
- date = '202
1-05-04
',
+ date = '202
2-02-03
',
description = 'Ruby annotation',
})
luatexja.ruby = {}
description = 'Ruby annotation',
})
luatexja.ruby = {}
diff --git
a/test/test17-priority.pdf
b/test/test17-priority.pdf
index
bc92755
..
5dc2d02
100644
(file)
Binary files a/test/test17-priority.pdf and b/test/test17-priority.pdf differ
diff --git
a/test/test17-priority.tex
b/test/test17-priority.tex
index
fdf837d
..
571d1bf
100644
(file)
--- a/
test/test17-priority.tex
+++ b/
test/test17-priority.tex
@@
-311,4
+311,13
@@
xkanjiskip手動挿入.
\leavevmode\hbox to 15\zw{◆\MYGUARDB{\MYVRULE}◆◆◆◆$f$◆} B\par
\leavevmode\hbox to 15\zw{◆\MYGUARDC{\MYVRULE}◆◆◆◆$f$◆} C\par
\leavevmode\hbox to 15\zw{◆◇◆◆◆◆$f$◆} 比較用\par
\leavevmode\hbox to 15\zw{◆\MYGUARDB{\MYVRULE}◆◆◆◆$f$◆} B\par
\leavevmode\hbox to 15\zw{◆\MYGUARDC{\MYVRULE}◆◆◆◆$f$◆} C\par
\leavevmode\hbox to 15\zw{◆◇◆◆◆◆$f$◆} 比較用\par
+
+\ltjsetparameter{xkanjiskip=10pt}
+
+ab\ltjghostjachar A\ltjghostjachar de\ltjghostjachar 漢f
+
+ab\ltjghostbeforejachar A\ltjghostbeforejachar de\ltjghostbeforejachar 漢\ltjghostbeforejachar f
+
+ab\ltjghostafterjachar A\ltjghostafterjachar de\ltjghostafterjachar 漢\ltjghostafterjachar f
+
\end{document}
\end{document}