summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-09-24 15:05:48 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-09-24 15:05:48 +0200
commitb7acaab4eb5fb8d6e3a6aa86a86c2b0576bde6ea (patch)
tree2a98bf1dfed3e2c7ef389acaddb655811d1fba33 /tex
parent7c2efd42267783f01b64e0a47cba89f84742618c (diff)
downloadcontext-b7acaab4eb5fb8d6e3a6aa86a86c2b0576bde6ea.tar.gz
2018-09-24 14:19:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/font-onr.lua1
-rw-r--r--tex/context/base/mkiv/font-shp.lua8
-rw-r--r--tex/context/base/mkiv/grph-epd.lua7
-rw-r--r--tex/context/base/mkiv/lpdf-epa.lua544
-rw-r--r--tex/context/base/mkiv/mult-fun.lua3
-rw-r--r--tex/context/base/mkiv/scrn-but.mkvi19
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin26346 -> 26130 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin269465 -> 268392 bytes
-rw-r--r--tex/context/base/mkiv/strc-sec.mkiv1
-rw-r--r--tex/context/base/mkiv/strc-tag.lua1
-rw-r--r--tex/context/base/mkiv/syst-ini.mkiv6
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin857468 -> 857002 bytes
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin61224 -> 60771 bytes
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
18 files changed, 302 insertions, 298 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index a606a45ff..638a86e4d 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{2018.09.21 19:52}
+\newcontextversion{2018.09.24 14:11}
%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 6c18b8bac..5a159dea6 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{2018.09.21 19:52}
+\edef\contextversion{2018.09.24 14:11}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index b764c4f9a..f5e111f99 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2018.09.21 19:52}
+\newcontextversion{2018.09.24 14: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/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 3bdca2bef..17a8896c3 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -42,7 +42,7 @@
%D has to match \type {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2018.09.21 19:52}
+\edef\contextversion{2018.09.24 14:11}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/font-onr.lua b/tex/context/base/mkiv/font-onr.lua
index 26a782649..7c806c692 100644
--- a/tex/context/base/mkiv/font-onr.lua
+++ b/tex/context/base/mkiv/font-onr.lua
@@ -200,6 +200,7 @@ do
binary = decrypt(binary,55665,4)
local names = { }
+
local encoding = lpegmatch(p_filterencoding,ascii)
local glyphs = { }
diff --git a/tex/context/base/mkiv/font-shp.lua b/tex/context/base/mkiv/font-shp.lua
index 6c3112b25..31971b880 100644
--- a/tex/context/base/mkiv/font-shp.lua
+++ b/tex/context/base/mkiv/font-shp.lua
@@ -296,6 +296,12 @@ local f_c = formatters["%F %F %F %F %F %F c"]
local f_l = formatters["%F %F l"]
local f_m = formatters["%F %F m"]
+directives.register("pdf.stripzeros",function()
+ f_c = formatters["%N %N %N %N %N %N c"]
+ f_l = formatters["%N %N l"]
+ f_m = formatters["%N %N m"]
+end)
+
local function segmentstopdf(segments,factor,bt,et)
local t = { }
local m = 0
@@ -382,7 +388,7 @@ otf.features.register {
}
}
--- In the end it is easier to just provide the new charstring (cff) and points (ttdf). First
+-- In the end it is easier to just provide the new charstring (cff) and points (ttf). First
-- of all we already have the right information so there is no need to patch the already complex
-- backend code (we only need to make sure the cff is valid). Also, I prototyped support for
-- these fonts using (converted to) normal postscript shapes, a functionality that was already
diff --git a/tex/context/base/mkiv/grph-epd.lua b/tex/context/base/mkiv/grph-epd.lua
index a136108c8..f8fa62953 100644
--- a/tex/context/base/mkiv/grph-epd.lua
+++ b/tex/context/base/mkiv/grph-epd.lua
@@ -16,17 +16,18 @@ local report = logs.reporter("backend","merging")
local function mergegoodies(optionlist)
local options = settings_to_hash(optionlist)
- local all = options[variables.all] or options[variables.yes]
+ local yes = options[variables.yes]
+ local all = options[variables.all]
if next(options) then
report("% t",table.sortedkeys(options))
end
- if all or options[variables.reference] then
+ if all or yes or options[variables.reference] then
codeinjections.mergereferences()
end
if all or options[variables.comment] then
codeinjections.mergecomments()
end
- if all or options[variables.bookmark] then
+ if all or yes or options[variables.bookmark] then
codeinjections.mergebookmarks()
end
if all or options[variables.field] then
diff --git a/tex/context/base/mkiv/lpdf-epa.lua b/tex/context/base/mkiv/lpdf-epa.lua
index 9f1dc0611..9c4444181 100644
--- a/tex/context/base/mkiv/lpdf-epa.lua
+++ b/tex/context/base/mkiv/lpdf-epa.lua
@@ -541,154 +541,154 @@ end
-- testing we end up with less code that we started with.
function codeinjections.mergecomments(specification)
- -- local specification, fullname, document = validdocument(specification)
- -- if not document then
- -- return ""
- -- end
- -- local pagenumber = specification.page or 1
- -- local pagedata = document.pages[pagenumber]
- -- local annotations = pagedata and pagedata.Annots
- -- if annotations and #annotations > 0 then
- -- local llx, lly, urx, ury, width, height, xscale, yscale = getmediasize(specification,pagedata,xscale,yscale)
- -- initializelayer(height,width)
- -- --
- -- local lockflags = specification.lock -- todo: proper parameter
- -- local references = { }
- -- local usedpopups = { }
- -- for i=1,#annotations do
- -- local annotation = annotations[i]
- -- if annotation then
- -- local subtype = annotation.Subtype
- -- if commentlike[subtype] then
- -- references[annotation] = pdfreserveobject()
- -- local p = annotation.Popup
- -- if p then
- -- usedpopups[p] = true
- -- end
- -- end
- -- end
- -- end
- -- --
- -- for i=1,#annotations do
- -- -- we keep the order
- -- local annotation = annotations[i]
- -- if annotation then
- -- local reference = references[annotation]
- -- if reference then
- -- local subtype = annotation.Subtype
- -- local kind = commentlike[subtype]
- -- if kind ~= "popup" or usedpopups[annotation] then
- -- local x, y, w, h, a_llx, a_lly, a_urx, a_ury = getdimensions(annotation,llx,lly,xscale,yscale,width,height,report_comment)
- -- if x then
- -- local voffset = h
- -- local dictionary = pdfdictionary {
- -- Subtype = pdfconstant (subtype),
- -- -- common (skipped: P AP AS OC AF BM StructParent)
- -- Contents = pdfcopyunicode(annotation.Contents),
- -- NM = pdfcopystring (annotation.NM),
- -- M = pdfcopystring (annotation.M),
- -- F = copyF (annotation.F,lockflags),
- -- C = copyC (annotation.C),
- -- ca = pdfcopynumber (annotation.ca),
- -- CA = pdfcopynumber (annotation.CA),
- -- Lang = pdfcopystring (annotation.Lang),
- -- -- also common
- -- CreationDate = pdfcopystring (annotation.CreationDate),
- -- T = pdfcopyunicode(annotation.T),
- -- Subj = pdfcopyunicode(annotation.Subj),
- -- -- border
- -- Border = pdfcopyarray (annotation.Border),
- -- BS = copyBS (annotation.BS),
- -- BE = copyBE (annotation.BE),
- -- -- sort of common
- -- Popup = copyPopup (annotation.Popup,references),
- -- RC = pdfcopyunicode(annotation.RC) -- string or stream
- -- }
- -- if kind == "markup" then
- -- dictionary.IRT = copyIRT (annotation.IRT,references)
- -- dictionary.RT = pdfconstant (annotation.RT)
- -- dictionary.IT = pdfcopyconstant (annotation.IT)
- -- dictionary.QuadPoints = pdfcopyarray (annotation.QuadPoints)
- -- -- dictionary.RD = pdfcopyarray (annotation.RD)
- -- elseif kind == "text" then
- -- -- somehow F fails to view : /F 24 : bit4=nozoom bit5=norotate
- -- dictionary.F = nil
- -- dictionary.Open = pdfcopyboolean (annotation.Open)
- -- dictionary.Name = pdfcopyunicode (annotation.Name)
- -- dictionary.State = pdfcopystring (annotation.State)
- -- dictionary.StateModel = pdfcopystring (annotation.StateModel)
- -- dictionary.IT = pdfcopyconstant (annotation.IT)
- -- dictionary.QuadPoints = pdfcopyarray (annotation.QuadPoints)
- -- dictionary.RD = pdfcopyarray (annotation.RD) -- caret
- -- dictionary.Sy = pdfcopyconstant (annotation.Sy) -- caret
- -- voffset = 0
- -- elseif kind == "freetext" then
- -- dictionary.DA = pdfcopystring (annotation.DA)
- -- dictionary.Q = pdfcopyinteger (annotation.Q)
- -- dictionary.DS = pdfcopystring (annotation.DS)
- -- dictionary.CL = pdfcopyarray (annotation.CL)
- -- dictionary.IT = pdfcopyconstant (annotation.IT)
- -- dictionary.LE = pdfcopyconstant (annotation.LE)
- -- -- dictionary.RC = pdfcopystring (annotation.RC)
- -- elseif kind == "line" then
- -- dictionary.LE = pdfcopyarray (annotation.LE)
- -- dictionary.IC = pdfcopyarray (annotation.IC)
- -- dictionary.LL = pdfcopynumber (annotation.LL)
- -- dictionary.LLE = pdfcopynumber (annotation.LLE)
- -- dictionary.Cap = pdfcopyboolean (annotation.Cap)
- -- dictionary.IT = pdfcopyconstant (annotation.IT)
- -- dictionary.LLO = pdfcopynumber (annotation.LLO)
- -- dictionary.CP = pdfcopyconstant (annotation.CP)
- -- dictionary.Measure = pdfcopydictionary(annotation.Measure) -- names
- -- dictionary.CO = pdfcopyarray (annotation.CO)
- -- voffset = 0
- -- elseif kind == "shape" then
- -- dictionary.IC = pdfcopyarray (annotation.IC)
- -- -- dictionary.RD = pdfcopyarray (annotation.RD)
- -- voffset = 0
- -- elseif kind == "stamp" then
- -- local name, appearance = validStamp(annotation.Name)
- -- dictionary.Name = name
- -- dictionary.AP = appearance
- -- voffset = 0
- -- elseif kind == "ink" then
- -- dictionary.InkList = pdfcopyarray (annotation.InkList)
- -- elseif kind == "poly" then
- -- dictionary.Vertices = pdfcopyarray (annotation.Vertices)
- -- -- dictionary.LE = pdfcopyarray (annotation.LE) -- todo: names in array
- -- dictionary.IC = pdfcopyarray (annotation.IC)
- -- dictionary.IT = pdfcopyconstant (annotation.IT)
- -- dictionary.Measure = pdfcopydictionary(annotation.Measure)
- -- dictionary.Path = pdfcopyarray (annotation.Path)
- -- -- dictionary.RD = pdfcopyarray (annotation.RD)
- -- elseif kind == "popup" then
- -- dictionary.Open = pdfcopyboolean (annotation.Open)
- -- dictionary.Parent = copyParent (annotation.Parent,references)
- -- voffset = 0
- -- end
- -- if dictionary then
- -- local locationspec = {
- -- x = x .. "bp",
- -- y = y .. "bp",
- -- voffset = voffset .. "bp",
- -- preset = "leftbottom",
- -- }
- -- local finalize = finalizer(dictionary,xscale,yscale,a_llx,a_ury)
- -- context.setlayer(layerspec,locationspec,function()
- -- context(hpack_node(nodeinjections.annotation(w/bpfactor,h/bpfactor,0,finalize,reference)))
- -- end)
- -- end
- -- end
- -- else
- -- -- report_comment("skipping annotation, index %a",i)
- -- end
- -- end
- -- elseif trace_comments then
- -- report_comment("broken annotation, index %a",i)
- -- end
- -- end
- -- end
- -- return namespace
+ local specification, fullname, document = validdocument(specification)
+ if not document then
+ return ""
+ end
+ local pagenumber = specification.page or 1
+ local pagedata = document.pages[pagenumber]
+ local annotations = pagedata and pagedata.Annots
+ if annotations and #annotations > 0 then
+ local llx, lly, urx, ury, width, height, xscale, yscale = getmediasize(specification,pagedata,xscale,yscale)
+ initializelayer(height,width)
+ --
+ local lockflags = specification.lock -- todo: proper parameter
+ local references = { }
+ local usedpopups = { }
+ for i=1,#annotations do
+ local annotation = annotations[i]
+ if annotation then
+ local subtype = annotation.Subtype
+ if commentlike[subtype] then
+ references[annotation] = pdfreserveobject()
+ local p = annotation.Popup
+ if p then
+ usedpopups[p] = true
+ end
+ end
+ end
+ end
+ --
+ for i=1,#annotations do
+ -- we keep the order
+ local annotation = annotations[i]
+ if annotation then
+ local reference = references[annotation]
+ if reference then
+ local subtype = annotation.Subtype
+ local kind = commentlike[subtype]
+ if kind ~= "popup" or usedpopups[annotation] then
+ local x, y, w, h, a_llx, a_lly, a_urx, a_ury = getdimensions(annotation,llx,lly,xscale,yscale,width,height,report_comment)
+ if x then
+ local voffset = h
+ local dictionary = pdfdictionary {
+ Subtype = pdfconstant (subtype),
+ -- common (skipped: P AP AS OC AF BM StructParent)
+ Contents = pdfcopyunicode(annotation.Contents),
+ NM = pdfcopystring (annotation.NM),
+ M = pdfcopystring (annotation.M),
+ F = copyF (annotation.F,lockflags),
+ C = copyC (annotation.C),
+ ca = pdfcopynumber (annotation.ca),
+ CA = pdfcopynumber (annotation.CA),
+ Lang = pdfcopystring (annotation.Lang),
+ -- also common
+ CreationDate = pdfcopystring (annotation.CreationDate),
+ T = pdfcopyunicode(annotation.T),
+ Subj = pdfcopyunicode(annotation.Subj),
+ -- border
+ Border = pdfcopyarray (annotation.Border),
+ BS = copyBS (annotation.BS),
+ BE = copyBE (annotation.BE),
+ -- sort of common
+ Popup = copyPopup (annotation.Popup,references),
+ RC = pdfcopyunicode(annotation.RC) -- string or stream
+ }
+ if kind == "markup" then
+ dictionary.IRT = copyIRT (annotation.IRT,references)
+ dictionary.RT = pdfconstant (annotation.RT)
+ dictionary.IT = pdfcopyconstant (annotation.IT)
+ dictionary.QuadPoints = pdfcopyarray (annotation.QuadPoints)
+ -- dictionary.RD = pdfcopyarray (annotation.RD)
+ elseif kind == "text" then
+ -- somehow F fails to view : /F 24 : bit4=nozoom bit5=norotate
+ dictionary.F = nil
+ dictionary.Open = pdfcopyboolean (annotation.Open)
+ dictionary.Name = pdfcopyunicode (annotation.Name)
+ dictionary.State = pdfcopystring (annotation.State)
+ dictionary.StateModel = pdfcopystring (annotation.StateModel)
+ dictionary.IT = pdfcopyconstant (annotation.IT)
+ dictionary.QuadPoints = pdfcopyarray (annotation.QuadPoints)
+ dictionary.RD = pdfcopyarray (annotation.RD) -- caret
+ dictionary.Sy = pdfcopyconstant (annotation.Sy) -- caret
+ voffset = 0
+ elseif kind == "freetext" then
+ dictionary.DA = pdfcopystring (annotation.DA)
+ dictionary.Q = pdfcopyinteger (annotation.Q)
+ dictionary.DS = pdfcopystring (annotation.DS)
+ dictionary.CL = pdfcopyarray (annotation.CL)
+ dictionary.IT = pdfcopyconstant (annotation.IT)
+ dictionary.LE = pdfcopyconstant (annotation.LE)
+ -- dictionary.RC = pdfcopystring (annotation.RC)
+ elseif kind == "line" then
+ dictionary.LE = pdfcopyarray (annotation.LE)
+ dictionary.IC = pdfcopyarray (annotation.IC)
+ dictionary.LL = pdfcopynumber (annotation.LL)
+ dictionary.LLE = pdfcopynumber (annotation.LLE)
+ dictionary.Cap = pdfcopyboolean (annotation.Cap)
+ dictionary.IT = pdfcopyconstant (annotation.IT)
+ dictionary.LLO = pdfcopynumber (annotation.LLO)
+ dictionary.CP = pdfcopyconstant (annotation.CP)
+ dictionary.Measure = pdfcopydictionary(annotation.Measure) -- names
+ dictionary.CO = pdfcopyarray (annotation.CO)
+ voffset = 0
+ elseif kind == "shape" then
+ dictionary.IC = pdfcopyarray (annotation.IC)
+ -- dictionary.RD = pdfcopyarray (annotation.RD)
+ voffset = 0
+ elseif kind == "stamp" then
+ local name, appearance = validStamp(annotation.Name)
+ dictionary.Name = name
+ dictionary.AP = appearance
+ voffset = 0
+ elseif kind == "ink" then
+ dictionary.InkList = pdfcopyarray (annotation.InkList)
+ elseif kind == "poly" then
+ dictionary.Vertices = pdfcopyarray (annotation.Vertices)
+ -- dictionary.LE = pdfcopyarray (annotation.LE) -- todo: names in array
+ dictionary.IC = pdfcopyarray (annotation.IC)
+ dictionary.IT = pdfcopyconstant (annotation.IT)
+ dictionary.Measure = pdfcopydictionary(annotation.Measure)
+ dictionary.Path = pdfcopyarray (annotation.Path)
+ -- dictionary.RD = pdfcopyarray (annotation.RD)
+ elseif kind == "popup" then
+ dictionary.Open = pdfcopyboolean (annotation.Open)
+ dictionary.Parent = copyParent (annotation.Parent,references)
+ voffset = 0
+ end
+ if dictionary then
+ local locationspec = {
+ x = x .. "bp",
+ y = y .. "bp",
+ voffset = voffset .. "bp",
+ preset = "leftbottom",
+ }
+ local finalize = finalizer(dictionary,xscale,yscale,a_llx,a_ury)
+ context.setlayer(layerspec,locationspec,function()
+ context(hpack_node(nodeinjections.annotation(w/bpfactor,h/bpfactor,0,finalize,reference)))
+ end)
+ end
+ end
+ else
+ -- report_comment("skipping annotation, index %a",i)
+ end
+ end
+ elseif trace_comments then
+ report_comment("broken annotation, index %a",i)
+ end
+ end
+ end
+ return namespace
end
local widgetflags = lpdf.flags.widgets
@@ -725,130 +725,130 @@ end
-- Q : quadding (0=left 1=middle 2=right)
function codeinjections.mergefields(specification)
- -- local specification, fullname, document = validdocument(specification)
- -- if not document then
- -- return ""
- -- end
- -- local pagenumber = specification.page or 1
- -- local pagedata = document.pages[pagenumber]
- -- local annotations = pagedata and pagedata.Annots
- -- if annotations and #annotations > 0 then
- -- local llx, lly, urx, ury, width, height, xscale, yscale = getmediasize(specification,pagedata,xscale,yscale)
- -- initializelayer(height,width)
- -- --
- -- for i=1,#annotations do
- -- -- we keep the order
- -- local annotation = annotations[i]
- -- if annotation then
- -- local subtype = annotation.Subtype
- -- if subtype == "Widget" then
- -- local parent = annotation.Parent or { }
- -- local name = annotation.T or parent.T
- -- local what = annotation.FT or parent.FT
- -- if name and what then
- -- local x, y, w, h, a_llx, a_lly, a_urx, a_ury = getdimensions(annotation,llx,lly,xscale,yscale,width,height,report_field)
- -- if x then
- -- x = x .. "bp"
- -- y = y .. "bp"
- -- local W, H = w, h
- -- w = w .. "bp"
- -- h = h .. "bp"
- -- if trace_fields then
- -- report_field("field %a, type %a, dx %s, dy %s, wd %s, ht %s",name,what,x,y,w,h)
- -- end
- -- local locationspec = {
- -- x = x,
- -- y = y,
- -- preset = "leftbottom",
- -- }
- -- --
- -- local aflags = flagstoset(annotation.F or parent.F, annotationflags)
- -- local wflags = flagstoset(annotation.Ff or parent.Ff, widgetflags)
- -- if what == "Tx" then
- -- -- DA DV F FT MaxLen MK Q T V | AA OC
- -- if wflags.MultiLine then
- -- wflags.MultiLine = nil
- -- what = "text"
- -- else
- -- what = "line"
- -- end
- -- -- via context
- -- local fieldspec = {
- -- width = w,
- -- height = h,
- -- offset = variables.overlay,
- -- frame = trace_links and variables.on or variables.off,
- -- n = annotation.MaxLen or (parent and parent.MaxLen),
- -- type = what,
- -- option = concat(merged(aflags,wflags),","),
- -- }
- -- context.setlayer (layerspec,locationspec,function()
- -- context.definefieldbody ( { name } , fieldspec )
- -- context.fieldbody ( { name } )
- -- end)
- -- --
- -- elseif what == "Btn" then
- -- if wflags.Radio or wflags.RadiosInUnison then
- -- -- AP AS DA F Ff FT H MK T V | AA OC
- -- wflags.Radio = nil
- -- wflags.RadiosInUnison = nil
- -- what = "radio"
- -- elseif wflags.PushButton then
- -- -- AP DA F Ff FT H MK T | AA OC
- -- --
- -- -- Push buttons only have an appearance and some associated
- -- -- actions so they are not worth copying.
- -- --
- -- wflags.PushButton = nil
- -- what = "push"
- -- else
- -- -- AP AS DA F Ff FT H MK T V | OC AA
- -- what = "check"
- -- -- direct
- -- local AP = annotation.AP or (parent and parent.AP)
- -- if AP then
- -- local im = img.new { filename = fullname }
- -- AP = img.immediatewriteobject(im,document.__xrefs__[AP])
- -- end
- -- local dictionary = pdfdictionary {
- -- Subtype = pdfconstant("Widget"),
- -- FT = pdfconstant("Btn"),
- -- T = pdfcopyunicode(annotation.T or parent.T),
- -- F = pdfcopyinteger(annotation.F or parent.F),
- -- Ff = pdfcopyinteger(annotation.Ff or parent.Ff),
- -- AS = pdfcopyconstant(annotation.AS or (parent and parent.AS)),
- -- AP = AP and pdfreference(AP),
- -- }
- -- local finalize = dictionary()
- -- context.setlayer(layerspec,locationspec,function()
- -- context(hpack_node(nodeinjections.annotation(W/bpfactor,H/bpfactor,0,finalize)))
- -- end)
- -- --
- -- end
- -- elseif what == "Ch" then
- -- -- F Ff FT Opt T | AA OC (rest follows)
- -- if wflags.PopUp then
- -- wflags.PopUp = nil
- -- if wflags.Edit then
- -- wflags.Edit = nil
- -- what = "combo"
- -- else
- -- what = "popup"
- -- end
- -- else
- -- what = "choice"
- -- end
- -- elseif what == "Sig" then
- -- what = "signature"
- -- else
- -- what = nil
- -- end
- -- end
- -- end
- -- end
- -- end
- -- end
- -- end
+ local specification, fullname, document = validdocument(specification)
+ if not document then
+ return ""
+ end
+ local pagenumber = specification.page or 1
+ local pagedata = document.pages[pagenumber]
+ local annotations = pagedata and pagedata.Annots
+ if annotations and #annotations > 0 then
+ local llx, lly, urx, ury, width, height, xscale, yscale = getmediasize(specification,pagedata,xscale,yscale)
+ initializelayer(height,width)
+ --
+ for i=1,#annotations do
+ -- we keep the order
+ local annotation = annotations[i]
+ if annotation then
+ local subtype = annotation.Subtype
+ if subtype == "Widget" then
+ local parent = annotation.Parent or { }
+ local name = annotation.T or parent.T
+ local what = annotation.FT or parent.FT
+ if name and what then
+ local x, y, w, h, a_llx, a_lly, a_urx, a_ury = getdimensions(annotation,llx,lly,xscale,yscale,width,height,report_field)
+ if x then
+ x = x .. "bp"
+ y = y .. "bp"
+ local W, H = w, h
+ w = w .. "bp"
+ h = h .. "bp"
+ if trace_fields then
+ report_field("field %a, type %a, dx %s, dy %s, wd %s, ht %s",name,what,x,y,w,h)
+ end
+ local locationspec = {
+ x = x,
+ y = y,
+ preset = "leftbottom",
+ }
+ --
+ local aflags = flagstoset(annotation.F or parent.F, annotationflags)
+ local wflags = flagstoset(annotation.Ff or parent.Ff, widgetflags)
+ if what == "Tx" then
+ -- DA DV F FT MaxLen MK Q T V | AA OC
+ if wflags.MultiLine then
+ wflags.MultiLine = nil
+ what = "text"
+ else
+ what = "line"
+ end
+ -- via context
+ local fieldspec = {
+ width = w,
+ height = h,
+ offset = variables.overlay,
+ frame = trace_links and variables.on or variables.off,
+ n = annotation.MaxLen or (parent and parent.MaxLen),
+ type = what,
+ option = concat(merged(aflags,wflags),","),
+ }
+ context.setlayer (layerspec,locationspec,function()
+ context.definefieldbody ( { name } , fieldspec )
+ context.fieldbody ( { name } )
+ end)
+ --
+ elseif what == "Btn" then
+ if wflags.Radio or wflags.RadiosInUnison then
+ -- AP AS DA F Ff FT H MK T V | AA OC
+ wflags.Radio = nil
+ wflags.RadiosInUnison = nil
+ what = "radio"
+ elseif wflags.PushButton then
+ -- AP DA F Ff FT H MK T | AA OC
+ --
+ -- Push buttons only have an appearance and some associated
+ -- actions so they are not worth copying.
+ --
+ wflags.PushButton = nil
+ what = "push"
+ else
+ -- AP AS DA F Ff FT H MK T V | OC AA
+ what = "check"
+ -- direct
+ local AP = annotation.AP or (parent and parent.AP)
+ if AP then
+ local im = img.new { filename = fullname }
+ AP = img.immediatewriteobject(im,document.__xrefs__[AP])
+ end
+ local dictionary = pdfdictionary {
+ Subtype = pdfconstant("Widget"),
+ FT = pdfconstant("Btn"),
+ T = pdfcopyunicode(annotation.T or parent.T),
+ F = pdfcopyinteger(annotation.F or parent.F),
+ Ff = pdfcopyinteger(annotation.Ff or parent.Ff),
+ AS = pdfcopyconstant(annotation.AS or (parent and parent.AS)),
+ AP = AP and pdfreference(AP),
+ }
+ local finalize = dictionary()
+ context.setlayer(layerspec,locationspec,function()
+ context(hpack_node(nodeinjections.annotation(W/bpfactor,H/bpfactor,0,finalize)))
+ end)
+ --
+ end
+ elseif what == "Ch" then
+ -- F Ff FT Opt T | AA OC (rest follows)
+ if wflags.PopUp then
+ wflags.PopUp = nil
+ if wflags.Edit then
+ wflags.Edit = nil
+ what = "combo"
+ else
+ what = "popup"
+ end
+ else
+ what = "choice"
+ end
+ elseif what == "Sig" then
+ what = "signature"
+ else
+ what = nil
+ end
+ end
+ end
+ end
+ end
+ end
+ end
end
-- Beware, bookmarks can be in pdfdoc encoding or in unicode. However, in mkiv we
diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua
index 7826342d3..8464e30ca 100644
--- a/tex/context/base/mkiv/mult-fun.lua
+++ b/tex/context/base/mkiv/mult-fun.lua
@@ -59,7 +59,8 @@ return {
"inverted", "uncolored", "softened", "grayed", "greyed",
"onlayer",
"along",
- "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", -- "lua",
+ "graphictext", "loadfigure", "externalfigure", "figure", "register",
+ "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath",
"checkedbounds", "checkbounds", "strut", "rule",
"withmask", "bitmapimage",
"colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist",
diff --git a/tex/context/base/mkiv/scrn-but.mkvi b/tex/context/base/mkiv/scrn-but.mkvi
index 8bbd6eeda..87af29cfb 100644
--- a/tex/context/base/mkiv/scrn-but.mkvi
+++ b/tex/context/base/mkiv/scrn-but.mkvi
@@ -11,20 +11,16 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% \restorestandardblank
-% better namespace for pos
-
\writestatus{loading}{ConTeXt Screen Macros / Buttons}
\registerctxluafile{scrn-but}{}
\unprotect
-%D Buttons are just what their names says: things that can be
-%D clicked (pushed) on. They are similar to \type{\goto},
-%D except that the text argument is not interpreted.
-%D Furthermore one can apply anything to them that can be done
-%D with \type{\framed}.
+%D Buttons are just what their names says: things that can be clicked (pushed) on.
+%D They are similar to \type{\goto}, except that the text argument is not
+%D interpreted. Furthermore one can apply anything to them that can be done with
+%D \type {\framed}.
%D
%D \startbuffer
%D \button[width=3cm,height=1.5cm]{Exit}[ExitViewer]
@@ -119,8 +115,8 @@
%D \overlaybutton[reference]
%D \stoptyping
%D
-%D This command can be used to define overlays an/or can be
-%D used in the whatevertext areas, like:
+%D This command can be used to define overlays an/or can be used in the whatevertext
+%D areas, like:
%D
%D \starttyping
%D \defineoverlay[PrevPage][\overlaybutton{PrevPage}]
@@ -128,8 +124,7 @@
%D \setuptexttexts[\overlaybutton{NextPage}]
%D \stoptyping
%D
-%D For practical reasons, this macro accepts square brackets
-%D as well as braces.
+%D For practical reasons, this macro accepts square brackets as well as braces.
\unexpanded\def\overlaybutton
{\dosingleempty\scrn_button_overlay}
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index c407fddcb..02dca1b86 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 14b339771..a557efdd7 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/strc-sec.mkiv b/tex/context/base/mkiv/strc-sec.mkiv
index e00ee24d0..637db03f4 100644
--- a/tex/context/base/mkiv/strc-sec.mkiv
+++ b/tex/context/base/mkiv/strc-sec.mkiv
@@ -35,6 +35,7 @@
\c!label=,
\c!coupling=,
\c!ownnumber=,
+ % \c!interaction=\v!list,
\c!sectionseparatorset=\s!default,
\c!sectionconversionset=\s!default,
\c!sectionstopper=,
diff --git a/tex/context/base/mkiv/strc-tag.lua b/tex/context/base/mkiv/strc-tag.lua
index 6ee7a9cff..f77f766a9 100644
--- a/tex/context/base/mkiv/strc-tag.lua
+++ b/tex/context/base/mkiv/strc-tag.lua
@@ -56,7 +56,6 @@ tags.labels = labels
tags.patterns = tagpatterns
tags.specifications = specifications
-
function tags.current()
if stacksize > 0 then
return stack[stacksize] -- maybe copy or proxy
diff --git a/tex/context/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv
index 953f86360..10c1fa113 100644
--- a/tex/context/base/mkiv/syst-ini.mkiv
+++ b/tex/context/base/mkiv/syst-ini.mkiv
@@ -1110,7 +1110,7 @@
\edef\pdfcompresslevel {\pdfvariable compresslevel} \pdfcompresslevel \plusnine
\edef\pdfobjcompresslevel {\pdfvariable objcompresslevel} \pdfobjcompresslevel \plusone
%edef\pdfrecompress {\pdfvariable recompress} \pdfrecompress \zerocount
-\edef\pdfdecimaldigits {\pdfvariable decimaldigits} \pdfdecimaldigits \plusfive
+\edef\pdfdecimaldigits {\pdfvariable decimaldigits} \pdfdecimaldigits \plussix % \plusfive
\edef\pdfgamma {\pdfvariable gamma} \pdfgamma \plusthousand
\edef\pdfimageresolution {\pdfvariable imageresolution} \pdfimageresolution 300
\edef\pdfimageapplygamma {\pdfvariable imageapplygamma} \pdfimageapplygamma \zerocount
@@ -1121,8 +1121,8 @@
\edef\pdfinclusioncopyfonts {\pdfvariable inclusioncopyfonts} \pdfinclusioncopyfonts \plusone
\edef\pdfinclusionerrorlevel {\pdfvariable inclusionerrorlevel} \pdfinclusionerrorlevel \zerocount
\edef\pdfgentounicode {\pdfvariable gentounicode} \pdfgentounicode \plusone
-%edef\pdfomitcidset {\pdfvariable omitcidset } \pdfomitcidset \zerocount
-%edef\pdfomitcharset {\pdfvariable omitcharset} \pdfomitcharset \plusone
+\edef\pdfomitcidset {\pdfvariable omitcidset } \pdfomitcidset \plusone
+\edef\pdfomitcharset {\pdfvariable omitcharset} \pdfomitcharset \plusone
\edef\pdfpagebox {\pdfvariable pagebox} \pdfpagebox \zerocount
\edef\pdfmajorversion {\pdfvariable majorversion} % \pdfmajorversion \plusone
\edef\pdfminorversion {\pdfvariable minorversion} \pdfminorversion \plusseven
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index 4fd1e2ad7..33a647f28 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index 7cc223ff7..d72ad1ee2 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 9cc067cb3..8ee2fcb32 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 : 09/21/18 19:52:37
+-- merge date : 09/24/18 14:11:29
do -- begin closure to overcome local limits and interference