diff options
| author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-08-26 10:15:06 +0200 | 
|---|---|---|
| committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-08-26 10:15:06 +0200 | 
| commit | 470438f73f2273ca9cff09393f198884a219ec48 (patch) | |
| tree | bfe466c731afb959a747f87be00366fcc99bc577 /tex/context/base/font-otn.lua | |
| parent | 095d5c305c2c8b536710a5b0ef5e104f07995fb5 (diff) | |
| download | context-470438f73f2273ca9cff09393f198884a219ec48.tar.gz | |
2015-08-26 09:09:00
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) | 
