diff options
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/cont-new.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4137 -> 4136 bytes | |||
-rw-r--r-- | tex/context/base/context-version.png | bin | 40498 -> 40273 bytes | |||
-rw-r--r-- | tex/context/base/context.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/core-uti.lua | 5 | ||||
-rw-r--r-- | tex/context/base/font-ctx.lua | 37 | ||||
-rw-r--r-- | tex/context/base/font-fea.mkvi | 30 | ||||
-rw-r--r-- | tex/context/base/font-odv.lua | 2 | ||||
-rw-r--r-- | tex/context/base/font-syn.lua | 4 | ||||
-rw-r--r-- | tex/context/base/l-lua.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mult-def.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24738 -> 24802 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 209990 -> 210148 bytes | |||
-rw-r--r-- | tex/context/base/util-str.lua | 4 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 8 |
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 Binary files differindex 4aaa7290f..c4c9fca76 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png Binary files differindex 83eac487a..dafc72c97 100644 --- a/tex/context/base/context-version.png +++ b/tex/context/base/context-version.png 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 Binary files differindex 6101bb979..354b7db67 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 5f226e134..32349caaf 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf 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 |