Skip to content

Commit

Permalink
Use fontmode instead of textmode in layered glyphs
Browse files Browse the repository at this point in the history
Fixes #124 for harf mode.
  • Loading branch information
zauguin committed Dec 6, 2019
1 parent e88500c commit 0f30cb5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/luaotfload-harf-plug.lua
Expand Up @@ -565,8 +565,17 @@ end
local push_cmd = { "push" }
local pop_cmd = { "pop" }
local nop_cmd = { "nop" }
local save_cmd = { "pdf", "page", "q" }
local restore_cmd = { "pdf", "page", "Q" }
--[[
In the following, "text" actually refers to "font" mode and not to "text"
mode. "font" mode is called "text" inside of virtual font commands (don't
ask me why, but the LuaTeX source does make it clear that this is intentional)
and behaves mostly like "page" (especially it does not enter a "BT" "ET"
block) except that it always resets the current position to the origin.
This is necessary to ensure that the q/Q pair does not interfere with TeX's
position tracking.
]]
local save_cmd = { "pdf", "text", "q" }
local restore_cmd = { "pdf", "text", "Q" }

-- Convert glyphs to nodes and collect font characters.
local function tonodes(head, node, run, glyphs)
Expand Down

0 comments on commit 0f30cb5

Please sign in to comment.