Drop old whatsit system
This commit is contained in:
parent
054a0f4110
commit
4f5f4fd981
@ -200,7 +200,6 @@ local function addlinkpoint(p, link, x, y, list, kind)
|
|||||||
local n = #quads
|
local n = #quads
|
||||||
quads[n+1], quads[n+2], quads[n+3], quads[n+4] = lx, ly, ux, uy
|
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
|
if kind == 'final' or (link.force_separate and (n+4)%8 == 0) then
|
||||||
print(kind, n, link.force_separate)
|
|
||||||
write_link(p, link)
|
write_link(p, link)
|
||||||
link.annots = nil
|
link.annots = nil
|
||||||
end
|
end
|
||||||
|
@ -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)
|
p.pos.x = p.pos.x + math.floor(getwidth(n)*(1+getexpansion(n)/1000000)+.5)
|
||||||
end
|
end
|
||||||
function nodehandler.whatsit(p, n, ...) -- Whatsit?
|
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
|
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
|
local global_p, global_x, global_y
|
||||||
function pdf._latelua(p, x, y, func, ...)
|
function pdf._latelua(p, x, y, func, ...)
|
||||||
global_p, global_x, global_y = p, x, y
|
global_p, global_x, global_y = p, x, y
|
||||||
|
Loading…
Reference in New Issue
Block a user