summaryrefslogtreecommitdiff
path: root/src/luaotfload-colors.lua
diff options
context:
space:
mode:
authorDohyun Kim <nomosnomos@gmail.com>2015-06-03 20:26:58 +0900
committerDohyun Kim <nomosnomos@gmail.com>2015-06-03 20:26:58 +0900
commit8a30fe684374af7dd25c8f9a2a97f5c01ea9d7bc (patch)
treefeb5afc1b5f8beeb1a7951dbd6b9bb9173b0afff /src/luaotfload-colors.lua
parent7bad2f7429de8354f0105108ea495c0c6b85291b (diff)
downloadluaotfload-8a30fe684374af7dd25c8f9a2a97f5c01ea9d7bc.tar.gz
check if token register exists using allocation number
Diffstat (limited to 'src/luaotfload-colors.lua')
-rw-r--r--src/luaotfload-colors.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/luaotfload-colors.lua b/src/luaotfload-colors.lua
index a151101..ff4dc13 100644
--- a/src/luaotfload-colors.lua
+++ b/src/luaotfload-colors.lua
@@ -321,9 +321,10 @@ local color_handler = function (head)
if res then
res["1"] = true
local tpr = texget("pdfpageresources")
- local pgf_loaded = tpr:find("/ExtGState %d+ 0 R")
+ local no_extgs = not tpr:find("/ExtGState<<.*>>")
+ local pgf_loaded = no_extgs and luaotfload.pgf_loaded
if pgf_loaded then
- tpr = texgettoks("pgf@sys@pgf@resource@list@extgs@toks") -- see luaotfload.sty
+ tpr = texgettoks(pgf_loaded) -- see luaotfload.sty
end
local t = ""
@@ -335,9 +336,9 @@ local color_handler = function (head)
end
if t ~= "" then
if pgf_loaded then
- texsettoks("global", "pgf@sys@pgf@resource@list@extgs@toks", tpr..t)
+ texsettoks("global", pgf_loaded, tpr..t)
else
- if not tpr:find("/ExtGState<<.*>>") then
+ if no_extgs then
tpr = tpr .. "/ExtGState<<>>"
end
tpr = tpr:gsub("/ExtGState<<", "%1"..t)