summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/oberdiek/oberdiek.luacolor.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-02 21:50:45 +0000
committerKarl Berry <karl@freefriends.org>2012-05-02 21:50:45 +0000
commitaa1776c78dfdb456e2228fbceaa886e64e36174c (patch)
tree7967af7f0f2079a632809a813221918af16ba8cc /Master/texmf-dist/scripts/oberdiek/oberdiek.luacolor.lua
parenta86d14742b305868a1c2b1f33f1263a6b7d0e03d (diff)
oberdiek (1may12)
git-svn-id: svn://tug.org/texlive/trunk@26177 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/oberdiek/oberdiek.luacolor.lua')
-rw-r--r--Master/texmf-dist/scripts/oberdiek/oberdiek.luacolor.lua20
1 files changed, 13 insertions, 7 deletions
diff --git a/Master/texmf-dist/scripts/oberdiek/oberdiek.luacolor.lua b/Master/texmf-dist/scripts/oberdiek/oberdiek.luacolor.lua
index b251322d45d..c7bf3deb8a9 100644
--- a/Master/texmf-dist/scripts/oberdiek/oberdiek.luacolor.lua
+++ b/Master/texmf-dist/scripts/oberdiek/oberdiek.luacolor.lua
@@ -9,7 +9,7 @@
-- This is a generated file.
--
-- Project: luacolor
--- Version: 2011/04/23 v1.6
+-- Version: 2011/11/01 v1.8
--
-- Copyright (C) 2007, 2009-2011 by
-- Heiko Oberdiek <heiko.oberdiek at googlemail.com>
@@ -37,7 +37,7 @@
--
module("oberdiek.luacolor", package.seeall)
function getversion()
- tex.write("2011/04/23 v1.6")
+ tex.write("2011/11/01 v1.8")
end
local ifpdf
if tonumber(tex.pdfoutput) > 0 then
@@ -75,7 +75,7 @@ function dvidetect()
local v = tex.box[0]
assert(v.id == node.id("hlist"))
for v in node.traverse_id(node.id("whatsit"), v.head) do
- if v and v.subtype == 3 then -- special
+ if v and v.subtype == node.subtype("special") then
local data = v.data
for pattern, driver in pairs(patterns) do
if string.find(data, pattern) then
@@ -94,6 +94,9 @@ local map = {
n = 0,
}
function get(color)
+ tex.write("" .. getvalue(color))
+end
+function getvalue(color)
local n = map[color]
if not n then
n = map.n + 1
@@ -101,12 +104,15 @@ function get(color)
map[n] = color
map[color] = n
end
- tex.write("" .. n)
+ return n
end
local attribute
function setattribute(attr)
attribute = attr
end
+function getattribute()
+ return attribute
+end
local LIST = 1
local LIST_LEADERS = 2
local COLOR = 3
@@ -118,9 +124,9 @@ local node_types = {
[node.id("glyph")] = COLOR,
[node.id("disc")] = COLOR,
[node.id("whatsit")] = {
- [3] = COLOR, -- special
- [8] = COLOR, -- pdf_literal
- [14] = COLOR, -- pdf_refximage
+ [node.subtype("special")] = COLOR,
+ [node.subtype("pdf_literal")] = COLOR,
+ [node.subtype("pdf_refximage")] = COLOR,
},
[node.id("glue")] =
function(n)