diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-12-05 12:15:04 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-12-05 12:15:04 +0100 |
commit | bdd2db48f4c5e7aa2eb9037bf90ff9c26bd44df9 (patch) | |
tree | 7ad39de2530ad52bb2b28e38d2f657e65ecce9bc /tex | |
parent | 0c03e5fd03732d2a47eeb32bfb43f67f7139332f (diff) | |
download | context-bdd2db48f4c5e7aa2eb9037bf90ff9c26bd44df9.tar.gz |
2014-12-05 11:13:00
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4388 -> 4386 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/font-inj.lua | 382 | ||||
-rw-r--r-- | tex/context/base/font-otf.lua | 4 | ||||
-rw-r--r-- | tex/context/base/font-otn.lua | 231 | ||||
-rw-r--r-- | tex/context/base/s-languages-system.lua | 63 | ||||
-rw-r--r-- | tex/context/base/s-languages-system.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24641 -> 24623 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 344553 -> 344549 bytes | |||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 4 |
11 files changed, 237 insertions, 453 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index cac66238a..0ff90ab76 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{2014.12.04 21:59} +\newcontextversion{2014.12.05 11:11} %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 Binary files differindex a4ac52c6a..d3f8bac3d 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index a168b88e4..74197acc5 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.12.04 21:59} +\edef\contextversion{2014.12.05 11:11} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/font-inj.lua b/tex/context/base/font-inj.lua index 4687e1ea7..deac06b40 100644 --- a/tex/context/base/font-inj.lua +++ b/tex/context/base/font-inj.lua @@ -257,17 +257,16 @@ local function dir(n) return (n and n<0 and "r-to-l") or (n and n>0 and "l-to-r") or "unset" end -local function trace(head) - report_injections("begin run: %s kerns, %s pairs, %s marks and %s cursives registered", - nofregisteredkerns,nofregisteredpairs,nofregisteredmarks,nofregisteredcursives) - for n in traverse_id(glyph_code,head) do - if getsubtype(n) < 256 then - local char = getchar(n) - report_injections("font %s, char %U, glyph %c",getfont(n),char,char) - local p = rawget(properties,n) - if p then - p = p.injections - end +local function showchar(n,nested) + local char = getchar(n) + report_injections("%wfont %s, char %U, glyph %c",nested and 2 or 0,getfont(n),char,char) +end + +local function show(n,what,nested,symbol) + if n then + local p = rawget(properties,n) + if p then + local p = p[what] if p then local leftkern = p.leftkern or 0 local rightkern = p.rightkern or 0 @@ -279,23 +278,64 @@ local function trace(head) local cursivex = p.cursivex or 0 local cursivey = p.cursivey or 0 local ligaindex = p.ligaindex or 0 + local margin = nested and 4 or 2 + -- if rightkern ~= 0 or yoffset ~= 0 then - report_injections(" pair: lx %p, rx %p, dy %p",leftkern,rightkern,yoffset) + report_injections("%w%s pair: lx %p, rx %p, dy %p",margin,symbol,leftkern,rightkern,yoffset) elseif leftkern ~= 0 then - report_injections(" kern: dx %p",leftkern) + report_injections("%w%s kern: dx %p",margin,symbol,leftkern) end if markx ~= 0 or marky ~= 0 or markbase ~= 0 then - report_injections(" mark: dx %p, dy %p, dir %s, base %s",markx,marky,markdir,markbase ~= 0 and "yes" or "no") + report_injections("%w%s mark: dx %p, dy %p, dir %s, base %s",margin,symbol,markx,marky,markdir,markbase ~= 0 and "yes" or "no") end if cursivex ~= 0 or cursivey ~= 0 then - report_injections(" curs: dx %p, dy %p",cursivex,cursivey) + report_injections("%w%s curs: dx %p, dy %p",margin,symbol,cursivex,cursivey) end if ligaindex ~= 0 then - report_injections(" liga: index %i",ligaindex) + report_injections("%w%s liga: index %i",margin,symbol,ligaindex) end end end end +end + +local function showsub(n,what,where) + report_injections("begin subrun: %s",where) + for n in traverse_id(glyph_code,n) do + showchar(n,where) + show(n,what,where," ") + end + report_injections("end subrun") +end + +local function trace(head) + report_injections("begin run: %s kerns, %s pairs, %s marks and %s cursives registered", + nofregisteredkerns,nofregisteredpairs,nofregisteredmarks,nofregisteredcursives) + local n = head + while n do + local id = getid(n) + if id == glyph_code then + showchar(n) + show(n,"injections",false," ") + show(n,"preinjections",false,"<") + show(n,"postinjections",false,">") + show(n,"replaceinjections",false,"=") + elseif id == disc_code then + local pre = getfield(n,"pre") + local post = getfield(n,"post") + local replace = getfield(n,"replace") + if pre then + showsub(pre,"preinjections","pre") + end + if post then + showsub(post,"postinjections","post") + end + if replace then + showsub(replace,"replaceinjections","replace") + end + end + n = getnext(n) + end report_injections("end run") end @@ -319,309 +359,6 @@ local function show_result(head) end end --- function injections.handler(head,where,keep) -- optimize for n=1 --- if nofregisteredmarks > 0 or nofregisteredcursives > 0 then --- head = tonut(head) --- if trace_injections then --- trace(head) --- end --- -- in the future variant we will not copy items but refs to tables --- local glyphs, nofglyphs = { }, 0 --- local marks, nofmarks = { }, 0 --- -- maybe merge loops --- if nofregisteredpairs > 0 then --- local nf, tm = nil, nil --- for n in traverse_id(glyph_code,head) do -- only needed for relevant fonts --- if getsubtype(n) < 256 then --- local pn = rawget(properties,n) --- if pn then --- pn = pn.injections --- end --- local f = getfont(n) --- if f ~= nf then --- nf = f --- tm = fontdata[nf].resources.marks -- other hash in ctx --- end --- if tm and tm[getchar(n)] then --- nofmarks = nofmarks + 1 --- marks[nofmarks] = n --- else --- nofglyphs = nofglyphs + 1 --- glyphs[nofglyphs] = n --- end --- -- yoffsets can influence curs steps --- if pn then --- local yoffset = pn.yoffset --- if yoffset and yoffset ~= 0 then --- setfield(n,"yoffset",yoffset) --- end --- end --- end --- end --- else --- local nf, tm = nil, nil --- for n in traverse_id(glyph_code,head) do --- if getsubtype(n) < 256 then --- -- local pn = rawget(properties,n) --- -- if pn then --- -- pn = pn.injections --- -- end --- local f = getfont(n) --- if f ~= nf then --- nf = f --- tm = fontdata[nf].resources.marks -- other hash in ctx --- end --- if tm and tm[getchar(n)] then --- nofmarks = nofmarks + 1 --- marks[nofmarks] = n --- else --- nofglyphs = nofglyphs + 1 --- glyphs[nofglyphs] = n --- end --- end --- end --- end --- if nofglyphs > 0 then --- if nofregisteredcursives > 0 then --- local cursiveanchor, lastanchor = nil, nil --- local minc, maxc, last = 0, 0, nil --- for i=1,nofglyphs do --- local n = glyphs[i] --- local pn = rawget(properties,n) --- if pn then --- pn = pn.injections --- end --- if pn then --- local cursivex = pn.cursivex --- if cursivex then --- if cursiveanchor then --- if cursivex ~= 0 then --- pn.leftkern = (pn.leftkern or 0) + cursivex --- end --- if lastanchor then --- if maxc == 0 then --- minc = lastanchor --- end --- maxc = lastanchor --- properties[cursiveanchor].cursivedy = pn.cursivey --- end --- last = n --- else --- maxc = 0 --- end --- elseif maxc > 0 then --- local ny = getfield(n,"yoffset") --- for i=maxc,minc,-1 do --- local ti = glyphs[i] --- ny = ny + properties[ti].cursivedy --- setfield(ti,"yoffset",ny) -- why not add ? --- end --- maxc = 0 --- end --- if pn.cursiveanchor then --- cursiveanchor = n --- lastanchor = i --- else --- cursiveanchor = nil --- lastanchor = nil --- if maxc > 0 then --- local ny = getfield(n,"yoffset") --- for i=maxc,minc,-1 do --- local ti = glyphs[i] --- ny = ny + properties[ti].cursivedy --- setfield(ti,"yoffset",ny) -- why not add ? --- end --- maxc = 0 --- end --- end --- elseif maxc > 0 then --- local ny = getfield(n,"yoffset") --- for i=maxc,minc,-1 do --- local ti = glyphs[i] --- ny = ny + properties[ti].cursivedy --- setfield(ti,"yoffset",getfield(ti,"yoffset") + ny) -- ? --- end --- maxc = 0 --- cursiveanchor = nil --- lastanchor = nil --- end --- -- if maxc > 0 and not cursiveanchor then --- -- local ny = getfield(n,"yoffset") --- -- for i=maxc,minc,-1 do --- -- local ti = glyphs[i] --- -- ny = ny + properties[ti].cursivedy --- -- setfield(ti,"yoffset",ny) -- why not add ? --- -- end --- -- maxc = 0 --- -- end --- end --- if last and maxc > 0 then --- local ny = getfield(last,"yoffset") --- for i=maxc,minc,-1 do --- local ti = glyphs[i] --- ny = ny + properties[ti].cursivedy --- setfield(ti,"yoffset",ny) -- why not add ? --- end --- end --- end --- if nofregisteredmarks > 0 then --- for i=1,nofmarks do --- local n = marks[i] --- local pn = rawget(properties,n) --- if pn then --- pn = pn.injections --- end --- if pn then --- -- local markbase = pn.markbase --- -- if markbase then --- -- local p = markanchors[markbase] --- local p = pn.markbasenode --- if p then --- local px = getfield(p,"xoffset") --- local ox = 0 --- local pp = rawget(properties,p) --- local rightkern = pp and pp.rightkern --- if rightkern then -- x and w ~= 0 --- if pn.markdir < 0 then --- -- kern(w-x) glyph(p) kern(x) mark(n) --- ox = px - pn.markx - rightkern --- -- report_injections("r2l case 1: %p",ox) --- else --- -- kern(x) glyph(p) kern(w-x) mark(n) --- -- ox = px - getfield(p,"width") + pn.markx - pp.leftkern --- ox = px - pn.markx - pp.leftkern --- -- report_injections("l2r case 1: %p",ox) --- end --- else --- -- we need to deal with fonts that have marks with width --- -- if pn.markdir < 0 then --- -- ox = px - pn.markx --- -- -- report_injections("r2l case 3: %p",ox) --- -- else --- -- -- ox = px - getfield(p,"width") + pn.markx --- ox = px - pn.markx --- -- report_injections("l2r case 3: %p",ox) --- -- end --- local wn = getfield(n,"width") -- in arial marks have widths --- if wn ~= 0 then --- -- bad: we should center --- -- insert_node_before(head,n,newkern(-wn/2)) --- -- insert_node_after(head,n,newkern(-wn/2)) --- pn.leftkern = -wn/2 --- pn.rightkern = -wn/2 --- -- wx[n] = { 0, -wn/2, 0, -wn } --- end --- -- so far --- end --- setfield(n,"xoffset",ox) --- -- --- local py = getfield(p,"yoffset") --- local oy = 0 --- if marks[p] then --- oy = py + pn.marky --- else --- oy = getfield(n,"yoffset") + py + pn.marky --- end --- setfield(n,"yoffset",oy) --- else --- -- normally this can't happen (only when in trace mode which is a special case anyway) --- -- report_injections("missing mark anchor %i",pn.markbase or 0) --- end --- -- end --- end --- end --- end --- for i=1,#glyphs do --- local n = glyphs[i] --- local pn = rawget(properties,n) --- if pn then --- pn = pn.injections --- end --- if pn then --- local leftkern = pn.leftkern --- if leftkern ~= 0 then --- insert_node_before(head,n,newkern(leftkern)) -- type 0/2 --- end --- local rightkern = pn.rightkern --- if rightkern ~= 0 then --- insert_node_after(head,n,newkern(rightkern)) -- type 0/2 --- end --- end --- end --- end --- if not keep then --- nofregisteredkerns = 0 --- nofregisteredpairs = 0 --- nofregisteredmarks = 0 --- nofregisteredcursives = 0 --- end --- return tonode(head), true --- elseif nofregisteredpairs > 0 then --- head = tonut(head) --- if trace_injections then --- trace(head) --- end --- for n in traverse_id(glyph_code,head) do --- if getsubtype(n) < 256 then --- local pn = rawget(properties,n) --- if pn then --- pn = pn.injections --- end --- if pn then --- local yoffset = pn.yoffset --- if yoffset and yoffset ~= 0 then --- setfield(n,"yoffset",yoffset) --- end --- local leftkern = pn.leftkern --- if leftkern and leftkern ~= 0 then --- insert_node_before(head,n,newkern(leftkern)) --- end --- local rightkern = pn.rightkern --- if rightkern and rightkern ~= 0 then --- insert_node_after(head,n,newkern(rightkern)) --- else --- -- simple (e.g. kernclass kerns) --- end --- end --- end --- end --- if not keep then --- nofregisteredpairs = 0 --- nofregisteredkerns = 0 --- end --- return tonode(head), true --- elseif nofregisteredkerns > 0 then --- head = tonut(head) --- if trace_injections then --- trace(head) --- end --- for n in traverse_id(glyph_code,head) do --- if getsubtype(n) < 256 then --- local pn = rawget(properties,n) --- if pn then --- pn = pn.injections --- end --- if pn then --- local leftkern = pn.leftkern --- if leftkern ~= 0 then --- insert_node_before(head,n,newkern(leftkern)) --- end --- end --- end --- end --- if not keep then --- nofregisteredkerns = 0 --- end --- return tonode(head), true --- else --- return head, false --- end --- end - --------- todo: store pre/post/replace state, see todo - --- in the future variant we will not copy items but refs to tables - -- we could also check for marks here but maybe not all are registered (needs checking) local function collect_glyphs_1(head) @@ -902,7 +639,7 @@ local function inject_cursives(glyphs,nofglyphs) end end -local function inject_kerns(glyphs,nofglyphs) +local function inject_kerns(head,glyphs,nofglyphs) -- todo: pre/post/replace for i=1,#glyphs do local n = glyphs[i] @@ -941,7 +678,7 @@ local function inject_everything(head,where,keep) if nofregisteredmarks > 0 then inject_marks(marks,nofmarks) end - inject_kerns(glyphs,nofglyphs) + inject_kerns(head,glyphs,nofglyphs) end if not keep then nofregisteredkerns = 0 @@ -1049,7 +786,7 @@ local function inject_kerns_only(head,where,keep) if d then local h = d for n in traverse(d) do - local pn = rawget(properties,n) + local pn = rawget(properties,n) -- why can it be empty { } if pn then pn = pn.replaceinjections end @@ -1057,6 +794,7 @@ local function inject_kerns_only(head,where,keep) local leftkern = pn.leftkern if leftkern ~= 0 then h = insert_node_before(h,n,newkern(leftkern)) +-- h = insert_node_after(h,n,newkern(leftkern)) end end end diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index 18b975215..302d8eabc 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -989,8 +989,8 @@ actions["add duplicates"] = function(data,filename,raw) local description = descriptions[unicode] local n = 0 for _, description in next, descriptions do + local kerns = description.kerns if kerns then - local kerns = description.kerns for _, k in next, kerns do local ku = k[unicode] if ku then @@ -1724,6 +1724,8 @@ actions["merge kern classes"] = function(data,filename,raw) local lookup = subtable.lookup or subtable.name if kernclass then -- the next one is quite slow if #kernclass > 0 then + -- it's a table with one entry .. a future luatex can just + -- omit that level kernclass = kernclass[1] lookup = type(kernclass.lookup) == "string" and kernclass.lookup or lookup report_otf("fixing kernclass table of lookup %a",lookup) diff --git a/tex/context/base/font-otn.lua b/tex/context/base/font-otn.lua index e23a1366c..f1274f79e 100644 --- a/tex/context/base/font-otn.lua +++ b/tex/context/base/font-otn.lua @@ -158,9 +158,10 @@ local trace_steps = false registertracker("otf.steps", function(v local trace_skips = false registertracker("otf.skips", function(v) trace_skips = v end) local trace_directions = false registertracker("otf.directions", function(v) trace_directions = v end) -local kernruns = true registerdirective("otf.kernruns", function(v) kernruns = v end) -local discruns = true registerdirective("otf.discruns", function(v) discruns = v end) -local compruns = true registerdirective("otf.compruns", function(v) compruns = v end) +local trace_kernruns = false registertracker("otf.kernruns", function(v) trace_kernruns = v end) +local trace_discruns = false registertracker("otf.discruns", function(v) trace_discruns = v end) +local trace_compruns = false registertracker("otf.compruns", function(v) trace_compruns = v end) + local zwnjruns = true registerdirective("otf.zwnjruns", function(v) zwnjruns = v end) local report_direct = logs.reporter("fonts","otf direct") @@ -169,6 +170,7 @@ local report_chain = logs.reporter("fonts","otf chain") local report_process = logs.reporter("fonts","otf process") local report_prepare = logs.reporter("fonts","otf prepare") local report_warning = logs.reporter("fonts","otf warning") +local report_run = logs.reporter("fonts","otf run") registertracker("otf.verbose_chain", function(v) otf.setcontextchain(v and "verbose") end) registertracker("otf.normal_chain", function(v) otf.setcontextchain(v and "normal") end) @@ -516,8 +518,6 @@ local function toligature(kind,lookupname,head,start,stop,char,markflag,discfoun end start = getnext(start) end - elseif not kernruns or not discruns or not compruns then - -- disabled elseif getsubtype(discfound) == discretionary_code then -- maybe some day else @@ -2260,113 +2260,127 @@ end -- optimization comes later ... local function kernrun(disc,run) -- we can assume that prev and next are glyphs - if kernruns then - -- - 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") - if not pre then - -- go on - elseif prev then - setfield(pre,"prev",prev) - setfield(prev,"next",pre) - run(prev,"preinjections") - setfield(pre,"prev",nil) - setfield(prev,"next",disc) - else - run(pre,"preinjections") - end - -- - local post = getfield(disc,"post") - if not post then - -- go on - elseif next then - local tail = find_node_tail(post) - setfield(tail,"next",next) - setfield(next,"prev",tail) - run(post,"postinjections",tail) - setfield(tail,"next",nil) - setfield(next,"prev",disc) - else - run(post,"postinjections") - end - -- - local replace = getfield(disc,"replace") - if not replace then - -- this should be already done by discfound - elseif prev and next then - local tail = find_node_tail(replace) - setfield(replace,"prev",prev) - setfield(prev,"next",replace) - setfield(tail,"next",next) - setfield(next,"prev",tail) - run(prev,"replaceinjections",tail) - setfield(replace,"prev",nil) - setfield(prev,"next",disc) - setfield(tail,"next",nil) - setfield(next,"prev",disc) - elseif prev then - setfield(replace,"prev",prev) - setfield(prev,"next",replace) - run(prev,"replaceinjections") - setfield(replace,"prev",nil) - setfield(prev,"next",disc) - elseif next then - local tail = find_node_tail(replace) - setfield(tail,"next",next) - setfield(next,"prev",tail) - run(replace,"replaceinjections",tail) - setfield(tail,"next",nil) - setfield(next,"prev",disc) - else - run(replace,"replaceinjections") - end + 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") + if not pre then + -- go on + elseif prev then + setfield(pre,"prev",prev) + setfield(prev,"next",pre) + run(prev,"preinjections") + setfield(pre,"prev",nil) + setfield(prev,"next",disc) + else + run(pre,"preinjections") + end + -- + local post = getfield(disc,"post") + if not post then + -- go on + elseif next then + local tail = find_node_tail(post) + setfield(tail,"next",next) + setfield(next,"prev",tail) + run(post,"postinjections",tail) + setfield(tail,"next",nil) + setfield(next,"prev",disc) + else + run(post,"postinjections") + end + -- + local replace = getfield(disc,"replace") + if not replace then + -- this should be already done by discfound + elseif prev and next then + local tail = find_node_tail(replace) + setfield(replace,"prev",prev) + setfield(prev,"next",replace) + setfield(tail,"next",next) + setfield(next,"prev",tail) + run(prev,"replaceinjections",tail) + setfield(replace,"prev",nil) + setfield(prev,"next",disc) + setfield(tail,"next",nil) + setfield(next,"prev",disc) + elseif prev then + setfield(replace,"prev",prev) + setfield(prev,"next",replace) + run(prev,"replaceinjections") + setfield(replace,"prev",nil) + setfield(prev,"next",disc) + elseif next then + local tail = find_node_tail(replace) + setfield(tail,"next",next) + setfield(next,"prev",tail) + run(replace,"replaceinjections",tail) + setfield(tail,"next",nil) + setfield(next,"prev",disc) + else + run(replace,"replaceinjections") end end local function comprun(disc,run) - if compruns then - -- - local pre = getfield(disc,"pre") - if pre then - local new = run(pre) - if new ~= pre then - setfield(disc,"pre",new) - end + if trace_compruns then + report_run("comp") -- will be more detailed + end + -- + local pre = getfield(disc,"pre") + if pre then + local new = run(pre) + if new ~= pre then + setfield(disc,"pre",new) end - -- - local post = getfield(disc,"post") - if post then - local new = run(post) - if new ~= post then - setfield(disc,"post",new) - end + end + -- + local post = getfield(disc,"post") + if post then + local new = run(post) + if new ~= post then + setfield(disc,"post",new) end - -- - local replace = getfield(disc,"replace") - if replace then - local new = run(replace) - if new ~= replace then - setfield(disc,"replace",new) - end + end + -- + local replace = getfield(disc,"replace") + if replace then + local new = run(replace) + if new ~= replace then + setfield(disc,"replace",new) end - -- end end -local function discrun(disc,run) +local function discrun(disc,drun,krun) local next = getnext(disc) - if discruns and next then - local prev = getprev(disc) - if prev then - setfield(prev,"next",next) - -- setfield(next,"prev",prev) - run(disc) - setfield(prev,"next",disc) - -- setfield(next,"prev",disc) - end + local prev = getprev(disc) + if trace_discruns then + report_run("disc") -- will be more detailed + end + if next and prev then + setfield(prev,"next",next) + -- setfield(next,"prev",prev) + drun(prev) + setfield(prev,"next",disc) + -- setfield(next,"prev",disc) + end + -- + local pre = getfield(disc,"pre") + if not pre then + -- go on + elseif prev then + setfield(pre,"prev",prev) + setfield(prev,"next",pre) + krun(prev,"preinjections") + setfield(pre,"prev",nil) + setfield(prev,"next",disc) + else + run(pre,"preinjections") end return next end @@ -2551,6 +2565,9 @@ local function featuresprocessor(head,font,attr) if a then -- sequence kan weg for n in traverse_nodes(sub) do -- only gpos + if n == last then + break + end local id = getid(n) if id == glyph_code then local lookupmatch = lookupcache[getchar(n)] @@ -2564,9 +2581,6 @@ local function featuresprocessor(head,font,attr) else -- message end - if n == last then - break - end end end end @@ -2609,7 +2623,7 @@ local function featuresprocessor(head,font,attr) if discretionary then kernrun(start,k_run) else - discrun(start,d_run) + discrun(start,d_run,k_run) end elseif discretionary then comprun(start,c_run) @@ -2718,6 +2732,7 @@ local function featuresprocessor(head,font,attr) a = not attribute or getprop(prev,a_state) == attribute end if a then + -- brr prev can be disc local char = getchar(prev) for i=1,ns do local lookupname = subtables[i] @@ -2748,6 +2763,9 @@ local function featuresprocessor(head,font,attr) end if a then for n in traverse_nodes(sub) do -- only gpos + if n == last then + break + end local id = getid(n) if id == glyph_code then local char = getchar(n) @@ -2770,9 +2788,6 @@ local function featuresprocessor(head,font,attr) else -- message end - if n == last then - break - end end end end @@ -2827,7 +2842,7 @@ local function featuresprocessor(head,font,attr) if discretionary then kernrun(start,k_run) else - discrun(start,d_run) + discrun(start,d_run,k_run) end elseif discretionary then comprun(start,c_run) diff --git a/tex/context/base/s-languages-system.lua b/tex/context/base/s-languages-system.lua index 5afc4d403..3b422db9f 100644 --- a/tex/context/base/s-languages-system.lua +++ b/tex/context/base/s-languages-system.lua @@ -10,26 +10,53 @@ moduledata.languages = moduledata.languages or { } moduledata.languages.system = moduledata.languages.system or { } local NC, NR, HL = context.NC, context.NR, context.HL +local sortedhash = table.sortedhash +local registered = languages.registered +local context = context +local ctx_NC = context.NC +local ctx_NR = context.NR +local ctx_bold = context.bold + +function moduledata.languages.system.loadinstalled() + context.start() + for k, v in table.sortedhash(registered) do + context.language{ k } + end + context.stop() +end function moduledata.languages.system.showinstalled() - local numbers = languages.numbers - local registered = languages.registered - context.starttabulate { "|r|l|l|l|l|" } - NC() context("id") - NC() context("tag") - NC() context("synonyms") - NC() context("parent") - NC() context("loaded") - NC() NR() HL() - for i=1,#numbers do - local tag = numbers[i] - local data = registered[tag] - NC() context(data.number) - NC() context(tag) - NC() context("% t",table.sortedkeys(data.synonyms)) - NC() context(data.parent) - NC() context("%+t",table.sortedkeys(data.used)) - NC() NR() + -- + context.starttabulate { "|l|r|l|l|p(7em)|r|p|" } + context.FL() + ctx_NC() ctx_bold("tag") + ctx_NC() ctx_bold("n") + ctx_NC() ctx_bold("parent") + ctx_NC() ctx_bold("file") + ctx_NC() ctx_bold("synonyms") + ctx_NC() ctx_bold("patterns") + ctx_NC() ctx_bold("characters") + ctx_NC() ctx_NR() + context.FL() + for k, v in sortedhash(registered) do + local parent = v.parent + local resources = v.resources + local patterns = resources and resources.patterns + ctx_NC() context(k) + ctx_NC() context(v.number) + ctx_NC() context(v.parent) + ctx_NC() context(v.patterns) + ctx_NC() for k, v in sortedhash(v.synonyms) do context("%s\\par",k) end + if patterns then + ctx_NC() context(patterns.n) + ctx_NC() context("% t",utf.split(patterns.characters)) + else + ctx_NC() + ctx_NC() + end + ctx_NC() ctx_NR() end + context.LL() context.stoptabulate() + -- end diff --git a/tex/context/base/s-languages-system.mkiv b/tex/context/base/s-languages-system.mkiv index 363720374..22991f264 100644 --- a/tex/context/base/s-languages-system.mkiv +++ b/tex/context/base/s-languages-system.mkiv @@ -16,6 +16,7 @@ \registerctxluafile{s-languages-system}{} \installmodulecommandluasingle \showinstalledlanguages {moduledata.languages.system.showinstalled} +\installmodulecommandluasingle \loadinstalledlanguages {moduledata.languages.system.loadinstalled} \stopmodule @@ -25,6 +26,7 @@ \starttext + \loadinstalledlanguages \showinstalledlanguages \stoptext diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 61ae8fa36..f7cfa76b9 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex bcb6ad6b6..b3c0ae66b 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 42003752d..78c801604 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 : 12/04/14 21:59:47 +-- merge date : 12/05/14 11:11:22 do -- begin closure to overcome local limits and interference @@ -7830,8 +7830,8 @@ actions["add duplicates"]=function(data,filename,raw) local description=descriptions[unicode] local n=0 for _,description in next,descriptions do + local kerns=description.kerns if kerns then - local kerns=description.kerns for _,k in next,kerns do local ku=k[unicode] if ku then |