summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/lpdf-wid.lua6
-rw-r--r--tex/context/base/mult-de.tex1
-rw-r--r--tex/context/base/mult-def.lua4
-rw-r--r--tex/context/base/mult-en.tex1
-rw-r--r--tex/context/base/mult-fr.tex1
-rw-r--r--tex/context/base/mult-it.tex1
-rw-r--r--tex/context/base/mult-nl.tex1
-rw-r--r--tex/context/base/mult-ro.tex1
-rw-r--r--tex/context/base/node-fnt.lua73
-rw-r--r--tex/context/base/strc-not.mkiv16
-rw-r--r--tex/context/interface/keys-cs.xml1
-rw-r--r--tex/context/interface/keys-de.xml1
-rw-r--r--tex/context/interface/keys-en.xml1
-rw-r--r--tex/context/interface/keys-fr.xml1
-rw-r--r--tex/context/interface/keys-it.xml1
-rw-r--r--tex/context/interface/keys-nl.xml1
-rw-r--r--tex/context/interface/keys-pe.xml1
-rw-r--r--tex/context/interface/keys-ro.xml1
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua2
21 files changed, 82 insertions, 37 deletions
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 0fe4d2057..716dcf694 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2010.10.12 17:13}
+\newcontextversion{2010.10.13 14:39}
%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.tex b/tex/context/base/context.tex
index 8412ea74e..aa609e378 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2010.10.12 17:13}
+\edef\contextversion{2010.10.13 14:39}
%D For those who want to use this:
diff --git a/tex/context/base/lpdf-wid.lua b/tex/context/base/lpdf-wid.lua
index a948fcedc..3a2d1338e 100644
--- a/tex/context/base/lpdf-wid.lua
+++ b/tex/context/base/lpdf-wid.lua
@@ -9,6 +9,7 @@ if not modules then modules = { } end modules ['lpdf-wid'] = {
local format, gmatch, gsub, find = string.format, string.gmatch, string.gsub, string.find
local texsprint, ctxcatcodes, texbox, texcount = tex.sprint, tex.ctxcatcodes, tex.box, tex.count
local settings_to_array = utilities.parsers.settings_to_array
+local settings_to_hash = utilities.parsers.settings_to_hash
local report_media = logs.new("media")
@@ -160,6 +161,8 @@ end
local nofattachments, attachments, filestreams = 0, { }, { }
+-- todo: hash and embed once
+
function codeinjections.embedfile(filename)
local r = filestreams[filename]
if r == false then
@@ -317,6 +320,7 @@ end
local function insertrendering(specification)
local label = specification.label
+ local options = utilities.parsers.settings_to_hash(specification.options)
if not mf[label] then
local filename = specification.filename
local isurl = find(filename,"://")
@@ -354,7 +358,7 @@ local function insertrendering(specification)
}
if isurl then
descriptor.FS = pdfconstant("URL")
- elseif specification.embed then
+ elseif options[variables.embed] then
descriptor.EF = codeinjections.embedfile(filename)
end
local clip = pdfdictionary {
diff --git a/tex/context/base/mult-de.tex b/tex/context/base/mult-de.tex
index a06c6c633..0f47cc406 100644
--- a/tex/context/base/mult-de.tex
+++ b/tex/context/base/mult-de.tex
@@ -142,6 +142,7 @@
\setinterfacevariable{down}{down}
\setinterfacevariable{each}{jede}
\setinterfacevariable{edge}{kante}
+\setinterfacevariable{embed}{embed}
\setinterfacevariable{empty}{leer}
\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{endnote}
diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua
index ec10d39e2..436e22f51 100644
--- a/tex/context/base/mult-def.lua
+++ b/tex/context/base/mult-def.lua
@@ -11148,6 +11148,10 @@ return {
},
},
["variables"]={
+ ["embed"]={
+ ["en"]="embed",
+ ["nl"]="sluitin",
+ },
["end"]={
["en"]="end",
["nl"]="eind",
diff --git a/tex/context/base/mult-en.tex b/tex/context/base/mult-en.tex
index c8d0d3b28..ea48f0c16 100644
--- a/tex/context/base/mult-en.tex
+++ b/tex/context/base/mult-en.tex
@@ -142,6 +142,7 @@
\setinterfacevariable{down}{down}
\setinterfacevariable{each}{each}
\setinterfacevariable{edge}{edge}
+\setinterfacevariable{embed}{embed}
\setinterfacevariable{empty}{empty}
\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{endnote}
diff --git a/tex/context/base/mult-fr.tex b/tex/context/base/mult-fr.tex
index cbe16592f..14cad19c3 100644
--- a/tex/context/base/mult-fr.tex
+++ b/tex/context/base/mult-fr.tex
@@ -142,6 +142,7 @@
\setinterfacevariable{down}{down}
\setinterfacevariable{each}{chaque}
\setinterfacevariable{edge}{bord}
+\setinterfacevariable{embed}{embed}
\setinterfacevariable{empty}{vide}
\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{notefin}
diff --git a/tex/context/base/mult-it.tex b/tex/context/base/mult-it.tex
index 8351025cc..5dc791b24 100644
--- a/tex/context/base/mult-it.tex
+++ b/tex/context/base/mult-it.tex
@@ -142,6 +142,7 @@
\setinterfacevariable{down}{down}
\setinterfacevariable{each}{ogni}
\setinterfacevariable{edge}{bordo}
+\setinterfacevariable{embed}{embed}
\setinterfacevariable{empty}{vuoto}
\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{endnote}
diff --git a/tex/context/base/mult-nl.tex b/tex/context/base/mult-nl.tex
index 2a3758254..9e1a4aa5f 100644
--- a/tex/context/base/mult-nl.tex
+++ b/tex/context/base/mult-nl.tex
@@ -142,6 +142,7 @@
\setinterfacevariable{down}{omlaag}
\setinterfacevariable{each}{elk}
\setinterfacevariable{edge}{rand}
+\setinterfacevariable{embed}{sluitin}
\setinterfacevariable{empty}{leeg}
\setinterfacevariable{end}{eind}
\setinterfacevariable{endnote}{eindnoot}
diff --git a/tex/context/base/mult-ro.tex b/tex/context/base/mult-ro.tex
index 072e513ec..137e09408 100644
--- a/tex/context/base/mult-ro.tex
+++ b/tex/context/base/mult-ro.tex
@@ -142,6 +142,7 @@
\setinterfacevariable{down}{down}
\setinterfacevariable{each}{fiecare}
\setinterfacevariable{edge}{bordura}
+\setinterfacevariable{embed}{embed}
\setinterfacevariable{empty}{gol}
\setinterfacevariable{end}{end}
\setinterfacevariable{endnote}{endnote}
diff --git a/tex/context/base/node-fnt.lua b/tex/context/base/node-fnt.lua
index c35a42840..7e8fa3694 100644
--- a/tex/context/base/node-fnt.lua
+++ b/tex/context/base/node-fnt.lua
@@ -9,8 +9,12 @@ if not modules then modules = { } end modules ['node-fnt'] = {
if not context then os.exit() end -- generic function in node-dum
local next, type = next, type
+local concat = table.concat
local trace_characters = false trackers.register("nodes.characters", function(v) trace_characters = v end)
+local trace_fontrun = false trackers.register("nodes.fontrun", function(v) trace_fontrun = v end)
+
+local report_fontrun = logs.new("font run")
local nodes, node = nodes, node
@@ -23,10 +27,11 @@ local has_attribute = node.has_attribute
local starttiming = statistics.starttiming
local stoptiming = statistics.stoptiming
local nodecodes = nodes.nodecodes
-local glyph = nodecodes.glyph
local fontdata = fonts.ids
local handlers = nodes.handlers
+local glyph_code = nodecodes.glyph
+
-- some tests with using an array of dynamics[id] and processes[id] demonstrated
-- that there was nothing to gain (unless we also optimize other parts)
--
@@ -37,15 +42,33 @@ local handlers = nodes.handlers
-- happen often; we could consider processing sublists but that might need mor
-- checking later on; the current approach also permits variants
+local run = 0
+
function handlers.characters(head)
-- either next or not, but definitely no already processed list
starttiming(nodes)
local usedfonts, attrfonts, done = { }, { }, false
local a, u, prevfont, prevattr = 0, 0, nil, 0
- for n in traverse_id(glyph,head) do
- local font, attr = n.font, has_attribute(n,0) -- zero attribute is reserved for fonts in context
- if attr and attr > 0 then
- if font ~= prevfont or attr ~= prevattr then
+ if trace_fontrun then
+ run = run + 1
+ report_fontrun("")
+ report_fontrun("node mode run %s",run)
+ report_fontrun("")
+ local n = head
+ while n do
+ if n.id == glyph_code then
+ local font, attr = n.font, has_attribute(n,0) or 0
+ report_run("font %03i dynamic %03i glyph %s",font,attr,utf.char(n.char))
+ else
+ report_run("[%s]",node.type(n.id))
+ end
+ n = n.next
+ end
+ end
+ for n in traverse_id(glyph_code,head) do
+ local font, attr = n.font, has_attribute(n,0) or 0 -- zero attribute is reserved for fonts in context
+ if font ~= prevfont or attr ~= prevattr then
+ if attr > 0 then
local used = attrfonts[font]
if not used then
used = { }
@@ -66,31 +89,33 @@ function handlers.characters(head)
end
end
end
- prevfont, prevattr = font, attr
- end
- elseif font ~= prevfont then
- prevfont, prevattr = font, 0
- local used = usedfonts[font]
- if not used then
- local tfmdata = fontdata[font]
- if tfmdata then
- local shared = tfmdata.shared -- we need to check shared, only when same features
- if shared then
- local processors = shared.processes
- if processors and #processors > 0 then
- usedfonts[font] = processors
- u = u + 1
+ else
+ local used = usedfonts[font]
+ if not used then
+ local tfmdata = fontdata[font]
+ if tfmdata then
+ local shared = tfmdata.shared -- we need to check shared, only when same features
+ if shared then
+ local processors = shared.processes
+ if processors and #processors > 0 then
+ usedfonts[font] = processors
+ u = u + 1
+ end
end
+ else
+ -- probably nullfont
end
- else
- -- probably nullfont
end
end
- else
- prevattr = attr
+ prevfont, prevattr = font, attr
end
end
-
+ if trace_fontrun then
+ report_fontrun("")
+ report_fontrun("statics : %s",(u > 0 and concat(table.keys(usedfonts)," ")) or "none")
+ report_fontrun("dynamics: %s",(a > 0 and concat(table.keys(attrfonts)," ")) or "none")
+ report_fontrun("")
+ end
-- we could combine these and just make the attribute nil
if u == 1 then
local font, processors = next(usedfonts)
diff --git a/tex/context/base/strc-not.mkiv b/tex/context/base/strc-not.mkiv
index 7d75340a5..02434c637 100644
--- a/tex/context/base/strc-not.mkiv
+++ b/tex/context/base/strc-not.mkiv
@@ -229,13 +229,13 @@
[\c!location=\@@defaultnotedefloc,
\c!distance=\@@defaultnotedefdis,
\c!width=\v!fit,
- \c!headstyle=\noteparameter\c!style, % hm
- \c!headcolor=\noteparameter\c!color, % hm
+ \c!headstyle=\noteparameter\c!style,
+ \c!headcolor=\noteparameter\c!color,
\s!handler=\v!note,
\c!text=,
\c!before=,
\c!after=]%
- \doredefinenotecommands\currentnote
+ \doredefinenotecommands
\setupenumerations
[\currentnote]
[\s!parent=\??vn\currentnote,
@@ -245,8 +245,6 @@
\getparameters
[\??vn\currentnote]
[\s!parent=\??vn,#2]%
-% \definestructurecounter
-% [\currentnote]%
\ctxlua{structures.notes.define("\currentnote","insert",\number\csname\??vn:\currentnote\endcsname)}%
\the\everysetupnote
\dochecknote}
@@ -265,13 +263,13 @@
{\begingroup
\doenumerationinit{#1}{#2}{#3}%
\@@notemakedescription[##1]{}{##2}%
- \endgroup}}
+ \expandafter\endgroup\noteparameter\c!next}} % WS: added \noteparameter\c!next
-\def\doredefinenotecommands#1%
- {\normalexpanded{\noexpand\dodoredefinenotecommands{#1}{1}{}}%
+\def\doredefinenotecommands
+ {\normalexpanded{\noexpand\dodoredefinenotecommands{\currentnote}{1}{}}%
\let\@@subslevel\empty
\dostepwiserecurse{2}{\descriptionparameter\c!levels}{1}
- {\normalexpanded{\noexpand\dodoredefinenotecommands{#1}{\recurselevel}{\@@subslevel\v!sub}}%
+ {\normalexpanded{\noexpand\dodoredefinenotecommands{\currentnote}{\recurselevel}{\@@subslevel\v!sub}}%
\edef\@@subslevel{\@@subslevel\v!sub}}}
\let\setupnotedefinition\setupenumerations
diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml
index 4de09d222..fec038251 100644
--- a/tex/context/interface/keys-cs.xml
+++ b/tex/context/interface/keys-cs.xml
@@ -145,6 +145,7 @@
<cd:variable name='down' value='down'/>
<cd:variable name='each' value='kazdy'/>
<cd:variable name='edge' value='hrana'/>
+ <cd:variable name='embed' value='embed'/>
<cd:variable name='empty' value='prazdne'/>
<cd:variable name='end' value='end'/>
<cd:variable name='endnote' value='endnote'/>
diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml
index 8b0b17c7b..c1e8a989e 100644
--- a/tex/context/interface/keys-de.xml
+++ b/tex/context/interface/keys-de.xml
@@ -145,6 +145,7 @@
<cd:variable name='down' value='down'/>
<cd:variable name='each' value='jede'/>
<cd:variable name='edge' value='kante'/>
+ <cd:variable name='embed' value='embed'/>
<cd:variable name='empty' value='leer'/>
<cd:variable name='end' value='end'/>
<cd:variable name='endnote' value='endnote'/>
diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml
index dd3932d8b..fc148cfbb 100644
--- a/tex/context/interface/keys-en.xml
+++ b/tex/context/interface/keys-en.xml
@@ -145,6 +145,7 @@
<cd:variable name='down' value='down'/>
<cd:variable name='each' value='each'/>
<cd:variable name='edge' value='edge'/>
+ <cd:variable name='embed' value='embed'/>
<cd:variable name='empty' value='empty'/>
<cd:variable name='end' value='end'/>
<cd:variable name='endnote' value='endnote'/>
diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml
index d21a28e73..78a4ebb4c 100644
--- a/tex/context/interface/keys-fr.xml
+++ b/tex/context/interface/keys-fr.xml
@@ -145,6 +145,7 @@
<cd:variable name='down' value='down'/>
<cd:variable name='each' value='chaque'/>
<cd:variable name='edge' value='bord'/>
+ <cd:variable name='embed' value='embed'/>
<cd:variable name='empty' value='vide'/>
<cd:variable name='end' value='end'/>
<cd:variable name='endnote' value='notefin'/>
diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml
index 680ac0a0c..12ecd566d 100644
--- a/tex/context/interface/keys-it.xml
+++ b/tex/context/interface/keys-it.xml
@@ -145,6 +145,7 @@
<cd:variable name='down' value='down'/>
<cd:variable name='each' value='ogni'/>
<cd:variable name='edge' value='bordo'/>
+ <cd:variable name='embed' value='embed'/>
<cd:variable name='empty' value='vuoto'/>
<cd:variable name='end' value='end'/>
<cd:variable name='endnote' value='endnote'/>
diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml
index 9aa4efa2d..df1f277b9 100644
--- a/tex/context/interface/keys-nl.xml
+++ b/tex/context/interface/keys-nl.xml
@@ -145,6 +145,7 @@
<cd:variable name='down' value='omlaag'/>
<cd:variable name='each' value='elk'/>
<cd:variable name='edge' value='rand'/>
+ <cd:variable name='embed' value='sluitin'/>
<cd:variable name='empty' value='leeg'/>
<cd:variable name='end' value='eind'/>
<cd:variable name='endnote' value='eindnoot'/>
diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml
index fabb5c821..cd3c6c101 100644
--- a/tex/context/interface/keys-pe.xml
+++ b/tex/context/interface/keys-pe.xml
@@ -145,6 +145,7 @@
<cd:variable name='down' value='down'/>
<cd:variable name='each' value='هر'/>
<cd:variable name='edge' value='لبه'/>
+ <cd:variable name='embed' value='embed'/>
<cd:variable name='empty' value='تهی'/>
<cd:variable name='end' value='end'/>
<cd:variable name='endnote' value='ته‌نوشت'/>
diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml
index e71ddff85..99ca40a16 100644
--- a/tex/context/interface/keys-ro.xml
+++ b/tex/context/interface/keys-ro.xml
@@ -145,6 +145,7 @@
<cd:variable name='down' value='down'/>
<cd:variable name='each' value='fiecare'/>
<cd:variable name='edge' value='bordura'/>
+ <cd:variable name='embed' value='embed'/>
<cd:variable name='empty' value='gol'/>
<cd:variable name='end' value='end'/>
<cd:variable name='endnote' value='endnote'/>
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index aee369864..7af0079f7 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 : 10/12/10 17:13:41
+-- merge date : 10/13/10 14:39:16
do -- begin closure to overcome local limits and interference