summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-02-24 12:15:08 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-02-24 12:15:08 +0100
commit33e29b1ba0661b0f58605749528362a0e12eae52 (patch)
treed9c1ceebec1f4869ffa0bdeafbeef390cb916525 /tex
parenta3170089e0016cfc0489c433d9113d94b9ce3d67 (diff)
downloadcontext-33e29b1ba0661b0f58605749528362a0e12eae52.tar.gz
2016-02-24 11:22:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/context-version.pdfbin4165 -> 4168 bytes
-rw-r--r--tex/context/base/mkiv/colo-ini.mkiv2
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/math-ini.mkiv19
-rw-r--r--tex/context/base/mkiv/mlib-pdf.lua48
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin9095 -> 9038 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin261032 -> 261033 bytes
-rw-r--r--tex/context/modules/mkiv/s-xml-analyzers.lua172
-rw-r--r--tex/context/modules/mkiv/s-xml-analyzers.mkiv37
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
11 files changed, 261 insertions, 23 deletions
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 7a9c71000..c8b24df0d 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/colo-ini.mkiv b/tex/context/base/mkiv/colo-ini.mkiv
index ebe390070..d8267becc 100644
--- a/tex/context/base/mkiv/colo-ini.mkiv
+++ b/tex/context/base/mkiv/colo-ini.mkiv
@@ -168,7 +168,7 @@
\unexpanded\def\startcolorpage {\startcolor[\ifx\maintextcolor\empty\defaulttextcolor\else\maintextcolor\fi]}
\unexpanded\def\stopcolorpage {\stopcolor}
-\def\getcolorattributevalue#1#2% obsolete, use \thecolorattribute instead ...
+\unexpanded\def\getcolorattributevalue#1#2% obsolete, use \thecolorattribute instead ...
{\begingroup
\colo_helpers_activate{#1}%
\normalexpanded{\endgroup\edef\noexpand#2%
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 09569f3ce..a5c077c88 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2016.02.23 17:25}
+\newcontextversion{2016.02.24 11:19}
%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/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 21f64f2f2..b116e336a 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -39,7 +39,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2016.02.23 17:25}
+\edef\contextversion{2016.02.24 11:19}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/math-ini.mkiv b/tex/context/base/mkiv/math-ini.mkiv
index aff02c57a..d20278c9b 100644
--- a/tex/context/base/mkiv/math-ini.mkiv
+++ b/tex/context/base/mkiv/math-ini.mkiv
@@ -628,15 +628,20 @@
%D Todo:
\unexpanded\def\mf
- {\csname\fontalternative\endcsname}
+ {\begincsname\fontalternative\endcsname}
-\let\normalmathop\mathop
+% \let\normalmathop\mathop % already defined
+
+% no longer needed as we no longer switch fonts
+%
+% \unexpanded\def\mathop
+% {\normalmathop
+% \bgroup
+% % no: \let\rm\mf
+% \afterassignment\math_op\let\nexttoken=}
+%
+% \def\math_op{\ifx\nexttoken\bgroup\else\nexttoken\egroup\fi}
-\unexpanded\def\mathop
- {\normalmathop
- \bgroup
- % no: \let\rm\mf
- \let\nexttoken=}
% this one too: \letvalue{\??mathcodecommand op}\mathop ?
diff --git a/tex/context/base/mkiv/mlib-pdf.lua b/tex/context/base/mkiv/mlib-pdf.lua
index 10327c01d..a2d4638a9 100644
--- a/tex/context/base/mkiv/mlib-pdf.lua
+++ b/tex/context/base/mkiv/mlib-pdf.lua
@@ -468,8 +468,21 @@ function metapost.flush(result,flusher,askedfig)
})
-- first we analyze
local before, after = processplugins(object)
- local evenodd = not object.istext and object.postscript == "evenodd"
- local collect = not object.istext and object.postscript == "collect"
+ local evenodd, collect, both = false, false, false
+ local postscript = object.postscript
+ if not object.istext then
+ if postscript == "evenodd" then
+ evenodd = true
+ elseif postscript == "collect" then
+ collect = true
+ elseif postscript == "both" then
+ both = true
+ elseif postscript == "eoboth" then
+ evenodd = true
+ both = true
+ end
+ end
+ --
if collect then
if not savedpath then
savedpath = { object.path or false }
@@ -498,16 +511,23 @@ function metapost.flush(result,flusher,askedfig)
linecap = lc
result[#result+1] = f_J(lc)
end
- local dl = object.dash
- if dl then
- local d = f_d(concat(dl.dashes or {}," "),dl.offset)
- if d ~= dashed then
- dashed = d
- result[#result+1] = d
+ if both then
+ if dashed ~= false then -- was just dashed test
+ result[#result+1] = "[] 0 d"
+ dashed = false
+ end
+ else
+ local dl = object.dash
+ if dl then
+ local d = f_d(concat(dl.dashes or {}," "),dl.offset)
+ if d ~= dashed then
+ dashed = d
+ result[#result+1] = d
+ end
+ elseif dashed ~= false then -- was just dashed test
+ result[#result+1] = "[] 0 d"
+ dashed = false
end
- elseif dashed ~= false then -- was just dashed test
- result[#result+1] = "[] 0 d"
- dashed = false
end
local path = object.path -- newpath
local transformed, penwidth = false, 1
@@ -547,7 +567,11 @@ function metapost.flush(result,flusher,askedfig)
if objecttype == "fill" then
result[#result+1] = evenodd and "h f*" or "h f" -- f* = eo
elseif objecttype == "outline" then
- result[#result+1] = open and "S" or "h S"
+ if both then
+ result[#result+1] = evenodd and "h B*" or "h B" -- f* = eo
+ else
+ result[#result+1] = open and "S" or "h S"
+ end
elseif objecttype == "both" then
result[#result+1] = evenodd and "h B*" or "h B"-- B* = eo -- b includes closepath
end
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 8edd493b1..6a35797d3 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 6297478c3..202123eb8 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/modules/mkiv/s-xml-analyzers.lua b/tex/context/modules/mkiv/s-xml-analyzers.lua
new file mode 100644
index 000000000..9de6471d1
--- /dev/null
+++ b/tex/context/modules/mkiv/s-xml-analyzers.lua
@@ -0,0 +1,172 @@
+if not modules then modules = { } end modules ['s-xml-analyzers'] = {
+ version = 1.001,
+ comment = "companion to s-xml-analyzers.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+moduledata.xml = moduledata.xml or { }
+moduledata.xml.analyzers = moduledata.xml.analyzers or { }
+
+local next, type = next, type
+local utfvalues = string.utfvalues
+local context = context
+local NC, NR, HL, FL, LL, SL, TB = context.NC, context.NR, context.HL, context.TB, context.FL, context.LL, context.SL
+local sortedhash, sortedkeys, concat, sequenced = table.sortedhash, table.sortedkeys, table.concat, table.sequenced
+
+local chardata = characters.data
+
+local tags = { }
+local char = { }
+local attr = { }
+local name = nil
+
+local function analyze(filename)
+
+ if type(filename) == "string" then
+ filename = { filename }
+ end
+
+ table.sort(filename)
+
+ local hash = concat(filename,"|")
+
+ if hash == name then
+ return
+ end
+
+ name = hash
+ tags = { }
+ char = { }
+ attr = { }
+
+ table.setmetatableindex(tags,function(t,k)
+ local v = {
+ n = 0,
+ attributes = { },
+ children = { },
+ }
+ t[k] = v
+ return v
+ end)
+
+ table.setmetatableindex(char,function(t,k)
+ t[k] = 0
+ return 0
+ end)
+
+ table.setmetatableindex(attr,function(t,k)
+ char[k] = char[k] or 0
+ t[k] = 0
+ return 0
+ end)
+
+ local function collect(e,parent)
+ local dt = e.dt
+ if e.special then
+ if dt then
+ for i=1,#dt do
+ local d = dt[i]
+ if type(d) == "table" then
+ collect(d,tg)
+ end
+ end
+ end
+ else
+ local at = e.at
+ local tg = e.tg
+ local tag = tags[tg]
+ tag.n = tag.n + 1
+ if at then
+ local attributes = tag.attributes
+ for k, v in next, at do
+ local a = attributes[k]
+ if a then
+ a[v] = (a[v] or 0) + 1
+ else
+ attributes[k] = { [v] = 1 }
+ end
+ for s in utfvalues(v) do
+ attr[s] = attr[s] + 1
+ end
+ end
+ end
+ if parent then
+ local children = tags[parent].children
+ children[tg] = (children[tg] or 0) + 1
+ end
+ if dt then
+ for i=1,#dt do
+ local d = dt[i]
+ if type(d) == "table" then
+ collect(d,tg)
+ else
+ for s in utfvalues(d) do
+ char[s] = char[s] + 1
+ end
+ end
+ end
+ end
+ end
+ end
+
+ for i=1,#filename do
+ collect(xml.load(filename[i]))
+ end
+
+ table.setmetatableindex(tags,nil)
+ table.setmetatableindex(char,nil)
+ table.setmetatableindex(attr,nil)
+
+end
+
+moduledata.xml.analyzers.maxnofattributes = 100
+
+function moduledata.xml.analyzers.structure(filename)
+ analyze(filename)
+ local done = false
+ local maxnofattributes = tonumber(moduledata.xml.analyzers.maxnofattributes) or 100
+ context.starttabulate { "|l|pA{nothyphenated,flushleft,verytolerant,stretch,broad}|" }
+ for name, data in table.sortedhash(tags) do
+ if done then
+ context.TB()
+ else
+ done = true
+ end
+ local children = data.children
+ local attributes = data.attributes
+ NC() context.bold("element") NC() context.darkred(name) NC() NR()
+ NC() context.bold("frequency") NC() context(data.n) NC() NR()
+ if next(children) then
+ NC() context.bold("children") NC() context.puretext(sequenced(children)) NC() NR()
+ end
+ if next(attributes) then
+ NC() context.bold("attributes") NC() context.puretext.darkgreen(concat(sortedkeys(attributes)," ")) NC() NR()
+ for attribute, values in sortedhash(attributes) do
+ local n = table.count(values)
+ if attribute == "id" or attribute == "xml:id" or n > maxnofattributes then
+ NC() context(attribute) NC() context("%s different values",n) NC() NR()
+ else
+ NC() context(attribute) NC() context.puretext(sequenced(values)) NC() NR()
+ end
+ end
+ end
+ end
+ context.stoptabulate()
+end
+
+function moduledata.xml.analyzers.characters(filename)
+ analyze(filename)
+ context.starttabulate { "|r|r|l|c|l|" }
+ for c, n in table.sortedhash(char) do
+ NC() context.darkred("%s",n)
+ NC() context.darkgreen("%s",attr[c])
+ NC() context("%U",c)
+ NC() context.char(c)
+ NC() context("%s",chardata[c].description)
+ NC() NR()
+ end
+ context.stoptabulate()
+end
+
diff --git a/tex/context/modules/mkiv/s-xml-analyzers.mkiv b/tex/context/modules/mkiv/s-xml-analyzers.mkiv
new file mode 100644
index 000000000..ed033bcfa
--- /dev/null
+++ b/tex/context/modules/mkiv/s-xml-analyzers.mkiv
@@ -0,0 +1,37 @@
+%D \module
+%D [ file=s-xml-analyzers,
+%D version=2013.05.28,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Analyze XML Content,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startmodule[xml-analyzers]
+
+\registerctxluafile{s-xml-analyzers}{}
+
+\installmodulecommandluasingle \showxmlstructure {moduledata.xml.analyzers.structure}
+\installmodulecommandluasingle \showxmlcharacters {moduledata.xml.analyzers.characters}
+
+\stopmodule
+
+\continueifinputfile{s-xml-analyzers.mkiv}
+
+\usemodule[art-01]
+
+\setupbodyfont[tt,10pt]
+
+\edef\FileName{\cldcontext{resolvers.findfile("music-collection.xml")}}
+
+\setupheadertexts[\FileName\space\emdash\space\pagenumber]
+
+\starttext
+
+ \showxmlcharacters[\FileName]
+
+\stoptext
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 04df65f02..7c784a440 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 02/23/16 17:25:08
+-- merge date : 02/24/16 11:19:40
do -- begin closure to overcome local limits and interference