summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-03-14 18:00:16 +0200
committerMarius <mariausol@gmail.com>2013-03-14 18:00:16 +0200
commit800d981b5f6f6d1f196dd3b9a421edb76504d600 (patch)
treeb67287c8c77ddfca8571f4160611c12d194304c9 /tex
parent660cef836abefb5cb3256ce80532e5c4abc5af7f (diff)
downloadcontext-800d981b5f6f6d1f196dd3b9a421edb76504d600.tar.gz
beta 2013.03.14 16:12
Diffstat (limited to 'tex')
-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-version.pdfbin4137 -> 4136 bytes
-rw-r--r--tex/context/base/context-version.pngbin40498 -> 40273 bytes
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/core-uti.lua5
-rw-r--r--tex/context/base/font-ctx.lua37
-rw-r--r--tex/context/base/font-fea.mkvi30
-rw-r--r--tex/context/base/font-odv.lua2
-rw-r--r--tex/context/base/font-syn.lua4
-rw-r--r--tex/context/base/l-lua.lua2
-rw-r--r--tex/context/base/mult-def.mkiv2
-rw-r--r--tex/context/base/status-files.pdfbin24738 -> 24802 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin209990 -> 210148 bytes
-rw-r--r--tex/context/base/util-str.lua4
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua8
17 files changed, 80 insertions, 22 deletions
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index 3a74876fc..c69747b77 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{2013.03.13 22:42}
+\newcontextversion{2013.03.14 16:12}
%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 c604b9fc7..2315d6f57 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.03.13 22:42}
+\newcontextversion{2013.03.14 16:12}
%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 4aaa7290f..c4c9fca76 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-version.png b/tex/context/base/context-version.png
index 83eac487a..dafc72c97 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index dbf11ad1f..e67c9c554 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{2013.03.13 22:42}
+\edef\contextversion{2013.03.14 16:12}
%D For those who want to use this:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 55193ca3a..dba25cfb0 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.03.13 22:42}
+\edef\contextversion{2013.03.14 16:12}
%D For those who want to use this:
diff --git a/tex/context/base/core-uti.lua b/tex/context/base/core-uti.lua
index b1b830c31..bf8d2c207 100644
--- a/tex/context/base/core-uti.lua
+++ b/tex/context/base/core-uti.lua
@@ -266,7 +266,10 @@ end)
function statistics.formatruntime(runtime)
if not environment.initex then -- else error when testing as not counters yet
local shipped = texcount['nofshipouts']
- local pages = texcount['realpageno'] - 1
+ local pages = texcount['realpageno']
+ if pages > shipped then
+ pages = shipped
+ end
if shipped > 0 or pages > 0 then
local persecond = shipped / runtime
if pages == 0 then pages = shipped end
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua
index a9fba145f..39fee86f1 100644
--- a/tex/context/base/font-ctx.lua
+++ b/tex/context/base/font-ctx.lua
@@ -492,7 +492,7 @@ local function presetcontext(name,parent,features) -- will go to con and shared
features = parent
parent = ""
end
- if features == "" then
+ if not features or features == "" then
features = { }
elseif type(features) == "string" then
features = normalize_features(settings_to_hash(features))
@@ -608,6 +608,7 @@ local function mergecontext(currentnumber,extraname,option)
numbers[number] = mergedname
merged[number] = option
setups[mergedname] = mergedfeatures
+-- inspect(mergedfeatures)
return number -- contextnumber(mergedname)
else
return currentnumber
@@ -663,15 +664,15 @@ end
-- end of redefine
-local cache = { } -- concat might be less efficient than nested tables
+local withcache = { } -- concat might be less efficient than nested tables
local function withset(name,what)
local zero = texattribute[0]
local hash = zero .. "+" .. name .. "*" .. what
- local done = cache[hash]
+ local done = withcache[hash]
if not done then
done = mergecontext(zero,name,what)
- cache[hash] = done
+ withcache[hash] = done
end
texattribute[0] = done
end
@@ -679,10 +680,10 @@ end
local function withfnt(name,what,font)
local font = font or currentfont()
local hash = font .. "*" .. name .. "*" .. what
- local done = cache[hash]
+ local done = withcache[hash]
if not done then
done = registercontext(font,name,what)
- cache[hash] = done
+ withcache[hash] = done
end
texattribute[0] = done
end
@@ -1606,7 +1607,29 @@ end
-- more interfacing:
-commands.definefontfeature = fonts.specifiers.presetcontext
+commands.definefontfeature = presetcontext
+
+local namecache = { }
+
+function commands.feature(name,parent,font)
+ local font = font or currentfont()
+ local hash = font .. "*" .. name .. "*" .. 2 -- what
+ local done = withcache[hash]
+ if not done then
+ if namecache[name] then
+ else
+ presetcontext(name,parent)
+ namecache[name] = true
+ end
+ if trace_features then
+ report_features("cummulative %a, font %a, number %a, set % a",name,font,n,f)
+ end
+ done = registercontext(font,name,2) -- what
+ withcache[hash] = done
+ end
+-- context(done)
+ texattribute[0] = done
+end
function commands.featurelist(...)
context(fonts.specifiers.contexttostring(...))
diff --git a/tex/context/base/font-fea.mkvi b/tex/context/base/font-fea.mkvi
index 969e95575..208b1b8db 100644
--- a/tex/context/base/font-fea.mkvi
+++ b/tex/context/base/font-fea.mkvi
@@ -166,6 +166,36 @@
\let\addff\addfontfeaturetofont
\let\subff\subtractfontfeaturefromfont
+% beware: these are global features on top of existing font features
+
+\let\currentfeature\s!current
+
+% \installcorenamespace{fontfeature}
+%
+% \setvalue{\??fontfeature\currentfeature}{}
+%
+% \unexpanded\def\feature#1%
+% {\ifcsname\??fontfeature\fontid\font+\currentfeature+#1\endcsname \else
+% \font_feature{#1}%
+% \fi
+% \attribute\zerocount\csname\??fontfeature\fontid\font+\currentfeature+#1\endcsname\relax
+% \edef\currentfeature{\currentfeature+#1}}
+%
+% \unexpanded\def\font_feature#1%
+% {\expandafter\xdef\csname\??fontfeature\fontid\font+\currentfeature+#1\endcsname{\ctxcommand{feature("\currentfeature+#1","#1",\number\fontid\font)}}}
+%
+% faster:
+%
+% \unexpanded\def\feature#1%
+% {\attribute\zerocount\ctxcommand{feature("\currentfeature+#1","#1")}\relax
+% \edef\currentfeature{\currentfeature+#1}}
+%
+% similar, less code:
+
+\unexpanded\def\feature#1%
+ {\ctxcommand{feature("\currentfeature+#1","#1")}%
+ \edef\currentfeature{\currentfeature+#1}}
+
%D \macros
%D {os}
%D
diff --git a/tex/context/base/font-odv.lua b/tex/context/base/font-odv.lua
index 7904bdb59..cd6b5b9c1 100644
--- a/tex/context/base/font-odv.lua
+++ b/tex/context/base/font-odv.lua
@@ -331,7 +331,7 @@ local basic_shaping_forms = {
}
local function initializedevanagi(tfmdata)
- local script, language = otf.scriptandlanguage(tfmdata,attr) -- take fast variant
+ local script, language = otf.scriptandlanguage(tfmdata,attr) -- todo: take fast variant
if script == "deva" or script == "dev2" then
local resources = tfmdata.resources
local lookuphash = resources.lookuphash
diff --git a/tex/context/base/font-syn.lua b/tex/context/base/font-syn.lua
index 6b3af4dee..ad8cd2b1d 100644
--- a/tex/context/base/font-syn.lua
+++ b/tex/context/base/font-syn.lua
@@ -1381,9 +1381,9 @@ local function heuristic(name,weight,style,width,variant,all) -- todo: fallbacks
if nf then
local t = { }
for i=1,nf do
- t[i] = format("%a",found[i].fontname)
+ t[i] = formatters["%a"](found[i].fontname)
end
- report_names("name %a resolved to %s instances: %s",name,nf,concat(t," "))
+ report_names("name %a resolved to %s instances: % t",name,nf,t)
else
report_names("name %a unresolved",name)
end
diff --git a/tex/context/base/l-lua.lua b/tex/context/base/l-lua.lua
index 24a788bec..401808772 100644
--- a/tex/context/base/l-lua.lua
+++ b/tex/context/base/l-lua.lua
@@ -304,7 +304,7 @@ helpers.notloaded = notloaded
function helpers.loaded(name)
local thename = gsub(name,"%.","/")
local luaname = addsuffix(thename,"lua")
- local libname = addsuffix(thename,os.libsuffix)
+ local libname = addsuffix(thename,os.libsuffix or "so") -- brrr
local libpaths = getlibpaths()
local clibpaths = getclibpaths()
return loadedbypath(luaname,name,libpaths,false,"lua")
diff --git a/tex/context/base/mult-def.mkiv b/tex/context/base/mult-def.mkiv
index 600f9a5ce..d54f160a9 100644
--- a/tex/context/base/mult-def.mkiv
+++ b/tex/context/base/mult-def.mkiv
@@ -78,6 +78,8 @@
\def\s!double {double}
\def\s!decimal {decimal}
+\def\s!current {current}
+
\def\c!HL {HL}
\def\c!VL {VL}
\def\c!NL {NL}
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 6101bb979..354b7db67 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 5f226e134..32349caaf 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/util-str.lua b/tex/context/base/util-str.lua
index cc21fb4d5..4890a11d6 100644
--- a/tex/context/base/util-str.lua
+++ b/tex/context/base/util-str.lua
@@ -221,7 +221,7 @@ function string.autodouble(s,sep)
return tostring(s) -- tostring not really needed
end
if t == "table" then
- return ('"' .. sequenced(t,sep or ",") .. '"')
+ return ('"' .. sequenced(s,sep or ",") .. '"')
end
return ('"' .. tostring(s) .. '"')
end
@@ -235,7 +235,7 @@ function string.autosingle(s,sep)
return tostring(s) -- tostring not really needed
end
if t == "table" then
- return ("'" .. sequenced(t,sep or ",") .. "'")
+ return ("'" .. sequenced(s,sep or ",") .. "'")
end
return ("'" .. tostring(s) .. "'")
end
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index d7f83cb87..eed915fda 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 : 03/13/13 22:42:27
+-- merge date : 03/14/13 16:12:57
do -- begin closure to overcome local limits and interference
@@ -204,7 +204,7 @@ helpers.notloaded=notloaded
function helpers.loaded(name)
local thename=gsub(name,"%.","/")
local luaname=addsuffix(thename,"lua")
- local libname=addsuffix(thename,os.libsuffix)
+ local libname=addsuffix(thename,os.libsuffix or "so")
local libpaths=getlibpaths()
local clibpaths=getclibpaths()
return loadedbypath(luaname,name,libpaths,false,"lua")
@@ -2632,7 +2632,7 @@ function string.autodouble(s,sep)
return tostring(s)
end
if t=="table" then
- return ('"'..sequenced(t,sep or ",")..'"')
+ return ('"'..sequenced(s,sep or ",")..'"')
end
return ('"'..tostring(s)..'"')
end
@@ -2645,7 +2645,7 @@ function string.autosingle(s,sep)
return tostring(s)
end
if t=="table" then
- return ("'"..sequenced(t,sep or ",").."'")
+ return ("'"..sequenced(s,sep or ",").."'")
end
return ("'"..tostring(s).."'")
end