From 4f5f4fd981d1f9b290529b8176bbd55761ab00ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= Date: Sat, 6 Jun 2020 00:36:05 +0200 Subject: [PATCH] Drop old whatsit system --- luametalatex-back-pdf.lua | 1 - luametalatex-nodewriter.lua | 22 ++++++---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/luametalatex-back-pdf.lua b/luametalatex-back-pdf.lua index 72d9bc0..127478d 100644 --- a/luametalatex-back-pdf.lua +++ b/luametalatex-back-pdf.lua @@ -200,7 +200,6 @@ local function addlinkpoint(p, link, x, y, list, kind) local n = #quads quads[n+1], quads[n+2], quads[n+3], quads[n+4] = lx, ly, ux, uy if kind == 'final' or (link.force_separate and (n+4)%8 == 0) then - print(kind, n, link.force_separate) write_link(p, link) link.annots = nil end diff --git a/luametalatex-nodewriter.lua b/luametalatex-nodewriter.lua index bdb2f70..438f5d9 100644 --- a/luametalatex-nodewriter.lua +++ b/luametalatex-nodewriter.lua @@ -428,23 +428,13 @@ function nodehandler.glyph(p, n, x, y, ...) p.pos.x = p.pos.x + math.floor(getwidth(n)*(1+getexpansion(n)/1000000)+.5) end function nodehandler.whatsit(p, n, ...) -- Whatsit? - return whatsithandler[getsubtype(n)](p, n, ...) + local prop = properties[n]-- or node.getproperty(n) + if prop and prop.handle then + prop:handle(p, n, ...) + else + write("Invalid whatsit found (missing handler).") + end end ---[[ -- These use the old whatsit handling system which might get removed. -function whatsithandler.pdf_start_link(p, n, x, y, outer, _, level) - local links = p.linkcontext - local link = {quads = {}, attr = n.link_attr, action = n.action, level = level, force_separate = false} -- force_separate should become an option - links[#links+1] = link - addlinkpoint(p, link, x, y, outer, 'start') -end -function whatsithandler.pdf_end_link(p, n, x, y, outer, _, level) - local links = p.linkcontext - local link = links[#links] - links[#links] = nil - if link.level ~= level then error"Wrong link level" end - addlinkpoint(p, link, x, y, outer, 'final') -end -]] local global_p, global_x, global_y function pdf._latelua(p, x, y, func, ...) global_p, global_x, global_y = p, x, y