diff options
Diffstat (limited to 'tex/context/base/font-otn.lua')
-rw-r--r-- | tex/context/base/font-otn.lua | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/tex/context/base/font-otn.lua b/tex/context/base/font-otn.lua index 769438f47..99e52a3b0 100644 --- a/tex/context/base/font-otn.lua +++ b/tex/context/base/font-otn.lua @@ -664,8 +664,8 @@ local function toligature(kind,lookupname,head,start,stop,char,markflag,discfoun setfield(discnext,"prev",nil) -- also blocks funny assignments setfield(discprev,"next",nil) -- also blocks funny assignments if pre then - setfield(comp,"next",pre) - setfield(pre,"prev",comp) + setfield(discprev,"next",pre) + setfield(pre,"prev",discprev) end pre = comp if post then @@ -689,7 +689,7 @@ local function toligature(kind,lookupname,head,start,stop,char,markflag,discfoun setfield(discfound,"subtype",discretionary_code) base = prev -- restart end - elseif discretionary_code == regular_code then + elseif subtype == regular_code then -- local prev = getfield(base,"prev") -- local next = getfield(base,"next") local copied = copy_node_list(comp) @@ -2568,17 +2568,32 @@ end -- -- * languages that use complex disc nodes --- optimization comes later ... - local function kernrun(disc,run) -- we can assume that prev and next are glyphs + -- + -- we catch <font 1><disc font 2> + -- if trace_kernruns then report_run("kern") -- will be more detailed end - -- - local prev = getprev(disc) -- todo, keep these in the main loop - local next = getnext(disc) -- todo, keep these in the main loop -- - local pre = getfield(disc,"pre") + local prev = getprev(disc) -- todo, keep these in the main loop + local next = getnext(disc) -- todo, keep these in the main loop + -- + local pre = getfield(disc,"pre") + local post = getfield(disc,"post") + local replace = getfield(disc,"replace") + -- + if pre or replace then + if not (prev and getid(prev) == glyph_code and getfont(prev) == currentfont and getsubtype(prev)<256) then + prev = false + end + end + if post or replace then + if not (next and getid(next) == glyph_code and getfont(next) == currentfont and getsubtype(next)<256) then + next = false + end + end + -- if not pre then -- go on elseif prev then @@ -2592,7 +2607,6 @@ local function kernrun(disc,run) -- we can assume that prev and next are glyphs run(pre,"preinjections") end -- - local post = getfield(disc,"post") if not post then -- go on elseif next then @@ -2606,8 +2620,7 @@ local function kernrun(disc,run) -- we can assume that prev and next are glyphs run(post,"postinjections") end -- - local replace = getfield(disc,"replace") - if not replace then + if not replace and prev and next then -- this should be already done by discfound elseif prev and next then local tail = find_node_tail(replace) |