summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua19
1 files changed, 10 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
index d33f032251d..ef05a671686 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
@@ -272,12 +272,12 @@ do
local traverse = node.direct.traverse
local function check_next_ickern(lp)
- if lp and getid(lp) == id_kern and ( getsubtype(lp)==3 or ITALIC == get_attr_icflag(lp)) then
- set_attr(lp, attr_icflag, IC_PROCESSED);
- Np.last = lp; return node_next(lp)
- else
- Np.last = Np.nuc; return lp
+ local lx = Np.nuc
+ while lp and getid(lp) == id_kern and ( getsubtype(lp)==3 or ITALIC == get_attr_icflag(lp)) do
+ set_attr(lp, attr_icflag, IC_PROCESSED);
+ lx, lp = lp, node_next(lp)
end
+ Np.last = lx; return lp
end
local function calc_np_pbox(lp, last)
@@ -569,16 +569,17 @@ do
local attr_jchar_code = luatexbase.attributes['ltj@charcode']
local attr_autospc = luatexbase.attributes['ltj@autospc']
local attr_autoxspc = luatexbase.attributes['ltj@autoxspc']
+ local getcomponents = node.direct.getcomponents
--local ltjf_get_vert_glyph = ltjf.get_vert_glyph
function set_np_xspc_jachar(Nx, x)
local m = ltjf_font_metric_table[getfont(x)]
- local c, c_glyph = ltjs_orig_char_table[x], getchar(x)
+ local c, c_glyph = (not getcomponents(x) and ltjs_orig_char_table[x]), getchar(x)
+ if c and c~=c_glyph then set_attr(x, attr_jchar_code, c) end
c = c or c_glyph
local cls = slow_find_char_class(c, m, c_glyph)
Nx.met, Nx.class, Nx.char = m, cls, c;
local mc = m.char_type; Nx.char_type = mc
if cls~=0 then set_attr(x, attr_jchar_class, cls) end
- if c~=c_glyph then set_attr(x, attr_jchar_code, c) end
Nx.pre = table_current_stack[PRE + c] or 0
Nx.post = table_current_stack[POST + c] or 0
Nx.xspc = table_current_stack[XSP + c] or 3
@@ -603,9 +604,9 @@ do
function set_np_xspc_alchar(Nx, c,x, lig)
if c~=-1 then
local f = (lig ==1) and nullfunc or node_tail
- local xc, xs = getfield(x, 'components'), getsubtype(x)
+ local xc, xs = getcomponents(x), getsubtype(x)
while xc and xs and xs%4>=2 do
- x = f(xc); xc, xs = getfield(x, 'components'), getsubtype(x)
+ x = f(xc); xc, xs = getcomponents(x), getsubtype(x)
end
c = getchar(x)
Nx.pre = table_current_stack[PRE + c] or 0