summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-11-13 13:40:25 +0200
committerMarius <mariausol@gmail.com>2013-11-13 13:40:25 +0200
commit776a9aa186e417e1d0220d18b1dda8fd2bae6886 (patch)
tree55d2d6b62beeebf2e73f1db7dedaf739b530579a /tex
parent7425449d374a84cde533bdb2ce5c76c62c1eb48c (diff)
downloadcontext-776a9aa186e417e1d0220d18b1dda8fd2bae6886.tar.gz
beta 2013.11.13 12:28
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4113 -> 4112 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/lpdf-epd.lua45
-rw-r--r--tex/context/base/status-files.pdfbin24537 -> 24519 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin222406 -> 222448 bytes
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
7 files changed, 40 insertions, 11 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 1ffe08bff..0506dce5d 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2013.11.10 12:23}
+\newcontextversion{2013.11.13 12:28}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 5218751b7..853950cd3 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 6a68d8c85..f945319dd 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -25,7 +25,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2013.11.10 12:23}
+\edef\contextversion{2013.11.13 12:28}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/lpdf-epd.lua b/tex/context/base/lpdf-epd.lua
index b9f8cfc7c..a7399f6b4 100644
--- a/tex/context/base/lpdf-epd.lua
+++ b/tex/context/base/lpdf-epd.lua
@@ -57,7 +57,7 @@ lpdf.epdf = { }
local checked_access
-local function prepare(document,d,t,n,k)
+local function prepare(document,d,t,n,k,mt)
for i=1,n do
local v = d:getVal(i)
local r = d:getValNF(i)
@@ -78,15 +78,16 @@ local function prepare(document,d,t,n,k)
t[d:getKey(i)] = checked_access[v:getTypeName()](v,document)
end
end
- getmetatable(t).__index = nil
+ getmetatable(t).__index = nil -- ?? weird
+setmetatable(t,mt)
return t[k]
end
-local function some_dictionary(d,document,r)
+local function some_dictionary(d,document,r,mt)
local n = d and d:getLength() or 0
if n > 0 then
local t = { }
- setmetatable(t, { __index = function(t,k) return prepare(document,d,t,n,k) end } )
+ setmetatable(t, { __index = function(t,k) return prepare(document,d,t,n,k,mt) end } )
return t
end
end
@@ -153,7 +154,7 @@ local function some_stream(d,document,r)
end
end
--- we need epdf.getBool
+-- we need epdf.boolean(v) in addition to v:getBool() [dictionary, array, stream, real, integer, string, boolean, name, ref, null]
checked_access = {
dictionary = function(d,document,r)
@@ -260,7 +261,8 @@ local function getlayers(document)
end
end
-local function getpages(document)
+
+local function getpages(document,Catalog)
local data = document.data
local xrefs = document.xrefs
local cache = document.cache
@@ -268,9 +270,33 @@ local function getpages(document)
local xref = data:getXRef()
local pages = { }
local nofpages = cata:getNumPages()
+-- local function getpagestuff(pagenumber,k)
+-- if k == "MediaBox" then
+-- local pageobj = cata:getPage(pagenumber)
+-- local pagebox = pageobj:getMediaBox()
+-- return { pagebox.x1, pagebox.y1, pagebox.x2, pagebox.y2 }
+-- elseif k == "CropBox" then
+-- local pageobj = cata:getPage(pagenumber)
+-- local pagebox = pageobj:getMediaBox()
+-- return { pagebox.x1, pagebox.y1, pagebox.x2, pagebox.y2 }
+-- elseif k == "Resources" then
+-- print("todo page resources from parent")
+-- -- local pageobj = cata:getPage(pagenumber)
+-- -- local resources = pageobj:getResources()
+-- end
+-- end
+-- for pagenumber=1,nofpages do
+-- local mt = { __index = function(t,k)
+-- local v = getpagestuff(pagenumber,k)
+-- if v then
+-- t[k] = v
+-- end
+-- return v
+-- end }
+ local mt = { __index = Catalog.Pages }
for pagenumber=1,nofpages do
local pagereference = cata:getPageRef(pagenumber).num
- local pagedata = some_dictionary(xref:fetch(pagereference,0):getDict(),document,pagereference)
+ local pagedata = some_dictionary(xref:fetch(pagereference,0):getDict(),document,pagereference,mt)
if pagedata then
pagedata.number = pagenumber
pages[pagenumber] = pagedata
@@ -298,6 +324,9 @@ local function delayed(document,tag,f)
return t
end
+-- local catobj = data:getXRef():fetch(data:getXRef():getRootNum(),data:getXRef():getRootGen())
+-- print(catobj:getDict(),data:getXRef():getCatalog():getDict())
+
local loaded = { }
function lpdf.epdf.load(filename)
@@ -318,7 +347,7 @@ function lpdf.epdf.load(filename)
document.Info = Info
-- document.catalog = Catalog
-- a few handy helper tables
- document.pages = delayed(document,"pages", function() return getpages(document) end)
+ document.pages = delayed(document,"pages", function() return getpages(document,Catalog) end)
document.destinations = delayed(document,"destinations", function() return getnames(document,Catalog.Names and Catalog.Names.Dests) end)
document.javascripts = delayed(document,"javascripts", function() return getnames(document,Catalog.Names and Catalog.Names.JS) end)
document.widgets = delayed(document,"widgets", function() return getnames(document,Catalog.Names and Catalog.Names.AcroForm) end)
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index a48337cb2..ce269173a 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 1d11c9fe1..3ac4ca292 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 94a082a8c..f6e95a000 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 11/10/13 12:23:28
+-- merge date : 11/13/13 12:28:55
do -- begin closure to overcome local limits and interference