Smaller fixes

This commit is contained in:
Marcel Fabian Krüger 2021-11-08 15:15:54 +01:00
parent 492e0864b0
commit ae36af4134
3 changed files with 11 additions and 5 deletions

View File

@ -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)

View File

@ -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

View File

@ -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