From e92a01a8876eb52c54d83d54323db89a2be097aa Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Sat, 23 May 2015 13:15:04 +0200 Subject: 2015-05-23 10:16:00 --- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4181 -> 4182 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/font-map.lua | 53 +++++++++++++++++++++ tex/context/base/node-fnt.lua | 15 +++++- tex/context/base/status-files.pdf | Bin 24527 -> 24520 bytes tex/context/base/status-lua.pdf | Bin 251253 -> 251248 bytes tex/generic/context/luatex/luatex-fonts-cbk.lua | 17 +++++-- tex/generic/context/luatex/luatex-fonts-merged.lua | 19 ++++++-- 9 files changed, 95 insertions(+), 13 deletions(-) (limited to 'tex') diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 266d84cba..f69746bbf 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2015.05.22 19:25} +\newcontextversion{2015.05.23 10:13} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index 824360cdf..937011004 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 70075043e..caca52426 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2015.05.22 19:25} +\edef\contextversion{2015.05.23 10:13} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/font-map.lua b/tex/context/base/font-map.lua index 449a00f2e..69474baf2 100644 --- a/tex/context/base/font-map.lua +++ b/tex/context/base/font-map.lua @@ -313,6 +313,59 @@ function mappings.addtounicode(data,filename) -- The next time I look into this, I'll add an extra analysis step to the otf loader (we can -- resolve some tounicodes by looking into the gsub data tables that are bound to glyphs. -- +-- a real tricky last resort: +-- +-- local lookups = glyph.lookups +-- if lookups then +-- for _, lookup in next, lookups do -- assume consistency else we need to sort +-- for i=1,#lookup do +-- local l = lookup[i] +-- if l.type == "ligature" then +-- local s = l.specification +-- if s.char == glyph.name then +-- local components = s.components +-- if components then +-- local t, n = { }, 0 +-- unicode = true +-- for l=1,#components do +-- local base = components[l] +-- local u = unicodes[base] or unicodevector[base] +-- if not u then +-- break +-- elseif type(u) == "table" then +-- if u[1] >= private then +-- unicode = false +-- break +-- end +-- n = n + 1 +-- t[n] = u[1] +-- else +-- if u >= private then +-- unicode = false +-- break +-- end +-- n = n + 1 +-- t[n] = u +-- end +-- end +-- if n == 0 then -- done then +-- -- nothing +-- elseif n == 1 then +-- glyph.unicode = t[1] +-- else +-- glyph.unicode = t +-- end +-- nl = nl + 1 +-- break +-- end +-- end +-- end +-- end +-- if unicode then +-- break +-- end +-- end +-- end if not unicode or unicode == "" then local split = lpegmatch(namesplitter,name) local nsplit = split and #split or 0 diff --git a/tex/context/base/node-fnt.lua b/tex/context/base/node-fnt.lua index d818e4544..2edaa04ea 100644 --- a/tex/context/base/node-fnt.lua +++ b/tex/context/base/node-fnt.lua @@ -138,7 +138,8 @@ function handlers.characters(head) local prevfont = nil local prevattr = 0 local done = false - local variants = false + local variants = nil + local redundant = nil if trace_fontrun then run = run + 1 @@ -216,7 +217,11 @@ function handlers.characters(head) local variant = hash[getchar(p)] if variant then setfield(p,"char",variant) - delete_node(nuthead,n) + if not redundant then + redundant = { n } + else + redundant[#redundant+1] = n + end end end end @@ -225,6 +230,12 @@ function handlers.characters(head) end end + if redundant then + for i=1,#redundant do + delete_node(nuthead,n) + end + end + -- could be an optional pass : seldom needed, only for documentation as a discretionary -- with pre/post/replace will normally not occur on it's own diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 45487ace4..be1ed8785 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index e4d0ca403..4465dd0a7 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-cbk.lua b/tex/generic/context/luatex/luatex-fonts-cbk.lua index 58162b4af..81b5b6e85 100644 --- a/tex/generic/context/luatex/luatex-fonts-cbk.lua +++ b/tex/generic/context/luatex/luatex-fonts-cbk.lua @@ -18,6 +18,7 @@ local nodes = nodes local traverse_id = node.traverse_id local free_node = node.free +local remove_node = node.remove local glyph_code = nodes.nodecodes.glyph local disc_code = nodes.nodecodes.disc @@ -60,6 +61,7 @@ function nodes.handlers.nodepass(head) local prevfont = nil local basefont = nil local variants = nil + local redundant = nil for n in traverse_id(glyph_code,head) do local font = n.font if font ~= prevfont then @@ -104,17 +106,24 @@ function nodes.handlers.nodepass(head) local variant = hash[p.char] if variant then p.char = variant - p.next = n.next - if n.next then - n.next.prev = p + if not redundant then + redundant = { n } + else + redundant[#redundant+1] = n end - node.free(n) end end end end end end + if redundant then + for i=1,#redundant do + local n = redundant[i] + remove_node(head,n) + free_node(n) + end + end for d in traverse_id(disc_code,head) do local r = d.replace if r then diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index c060dc304..fe61b3dcb 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/22/15 19:25:13 +-- merge date : 05/23/15 10:13:59 do -- begin closure to overcome local limits and interference @@ -15211,6 +15211,7 @@ local fonts=fonts local nodes=nodes local traverse_id=node.traverse_id local free_node=node.free +local remove_node=node.remove local glyph_code=nodes.nodecodes.glyph local disc_code=nodes.nodecodes.disc local ligaturing=node.ligaturing @@ -15241,6 +15242,7 @@ function nodes.handlers.nodepass(head) local prevfont=nil local basefont=nil local variants=nil + local redundant=nil for n in traverse_id(glyph_code,head) do local font=n.font if font~=prevfont then @@ -15285,17 +15287,24 @@ function nodes.handlers.nodepass(head) local variant=hash[p.char] if variant then p.char=variant - p.next=n.next - if n.next then - n.next.prev=p + if not redundant then + redundant={ n } + else + redundant[#redundant+1]=n end - node.free(n) end end end end end end + if redundant then + for i=1,#redundant do + local n=redundant[i] + remove_node(head,n) + free_node(n) + end + end for d in traverse_id(disc_code,head) do local r=d.replace if r then -- cgit v1.2.3