Compare commits

..

No commits in common. "29c97800a3fa14a0ef8209ebcbc25154de9ec48b" and "15052dbc43ac46dd72ed7c02689527e1665aee5d" have entirely different histories.

3 changed files with 6 additions and 20 deletions

View file

@ -58,8 +58,7 @@ callback.register("stop_run", function()
pfile:indirect(id, require'luametalatex-pdf-font'(pfile, f, sorted)) pfile:indirect(id, require'luametalatex-pdf-font'(pfile, f, sorted))
end end
pfile.root = pfile:getobj() pfile.root = pfile:getobj()
pfile.version = string.format("%i.%i", pdf.variable.majorversion, pdf.variable.minorversion) pfile:indirect(pfile.root, string.format([[<</Type/Catalog/Version/1.7/Pages %i 0 R>>]], pfile:writepages()))
pfile:indirect(pfile.root, string.format([[<</Type/Catalog/Version/%s/Pages %i 0 R>>]], pfile.version, pfile:writepages()))
pfile.info = write_infodir(pfile) pfile.info = write_infodir(pfile)
pfile:close() pfile:close()
end, "Finish PDF file") end, "Finish PDF file")

View file

@ -8,7 +8,6 @@
return token.new(t.mode, t.command) return token.new(t.mode, t.command)
end end
local dimen_cmd = token.command_id'assign_dimen' local dimen_cmd = token.command_id'assign_dimen'
local count_cmd = token.command_id'assign_int'
local tex_params = {} local tex_params = {}
local texmeta = getmetatable(tex) local texmeta = getmetatable(tex)
local texmetaoldindex = texmeta.__index local texmetaoldindex = texmeta.__index
@ -16,9 +15,7 @@
function texmeta.__index(t, k) function texmeta.__index(t, k)
local v = tex_params[k] local v = tex_params[k]
if v then if v then
if v.command == count_cmd then if v.command == dimen_cmd then
return tex.count[v.index]
elseif v.command == dimen_cmd then
return tex.dimen[v.index] return tex.dimen[v.index]
end end
else else
@ -28,9 +25,7 @@
function texmeta.__newindex(t, k, v) function texmeta.__newindex(t, k, v)
local p = tex_params[k] local p = tex_params[k]
if p then if p then
if p.command == count_cmd then if p.command == dimen_cmd then
tex.count[p.index] = v
elseif p.command == dimen_cmd then
tex.dimen[p.index] = v tex.dimen[p.index] = v
end end
else else
@ -43,9 +38,7 @@
__index = function(t, k) __index = function(t, k)
local v = pdf_params[k] local v = pdf_params[k]
if v then if v then
if v.command == count_cmd then if v.command == dimen_cmd then
return tex.count[v.index]
elseif v.command == dimen_cmd then
return tex.dimen[v.index] return tex.dimen[v.index]
end end
else else
@ -55,9 +48,7 @@
__newindex = function(t, k, v) __newindex = function(t, k, v)
local p = pdf_params[k] local p = pdf_params[k]
if p then if p then
if p.command == count_cmd then if p.command == dimen_cmd then
tex.count[p.index] = v
elseif p.command == dimen_cmd then
tex.dimen[p.index] = v tex.dimen[p.index] = v
end end
else else
@ -80,15 +71,12 @@
\def\pdfAlloc{% \def\pdfAlloc{%
\internalAlloc{pdf}% \internalAlloc{pdf}%
} }
\texAlloc{count}{suppressfontnotfounderror}{0}
\texAlloc{count}{outputmode}{1} % The "traditional" default would be 0, \texAlloc{count}{outputmode}{1} % The "traditional" default would be 0,
% but we do not actually support that. % but we do not actually support that.
\texAlloc{dimen}{pageheight}{210mm} \texAlloc{dimen}{pageheight}{210mm}
\texAlloc{dimen}{pagewidth}{297mm} \texAlloc{dimen}{pagewidth}{297mm}
\pdfAlloc{dimen}{horigin}{1in} \pdfAlloc{dimen}{horigin}{1in}
\pdfAlloc{dimen}{vorigin}{1in} \pdfAlloc{dimen}{vorigin}{1in}
\pdfAlloc{count}{majorversion}{1}
\pdfAlloc{count}{minorversion}{7}
\directlua{ \directlua{
lua.prepared_code[\csstring#lua.prepared_code+1] = tex.toks[0] .. "end" lua.prepared_code[\csstring#lua.prepared_code+1] = tex.toks[0] .. "end"
\the\toks0 \the\toks0

View file

@ -13,7 +13,6 @@ function token.luacmd(name, func, ...)
local idx = new_luafunction(name) local idx = new_luafunction(name)
set_lua(name, idx, ...) set_lua(name, idx, ...)
functions[idx] = func functions[idx] = func
return idx
end end
local properties = node.get_properties_table() local properties = node.get_properties_table()
-- setmetatable(node.direct.get_properties_table(), { -- setmetatable(node.direct.get_properties_table(), {
@ -29,7 +28,7 @@ local whatsits = {
[0] = "open", [0] = "open",
"write", "write",
"close", "close",
"special", nil,
nil, nil,
nil, nil,
"save_pos", "save_pos",