summaryrefslogtreecommitdiff
path: root/otfl-font-msc.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-01-16 07:32:37 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-01-16 07:32:37 +0200
commit1c02c7311fd48b0de24e6bedaec42f2a48e791a6 (patch)
treec4320c8a9e7f6393b703dfb0469469a5f42b23c1 /otfl-font-msc.lua
parent5292accc316fe59d996d574ecf69b52f2e113fb9 (diff)
downloadluaotfload-1c02c7311fd48b0de24e6bedaec42f2a48e791a6.tar.gz
Improved page resources handling
Diffstat (limited to 'otfl-font-msc.lua')
-rw-r--r--otfl-font-msc.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/otfl-font-msc.lua b/otfl-font-msc.lua
index bb04927..6ebf31d 100644
--- a/otfl-font-msc.lua
+++ b/otfl-font-msc.lua
@@ -172,11 +172,17 @@ function luaotfload.node_colorize(head)
end
function luaotfload.colorize(head)
- local h = luaotfload.node_colorize(head)
+ -- check if our page resources existed in the previous run
+ -- and remove it to avoid duplicating it later
if res then
local r = "/ExtGState<<"..res..">>"
- local s = tex.pdfpageresources:find(r) and "" or r
- tex.pdfpageresources = tex.pdfpageresources..s
+ tex.pdfpageresources = tex.pdfpageresources:gsub(r, "")
+ end
+ local h = luaotfload.node_colorize(head)
+ -- now append our page resources
+ if res and not res:is_empty() then
+ local r = "/ExtGState<<"..res..">>"
+ tex.pdfpageresources = tex.pdfpageresources..r
end
return h
end