summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDohyun Kim <nomosnomos@gmail.com>2015-07-29 23:55:56 +0900
committerDohyun Kim <nomosnomos@gmail.com>2015-07-30 00:03:01 +0900
commit38abb3104a24e42bc6c50a22fb7197c3041206fc (patch)
tree29ae43333dae01feb05278e448660084b84905bb /src
parenta3609f5cd2e3e7ec844adab7f7220f02599e4743 (diff)
parentfbf06cfeaa65ed3e3cee8275c892ae5b7c90e667 (diff)
downloadluaotfload-38abb3104a24e42bc6c50a22fb7197c3041206fc.tar.gz
revert to the previous; remove tex code
Diffstat (limited to 'src')
-rw-r--r--src/luaotfload-colors.lua17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/luaotfload-colors.lua b/src/luaotfload-colors.lua
index 8035210..19903d8 100644
--- a/src/luaotfload-colors.lua
+++ b/src/luaotfload-colors.lua
@@ -40,6 +40,8 @@ local setattribute = nodedirect.set_attribute
local texset = tex.set
local texget = tex.get
+local texsettoks = tex.settoks
+local texgettoks = tex.gettoks
local stringformat = string.format
local concat = table.concat
@@ -310,9 +312,6 @@ node_colorize = function (head, current_color)
return head, current_color
end
-local pgf_extgs = { }
-luaotfload.pgf_extgs = pgf_extgs
-
--- node -> node
local color_handler = function (head)
head = todirect(head)
@@ -326,7 +325,7 @@ local color_handler = function (head)
local no_extgs = not tpr:find("/ExtGState<<.*>>")
local pgf_loaded = no_extgs and luaotfload.pgf_loaded
if pgf_loaded then
- tpr = concat(pgf_extgs)
+ tpr = texgettoks(pgf_loaded)
end
local t = ""
@@ -338,7 +337,7 @@ local color_handler = function (head)
end
if t ~= "" then
if pgf_loaded then
- pgf_extgs[#pgf_extgs+1] = t
+ texsettoks("global", pgf_loaded, tpr..t)
else
if no_extgs then
tpr = tpr .. "/ExtGState<<>>"
@@ -379,13 +378,5 @@ add_color_callback = function ( )
end
end
-tex.sprint("\\count255=\\catcode`@ \\catcode`@=11 ",
- "\\ifdefined\\AtBeginDocument\\else\\def\\AtBeginDocument#1{#1}\\fi",
- "\\AtBeginDocument{\\ifdefined\\pgfutil@everybye",
- "\\directlua{luaotfload.pgf_loaded=true}\\begingroup",
- "\\toks@{\\pgf@sys@addpdfresource@extgs@plain{\\directlua{tex.sprint(luaotfload.pgf_extgs)}}}",
- "\\edef\\x{\\endgroup\\noexpand\\pgfutil@everybye{\\the\\toks@\\the\\pgfutil@everybye}}\\x",
- "\\fi}\\catcode`@=\\count255 ")
-
-- vim:tw=71:sw=4:ts=4:expandtab