diff --git a/luametalatex-baseregisters.lua b/luametalatex-baseregisters.lua index 79600f8..be12afd 100644 --- a/luametalatex-baseregisters.lua +++ b/luametalatex-baseregisters.lua @@ -120,6 +120,7 @@ end tex_variable(count_code, scan_int, 'suppressfontnotfounderror', 0) tex_variable(count_code, scan_int, 'outputmode', 1) -- The "traditional" default would be 0, -- but we do not actually support that. +tex_variable(count_code, scan_int, 'mag', 1000) -- Let's hope that noone wants to use these tex_variable(count_code, scan_int, 'tracingscantokens', 0) tex_variable(dimen_code, scan_dimen, 'pageheight', 0) diff --git a/luametalatex-meaning.lua b/luametalatex-meaning.lua index e4ba49e..3b40ac6 100644 --- a/luametalatex-meaning.lua +++ b/luametalatex-meaning.lua @@ -10,11 +10,12 @@ local primitive_meaning = { lmlt.primitive_tokens.relax, lmlt.primitive_tokens.meaning, } +local call_cmd = token.command_id'call' lmlt.luacmd("meaning", function() local peeked = token.peeknext() token.put_next(primitive_meaning) token.skipnextexpanded() - if peeked.parameters == 0 then + if peeked.parameters == 0 or (peeked.command == call_cmd and not peeked.parameters) then local stash = '' if peeked.protected then if token.scankeywordcs'protected' then diff --git a/luametalatex-nodewriter.lua b/luametalatex-nodewriter.lua index 80848ab..cde5fc3 100644 --- a/luametalatex-nodewriter.lua +++ b/luametalatex-nodewriter.lua @@ -626,12 +626,14 @@ vf = { } function nodehandler.glyph(p, n, x, y, outer, x0, level, direction) if getfont(n) ~= p.vfont.fid then - p.vfont.fid = getfont(n) - p.vfont.font = font.getfont(getfont(n)) or font.fonts[getfont(n)] + local fid = getfont(n) + p.vfont.fid = fid + p.vfont.font = font.fonts[fid] end local f, fid = p.vfont.font, p.vfont.fid local cid = getchar(n) - local c = f.characters[cid] + local c = f and f.characters + c = c and c[cid] if not c then texio.write_nl("Missing character") return @@ -704,8 +706,10 @@ function pdf.write(mode, text, x, y, p) topage(p) p.strings[#p.strings + 1] = text elseif mode == "direct" then - if p.mode ~= page then + if p.mode < page then totext(p, p.font.fid) + elseif p.mode > page then + topage(p) end p.strings[#p.strings + 1] = text elseif mode == "origin" then