From f9a875c39c19e25a6744db40c39935c880a95cc0 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 10 Jun 2009 23:24:34 +0300 Subject: Sync with ConTeXt 2009.06.10 20:06, fixes bug with undefined fonts.register_message function that would crash luatex with certain fonts, pluse more. --- otfl-node-inj.lua | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'otfl-node-inj.lua') diff --git a/otfl-node-inj.lua b/otfl-node-inj.lua index 6ba21b3..2e8b5ae 100644 --- a/otfl-node-inj.lua +++ b/otfl-node-inj.lua @@ -168,7 +168,7 @@ end -- todo: reuse tables (i.e. no collection), but will be extra fields anyway -function nodes.inject_kerns(head,tail,keep) +function nodes.inject_kerns(head,tail,where,keep) if trace_injections then nodes.trace_injection(head) end @@ -176,10 +176,10 @@ function nodes.inject_kerns(head,tail,keep) if has_marks or has_cursives then -- in the future variant we will not copy items but refs to tables local done, ky, rl, valid, cx, wx = false, { }, { }, { }, { }, { } - for n in traverse_id(glyph,head) do - if n.subtype < 256 then - valid[#valid+1] = n - if has_kerns then -- move outside loop + if has_kerns then -- move outside loop + for n in traverse_id(glyph,head) do + if n.subtype < 256 then + valid[#valid+1] = n local k = has_attribute(n,kernpair) if k then local kk = kerns[k] @@ -197,6 +197,12 @@ function nodes.inject_kerns(head,tail,keep) end end end + else + for n in traverse_id(glyph,head) do + if n.subtype < 256 then + valid[#valid+1] = n + end + end end if #valid > 0 then -- we can assume done == true because we have cursives and marks @@ -215,6 +221,7 @@ function nodes.inject_kerns(head,tail,keep) n = valid[i] if n.font ~= nf then nf = n.font +--~ print(n.font,nf,fontdata[nf]) tm = fontdata[nf].marks -- maybe flush maxt = 0 -- cgit v1.2.3