summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-04-20 00:00:12 +0300
committerMarius <mariausol@gmail.com>2011-04-20 00:00:12 +0300
commit9a911f4fe29fcd7b02102d54ba0e938b40635e59 (patch)
tree9012560bcba898cb1188afdbefbf1f8ce6ad7a5e
parent865b5da32dfab508db87744c7542a59c192dd459 (diff)
downloadcontext-9a911f4fe29fcd7b02102d54ba0e938b40635e59.tar.gz
beta 2011.04.19 22:49
-rw-r--r--scripts/context/lua/mtxrun.lua6
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua6
-rw-r--r--scripts/context/stubs/unix/mtxrun6
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/grph-inc.mkiv2
-rw-r--r--tex/context/base/grph-swf.lua1
-rw-r--r--tex/context/base/grph-u3d.lua2
-rw-r--r--tex/context/base/l-io.lua6
-rw-r--r--tex/context/base/lpdf-swf.lua34
-rw-r--r--tex/context/base/lpdf-u3d.lua2
-rw-r--r--tex/context/base/lpdf-wid.lua6
-rw-r--r--tex/context/base/status-files.pdfbin23627 -> 23614 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin155194 -> 155189 bytes
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua8
17 files changed, 75 insertions, 12 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 72f105d07..a72c56251 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -1792,6 +1792,12 @@ local function readnumber(f,n,m)
elseif n == 12 then
local a, b, c = readnumber(f,4), readnumber(f,4), readnumber(f,4)
return 256*256 * a + 256 * b + c
+ elseif n == -2 then
+ local b, a = byte(f:read(2),1,2)
+ return 256*a + b
+ elseif n == -4 then
+ local d, c, b, a = byte(f:read(4),1,4)
+ return 256*256*256 * a + 256*256 * b + 256*c + d
else
return 0
end
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 72f105d07..a72c56251 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -1792,6 +1792,12 @@ local function readnumber(f,n,m)
elseif n == 12 then
local a, b, c = readnumber(f,4), readnumber(f,4), readnumber(f,4)
return 256*256 * a + 256 * b + c
+ elseif n == -2 then
+ local b, a = byte(f:read(2),1,2)
+ return 256*a + b
+ elseif n == -4 then
+ local d, c, b, a = byte(f:read(4),1,4)
+ return 256*256*256 * a + 256*256 * b + 256*c + d
else
return 0
end
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 72f105d07..a72c56251 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -1792,6 +1792,12 @@ local function readnumber(f,n,m)
elseif n == 12 then
local a, b, c = readnumber(f,4), readnumber(f,4), readnumber(f,4)
return 256*256 * a + 256 * b + c
+ elseif n == -2 then
+ local b, a = byte(f:read(2),1,2)
+ return 256*a + b
+ elseif n == -4 then
+ local d, c, b, a = byte(f:read(4),1,4)
+ return 256*256*256 * a + 256*256 * b + 256*c + d
else
return 0
end
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index 5ba08f7fc..f32124f84 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2011.04.19 16:38}
+\newcontextversion{2011.04.19 22:49}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 444c14b98..158e48b95 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{2011.04.19 16:38}
+\newcontextversion{2011.04.19 22:49}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index bcb773bcf..a6e41c766 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2011.04.19 16:38}
+\edef\contextversion{2011.04.19 22:49}
%D For those who want to use this:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index a4e32ae3a..c301fc844 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2011.04.19 16:38}
+\edef\contextversion{2011.04.19 22:49}
%D For those who want to use this:
diff --git a/tex/context/base/grph-inc.mkiv b/tex/context/base/grph-inc.mkiv
index 8304c393e..aa2157b9f 100644
--- a/tex/context/base/grph-inc.mkiv
+++ b/tex/context/base/grph-inc.mkiv
@@ -157,6 +157,7 @@
\let\@@efsymbol \v!no
%
\let\@@efcontrols \v!no
+ \let\@@efresources \empty
\let\@@efpreview \v!no
\let\@@efrepeat \v!no
%
@@ -254,6 +255,7 @@
format = "\@@efmethod",
preset = "\@@efprefix",
controls = "\@@efcontrols",
+ resources = "\@@efresources",
preview = "\@@efpreview",
display = "\@@efdisplay",
mask = "\@@efmask",
diff --git a/tex/context/base/grph-swf.lua b/tex/context/base/grph-swf.lua
index c597a77f8..62667bbba 100644
--- a/tex/context/base/grph-swf.lua
+++ b/tex/context/base/grph-swf.lua
@@ -29,6 +29,7 @@ function figures.checkers.swf(data)
-- display = dr.display,
-- controls = dr.controls,
-- label = dr.label,
+ resources = dr.resources,
}
context.stopfoundexternalfigure()
return data
diff --git a/tex/context/base/grph-u3d.lua b/tex/context/base/grph-u3d.lua
index 09bfd29e7..f2baac2f3 100644
--- a/tex/context/base/grph-u3d.lua
+++ b/tex/context/base/grph-u3d.lua
@@ -23,7 +23,7 @@ function figures.checkers.u3d(data)
local dr, du, ds = data.request, data.used, data.status
local width = todimen(dr.width or figures.defaultwidth)
local height = todimen(dr.height or figures.defaultheight)
- local foundname = du.report_u3ds(
+ local foundname = du.fullname
dr.width, dr.height = width, height
du.width, du.height, du.foundname = width, height, foundname
if trace_inclusion then
diff --git a/tex/context/base/l-io.lua b/tex/context/base/l-io.lua
index 88816648d..290dcec42 100644
--- a/tex/context/base/l-io.lua
+++ b/tex/context/base/l-io.lua
@@ -215,6 +215,12 @@ local function readnumber(f,n,m)
elseif n == 12 then
local a, b, c = readnumber(f,4), readnumber(f,4), readnumber(f,4)
return 256*256 * a + 256 * b + c
+ elseif n == -2 then
+ local b, a = byte(f:read(2),1,2)
+ return 256*a + b
+ elseif n == -4 then
+ local d, c, b, a = byte(f:read(4),1,4)
+ return 256*256*256 * a + 256*256 * b + 256*c + d
else
return 0
end
diff --git a/tex/context/base/lpdf-swf.lua b/tex/context/base/lpdf-swf.lua
index 2d26a6867..2fec5df07 100644
--- a/tex/context/base/lpdf-swf.lua
+++ b/tex/context/base/lpdf-swf.lua
@@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['lpdf-swf'] = {
-- The following code is based on tests by Luigi Scarso. His prototype
-- was using tex code. This is the official implementation.
-local format = string.format
+local format, gsub = string.format, string.gsub
local backends, lpdf = backends, lpdf
@@ -30,9 +30,11 @@ local pdfannotation_node = nodes.pool.pdfannotation
local function insertswf(spec)
- local width, height, filename = spec.width, spec.height, spec.foundname
+ local width, height, filename, resources = spec.width, spec.height, spec.foundname, spec.resources
- local eref = codeinjections.embedfile(filename)
+ local resources = resources and parametersets[resources]
+
+ local eref = codeinjections.embedfile { file = filename }
local flash = pdfdictionary {
Subtype = pdfconstant("Flash"),
@@ -58,6 +60,31 @@ local function insertswf(spec)
},
}
+ if resources then
+ local names = configuration.Assets.Names
+ local function add(filename)
+ local filename = gsub(filename,"%./","")
+ local eref = codeinjections.embedfile { file = filename, keepdir = true }
+ names[#names+1] = pdfstring(filename)
+ names[#names+1] = eref
+ end
+ local paths = resources.paths
+ if paths then
+ for i=1,#paths do
+ local files = dir.glob(paths[i] .. "/**")
+ for i=1,#files do
+ add(files[i])
+ end
+ end
+ end
+ local files = resources.files
+ if files then
+ for i=1,#files do
+ add(files[i])
+ end
+ end
+ end
+
local cref = pdfreference(pdfimmediateobject(tostring(configuration)))
local activation = pdfdictionary {
@@ -125,6 +152,7 @@ function backends.pdf.nodeinjections.insertswf(spec)
-- display = spec.display,
-- controls = spec.controls,
-- label = spec.label,
+ resources = spec.resources,
}
node.write(pdfannotation_node(spec.width,spec.height,0,annotation()))
end
diff --git a/tex/context/base/lpdf-u3d.lua b/tex/context/base/lpdf-u3d.lua
index 44e568ee1..60df2e2ab 100644
--- a/tex/context/base/lpdf-u3d.lua
+++ b/tex/context/base/lpdf-u3d.lua
@@ -479,7 +479,7 @@ local function insert3d(spec) -- width, height, factor, display, controls, label
end
function nodeinjections.insertu3d(spec)
- local annotation, preview, ref = insert3d {
+ local annotation, preview, ref = insert3d { -- just spec
foundname = spec.foundname,
width = spec.width,
height = spec.height,
diff --git a/tex/context/base/lpdf-wid.lua b/tex/context/base/lpdf-wid.lua
index d9885e30e..5e4247003 100644
--- a/tex/context/base/lpdf-wid.lua
+++ b/tex/context/base/lpdf-wid.lua
@@ -203,6 +203,7 @@ function codeinjections.embedfile(specification)
local name = specification.name or ""
local title = specification.title or ""
local hash = specification.hash or filename
+ local keepdir = specification.keepdir -- can change
if filename == "" then
filename = nil
end
@@ -240,7 +241,8 @@ function codeinjections.embedfile(specification)
end
end
end
- local basename = file.basename(filename)
+ local basename = keepdir == true and filename or file.basename(filename)
+local basename = string.gsub(basename,"%./","")
local savename = file.addsuffix(name ~= "" and name or basename,"txt") -- else no valid file
local a = pdfdictionary { Type = pdfconstant("EmbeddedFile") }
local f
@@ -559,7 +561,7 @@ local function insertrendering(specification)
if isurl then
descriptor.FS = pdfconstant("URL")
elseif option[v_embed] then
- descriptor.EF = codeinjections.embedfile(filename)
+ descriptor.EF = codeinjections.embedfile { file = filename }
end
local clip = pdfdictionary {
Type = pdfconstant("MediaClip"),
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index a7fb4838d..7e4138217 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 1f67d617a..3cc3340de 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-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index 82e90df27..17f136b29 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 04/19/11 16:38:06
+-- merge date : 04/19/11 22:49:01
do -- begin closure to overcome local limits and interference
@@ -2352,6 +2352,12 @@ local function readnumber(f,n,m)
elseif n == 12 then
local a, b, c = readnumber(f,4), readnumber(f,4), readnumber(f,4)
return 256*256 * a + 256 * b + c
+ elseif n == -2 then
+ local b, a = byte(f:read(2),1,2)
+ return 256*a + b
+ elseif n == -4 then
+ local d, c, b, a = byte(f:read(4),1,4)
+ return 256*256*256 * a + 256*256 * b + 256*c + d
else
return 0
end