summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/lpdf-ano.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-08 00:43:40 +0000
committerKarl Berry <karl@freefriends.org>2013-04-08 00:43:40 +0000
commit824f7b0903de8ad7f6ee3d7656005e4c59155e06 (patch)
treeabfc8673ef9916f3ab7074e811207384c301492b /Master/texmf-dist/tex/context/base/lpdf-ano.lua
parent689aefb0727676ed3cddf331337b4be226495e72 (diff)
context import for TL13, from www.pragma-ade.com/context/beta/cont-tmf.zip
git-svn-id: svn://tug.org/texlive/trunk@29731 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/lpdf-ano.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/lpdf-ano.lua48
1 files changed, 26 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/context/base/lpdf-ano.lua b/Master/texmf-dist/tex/context/base/lpdf-ano.lua
index 154296e9be2..e722446ee2c 100644
--- a/Master/texmf-dist/tex/context/base/lpdf-ano.lua
+++ b/Master/texmf-dist/tex/context/base/lpdf-ano.lua
@@ -14,6 +14,7 @@ local next, tostring = next, tostring
local rep, format = string.rep, string.format
local texcount = tex.count
local lpegmatch = lpeg.match
+local formatters = string.formatters
local backends, lpdf = backends, lpdf
@@ -150,7 +151,7 @@ local function link(url,filename,destination,page,actions)
}
}
elseif trace_references then
- report_reference("invalid page reference: %s",tostring(page))
+ report_reference("invalid page reference %a",page)
end
end
return false
@@ -234,7 +235,7 @@ local function use_normal_annotations()
local function reference(width,height,depth,prerolled) -- keep this one
if prerolled then
if trace_references then
- report_reference("w=%s, h=%s, d=%s, a=%s",width,height,depth,prerolled)
+ report_reference("width %p, height %p, depth %p, prerolled %a",width,height,depth,prerolled)
end
return pdfannotation_node(width,height,depth,prerolled)
end
@@ -251,6 +252,9 @@ end
local hashed, nofunique, nofused = { }, 0, 0
+local f_annot = formatters["<< /Type /Annot %s /Rect [%0.3f %0.3f %0.3f %0.3f] >>"]
+local f_bpnf = formatters["_bpnf_(%s,%s,%s,'%s')"]
+
local function use_shared_annotations()
local factor = number.dimenfactors.bp
@@ -259,7 +263,7 @@ local function use_shared_annotations()
local h, v = pdf.h, pdf.v
local llx, lly = h*factor, (v - depth)*factor
local urx, ury = (h + width)*factor, (v + height)*factor
- local annot = format("<< /Type /Annot %s /Rect [%0.3f %0.3f %0.3f %0.3f] >>",prerolled,llx,lly,urx,ury)
+ local annot = f_annot(prerolled,llx,lly,urx,ury)
local n = hashed[annot]
if not n then
n = pdfdelayedobject(annot)
@@ -275,9 +279,9 @@ local function use_shared_annotations()
local function reference(width,height,depth,prerolled)
if prerolled then
if trace_references then
- report_reference("w=%s, h=%s, d=%s, a=%s",width,height,depth,prerolled)
+ report_reference("width %p, height %p, depth %p, prerolled %a",width,height,depth,prerolled)
end
- local luacode = format("_bpnf_(%s,%s,%s,'%s')",width,height,depth,prerolled)
+ local luacode = f_bpnf(width,height,depth,prerolled)
return latelua_node(luacode)
end
end
@@ -323,9 +327,9 @@ function nodeinjections.destination(width,height,depth,name,view)
if not done[name] then
done[name] = true
if trace_destinations then
- report_destination("w=%s, h=%s, d=%s, n=%s, v=%s",width,height,depth,name,view or "no view")
+ report_destination("width %p, height %p, depth %p, name %a, view %a",width,height,depth,name,view)
end
- return pdfdestination_node(width,height,depth,name,view)
+ return pdfdestination_node(width,height,depth,name,view) -- can be begin/end node
end
end
@@ -414,7 +418,7 @@ function specials.internal(var,actions) -- better resolve in strc-ref
--~ inspect(v)
if not v then
-- error
- report_reference("no internal reference '%s'",i or "?")
+ report_reference("no internal reference %a",i)
elseif getinnermethod() == "names" then
-- named
return link(nil,nil,"aut:"..i,v.references.realpage,actions)
@@ -492,17 +496,17 @@ end
-- sections
---~ function specials.section(var,actions)
---~ local sectionname = var.operation
---~ local destination = var.arguments
---~ local internal = structures.sections.internalreference(sectionname,destination)
---~ if internal then
---~ var.special = "internal"
---~ var.operation = internal
---~ var.arguments = nil
---~ specials.internal(var,actions)
---~ end
---~ end
+-- function specials.section(var,actions)
+-- local sectionname = var.operation
+-- local destination = var.arguments
+-- local internal = structures.sections.internalreference(sectionname,destination)
+-- if internal then
+-- var.special = "internal"
+-- var.operation = internal
+-- var.arguments = nil
+-- specials.internal(var,actions)
+-- end
+-- end
specials.section = specials.internal -- specials.section just need to have a value as it's checked
@@ -607,8 +611,8 @@ function executers.submitform(arguments)
local flag = flags[formmethod] or flags.post
flag = (flag and (flag[formformat] or flag.xml)) or 32 -- default: post, xml
return pdfdictionary {
- S = pdfconstant("ResetForm"),
- F = fieldset(arguments[1]),
+ S = pdfconstant("SubmitForm"),
+ F = arguments[1],
Field = fieldset(arguments[2]),
Flags = flag,
-- \PDFsubmitfiller
@@ -687,7 +691,7 @@ local function build(levels,start,parent,method)
return i, n, first, last
elseif level == startlevel then
if trace_bookmarks then
- report_bookmark("%3i %s%s %s",reference.realpage,rep(" ",level-1),(open and "+") or "-",title)
+ report_bookmark("%3i %w%s %s",reference.realpage,(level-1)*2,(open and "+") or "-",title)
end
local prev = child
child = pdfreserveobject()