diff options
Diffstat (limited to 'tex')
28 files changed, 219 insertions, 246 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index a7ee56e1e..0d21cdc48 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2019.08.14 11:26} +\newcontextversion{2019.08.17 11:46} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 3d0cf4de2..3d9c5347e 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2019.08.14 11:26} +\edef\contextversion{2019.08.17 11:46} %D For those who want to use this: diff --git a/tex/context/base/mkiv/anch-pos.lua b/tex/context/base/mkiv/anch-pos.lua index e53c3c514..ba830e3de 100644 --- a/tex/context/base/mkiv/anch-pos.lua +++ b/tex/context/base/mkiv/anch-pos.lua @@ -332,11 +332,13 @@ local getpos, gethpos, getvpos function jobpositions.registerhandlers(t) getpos = t and t.getpos or function() return 0, 0 end - gethpos = t and t.gethpos or function() return 0 end - getvpos = t and t.getvpos or function() return 0 end + getrpos = t and t.getrpos or function() return 0, 0, 0 end + gethpos = t and t.gethpos or function() return 0 end + getvpos = t and t.getvpos or function() return 0 end end function jobpositions.getpos () return getpos () end +function jobpositions.getrpos() return getrpos() end function jobpositions.gethpos() return gethpos() end function jobpositions.getvpos() return getvpos() end diff --git a/tex/context/base/mkiv/back-out.lua b/tex/context/base/mkiv/back-out.lua index 9934f7847..5ea5aa048 100644 --- a/tex/context/base/mkiv/back-out.lua +++ b/tex/context/base/mkiv/back-out.lua @@ -181,7 +181,7 @@ local function latelua() return context(tonode(node)) end -function backends.latelua(current,pos_h,pos_v,cur_h,cur_v) +function backends.latelua(current,pos_h,pos_v) -- todo: pass pos_h and pos_v (more efficient in lmtx) local p = nodeproperties[current] if p then data = p.data diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 99f1c2d9c..703a0f1d8 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2019.08.14 11:26} +\newcontextversion{2019.08.17 11:46} %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/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 8694533e8..1f8e6a2e6 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.08.14 11:26} +\edef\contextversion{2019.08.17 11:46} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl index d6aaa9b2c..40198288a 100644 --- a/tex/context/base/mkiv/context.mkxl +++ b/tex/context/base/mkiv/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.08.14 11:26} +\edef\contextversion{2019.08.17 11:46} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/driv-shp.lua b/tex/context/base/mkiv/driv-shp.lua index b965b6c64..18f910225 100644 --- a/tex/context/base/mkiv/driv-shp.lua +++ b/tex/context/base/mkiv/driv-shp.lua @@ -157,8 +157,9 @@ local flushspecial -- make local function drivers.getpos () return round(pos_h), round(pos_v) end -function drivers.gethpos() return round(pos_h) end -function drivers.getvpos() return round(pos_v) end +function drivers.getrpos() return round(pos_h), round(pos_v), pos_r end +function drivers.gethpos() return round(pos_h) end +function drivers.getvpos() return round(pos_v) end -- characters @@ -404,8 +405,8 @@ local function reset_dir_stack() dirstack = setmetatableindex(dirstackentry) end -local function flushlatelua(current) - return backends.latelua(current) +local function flushlatelua(current,h,v) + return backends.latelua(current,h,v) end local function flushwriteout(current) @@ -799,7 +800,7 @@ local hlist_out, vlist_out do if subtype == literalwhatsit_code then flushliteral(current,pos_h,pos_v) elseif subtype == lateluawhatsit_code then - flushlatelua(current,pos_h,pos_v,cur_h,cur_v) + flushlatelua(current,pos_h,pos_v) elseif subtype == setmatrixwhatsit_code then flushsetmatrix(current,pos_h,pos_v) elseif subtype == savewhatsit_code then @@ -1045,7 +1046,7 @@ local hlist_out, vlist_out do if subtype == literalwhatsit_code then flushliteral(current,pos_h,pos_v) elseif subtype == lateluawhatsit_code then - flushlatelua(current,pos_h,pos_v,cur_h,cur_v) + flushlatelua(current,pos_h,pos_v) elseif subtype == setmatrixwhatsit_code then flushsetmatrix(current,pos_h,pos_v) elseif subtype == savewhatsit_code then diff --git a/tex/context/base/mkiv/font-osd.lua b/tex/context/base/mkiv/font-osd.lua index 203c1d79d..b97ac9c6f 100644 --- a/tex/context/base/mkiv/font-osd.lua +++ b/tex/context/base/mkiv/font-osd.lua @@ -1285,7 +1285,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) local cp = getprev(current) local cnsn = getnext(cns) setlink(cp,n) - setlink(cns,current) + setlink(cns,current) -- cns ? setlink(c,cnsn) if c == stop then stop = cp diff --git a/tex/context/base/mkiv/font-shp.lua b/tex/context/base/mkiv/font-shp.lua index 40a3e7018..fd59d689b 100644 --- a/tex/context/base/mkiv/font-shp.lua +++ b/tex/context/base/mkiv/font-shp.lua @@ -382,9 +382,7 @@ end) otf.loadoutlinedata = loadoutlinedata -- not public otf.loadstreamdata = loadstreamdata -- not public otf.loadshapes = loadshapes -otf.getstreamhash = getstreamhash -- not public, might move to other namespace - --- experimental code, for me only ... unsupported (todo: use %N) +otf.getstreamhash = getstreamhash -- not public, might move to other namespace local f_c = formatters["%F %F %F %F %F %F c"] local f_l = formatters["%F %F l"] diff --git a/tex/context/base/mkiv/lpdf-ano.lua b/tex/context/base/mkiv/lpdf-ano.lua index 49bf973c9..2a77732eb 100644 --- a/tex/context/base/mkiv/lpdf-ano.lua +++ b/tex/context/base/mkiv/lpdf-ano.lua @@ -18,7 +18,7 @@ local rep, format, find = string.rep, string.format, string.find local min = math.min local lpegmatch = lpeg.match local formatters = string.formatters -local sortedkeys = table.sortedkeys +local sortedkeys, concat = table.sortedkeys, table.concat local backends, lpdf = backends, lpdf @@ -93,7 +93,7 @@ local pdfrectangle = lpdf.rectangle -- todo: 3dview -local pdf_annot = pdfconstant("Annot") +----- pdf_annot = pdfconstant("Annot") local pdf_uri = pdfconstant("URI") local pdf_gotor = pdfconstant("GoToR") local pdf_goto = pdfconstant("GoTo") @@ -759,9 +759,11 @@ local nofspecial = 0 local share = true local f_annot = formatters["<< /Type /Annot %s /Rect [ %0.6F %0.6F %0.6F %0.6F ] >>"] +local f_quadp = formatters["<< /Type /Annot %s /QuadPoints [ %s ] /Rect [ %0.6F %0.6F %0.6F %0.6F ] >>"] directives.register("pdf.stripzeros",function() f_annot = formatters["<< /Type /Annot %s /Rect [ %0.6N %0.6N %0.6N %0.6N ] >>"] + f_quadp = formatters["<< /Type /Annot %s /QuadPoints [ %s ] /Rect [ %0.6N %0.6N %0.6N %0.6N ] >>"] end) directives.register("references.sharelinks", function(v) @@ -777,10 +779,41 @@ setmetatableindex(hashed,function(t,k) return v end) -local function finishreference(specification) -- %0.2f looks okay enough (no scaling anyway) - local annot = hashed[f_annot(specification.prerolled,pdfrectangle(specification.width,specification.height,specification.depth))] +local function toquadpoints(paths) + local t, n = { }, 0 + for i=1,#paths do + local path = paths[i] + local size = #path + for j=1,size do + local p = path[j] + n = n + 1 ; t[n] = p[1] + n = n + 1 ; t[n] = p[2] + end + local m = size % 4 + if m > 0 then + local p = path[size] + for j=size+1,m do + n = n + 1 ; t[n] = p[1] + n = n + 1 ; t[n] = p[2] + end + end + end + return concat(t," ") +end + +local function finishreference(specification) + local prerolled = specification.prerolled + local quadpoints = specification.mesh + local llx, lly, + urx, ury = pdfrectangle(specification.width,specification.height,specification.depth) + local specifier = nil + if quadpoints and #quadpoints > 0 then + specifier = f_quadp(prerolled,toquadpoints(quadpoints),llx,lly,urx,ury) + else + specifier = f_annot(prerolled,llx,lly,urx,ury) + end nofused = nofused + 1 - return pdfregisterannotation(annot) + return pdfregisterannotation(hashed[specifier]) end local function finishannotation(specification) @@ -799,7 +832,7 @@ local function finishannotation(specification) return pdfregisterannotation(objref) end -function nodeinjections.reference(width,height,depth,prerolled) +function nodeinjections.reference(width,height,depth,prerolled,mesh) if prerolled then if trace_references then report_references("link: width %p, height %p, depth %p, prerolled %a",width,height,depth,prerolled) @@ -810,6 +843,7 @@ function nodeinjections.reference(width,height,depth,prerolled) height = height, depth = depth, prerolled = prerolled, + mesh = mesh, } end end diff --git a/tex/context/base/mkiv/lpdf-fld.lua b/tex/context/base/mkiv/lpdf-fld.lua index 983be508f..e5a95fdab 100644 --- a/tex/context/base/mkiv/lpdf-fld.lua +++ b/tex/context/base/mkiv/lpdf-fld.lua @@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['lpdf-fld'] = { license = "see context related readme files" } +-- TURN OFF: preferences -> forms -> highlight -> etc + -- The problem with widgets is that so far each version of acrobat has some -- rendering problem. I tried to keep up with this but it makes no sense to do so as -- one cannot rely on the viewer not changing. Especially Btn fields are tricky as @@ -87,6 +89,7 @@ local pdfflushobject = lpdf.flushobject local pdfshareobjectreference = lpdf.shareobjectreference local pdfshareobject = lpdf.shareobject local pdfreserveobject = lpdf.reserveobject +local pdfpagereference = lpdf.pagereference local pdfaction = lpdf.action local pdfmajorversion = lpdf.majorversion @@ -911,8 +914,11 @@ end local collected = pdfarray() local forceencoding = false +-- todo : check #opt + local function finishfields() local sometext = forceencoding + local somefont = next(usedfonts) for name, field in sortedhash(fields) do local kids = field.kids if kids then @@ -943,15 +949,33 @@ local function finishfields() Fields = pdfreference(pdfflushobject(collected)), CO = fieldsetlist(calculationset), } - if sometext then + if sometext or somefont then checkpdfdocencoding() - usedfonts.tttf = fontnames.tt.tf - acroform.DA = "/tttf 12 Tf 0 g" + if sometext then + usedfonts.tttf = fontnames.tt.tf + acroform.DA = "/tttf 12 Tf 0 g" + end acroform.DR = pdfdictionary { Font = registerfonts(), Encoding = pdfdocencodingcapsule, } end + -- maybe: + -- if sometext then + -- checkpdfdocencoding() + -- if sometext then + -- usedfonts.tttf = fontnames.tt.tf + -- acroform.DA = "/tttf 12 Tf 0 g" + -- end + -- acroform.DR = pdfdictionary { + -- Font = registerfonts(), + -- Encoding = pdfdocencodingcapsule, + -- } + -- elseif somefont then + -- acroform.DR = pdfdictionary { + -- Font = registerfonts(), + -- } + -- end lpdf.addtocatalog("AcroForm",pdfreference(pdfflushobject(acroform))) end end @@ -1350,6 +1374,65 @@ local function makeradioparent(field,specification) save_parent(field,specification,d,true) end +-- local function makeradiochild(name,specification) +-- local field = clones[name] +-- local parent = nil +-- local pname = nil +-- if field then +-- pname = field.parent +-- field = radios[pname] +-- parent = fields[pname] +-- if not parent.pobj then +-- if trace_fields then +-- report_fields("forcing parent radio %a",parent.name) +-- end +-- makeradioparent(parent,parent) +-- end +-- else +-- field = radios[name] +-- if not field then +-- report_fields("there is some problem with field %a",name) +-- return nil +-- end +-- pname = field.parent +-- parent = fields[pname] +-- if not parent.pobj then +-- if trace_fields then +-- report_fields("using parent radio %a",name) +-- end +-- makeradioparent(parent,parent) +-- end +-- end +-- if trace_fields then +-- report_fields("using child radio %a with values %a and default %a",name,field.values,field.default) +-- end +-- local fontsymbol = specification.fontsymbol +-- -- fontsymbol = "circle" +-- local d = pdfdictionary { +-- Subtype = pdf_widget, +-- Parent = pdfreference(parent.pobj), +-- F = fieldplus(specification), +-- OC = fieldlayer(specification), +-- AA = fieldactions(specification), +-- H = pdf_n, +-- -- H = pdf_p, +-- -- P = pdfpagereference(true), +-- } +-- if fontsymbol and fontsymbol ~= "" then +-- specification.fontsymbol = todingbat(fontsymbol) +-- specification.fontstyle = "symbol" +-- specification.fontalternative = "dingbats" +-- d.DA = fieldsurrounding(specification) +-- d.MK = fieldrendering(specification) +-- return save_kid(parent,specification,d) -- todo: what if no value +-- else +-- local appearance, default, value = fieldstates_radio(field,name,fields[pname]) +-- d.AP = appearance +-- d.AS = default -- /Whatever +-- return save_kid(parent,specification,d,value) +-- end +-- end + local function makeradiochild(name,specification) local field, parent = clones[name], nil if field then @@ -1398,6 +1481,8 @@ local function makeradiochild(name,specification) local appearance, default, value = fieldstates_radio(field,name,fields[field.parent]) d.AP = appearance d.AS = default -- /Whatever +-- d.MK = pdfdictionary { BC = pdfarray {0}, BG = pdfarray { 1 } } +d.BS = pdfdictionary { S = pdfconstant("I"), W = 1 } return save_kid(parent,specification,d,value) end diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua index 4bb72be1f..19654a3d9 100644 --- a/tex/context/base/mkiv/lpdf-ini.lua +++ b/tex/context/base/mkiv/lpdf-ini.lua @@ -184,9 +184,11 @@ end local jobpositions = job.positions local getpos = jobpositions.getpos +local getrpos = jobpositions.getrpos jobpositions.registerhandlers { getpos = pdf.getpos, + -- getrpos = pdf.getrpos, gethpos = pdf.gethpos, getvpos = pdf.getvpos, } @@ -235,7 +237,7 @@ do -- funny values for tx and ty function lpdf.rectangle(width,height,depth,offset) - local tx, ty = getpos() + local tx, ty = getpos() -- pdfgetpos, maybe some day use dir here if offset then tx = tx - offset ty = ty + offset @@ -865,18 +867,21 @@ end local nofpages = 0 -function lpdf.pagereference(n) +local texgetcount = tex.getcount + +function lpdf.pagereference(n,complete) -- true | false | nil | n [true,false] if nofpages == 0 then nofpages = structures.pages.nofpages if nofpages == 0 then nofpages = 1 end end - if n > nofpages then - return pdfgetpagereference(nofpages) -- or 1, could be configureable - else - return pdfgetpagereference(n) + if n == true or not n then + complete = n + n = texgetcount("realpageno") end + local r = n > nofpages and pdfgetpagereference(nofpages) or pdfgetpagereference(n) + return complete and pdfreference(r) or r end function lpdf.nofpages() diff --git a/tex/context/base/mkiv/lpdf-lmt.lua b/tex/context/base/mkiv/lpdf-lmt.lua index d3dfecd7b..b1fcc2c78 100644 --- a/tex/context/base/mkiv/lpdf-lmt.lua +++ b/tex/context/base/mkiv/lpdf-lmt.lua @@ -1519,6 +1519,7 @@ end updaters.register("backend.update.pdf",function() job.positions.registerhandlers { getpos = drivers.getpos, + getrpos = drivers.getrpos, gethpos = drivers.gethpos, getvpos = drivers.getvpos, } diff --git a/tex/context/base/mkiv/mlib-lmt.lua b/tex/context/base/mkiv/mlib-lmt.lua index 774ddc8e5..9137861a5 100644 --- a/tex/context/base/mkiv/mlib-lmt.lua +++ b/tex/context/base/mkiv/mlib-lmt.lua @@ -6,7 +6,12 @@ if not modules then modules = { } end modules ['mlib-lmt'] = { license = "see context related readme files", } -local mppath = mp.path +local mppath = mp.path + +local scannumeric = mp.scan.numeric +local scanpath = mp.scan.path + +local getparameter = metapost.getparameter function mp.lmt_function_x(xmin,xmax,xstep,code,shape) -- experimental local code = "return function(x) return " .. code .. " end" @@ -46,3 +51,13 @@ function mp.lmt_function_x(xmin,xmax,xstep,code,shape) -- experimental end mppath(points,shape == "curve" and ".." or "--",false) end + +function mp.lmt_mesh_set() + local mesh = getparameter { "mesh", "paths" } + structures.references.currentset.mesh = mesh +end + +function mp.lmt_mesh_update() + local mesh = getparameter { "paths" } or getparameter { "mesh", "paths" } + mesh[scannumeric()] = scanpath(true) +end diff --git a/tex/context/base/mkiv/mlib-lua.lua b/tex/context/base/mkiv/mlib-lua.lua index 9d271de82..70792e426 100644 --- a/tex/context/base/mkiv/mlib-lua.lua +++ b/tex/context/base/mkiv/mlib-lua.lua @@ -170,11 +170,20 @@ do local f_integer = formatters["%i"] - local f_numeric = formatters["%n"] -- maybe %N - local f_pair = formatters["(%n,%n)"] - local f_ctrl = formatters["(%n,%n) .. controls (%n,%n) and (%n,%n)"] - local f_triplet = formatters["(%n,%n,%n)"] - local f_quadruple = formatters["(%n,%n,%n,%n)"] + -- no %n as that can produce -e notation and that is not so nice for scaled butmaybe we + -- should then switch between ... i.e. make a push/pop for the formatters here ... not now. + + -- local f_numeric = formatters["%n"] -- maybe %N + -- local f_pair = formatters["(%n,%n)"] + -- local f_ctrl = formatters["(%n,%n) .. controls (%n,%n) and (%n,%n)"] + -- local f_triplet = formatters["(%n,%n,%n)"] + -- local f_quadruple = formatters["(%n,%n,%n,%n)"] + + local f_numeric = formatters["%F"] + local f_pair = formatters["(%F,%F)"] + local f_ctrl = formatters["(%F,%F) .. controls (%F,%F) and (%F,%F)"] + local f_triplet = formatters["(%F,%F,%F)"] + local f_quadruple = formatters["(%F,%F,%F,%F)"] local f_points = formatters["%p"] local f_pair_pt = formatters["(%p,%p)"] @@ -192,25 +201,6 @@ do mp.cleaned = function(s) return lpegmatch(p,s) or s end - -- local function mpprint(...) -- we can optimize for n=1 - -- for i=1,select("#",...) do - -- local value = (select(i,...)) - -- if value ~= nil then - -- n = n + 1 - -- local t = type(value) - -- if t == "number" then - -- buffer[n] = f_numeric(value) - -- elseif t == "string" then - -- buffer[n] = value - -- elseif t == "table" then - -- buffer[n] = "(" .. concat(value,",") .. ")" - -- else -- boolean or whatever - -- buffer[n] = tostring(value) - -- end - -- end - -- end - -- end - local function mpp(value) n = n + 1 local t = type(value) diff --git a/tex/context/base/mkiv/mlib-scn.lua b/tex/context/base/mkiv/mlib-scn.lua index 6916f3f38..454f3e281 100644 --- a/tex/context/base/mkiv/mlib-scn.lua +++ b/tex/context/base/mkiv/mlib-scn.lua @@ -345,6 +345,8 @@ local function popparameters() end end +-- todo: + local function getparameter() local list, n = collectnames() local v = namespaces @@ -556,7 +558,6 @@ local function getparameteroption() return false end - metapost.registerscript("getparameters", getparameters) metapost.registerscript("applyparameters", applyparameters) metapost.registerscript("presetparameters", presetparameters) @@ -570,6 +571,20 @@ metapost.registerscript("getparameteroption", getparameteroption) metapost.registerscript("pushparameters", pushparameters) metapost.registerscript("popparameters", popparameters) +function metapost.getparameter(list) + local n = #list + local v = namespaces + for i=1,n do + local l = list[i] + local vl = v[l] + if vl == nil then + return + end + v = vl + end + return v +end + -- tex scanners local scanners = tokens.scanners diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index 1f0f91311..04044e2a9 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -229,6 +229,7 @@ return { "automatichyphenpenalty", "begincsname", "boundary", + "boxattr", "boxdirection", "boxorientation", "boxtotal", diff --git a/tex/context/base/mkiv/node-ref.lua b/tex/context/base/mkiv/node-ref.lua index 21fc4ce4d..6828fab0d 100644 --- a/tex/context/base/mkiv/node-ref.lua +++ b/tex/context/base/mkiv/node-ref.lua @@ -258,7 +258,7 @@ local function inject_range(head,first,last,reference,make,stack,parent,pardir,t local width, height, depth, line = dimensions(parent,first,last) if txtdir == righttoleft_code then width = - width - elseif textdir == lefttoright_code then + elseif txtdir == lefttoright_code then -- go on elseif pardir == righttoleft_code then width = - width @@ -374,6 +374,9 @@ end -- where we can end up with a first and last spanning lines so maybe -- we need to do vlists differently +-- todo: no need for dir here if we inject in the right spot as then we can +-- pick up the dir elsewhere (in lmtx) + local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,txtdir) -- main local first, last, firstdir, reference local current = head @@ -383,9 +386,6 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx local r = getattr(current,attribute) -- test \goto{test}[page(2)] test \gotobox{test}[page(2)] -- test \goto{\TeX}[page(2)] test \gotobox{\hbox {x} \hbox {x}}[page(2)] - -- if r and (not skip or r >) skip then -- maybe no > test - -- inject_list(id,current,r,make,stack,pardir,txtdir) - -- end if r then if not reference then reference, first, last, firstdir = r, current, current, txtdir @@ -447,182 +447,6 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx return head, pardir, txtdir end --- -- not faster either: --- --- local findattr = node.direct.find_attribute --- --- local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,txtdir) -- main --- local first, last, firstdir, reference --- local someatt = findattr(head,attribute) --- if someatt then --- local current = head --- while current do --- local id = getid(current) --- if id == hlist_code or id == vlist_code then --- local r = getattr(current,attribute) --- -- test \goto{test}[page(2)] test \gotobox{test}[page(2)] --- -- test \goto{\TeX}[page(2)] test \gotobox{\hbox {x} \hbox {x}}[page(2)] --- -- if r and (not skip or r >) skip then -- maybe no > test --- -- inject_list(id,current,r,make,stack,pardir,txtdir) --- -- end --- if r then --- if not reference then --- reference, first, last, firstdir = r, current, current, txtdir --- elseif r == reference then --- -- same link --- last = current --- elseif (done[reference] or 0) == 0 then --- if not skip or r > skip then -- maybe no > test --- head, current = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) --- reference, first, last, firstdir = nil, nil, nil, nil --- end --- else --- reference, first, last, firstdir = r, current, current, txtdir --- end --- done[r] = (done[r] or 0) + 1 --- end --- local list = getlist(current) --- if list then --- local h --- h, pardir, txtdir = inject_areas(list,attribute,make,stack,done,r or skip or 0,current,pardir,txtdir) --- if h ~= current then --- setlist(current,h) --- end --- end --- if r then --- done[r] = done[r] - 1 --- end --- elseif id == dir_code then --- local direction, pop = getdirection(current) --- txtdir = not pop and direction -- we might need a stack --- elseif id == localpar_code then -- only test at begin --- pardir = getdirection(current) --- elseif id == glue_code and getsubtype(current) == leftskip_code then -- any glue at the left? --- -- --- else --- local r = getattr(current,attribute) --- if not r then --- -- just go on, can be kerns --- elseif not reference then --- reference, first, last, firstdir = r, current, current, txtdir --- elseif r == reference then --- last = current --- elseif (done[reference] or 0) == 0 then -- or id == glue_code and getsubtype(current) == right_skip_code --- if not skip or r > skip then -- maybe no > test --- head, current = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) --- reference, first, last, firstdir = nil, nil, nil, nil --- end --- else --- reference, first, last, firstdir = r, current, current, txtdir --- end --- end --- current = getnext(current) --- end --- if reference and (done[reference] or 0) == 0 then --- head = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) --- end --- else --- local current = head --- while current do --- local id = getid(current) --- if id == hlist_code or id == vlist_code then --- local list = getlist(current) --- if list then --- local h = inject_areas(list,attribute,make,stack,done,skip or 0,current,pardir,txtdir) --- if h ~= current then --- setlist(current,h) --- end --- end --- elseif id == dir_code then --- local direction, pop = getdirection(current) --- txtdir = not pop and direction -- we might need a stack --- elseif id == localpar_code then -- only test at begin --- pardir = getdirection(current) --- end --- current = getnext(current) --- end --- end --- return head, pardir, txtdir --- end - --- -- maybe first check for glyphs and use a goto: --- --- local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,txtdir) -- main --- local first, last, firstdir, reference --- local current = head --- while current do --- local id = getid(current) --- local r -- else scope message due to goto --- if id == glyph_code then --- goto rest --- elseif id == hlist_code or id == vlist_code then --- r = getattr(current,attribute) --- -- test \goto{test}[page(2)] test \gotobox{test}[page(2)] --- -- test \goto{\TeX}[page(2)] test \gotobox{\hbox {x} \hbox {x}}[page(2)] --- -- if r and (not skip or r >) skip then -- maybe no > test --- -- inject_list(id,current,r,make,stack,pardir,txtdir) --- -- end --- if r then --- if not reference then --- reference, first, last, firstdir = r, current, current, txtdir --- elseif r == reference then --- -- same link --- last = current --- elseif (done[reference] or 0) == 0 then --- if not skip or r > skip then -- maybe no > test --- head, current = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) --- reference, first, last, firstdir = nil, nil, nil, nil --- end --- else --- reference, first, last, firstdir = r, current, current, txtdir --- end --- done[r] = (done[r] or 0) + 1 --- end --- local list = getlist(current) --- if list then --- local h --- h, pardir, txtdir = inject_areas(list,attribute,make,stack,done,r or skip or 0,current,pardir,txtdir) --- if h ~= current then --- setlist(current,h) --- end --- end --- if r then --- done[r] = done[r] - 1 --- end --- elseif id == glue_code and getsubtype(current) == leftskip_code then -- any glue at the left? --- -- --- elseif id == dir_code then --- local direction, pop = getdirection(current) --- txtdir = not pop and direction -- we might need a stack --- elseif id == localpar_code then -- only test at begin --- pardir = getdirection(current) --- end --- goto next --- ::rest:: --- r = getattr(current,attribute) --- if not r then --- -- just go on, can be kerns --- elseif not reference then --- reference, first, last, firstdir = r, current, current, txtdir --- elseif r == reference then --- last = current --- elseif (done[reference] or 0) == 0 then -- or id == glue_code and getsubtype(current) == right_skip_code --- if not skip or r > skip then -- maybe no > test --- head, current = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) --- reference, first, last, firstdir = nil, nil, nil, nil --- end --- else --- reference, first, last, firstdir = r, current, current, txtdir --- end --- ::next:: --- current = getnext(current) --- end --- if reference and (done[reference] or 0) == 0 then --- head = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) --- end --- return head, pardir, txtdir --- end - -- tracing: todo: use predefined colors local register_color = colors.register @@ -766,7 +590,7 @@ local function makereference(width,height,depth,reference) -- height and depth a if depth < dp then depth = dp end end -- logs.report("temp","used: ht=%p dp=%p",height,depth) - local annot = nodeinjections.reference(width,height,depth,set) + local annot = nodeinjections.reference(width,height,depth,set,resolved.mesh) if annot then annot = tonut(annot) -- todo nofreferences = nofreferences + 1 diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 3aeda1ce0..1eaa1b583 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex dd252229f..57b0bac47 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/strc-ren.mkiv b/tex/context/base/mkiv/strc-ren.mkiv index 0c9dc3ad5..59f3a9256 100644 --- a/tex/context/base/mkiv/strc-ren.mkiv +++ b/tex/context/base/mkiv/strc-ren.mkiv @@ -261,7 +261,7 @@ \d_strc_rendering_hang_height\htdp\b_strc_rendering_head \getnoflines\d_strc_rendering_hang_height \normalexpanded{\endgroup\n_strc_rendering_hang_lines\the\numexpr\noflines-\plusone\relax}% brrr - \setbox\b_strc_rendering_head\hbox{\lower\n_strc_rendering_hang_lines\d_strc_rendering_hang_height\box\b_strc_rendering_head}% + \setbox\b_strc_rendering_head\hpack{\lower\n_strc_rendering_hang_lines\d_strc_rendering_hang_height\box\b_strc_rendering_head}% \d_strc_rendering_hang_height\dimexpr\htdp\b_strc_rendering_head-\d_strc_rendering_local_height+\strutdp\relax \ht\b_strc_rendering_head\strutht \dp\b_strc_rendering_head\strutdp @@ -795,7 +795,7 @@ \advance\hsize-\wd\scratchboxone\relax \headtextcontent } - \hbox { + \hpack { \box\scratchboxone \hskip\headnumberdistance \box\scratchboxtwo @@ -824,7 +824,7 @@ \advance\hsize-\wd\scratchboxone\relax \headtextcontent } - \hbox { + \hpack { \box\scratchboxone \hskip\headnumberdistance \box\scratchboxtwo diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua index ad22302df..92e17b550 100644 --- a/tex/context/base/mkiv/util-str.lua +++ b/tex/context/base/mkiv/util-str.lua @@ -908,7 +908,7 @@ local format_L = function() return format("(a%s and 'TRUE' or 'FALSE')",n) end -local format_n = function() -- strips leading and trailing zeros and removes .0 +local format_n = function() -- strips leading and trailing zeros and removes .0, beware: can produce e notation n = n + 1 return format("((a%s %% 1 == 0) and format('%%i',a%s) or tostring(a%s))",n,n,n) end diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 9c6b51114..613e7b795 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 6176d9f3a..1207e9f04 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/context/modules/common/s-abbreviations-logos.tex b/tex/context/modules/common/s-abbreviations-logos.tex index 5d8735b5d..f10f42a16 100644 --- a/tex/context/modules/common/s-abbreviations-logos.tex +++ b/tex/context/modules/common/s-abbreviations-logos.tex @@ -70,6 +70,7 @@ \logo [CPLUSPLUS] {C\high{++}} \logo [CPU] {cpu} \logo [CSS] {css} +\logo [CSV] {csv} \logo [CTAN] {ctan} \logo [CTXTOOLS] {ctxtools} \logo [CWEB] {cweb} diff --git a/tex/context/modules/mkiv/x-asciimath.lua b/tex/context/modules/mkiv/x-asciimath.lua index 6a4755483..23f907d95 100644 --- a/tex/context/modules/mkiv/x-asciimath.lua +++ b/tex/context/modules/mkiv/x-asciimath.lua @@ -776,6 +776,7 @@ local isunary = { -- can be taken from reserved ["\\widehat"] = true, -- widehat ["\\bar"] = true, -- ["\\overbar"] = true, -- + ["\\overline"] = true, -- ["\\underline"] = true, -- ["\\vec"] = true, -- overrightarrow ["\\overrightarrow"] = true, -- overrightarrow diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index e64be4310..f91a0d110 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 08/14/19 11:26:57 +-- merge date : 08/17/19 11:46:05 do -- begin closure to overcome local limits and interference @@ -30708,7 +30708,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces) local cp=getprev(current) local cnsn=getnext(cns) setlink(cp,n) - setlink(cns,current) + setlink(cns,current) setlink(c,cnsn) if c==stop then stop=cp |