summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-06-04 17:42:38 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-06-04 17:42:38 +0200
commit32f8047624c2fa49c3031a66edb5a039a813f276 (patch)
treed568ec496e3b4c95adc37ce435b0161a3f40c581
parent3ab20dbdfa095edd8c6bc00b8e3bdccd78900257 (diff)
downloadcontext-32f8047624c2fa49c3031a66edb5a039a813f276.tar.gz
2017-06-04 17:01:00
-rw-r--r--doc/context/documents/general/manuals/rules-mkiv.pdfbin155730 -> 155746 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-cs.pdfbin843684 -> 845018 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-de.pdfbin841934 -> 842943 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-en.pdfbin846823 -> 847214 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-fr.pdfbin840815 -> 841488 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-it.pdfbin842897 -> 843081 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-nl.pdfbin839028 -> 840035 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-ro.pdfbin839482 -> 840119 bytes
-rw-r--r--doc/context/presentations/examples/present-weird-001.pdfbin0 -> 334905 bytes
-rw-r--r--doc/context/presentations/examples/present-weird-001.tex113
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-fonts.tex64
-rw-r--r--doc/context/sources/general/manuals/rules/rules-mkiv.tex2
-rw-r--r--scripts/context/lua/mtxrun.lua26
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua26
-rw-r--r--scripts/context/stubs/unix/mtxrun26
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua26
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkiv/cont-fil.mkiv3
-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/font-ctx.lua113
-rw-r--r--tex/context/base/mkiv/font-emp.mkvi18
-rw-r--r--tex/context/base/mkiv/font-hsh.lua2
-rw-r--r--tex/context/base/mkiv/font-ini.lua4
-rw-r--r--tex/context/base/mkiv/font-ots.lua18
-rw-r--r--tex/context/base/mkiv/font-pre.mkiv8
-rw-r--r--tex/context/base/mkiv/font-sol.lua2
-rw-r--r--tex/context/base/mkiv/font-sty.mkvi115
-rw-r--r--tex/context/base/mkiv/grph-inc.lua4
-rw-r--r--tex/context/base/mkiv/l-table.lua22
-rw-r--r--tex/context/base/mkiv/lang-hyp.lua2
-rw-r--r--tex/context/base/mkiv/math-act.lua29
-rw-r--r--tex/context/base/mkiv/math-dim.lua5
-rw-r--r--tex/context/base/mkiv/math-noa.lua2
-rw-r--r--tex/context/base/mkiv/math-vfu.lua40
-rw-r--r--tex/context/base/mkiv/node-met.lua36
-rw-r--r--tex/context/base/mkiv/node-nut.lua5
-rw-r--r--tex/context/base/mkiv/node-res.lua17
-rw-r--r--tex/context/base/mkiv/node-rul.lua51
-rw-r--r--tex/context/base/mkiv/node-rul.mkiv11
-rw-r--r--tex/context/base/mkiv/page-one.mkiv2
-rw-r--r--tex/context/base/mkiv/spac-ver.lua31
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin25794 -> 25706 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin424658 -> 424698 bytes
-rw-r--r--tex/context/base/mkiv/strc-ref.mkvi2
-rw-r--r--tex/context/fonts/mkiv/cambria-math.lfg15
-rw-r--r--tex/context/interface/mkiv/context-en.xml4
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin846823 -> 847214 bytes
-rw-r--r--tex/context/interface/mkiv/i-fonts.xml10
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin60771 -> 60769 bytes
-rw-r--r--tex/context/modules/mkii/m-streams.mkii2
-rw-r--r--tex/context/modules/mkiv/m-matrix.mkiv359
-rw-r--r--tex/context/modules/mkiv/s-pre-30.mkiv257
-rw-r--r--tex/context/modules/mkiv/s-present-weird.mkiv (renamed from tex/context/modules/mkiv/s-pre-17.mkiv)138
-rw-r--r--tex/generic/context/luatex/luatex-basics-nod.lua2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua36
-rw-r--r--tex/generic/context/luatex/luatex-pdf.tex11
58 files changed, 899 insertions, 768 deletions
diff --git a/doc/context/documents/general/manuals/rules-mkiv.pdf b/doc/context/documents/general/manuals/rules-mkiv.pdf
index 97ac2fe4d..6e4da3ec8 100644
--- a/doc/context/documents/general/manuals/rules-mkiv.pdf
+++ b/doc/context/documents/general/manuals/rules-mkiv.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf
index 3fc137d65..b60b34a12 100644
--- a/doc/context/documents/general/qrcs/setup-cs.pdf
+++ b/doc/context/documents/general/qrcs/setup-cs.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf
index 9c2207d89..8555bebb8 100644
--- a/doc/context/documents/general/qrcs/setup-de.pdf
+++ b/doc/context/documents/general/qrcs/setup-de.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf
index ba034bb5c..068bac6cb 100644
--- a/doc/context/documents/general/qrcs/setup-en.pdf
+++ b/doc/context/documents/general/qrcs/setup-en.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf
index 4c1affb39..576e2e9f5 100644
--- a/doc/context/documents/general/qrcs/setup-fr.pdf
+++ b/doc/context/documents/general/qrcs/setup-fr.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf
index 1b39b9ed8..64554d876 100644
--- a/doc/context/documents/general/qrcs/setup-it.pdf
+++ b/doc/context/documents/general/qrcs/setup-it.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf
index ccb328a6b..4aa4dc2f6 100644
--- a/doc/context/documents/general/qrcs/setup-nl.pdf
+++ b/doc/context/documents/general/qrcs/setup-nl.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf
index d31367ab2..a21665aff 100644
--- a/doc/context/documents/general/qrcs/setup-ro.pdf
+++ b/doc/context/documents/general/qrcs/setup-ro.pdf
Binary files differ
diff --git a/doc/context/presentations/examples/present-weird-001.pdf b/doc/context/presentations/examples/present-weird-001.pdf
new file mode 100644
index 000000000..e3533a31e
--- /dev/null
+++ b/doc/context/presentations/examples/present-weird-001.pdf
Binary files differ
diff --git a/doc/context/presentations/examples/present-weird-001.tex b/doc/context/presentations/examples/present-weird-001.tex
new file mode 100644
index 000000000..7049bac59
--- /dev/null
+++ b/doc/context/presentations/examples/present-weird-001.tex
@@ -0,0 +1,113 @@
+\usemodule[present-weird]
+
+\starttext
+
+\TitlePage{About Text\\Today's Talk\\Hans Hagen}
+
+\StartPage{The First Page}
+
+ \StartTopic{Some Text}
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StartText \input knuth \StopText
+ \StopTopic
+
+ \StartTopic{Another Text}
+ \StartText \input tufte \StopText
+ \StartText \input zapf \StopText
+ \StartText \input knuth \StopText
+ \StopTopic
+
+ \StartTopic{Some More Text}
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StartText \input tufte \StopText
+ \StopTopic
+
+ \StartTopic{Some Text Again}
+ \StartText \input tufte \StopText
+ \StartText \input zapf \StopText
+ \StartText \input knuth \StopText
+ \StartText \input tufte \StopText
+ \StopTopic
+
+\StopPage
+
+\StartPage{The Second Page}
+
+ \StartTopic{Some Text}
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StopTopic
+
+ \StartTopic{Another Text}
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StopTopic
+
+ \StartTopic{Some Nice Text}
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StartText \input tufte \StopText
+ \StartText \input tufte \StopText
+ \StopTopic
+
+ \StartTopic{Some Funny Text}
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StopTopic
+
+ \StartTopic{Quite Some Text}
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StopTopic
+
+ \StartTopic{Even More Text}
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StopTopic
+
+\StopPage
+
+\StartPage{The Third Page}
+
+ \StartTopic{Some Short Text}
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StopTopic
+
+ \StartTopic{Some Minimal Text}
+ \StartText \input tufte \StopText
+ \StartText \input zapf \StopText
+ \StopTopic
+
+ \StartTopic{Some More Text}
+ \StartText \input tufte \StopText
+ \StartText \input knuth \StopText
+ \StartText \input zapf \StopText
+ \StartText \input tufte \StopText
+ \StartText \input tufte \StopText
+ \StopTopic
+
+\StopPage
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/luatex/luatex-fonts.tex b/doc/context/sources/general/manuals/luatex/luatex-fonts.tex
index 221c0ce85..793189d1c 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-fonts.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-fonts.tex
@@ -460,7 +460,7 @@ parameters to that command. The allowed commands and their arguments are:
and move right by the character's width\NC\NR
\NC node \NC 1 \NC node \NC output this node (list), and move right
by the width of this list\NC\NR
-\NC slot \NC 2 \NC number \NC a shortcut for the combination of a font and char command\NC\NR
+\NC slot \NC 2 \NC 2 numbers \NC a shortcut for the combination of a font and char command\NC\NR
\NC push \NC 0 \NC \NC save current position\NC\NR
\NC nop \NC 0 \NC \NC do nothing \NC\NR
\NC pop \NC 0 \NC \NC pop position \NC\NR
@@ -468,6 +468,8 @@ parameters to that command. The allowed commands and their arguments are:
\NC down \NC 1 \NC number \NC move down on the page\NC\NR
\NC right \NC 1 \NC number \NC move right on the page\NC\NR
\NC special \NC 1 \NC string \NC output a \type {\special} command\NC\NR
+\NC pdf \NC 2 \NC 2 strings \NC output a \PDF\ literal, the first string is one of \type {origin},
+ \type {page}, \type {direct} or \type {raw}\NC\NR
\NC lua \NC 1 \NC string \NC execute a \LUA\ script (at \type {\latelua} time)\NC\NR
\NC image \NC 1 \NC image \NC output an image (the argument can be either an \type
{<image>} variable or an \type {image_spec} table)\NC\NR
@@ -484,15 +486,17 @@ Here is a rather elaborate glyph commands example:
\starttyping
...
commands = {
- { 'push' }, -- remember where we are
- { 'right', 5000 }, -- move right about 0.08pt
- { 'font', 3 }, -- select the fonts[3] entry
- { 'char', 97 }, -- place character 97 (ASCII 'a')
- { 'pop' }, -- go all the way back
- { 'down', -200000 }, -- move upwards by about 3pt
- { 'special', 'pdf: 1 0 0 rg' } -- switch to red color
- { 'rule', 500000, 20000 } -- draw a bar
- { 'special','pdf: 0 g' } -- back to black
+ { "push" }, -- remember where we are
+ { "right", 5000 }, -- move right about 0.08pt
+ { "font", 3 }, -- select the fonts[3] entry
+ { "char", 97 }, -- place character 97 (ASCII 'a')
+ { "pop" }, -- go all the way back
+ { "down", -200000 }, -- move upwards by about 3pt
+ { "special", "pdf: 1 0 0 rg" } -- switch to red color
+ -- { "pdf", "origin", "1 0 0 rg" } -- switch to red color (alternative)
+ { "rule", 500000, 20000 } -- draw a bar
+ { "special", "pdf: 0 g" } -- back to black
+ -- { "pdf", "origin", "0 g" } -- back to black (alternative)
}
...
\stoptyping
@@ -511,6 +515,10 @@ output pointer will always move by exactly the width that was given in the \type
{width} key of the character hash. Any movements that take place inside the \type
{commands} array are ignored on the upper level.
+The special can have a \type {pdf:}, \type {pdf:origin:}, \type {pdf:page:},
+\type {pdf:direct:} or \type {pdf:raw:} prefix. When you have to concatenate
+strings using the \type {pdf} command might be more efficient.
+
\subsection{Artificial fonts}
Even in a \quote {real} font, there can be virtual characters. When \LUATEX\
@@ -662,7 +670,32 @@ You can define your own font into \type {font.fonts} by calling this function:
The return value is the internal id number of the defined font (the index into
\type {font.fonts}). If the font creation fails, an error is raised. The table
-is a font structure, as explained in \in {chapter} [fonts].
+is a font structure, as explained in \in {chapter} [fonts]. An alternative call
+is:
+
+\startfunctioncall
+<number> i =
+ font.define(<number> n, <table> f)
+\stopfunctioncall
+
+Where the first argument is a reserved font id (see below).
+
+\subsection{Extending a font}
+
+Within reasonable bounds you can extend a font after it has been defined. Because
+some properties are best left unchanged this is limited to adding characters.
+
+\startfunctioncall
+font.addcharacters(<number n>, <table> f)
+\stopfunctioncall
+
+The table passed can have the fields \type {characters} which is a (sub)table
+like the one used in define, and for virtual fonts a \type {fonts} table can be
+added. The characters defined in the \type {characters} table are added (when not
+yet present) or replace an existing entry. Keep in mind that replacing can have
+side effects because a character already can have been used. Instead of posing
+restrictions we expect the user to be careful. (The \type {setfont} helper is
+a more drastic replacer.)
\subsection{Projected next font id}
@@ -673,7 +706,14 @@ is a font structure, as explained in \in {chapter} [fonts].
This returns the font id number that would be returned by a \type {font.define}
call if it was executed at this spot in the code flow. This is useful for virtual
-fonts that need to reference themselves.
+fonts that need to reference themselves. If you pass \type {true} as argument,
+the id gets reserved and you can pass to \type {font.define} as first argument.
+This can be handy when you create complex virtual fonts.
+
+\startfunctioncall
+<number> i =
+ font.nextid(true)
+\stopfunctioncall
\subsection{Font id}
diff --git a/doc/context/sources/general/manuals/rules/rules-mkiv.tex b/doc/context/sources/general/manuals/rules/rules-mkiv.tex
index 536a37aea..00ab49c25 100644
--- a/doc/context/sources/general/manuals/rules/rules-mkiv.tex
+++ b/doc/context/sources/general/manuals/rules/rules-mkiv.tex
@@ -627,7 +627,7 @@ primitive here, so we follow the \TEX\ conventions of keywords.
\hskip-100mm
\darkred \frule width 100mm height 10mm depth 8mm radius 2mm line 2pt\relax
\hskip-100mm
- \hbox to 100mm{\white \bold \hfill some handy word with frames\hfill}
+ \hbox to 100mm{\white \bold \hfill some handy word with frames\hfill}%
\egroup
\stopbuffer
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 5e0aff589..7589a5c95 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -1670,7 +1670,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-table"] = package.loaded["l-table"] or true
--- original size: 39608, stripped down to: 23165
+-- original size: 39726, stripped down to: 23243
if not modules then modules={} end modules ['l-table']={
version=1.001,
@@ -2464,7 +2464,9 @@ function table.unnest(t)
return unnest(t)
end
local function are_equal(a,b,n,m)
- if a and b and #a==#b then
+ if a==b then
+ return true
+ elseif a and b and #a==#b then
n=n or 1
m=m or #a
for i=n,m do
@@ -2484,15 +2486,17 @@ local function are_equal(a,b,n,m)
end
end
local function identical(a,b)
- for ka,va in next,a do
- local vb=b[ka]
- if va==vb then
- elseif type(va)=="table" and type(vb)=="table" then
- if not identical(va,vb) then
+ if a~=b then
+ for ka,va in next,a do
+ local vb=b[ka]
+ if va==vb then
+ elseif type(va)=="table" and type(vb)=="table" then
+ if not identical(va,vb) then
+ return false
+ end
+ else
return false
end
- else
- return false
end
end
return true
@@ -20536,8 +20540,8 @@ end -- of closure
-- used libraries : l-lua.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 845187
--- stripped bytes : 306192
+-- original bytes : 845305
+-- stripped bytes : 306232
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 5e0aff589..7589a5c95 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -1670,7 +1670,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-table"] = package.loaded["l-table"] or true
--- original size: 39608, stripped down to: 23165
+-- original size: 39726, stripped down to: 23243
if not modules then modules={} end modules ['l-table']={
version=1.001,
@@ -2464,7 +2464,9 @@ function table.unnest(t)
return unnest(t)
end
local function are_equal(a,b,n,m)
- if a and b and #a==#b then
+ if a==b then
+ return true
+ elseif a and b and #a==#b then
n=n or 1
m=m or #a
for i=n,m do
@@ -2484,15 +2486,17 @@ local function are_equal(a,b,n,m)
end
end
local function identical(a,b)
- for ka,va in next,a do
- local vb=b[ka]
- if va==vb then
- elseif type(va)=="table" and type(vb)=="table" then
- if not identical(va,vb) then
+ if a~=b then
+ for ka,va in next,a do
+ local vb=b[ka]
+ if va==vb then
+ elseif type(va)=="table" and type(vb)=="table" then
+ if not identical(va,vb) then
+ return false
+ end
+ else
return false
end
- else
- return false
end
end
return true
@@ -20536,8 +20540,8 @@ end -- of closure
-- used libraries : l-lua.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 845187
--- stripped bytes : 306192
+-- original bytes : 845305
+-- stripped bytes : 306232
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 5e0aff589..7589a5c95 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -1670,7 +1670,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-table"] = package.loaded["l-table"] or true
--- original size: 39608, stripped down to: 23165
+-- original size: 39726, stripped down to: 23243
if not modules then modules={} end modules ['l-table']={
version=1.001,
@@ -2464,7 +2464,9 @@ function table.unnest(t)
return unnest(t)
end
local function are_equal(a,b,n,m)
- if a and b and #a==#b then
+ if a==b then
+ return true
+ elseif a and b and #a==#b then
n=n or 1
m=m or #a
for i=n,m do
@@ -2484,15 +2486,17 @@ local function are_equal(a,b,n,m)
end
end
local function identical(a,b)
- for ka,va in next,a do
- local vb=b[ka]
- if va==vb then
- elseif type(va)=="table" and type(vb)=="table" then
- if not identical(va,vb) then
+ if a~=b then
+ for ka,va in next,a do
+ local vb=b[ka]
+ if va==vb then
+ elseif type(va)=="table" and type(vb)=="table" then
+ if not identical(va,vb) then
+ return false
+ end
+ else
return false
end
- else
- return false
end
end
return true
@@ -20536,8 +20540,8 @@ end -- of closure
-- used libraries : l-lua.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 845187
--- stripped bytes : 306192
+-- original bytes : 845305
+-- stripped bytes : 306232
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index 5e0aff589..7589a5c95 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -1670,7 +1670,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-table"] = package.loaded["l-table"] or true
--- original size: 39608, stripped down to: 23165
+-- original size: 39726, stripped down to: 23243
if not modules then modules={} end modules ['l-table']={
version=1.001,
@@ -2464,7 +2464,9 @@ function table.unnest(t)
return unnest(t)
end
local function are_equal(a,b,n,m)
- if a and b and #a==#b then
+ if a==b then
+ return true
+ elseif a and b and #a==#b then
n=n or 1
m=m or #a
for i=n,m do
@@ -2484,15 +2486,17 @@ local function are_equal(a,b,n,m)
end
end
local function identical(a,b)
- for ka,va in next,a do
- local vb=b[ka]
- if va==vb then
- elseif type(va)=="table" and type(vb)=="table" then
- if not identical(va,vb) then
+ if a~=b then
+ for ka,va in next,a do
+ local vb=b[ka]
+ if va==vb then
+ elseif type(va)=="table" and type(vb)=="table" then
+ if not identical(va,vb) then
+ return false
+ end
+ else
return false
end
- else
- return false
end
end
return true
@@ -20536,8 +20540,8 @@ end -- of closure
-- used libraries : l-lua.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 845187
--- stripped bytes : 306192
+-- original bytes : 845305
+-- stripped bytes : 306232
-- end library merge
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index da22a37a1..f1f1b7b54 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2017.05.28 19:30}
+\newcontextversion{2017.06.04 16:55}
%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/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index b47be4275..ed6e5657a 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2017.05.28 19:30}
+\edef\contextversion{2017.06.04 16:55}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/cont-fil.mkiv b/tex/context/base/mkiv/cont-fil.mkiv
index e2c7f401e..69c45c0e5 100644
--- a/tex/context/base/mkiv/cont-fil.mkiv
+++ b/tex/context/base/mkiv/cont-fil.mkiv
@@ -74,7 +74,8 @@
\definefilesynonym [pre-balls] [present-balls]
\definefilesynonym [pre-15] [present-balls]
\definefilesynonym [pre-knot] [pre-16]
-\definefilesynonym [pre-weird] [pre-17]
+\definefilesynonym [pre-17] [present-weird]
+\definefilesynonym [pre-weird] [present-weird]
\definefilesynonym [pre-shade] [pre-18]
\definefilesynonym [pre-organic] [pre-19]
\definefilesynonym [pre-speckle] [pre-20]
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index c98444273..cd928701d 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{2017.05.28 19:30}
+\newcontextversion{2017.06.04 16:55}
%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 ac0e03320..f586f8706 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{2017.05.28 19:30}
+\edef\contextversion{2017.06.04 16:55}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/font-ctx.lua b/tex/context/base/mkiv/font-ctx.lua
index d375d4679..e13da7f8a 100644
--- a/tex/context/base/mkiv/font-ctx.lua
+++ b/tex/context/base/mkiv/font-ctx.lua
@@ -1262,7 +1262,7 @@ do -- else too many locals
-- -- characters[0x2007] = { width = characters[0x0030] and characters[0x0030].width or parameters.space } -- figure
-- -- characters[0x2008] = { width = characters[0x002E] and characters[0x002E].width or parameters.space } -- period
-- --
--- constructors.checkvirtualids(tfmdata) -- experiment, will become obsolete when slots can selfreference
+-- -- constructors.checkvirtualids(tfmdata) -- experiment, will become obsolete when slots can selfreference
-- local id = definefont(tfmdata)
-- csnames[id] = specification.cs
-- tfmdata.properties.id = id
@@ -1429,7 +1429,7 @@ do -- else too many locals
-- characters[0x2007] = { width = characters[0x0030] and characters[0x0030].width or parameters.space } -- figure
-- characters[0x2008] = { width = characters[0x002E] and characters[0x002E].width or parameters.space } -- period
--
- constructors.checkvirtualids(tfmdata) -- experiment, will become obsolete when slots can selfreference
+ -- constructors.checkvirtualids(tfmdata) -- experiment, will become obsolete when slots can selfreference
local fallbacks = specification.fallbacks
local mathsize = (mathsize == 1 or mathsize == 2 or mathsize == 3) and mathsize or nil -- can be unset so we test 1 2 3
if fallbacks and fallbacks ~= "" and mathsize and not busy then
@@ -2383,26 +2383,24 @@ dimenfactors.pct = nil
to scale virtual characters.</p>
--ldx]]--
--- in versions > 0.82 0 is supported as equivalent of self
-
-function constructors.checkvirtualids(tfmdata)
- -- begin of experiment: we can use { "slot", 0, number } in virtual fonts
- local fonts = tfmdata.fonts
- local selfid = font.nextid()
- if fonts and #fonts > 0 then
- for i=1,#fonts do
- local fi = fonts[i]
- if fi[2] == 0 then
- fi[2] = selfid
- elseif fi.id == 0 then
- fi.id = selfid
- end
- end
- else
- -- tfmdata.fonts = { "id", selfid } -- conflicts with other next id's (vf math), too late anyway
- end
- -- end of experiment
-end
+-- function constructors.checkvirtualids(tfmdata)
+-- -- begin of experiment: we can use { "slot", 0, number } in virtual fonts
+-- local fonts = tfmdata.fonts
+-- local selfid = font.nextid()
+-- if fonts and #fonts > 0 then
+-- for i=1,#fonts do
+-- local fi = fonts[i]
+-- if fi[2] == 0 then
+-- fi[2] = selfid
+-- elseif fi.id == 0 then
+-- fi.id = selfid
+-- end
+-- end
+-- else
+-- -- tfmdata.fonts = { "id", selfid } -- conflicts with other next id's (vf math), too late anyway
+-- end
+-- -- end of experiment
+-- end
-- function constructors.getvirtualid(tfmdata)
-- -- since we don't know the id yet, we use 0 as signal
@@ -3091,3 +3089,74 @@ do
}
end
+
+-- for the moment here (and not in font-con.lua):
+
+local identical = table.identical
+local copy = table.copy
+local fontdata = fonts.hashes.identifiers
+local addcharacters = font.addcharacters
+
+-- This helper is mostly meant to add last-resort (virtual) characters
+-- or runtime generated fonts (so we forget about features and such). It
+-- will probably take a while before it get used.
+
+local trace_adding = false
+local report_adding = logs.reporter("fonts","add characters")
+
+trackers.register("fonts.addcharacters",function(v) trace_adding = v end)
+
+if addcharacters then
+
+ function fonts.constructors.addcharacters(id,list)
+ local newchar = list.characters
+ if newchar then
+ local data = fontdata[id]
+ local newfont = list.fonts
+ local oldchar = data.characters
+ local oldfont = data.fonts
+ addcharacters(id, {
+ characters = newchar,
+ fonts = newfont,
+ nomath = not data.properties.hasmath,
+ })
+ -- this is just for tracing, as the assignment only uses the fonts list
+ -- and doesn't store it otherwise
+ if newfont then
+ if oldfont then
+ local oldn = #oldfont
+ local newn = #newfont
+ for n=1,newn do
+ local ok = false
+ local nf = newfont[n]
+ for o=1,oldn do
+ if identical(nf,oldfont[o]) then
+ ok = true
+ break
+ end
+ end
+ if not ok then
+ oldn = oldn + 1
+ oldfont[oldn] = newfont[i]
+ end
+ end
+ else
+ data.fonts = newfont
+ end
+ end
+ -- this is because we need to know what goes on and also might
+ -- want to access character data
+ for u, c in next, newchar do
+ if trace_adding then
+ report_adding("adding character %U to font %!font:name!",u,id)
+ end
+ oldchar[u] = c
+ end
+ end
+ end
+
+else
+ function fonts.constructors.addcharacters(id,list)
+ report_adding("adding characters to %!font:name! is not yet supported",id)
+ end
+end
diff --git a/tex/context/base/mkiv/font-emp.mkvi b/tex/context/base/mkiv/font-emp.mkvi
index 8f87ff7a1..1b6d46798 100644
--- a/tex/context/base/mkiv/font-emp.mkvi
+++ b/tex/context/base/mkiv/font-emp.mkvi
@@ -62,6 +62,16 @@
\else \ifx\fontalternative\s!sl\bs
\else \bf\fi\fi}
+\unexpanded\def\normalitalicface % public
+ {\relax\ifx\fontalternative\s!tf\it
+ \else \ifx\fontalternative\s!bf\bi
+ \else \tf\fi\fi}
+
+\unexpanded\def\normalslantedface % public
+ {\relax\ifx\fontalternative\s!tf\sl
+ \else \ifx\fontalternative\s!bf\bs
+ \else \tf\fi\fi}
+
\unexpanded\def\normaltypeface % public
{\relax
\ifx\fontalternative\s!bi \it \else
@@ -77,9 +87,11 @@
\ifx\fontalternative\s!bi \bf \else
\emphasistypeface \fi\fi\fi\fi\fi}
-\let\typeface\normaltypeface % public
-\let\boldface\normalboldface % public
-\let\swapface\swaptypeface % public
+\let\typeface \normaltypeface % public
+\let\boldface \normalboldface % public
+\let\slantedface\normalslantedface % public
+\let\italicface \normalitalicface % public
+\let\swapface \swaptypeface % public
%D To be set with the default body font environment: \type
%D {em} being \type {slanted} or \type {italic}.
diff --git a/tex/context/base/mkiv/font-hsh.lua b/tex/context/base/mkiv/font-hsh.lua
index 12f7bdfc2..95914b50c 100644
--- a/tex/context/base/mkiv/font-hsh.lua
+++ b/tex/context/base/mkiv/font-hsh.lua
@@ -359,4 +359,4 @@ function font.getfont(id)
return identifiers[id]
end
-font.setfont = currentfont -- bah, no native 'setfont' as name
+-- font.setfont = currentfont -- bah, no native 'setfont' as name
diff --git a/tex/context/base/mkiv/font-ini.lua b/tex/context/base/mkiv/font-ini.lua
index 708961b97..7ac8f218b 100644
--- a/tex/context/base/mkiv/font-ini.lua
+++ b/tex/context/base/mkiv/font-ini.lua
@@ -27,4 +27,6 @@ fonts.readers = { }
fonts.definers = { methods = { } }
fonts.loggers = { register = function() end }
-fontloader = nil
+if context then
+ fontloader = nil
+end
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index 1230475b3..bd54b61c9 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -224,7 +224,7 @@ local math_code = nodecodes.math
local dir_code = nodecodes.dir
local localpar_code = nodecodes.localpar
-local discretionary_code = disccodes.discretionary
+----- discretionary_code = disccodes.discretionary
local ligature_code = glyphcodes.ligature
local a_state = attributes.private('state')
@@ -3833,11 +3833,13 @@ otf.helpers.pardirstate = pardirstate
do
- -- experimental speedup (only with hyphenated text and multiple fonts per processing)
- --
- -- at some point this might become true by default
+ -- This is a measurable experimental speedup (only with hyphenated text and multiple
+ -- fonts per processor call), especially for fonts with lots of contextual lookups.
+
+ -- local fastdisc = true
+ local fastdisc = context and LUATEXVERSION >= 1.005
- local fastdisc = false directives.register("otf.fastdisc",function(v) fastdisc = v end)
+ directives.register("otf.fastdisc",function(v) fastdisc = v end)
function otf.featuresprocessor(head,font,attr,direction,n)
@@ -4023,9 +4025,9 @@ do
if ok then
done = true
end
- else
- start = getnext(start)
- end
+ else
+ start = getnext(start)
+ end
elseif id == math_code then
start = getnext(end_of_math(start))
elseif id == dir_code then
diff --git a/tex/context/base/mkiv/font-pre.mkiv b/tex/context/base/mkiv/font-pre.mkiv
index 9336fa352..45f933dd5 100644
--- a/tex/context/base/mkiv/font-pre.mkiv
+++ b/tex/context/base/mkiv/font-pre.mkiv
@@ -607,7 +607,7 @@
\definealternativestyle [\v!bigger] [\setbigbodyfont \tf] []
\definealternativestyle [\v!smaller] [\setsmallbodyfont\tf] []
-\definealternativestyle [\v!sans,\v!sansserif] [\ss] []
+\definealternativestyle [\v!sans,\v!sansserif] [\ss]
\definealternativestyle [\v!roman,\v!serif,\v!regular] [\rm]
\definealternativestyle [\v!handwritten] [\hw]
\definealternativestyle [\v!calligraphic] [\cg]
@@ -619,6 +619,12 @@
\definealternativestyle [\v!mononormal] [\tt\tf] []
\definealternativestyle [\v!monobold] [\tt\bf] []
+\definealternativestyle [typeface] [\typeface] [] % no translation here (quite basic)
+\definealternativestyle [boldface] [\boldface] []
+\definealternativestyle [slantedface] [\slantedface] []
+\definealternativestyle [italicface] [\italicface] []
+\definealternativestyle [swapface] [\swapface] []
+
% For Alan:
\definealternativestyle
diff --git a/tex/context/base/mkiv/font-sol.lua b/tex/context/base/mkiv/font-sol.lua
index 82fc3dc40..d89f41441 100644
--- a/tex/context/base/mkiv/font-sol.lua
+++ b/tex/context/base/mkiv/font-sol.lua
@@ -395,7 +395,7 @@ function splitters.split(head)
if m > max_more then max_more = m end
start, stop, done = nil, nil, true
end
- while current do -- also nextid
+ while current do -- also ischar
local next = getnext(current)
local id = getid(current)
if id == glyph_code then
diff --git a/tex/context/base/mkiv/font-sty.mkvi b/tex/context/base/mkiv/font-sty.mkvi
index cf49cd5eb..2d00c5ec8 100644
--- a/tex/context/base/mkiv/font-sty.mkvi
+++ b/tex/context/base/mkiv/font-sty.mkvi
@@ -18,34 +18,33 @@
%D \macros
%D {definealternativestyle}
%D
-%D In the main modules we are going to implement lots of
-%D parameterized commands and one of these parameters will
-%D concern the font to use. To suit consistent use of fonts we
-%D here implement a mechanism for defining the keywords that
-%D present a particular style or alternative.
+%D In the main modules we are going to implement lots of parameterized commands and
+%D one of these parameters will concern the font to use. To suit consistent use of
+%D fonts we here implement a mechanism for defining the keywords that present a
+%D particular style or alternative.
%D
%D \starttyping
%D \definealternativestyle [keywords] [\style] [\nostyle]
%D \stoptyping
%D
-%D The first command is used in the normal textflow, while the
-%D second command takes care of headings and alike. Consider
-%D the next two definitions:
+%D The first command is used in the normal textflow, while the second command takes
+%D care of headings and alike. Consider the next two definitions:
%D
%D \starttyping
%D \definealternativestyle [bold] [\bf] []
%D \definealternativestyle [cap] [\cap] [\cap]
%D \stoptyping
%D
-%D A change \type{\bf} in a heading which is to be set in
-%D \type{\tfd} does not look that well, so therefore we leave
-%D the second argument of \type{\definealternativestyle} empty.
-%D When we capatalize characters using the pseudo small cap
-%D command \type{\cap}, we want this to take effect in both
-%D text and headings, which is accomplished by assigning both
-%D arguments.
+%D A change \type {\bf} in a heading which is to be set in \type {\tfd} does not look
+%D that well, so therefore we leave the second argument of \type
+%D {\definealternativestyle} empty. When we capatalize characters using the pseudo
+%D small cap command \type {\cap}, we want this to take effect in both text and
+%D headings, which is accomplished by assigning both arguments.
-\installcorenamespace{alternativestyles}
+\installcorenamespace{alternativestyles} % settings
+\installcorenamespace{alternativestyle} % instances
+
+\installsetuponlycommandhandler \??alternativestyles {alternativestyles}
\setnewconstant \c_font_current_alternative_style_index \plusone
@@ -57,13 +56,21 @@
\let\definestyle\definealternativestyle % later redefined
+\newconstant\c_fonts_basics_alternative_style_method
+
\def\font_basics_define_alternative_style_indeed#variantone#varianttwo#command%
- {\ifcsname#command\endcsname
+ {\setvalue{\??alternativestyle#command}{\font_helpers_apply_alternative_style{#variantone}{#varianttwo}}%
+ \ifcsname#command\endcsname
% no redefinition
+ \else\ifnum\c_fonts_basics_alternative_style_method=\plusone
+ \ifthirdargument
+ \setuevalue{#command}{\groupedcommand{\expandafter\noexpand\begincsname\??alternativestyle#command\endcsname}{}}%
+ \else
+ \setuvalue{#command}{\groupedcommand{#variantone}{}}%
+ \fi
\else
\setuvalue{#command}{\groupedcommand{#variantone}{}}%
- \fi
- \setvalue{\??alternativestyles#command}{\font_helpers_apply_alternative_style{#variantone}{#varianttwo}}}%
+ \fi\fi}
\def\font_helpers_apply_alternative_style
{\ifcase\c_font_current_alternative_style_index
@@ -77,18 +84,24 @@
\fi}
\def\applyalternativestyle#name% public
- {\begincsname\??alternativestyles#name\endcsname}
+ {\begincsname\??alternativestyle#name\endcsname}
+
+\appendtoks
+ \doifelse{\alternativestylesparameter\c!method}\v!auto
+ {\c_fonts_basics_alternative_style_method\plusone}%
+ {\c_fonts_basics_alternative_style_method\zerocount}%
+\to \everysetupalternativestyles
-%D Maybe too geneneric, but probably ok is the following. (Maybe one
-%D day we will use a dedicated grouped command for styles.)
+%D Maybe too generic, but probably ok is the following. (Maybe one day we will use a
+%D dedicated grouped command for styles.)
% \appendtoks
% \let\groupedcommand\thirdofthreearguments
% \to \everysimplifycommands
-%D This command also defines the keyword as command. This means
-%D that the example definition of \type{bold} we gave before,
-%D results in a command \type{\bold} which can be used as:
+%D This command also defines the keyword as command. This means that the example
+%D definition of \type {bold} we gave before, results in a command \type {\bold}
+%D which can be used as:
%D
%D \startbuffer
%D He's a \bold{bold} man with a {\bold head}.
@@ -102,39 +115,33 @@
%D \definealternativestyle[bold][\bf][]\getbuffer
%D \stopexample
%D
-%D Such definitions are of course unwanted for \type{\cap}
-%D because this would result in an endless recursive call.
-%D Therefore we check on the existance of both the command and
-%D the substitution. The latter is needed because for instance
-%D \type{\type} is an entirely diferent command. That command
-%D handles verbatim, while the style command would just switch
-%D to teletype font. This is just an example of a tricky
-%D naming coincidence.
-
+%D Such definitions are of course unwanted for \type {\cap} because this would
+%D result in an endless recursive call. Therefore we check on the existance of both
+%D the command and the substitution. The latter is needed because for instance \type
+%D {\type} is an entirely diferent command. That command handles verbatim, while the
+%D style command would just switch to teletype font. This is just an example of a
+%D tricky naming coincidence.
+%D
%D \macros
%D {doconvertfont,noconvertfont,
%D dontconvertfont,redoconvertfont}
%D
-%D After having defined such keywords, we can call for them by
-%D using
+%D After having defined such keywords, we can call for them by using
%D
%D \starttyping
%D \doconvertfont{keyword}{text}
%D \stoptyping
%D
-%D We deliberately pass an argument. This enables us to
-%D assign converters that handle one argument, like
-%D \type{\cap}.
+%D We deliberately pass an argument. This enables us to assign converters that
+%D handle one argument, like \type {\cap}.
%D
-%D By default the first specification is used to set the style,
-%D exept when we say \type{\dontconvertfont}, after which the
-%D second specification is used. We can also directly call for
-%D \type{\noconvertfont}. In nested calls, we can restore the
-%D conversion by saying \type{\redoconvertfont}.
-
-%D These commands are not grouped! Grouping is most probably
-%D done by the calling macro's and would lead to unnecessary
-%D overhead.
+%D By default the first specification is used to set the style, exept when we say
+%D \type {\dontconvertfont}, after which the second specification is used. We can
+%D also directly call for \type {\noconvertfont}. In nested calls, we can restore
+%D the conversion by saying \type {\redoconvertfont}.
+%D
+%D These commands are not grouped! Grouping is most probably done by the calling
+%D macro's and would lead to unnecessary overhead.
\let\m_current_convert_font \empty
\let\m_current_convert_font_dt\empty
@@ -149,7 +156,7 @@
\def\font_helpers_do_convert_font
{\edef\m_current_convert_font_dt{\detokenize\expandafter{\m_current_convert_font}}%
- \ifcsname\??alternativestyles\m_current_convert_font_dt\endcsname
+ \ifcsname\??alternativestyle\m_current_convert_font_dt\endcsname
\expandafter\lastnamedcs
\else\ifcsname\m_current_convert_font_dt\endcsname
\doubleexpandafter\lastnamedcs
@@ -157,8 +164,8 @@
\doubleexpandafter\m_current_convert_font
\fi\fi}
-%D Low level switches (downward compatible, but we keep them as one can use
-%D them in styles):
+%D Low level switches (downward compatible, but we keep them as one can use them in
+%D styles):
%D
%D \starttyping
%D \usemodule[abr-02]
@@ -188,7 +195,7 @@
\unexpanded\def\dousecurrentstyleparameter % empty check outside here
{\edef\detokenizedstyleparameter{\detokenize\expandafter{\currentstyleparameter}}%
\settrue\fontattributeisset % reset is done elsewhere
- \ifcsname\??alternativestyles\detokenizedstyleparameter\endcsname
+ \ifcsname\??alternativestyle\detokenizedstyleparameter\endcsname
\lastnamedcs
\else\ifcsname\detokenizedstyleparameter\endcsname
\lastnamedcs
@@ -392,8 +399,8 @@
\unexpanded\edef\vsone#character{#character\normalUchar"FE00 } % used
\unexpanded\edef\vstwo#character{#character\normalUchar"FE01 } % not used but handy for testing
-%D For historic reasons we keep the following around but they are no longer
-%D that relevant for \MKIV.
+%D For historic reasons we keep the following around but they are no longer that
+%D relevant for \MKIV.
\unexpanded\def\doattributes#1#2#3#4%
{\begingroup % geen \bgroup, anders in mathmode lege \hbox
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua
index b5e74b4c1..5f2fb88c9 100644
--- a/tex/context/base/mkiv/grph-inc.lua
+++ b/tex/context/base/mkiv/grph-inc.lua
@@ -89,10 +89,6 @@ local trace_usage = false trackers.register ("graphics.usage", func
local extra_check = false directives.register("graphics.extracheck", function(v) extra_check = v end)
local auto_transform = true directives.register("graphics.autotransform", function(v) auto_transform = v end)
-if LUATEXVERSION <= 1 then
- auto_transform = false
-end
-
local report_inclusion = logs.reporter("graphics","inclusion")
local report_figures = logs.reporter("system","graphics")
local report_figure = logs.reporter("used graphic")
diff --git a/tex/context/base/mkiv/l-table.lua b/tex/context/base/mkiv/l-table.lua
index 3c1ce6daf..5bfc4bc47 100644
--- a/tex/context/base/mkiv/l-table.lua
+++ b/tex/context/base/mkiv/l-table.lua
@@ -1092,7 +1092,9 @@ function table.unnest(t) -- bad name
end
local function are_equal(a,b,n,m) -- indexed
- if a and b and #a == #b then
+ if a == b then
+ return true
+ elseif a and b and #a == #b then
n = n or 1
m = m or #a
for i=n,m do
@@ -1114,16 +1116,18 @@ local function are_equal(a,b,n,m) -- indexed
end
local function identical(a,b) -- assumes same structure
- for ka, va in next, a do
- local vb = b[ka]
- if va == vb then
- -- same
- elseif type(va) == "table" and type(vb) == "table" then
- if not identical(va,vb) then
+ if a ~= b then
+ for ka, va in next, a do
+ local vb = b[ka]
+ if va == vb then
+ -- same
+ elseif type(va) == "table" and type(vb) == "table" then
+ if not identical(va,vb) then
+ return false
+ end
+ else
return false
end
- else
- return false
end
end
return true
diff --git a/tex/context/base/mkiv/lang-hyp.lua b/tex/context/base/mkiv/lang-hyp.lua
index b85295f19..b1b9e605a 100644
--- a/tex/context/base/mkiv/lang-hyp.lua
+++ b/tex/context/base/mkiv/lang-hyp.lua
@@ -1647,7 +1647,7 @@ featureset.hyphenonly = hyphenonly == v_yes
return head, done
end
- if LUATEXVERSION< 1.005 then
+ if LUATEXVERSION < 1.005 then
expanded = function(head)
local done = hyphenate(head)
diff --git a/tex/context/base/mkiv/math-act.lua b/tex/context/base/mkiv/math-act.lua
index ddc7510b1..69d85d01f 100644
--- a/tex/context/base/mkiv/math-act.lua
+++ b/tex/context/base/mkiv/math-act.lua
@@ -238,6 +238,8 @@ function mathematics.overloaddimensions(target,original,set)
local hfactor = parameters.hfactor
local vfactor = parameters.vfactor
local addprivate = fonts.helpers.addprivate
+target.type = "virtual"
+target.properties.virtualized = true
local function overload(dimensions)
for unicode, data in next, dimensions do
local character = characters[unicode]
@@ -249,9 +251,9 @@ function mathematics.overloaddimensions(target,original,set)
if trace_defining and (width or height or depth) then
report_math("overloading dimensions of %C, width %a, height %a, depth %a",unicode,width,height,depth)
end
- if width then character.width = width * hfactor end
- if height then character.height = height * vfactor end
- if depth then character.depth = depth * vfactor end
+ if width then character.width = width * hfactor end
+ if height then character.height = height * vfactor end
+ if depth then character.depth = depth * vfactor end
--
local xoffset = data.xoffset
local yoffset = data.yoffset
@@ -262,13 +264,22 @@ function mathematics.overloaddimensions(target,original,set)
yoffset = { "down", -yoffset * vfactor }
end
if xoffset or yoffset then
- local slot = { "slot", 1, addprivate(target,nil,fastcopy(character)) }
- if xoffset and yoffset then
- character.commands = { xoffset, yoffset, slot }
- elseif xoffset then
- character.commands = { xoffset, slot }
+ if character.commands then
+ if yoffset then
+ insert(character.commands,1,yoffset)
+ end
+ if xoffset then
+ insert(character.commands,1,xoffset)
+ end
else
- character.commands = { yoffset, slot }
+ local slot = { "slot", 0, addprivate(target,nil,fastcopy(character)) }
+ if xoffset and yoffset then
+ character.commands = { xoffset, yoffset, slot }
+ elseif xoffset then
+ character.commands = { xoffset, slot }
+ else
+ character.commands = { yoffset, slot }
+ end
end
character.index = nil
end
diff --git a/tex/context/base/mkiv/math-dim.lua b/tex/context/base/mkiv/math-dim.lua
index ba0235a5b..72b9d7e50 100644
--- a/tex/context/base/mkiv/math-dim.lua
+++ b/tex/context/base/mkiv/math-dim.lua
@@ -6,9 +6,6 @@ if not modules then modules = { } end modules ['math-dim'] = {
license = "see context related readme files"
}
--- Beware: only Taco and Ulrik really understands in depth what these dimensions
--- do so if you run into problems ask on the context list.
-
-- The radical_rule value is also used as a trigger. In luatex the accent
-- placement happens either the opentype way (using top_accent cum suis) or the
-- traditional way. In order to determine what method to use the \Umathradicalrule
@@ -18,6 +15,8 @@ if not modules then modules = { } end modules ['math-dim'] = {
-- which case the engine takes the rulethickness. In c-speak:
--
-- int compat_mode = (radical_rule(cur_style) == undefined_math_parameter) ;
+--
+-- In the meantime things have been updated and we now have two code paths.
local abs, next = math.abs, next
diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua
index 2e94f0d71..8b1fa87fd 100644
--- a/tex/context/base/mkiv/math-noa.lua
+++ b/tex/context/base/mkiv/math-noa.lua
@@ -1461,7 +1461,7 @@ do
local hash = setmetatableindex(function(t,font)
local g = fontdata[font].goodies
- local m = g and g[1].mathematics
+ local m = g and g[1] and g[1].mathematics
local k = m and m.kernpairs
t[font] = k
return k
diff --git a/tex/context/base/mkiv/math-vfu.lua b/tex/context/base/mkiv/math-vfu.lua
index a8a789d28..1e40d5ac4 100644
--- a/tex/context/base/mkiv/math-vfu.lua
+++ b/tex/context/base/mkiv/math-vfu.lua
@@ -603,22 +603,24 @@ local function copy_glyph(main,target,original,unicode,slot)
local olddata = original[unicode]
if olddata then
local newdata = {
- width = olddata.width,
- height = olddata.height,
- depth = olddata.depth,
- italic = olddata.italic,
- kerns = olddata.kerns,
- commands = { { "slot", slot, unicode } },
+ width = olddata.width,
+ height = olddata.height,
+ depth = olddata.depth,
+ italic = olddata.italic,
+ kerns = olddata.kerns,
+ tounicode = olddata.tounicode,
+ commands = { { "slot", slot, unicode } },
}
local glyphdata = newdata
local nextglyph = olddata.next
while nextglyph do
local oldnextdata = original[nextglyph]
local newnextdata = {
- commands = { { "slot", slot, nextglyph } },
- width = oldnextdata.width,
- height = oldnextdata.height,
- depth = oldnextdata.depth,
+ width = oldnextdata.width,
+ height = oldnextdata.height,
+ depth = oldnextdata.depth,
+ tounicode = olddata.tounicode,
+ commands = { { "slot", slot, nextglyph } },
}
local newnextglyph = addprivate(main,formatters["M-N-%H"](nextglyph),newnextdata)
newdata.next = newnextglyph
@@ -641,10 +643,11 @@ local function copy_glyph(main,target,original,unicode,slot)
local oldglyph = hvi.glyph
local olddata = original[oldglyph]
local newdata = {
- commands = { { "slot", slot, oldglyph } },
- width = olddata.width,
- height = olddata.height,
- depth = olddata.depth,
+ width = olddata.width,
+ height = olddata.height,
+ depth = olddata.depth,
+ tounicode = olddata.tounicode,
+ commands = { { "slot", slot, oldglyph } },
}
hvi.glyph = addprivate(main,formatters["M-H-%H"](oldglyph),newdata)
-- report_virtual("copied h variant: %X at index %i",hvi.glyph,i)
@@ -659,10 +662,11 @@ local function copy_glyph(main,target,original,unicode,slot)
local oldglyph = vvi.glyph
local olddata = original[oldglyph]
local newdata = {
- commands = { { "slot", slot, oldglyph } },
- width = olddata.width,
- height = olddata.height,
- depth = olddata.depth,
+ width = olddata.width,
+ height = olddata.height,
+ depth = olddata.depth,
+ tounicode = olddata.tounicode,
+ commands = { { "slot", slot, oldglyph } },
}
vvi.glyph = addprivate(main,formatters["M-V-%H"](oldglyph),newdata)
-- report_virtual("copied v variant: %X at index %i",vvi.glyph,i)
diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua
index 9ebc8e411..e6d0f4689 100644
--- a/tex/context/base/mkiv/node-met.lua
+++ b/tex/context/base/mkiv/node-met.lua
@@ -669,39 +669,3 @@ end
nodes.keys = keys -- [id][subtype]
nodes.fields = nodefields -- (n)
-
--- temporary hack
-
-if LUATEXVERSION <= 1.002 then
-
- local get = tex.get
- local flush = node.free
-
- function tex.get(name,split)
- local s = get(name)
- if split == true then
- if s then
- local width = s.width
- local stretch = s.stretch
- local shrink = s.shrink
- local stretch_order = s.stretch_order
- local shrink_order = s.shrink_order
- flush(s)
- return width, stretch, shrink, stretch_order, shrink_order
- else
- return 0, 0, 0, 0, 0
- end
- elseif split == false then
- if s then
- local width = s.width
- flush(s)
- return width
- else
- return 0
- end
- else
- return s
- end
- end
-
-end
diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua
index b42727e06..787afd888 100644
--- a/tex/context/base/mkiv/node-nut.lua
+++ b/tex/context/base/mkiv/node-nut.lua
@@ -210,11 +210,6 @@ if LUATEXVERSION < 1.005 then
function direct.getsup (n) return getfield(n,"sup") end
end
--- if LUATEXVERSION < 1.004 then
--- local gc = direct.getcomponents
--- getcomponents = function(n) local c = gc(n) return c ~= 0 and c or nil end
--- end
-
-- local hash = table.setmetatableindex("number")
-- local ga = direct.get_attribute
-- function direct.get_attribute(n,a)
diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua
index 8b7ec1a62..858408bd9 100644
--- a/tex/context/base/mkiv/node-res.lua
+++ b/tex/context/base/mkiv/node-res.lua
@@ -26,6 +26,7 @@ local skipcodes = nodes.skipcodes
local kerncodes = nodes.kerncodes
local rulecodes = nodes.rulecodes
local nodecodes = nodes.nodecodes
+local gluecodes = nodes.gluecodes
local boundarycodes = nodes.boundarycodes
local usercodes = nodes.usercodes
@@ -86,6 +87,8 @@ local setpenalty = nuts.setpenalty
local setdir = nuts.setdir
local setshift = nuts.setshift
local setwidth = nuts.setwidth
+local setsubtype = nuts.setsubtype
+local setleader = nuts.setleader
local copy_nut = nuts.copy
local new_nut = nuts.new
@@ -183,6 +186,8 @@ local noad = register_nut(new_nut("noad"))
local boundary = register_nut(new_nut("boundary",boundarycodes.user))
local wordboundary = register_nut(new_nut("boundary",boundarycodes.word))
+local cleader = register_nut(copy_nut(glue)) setsubtype(cleader,gluecodes.cleaders) setglue(cleader,0,65536,0,2,0)
+
-- the dir field needs to be set otherwise crash:
local rule = register_nut(new_nut("rule")) setdir(rule, "TLT")
@@ -362,6 +367,18 @@ function nutpool.userrule(width,height,depth,dir) -- w/h/d == nil will let them
return n
end
+function nutpool.leader(width,list)
+ local n = copy_nut(cleader)
+ if width then
+ setwidth(n,width)
+ end
+ if list then
+ setleader(n,list)
+ end
+ return n
+end
+
+
function nutpool.latelua(code)
local n = copy_nut(latelua)
setfield(n,"string",code)
diff --git a/tex/context/base/mkiv/node-rul.lua b/tex/context/base/mkiv/node-rul.lua
index 4ec651d3b..b6cb9c167 100644
--- a/tex/context/base/mkiv/node-rul.lua
+++ b/tex/context/base/mkiv/node-rul.lua
@@ -35,6 +35,7 @@ local setlink = nuts.setlink
local getnext = nuts.getnext
local getprev = nuts.getprev
local getid = nuts.getid
+local getdir = nuts.getdir
local getattr = nuts.getattr
local setattr = nuts.setattr
local getfont = nuts.getfont
@@ -57,6 +58,7 @@ local traverse_id = nuts.traverse_id
local list_dimensions = nuts.rangedimensions
local hpack_nodes = nuts.hpack
local current_attr = nuts.current_attr
+local copy_list = nuts.copy_list
local nodecodes = nodes.nodecodes
local rulecodes = nodes.rulecodes
@@ -82,6 +84,7 @@ local nodepool = nuts.pool
local new_rule = nodepool.rule
local new_userrule = nodepool.userrule
local new_kern = nodepool.kern
+local new_leader = nodepool.leader
local n_tostring = nodes.idstostring
local n_tosequence = nodes.tosequence
@@ -208,8 +211,19 @@ local trace_ruled = false trackers.register("nodes.rules", function(v) trace_
local report_ruled = logs.reporter("nodes","rules")
function rules.define(settings)
- data[#data+1] = settings
- context(#data)
+ local nofdata = #data+1
+ data[nofdata] = settings
+ local text = settings.text
+ if text then
+ local b = nuts.takebox(text)
+ if b then
+ nodepool.register(b)
+ settings.text = getlist(b)
+ else
+ settings.text = nil
+ end
+ end
+ context(nofdata)
end
local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but acceptable for this purpose
@@ -242,7 +256,6 @@ local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but a
local method = d.method
local empty = d.empty == v_yes
local offset = d.offset
- local continue = d.continue
local dy = d.dy
local order = d.order
local max = d.max
@@ -322,18 +335,28 @@ local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but a
}
inject(tonut(r),w,ht,dp)
else
- for i=1,level do
- local ht = (offset+(i-1)*dy)*e + rulethickness - m
- local dp = -(offset+(i-1)*dy)*e + rulethickness + m
- local r = new_rule(w,ht,dp)
- if color then
- setattr(r,a_colormodel,colorspace)
- setattr(r,a_color,color)
- end
- if transparency then
- setattr(r,a_transparency,transparency)
+ local tx = d.text
+ if tx then
+ tx = copy_list(tx)
+ if d["repeat"] == v_yes then
+ tx = new_leader(w,tx)
end
+ local r = hpack_nodes(tx,w,"exactly")
inject(r,w,ht,dp)
+ else
+ for i=1,level do
+ local ht = (offset+(i-1)*dy)*e + rulethickness - m
+ local dp = -(offset+(i-1)*dy)*e + rulethickness + m
+ local r = new_rule(w,ht,dp)
+ if color then
+ setattr(r,a_colormodel,colorspace)
+ setattr(r,a_color,color)
+ end
+ if transparency then
+ setattr(r,a_transparency,transparency)
+ end
+ inject(r,w,ht,dp)
+ end
end
end
return head
@@ -617,6 +640,8 @@ implement {
{ "ta", "integer" },
{ "mp" },
{ "empty" },
+ { "text", "integer" },
+ { "repeat" },
}
}
}
diff --git a/tex/context/base/mkiv/node-rul.mkiv b/tex/context/base/mkiv/node-rul.mkiv
index bfdd17d30..661c8d7ef 100644
--- a/tex/context/base/mkiv/node-rul.mkiv
+++ b/tex/context/base/mkiv/node-rul.mkiv
@@ -108,8 +108,14 @@
\setuevalue\currentbar{\node_rules_direct{\currentbar}}%
\to \everydefinebar
+\newbox\b_node_rules
+
\unexpanded\def\node_rules_define
{\edef\p_node_rules_color{\barparameter\c!color}%
+ \edef\p_node_text{\barparameter\c!text}%
+ \ifx\p_node_text\empty\else
+ \setbox\b_node_rules\hbox{\p_node_text}%
+ \fi
\setevalue{\??barattribute\currentbar}{\number
\clf_definerule
continue {\barparameter\c!continue}%
@@ -125,6 +131,11 @@
offset \barparameter\c!offset\space % number
dy \barparameter\c!dy\space % number
empty {\barparameter\c!empty}%
+ \ifx\p_node_text\empty\else
+ % not that useful and efficient, more for testing something
+ text \b_node_rules
+ repeat {\barparameter\c!repeat}%
+ \fi
\relax}}
\unexpanded\def\node_rules_redefine#1%
diff --git a/tex/context/base/mkiv/page-one.mkiv b/tex/context/base/mkiv/page-one.mkiv
index 59efbd204..180c63834 100644
--- a/tex/context/base/mkiv/page-one.mkiv
+++ b/tex/context/base/mkiv/page-one.mkiv
@@ -1,4 +1,4 @@
- %D \module
+%D \module
%D [ file=page-one,
%D version=2000.10.20,
%D title=\CONTEXT\ Page Macros,
diff --git a/tex/context/base/mkiv/spac-ver.lua b/tex/context/base/mkiv/spac-ver.lua
index 2f0191e6a..d7c1a2cbb 100644
--- a/tex/context/base/mkiv/spac-ver.lua
+++ b/tex/context/base/mkiv/spac-ver.lua
@@ -1117,7 +1117,7 @@ end
-- we could inject a vadjust to force a recalculation .. a mess
--
-- So, the next is far from robust and okay but for the moment this overlaying
--- has to do. Always test this with the examples in spec-ver.mkvi!
+-- has to do. Always test this with the examples in spac-ver.mkvi!
local function check_experimental_overlay(head,current)
local p = nil
@@ -1131,7 +1131,12 @@ local function check_experimental_overlay(head,current)
-- We deal with this at the tex end .. we don't see spacing .. enabling this code
-- is probably harmless but then we need to test it.
--
+ -- we could calculate this before we call
+ --
+ -- problem: prev list and next list can be unconnected
+ --
local c = getnext(p)
+ local l = c
while c and c ~= n do
local id = getid(c)
if id == glue_code then
@@ -1139,19 +1144,28 @@ local function check_experimental_overlay(head,current)
elseif id == kern_code then
skips = skips + getkern(c)
end
+ l = c
c = getnext(c)
end
+ local c = getprev(n)
+ while c and c ~= n and c ~= l do
+ local id = getid(c)
+ if id == glue_code then
+ skips = skips + getwidth(c)
+ elseif id == kern_code then
+ skips = skips + getkern(c)
+ end
+ c = getprev(c)
+ end
--
local delta = n_ht + skips + p_dp
texsetdimen("global","d_spac_overlay",-delta) -- for tracing
+ -- we should adapt pagetotal ! (need a hook for that) .. now we have the wrong pagebreak
local k = new_kern(-delta)
+ head = insert_node_before(head,n,k)
if n_ht > p_ht then
- -- we should adapt pagetotal ! (need a hook for that) .. now we have the wrong pagebreak
- setheight(p,n_ht)
- end
- insert_node_before(head,n,k)
- if p == head then
- head = k
+ local k = new_kern(n_ht-p_ht)
+ head = insert_node_before(head,p,k)
end
if trace_vspacing then
report_vspacing("overlaying, prev height: %p, prev depth: %p, next height: %p, skips: %p, move up: %p",p_ht,p_dp,n_ht,skips,delta)
@@ -1177,7 +1191,7 @@ local function check_experimental_overlay(head,current)
c = current
while c do
local id = getid(c)
- if id == glue_code or id == penalty_code then
+ if id == glue_code or id == penalty_code then -- kern ?
c = getprev(c)
elseif id == hlist_code then
p = c
@@ -1190,6 +1204,7 @@ local function check_experimental_overlay(head,current)
if a_snapmethod == a_snapvbox then
-- quit, we're not on the mvl
else
+ -- inefficient when we're at the end of a page
local c = tonut(texlists.page_head)
while c and c ~= n do
local id = getid(c)
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 35991ae80..eb8c1fec7 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 d55d283f5..011c188be 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/base/mkiv/strc-ref.mkvi b/tex/context/base/mkiv/strc-ref.mkvi
index 9f2a7b91c..69a9e2219 100644
--- a/tex/context/base/mkiv/strc-ref.mkvi
+++ b/tex/context/base/mkiv/strc-ref.mkvi
@@ -372,7 +372,7 @@
{\begingroup
\dowithnextbox
{\strc_references_set_page_only_destination_attribute{#1}%
- \hbox
+ \hpack % \hbox
\ifnum\lastdestinationattribute=\attributeunsetvalue\else attr \destinationattribute \lastdestinationattribute \fi
{\box\b_strc_destination_nodes\box\nextbox}%
\endgroup}}
diff --git a/tex/context/fonts/mkiv/cambria-math.lfg b/tex/context/fonts/mkiv/cambria-math.lfg
index ae875e64d..c18854d18 100644
--- a/tex/context/fonts/mkiv/cambria-math.lfg
+++ b/tex/context/fonts/mkiv/cambria-math.lfg
@@ -50,5 +50,20 @@ return {
-- [0x1D44F] = 1000, -- 𝑎𝑏 demo
-- }
-- },
+ -- kerns = {
+ -- [0x1D453] = {
+ -- force = true,
+ -- topright = {
+ -- {
+ -- kern = 1000,
+ -- },
+ -- },
+ -- bottomright = {
+ -- {
+ -- kern = 1000,
+ -- },
+ -- },
+ -- },
+ -- },
},
}
diff --git a/tex/context/interface/mkiv/context-en.xml b/tex/context/interface/mkiv/context-en.xml
index 07181d34f..7a861c30e 100644
--- a/tex/context/interface/mkiv/context-en.xml
+++ b/tex/context/interface/mkiv/context-en.xml
@@ -10483,11 +10483,15 @@
</cd:command>
<cd:command category="fonts" file="font-emp.mkvi" name="emphasistypeface"/>
<cd:command category="fonts" file="font-emp.mkvi" name="emphasisboldface"/>
+ <cd:command category="fonts" file="font-emp.mkvi" name="normalitalicface"/>
+ <cd:command category="fonts" file="font-emp.mkvi" name="normalslantedface"/>
<cd:command category="fonts" file="font-emp.mkvi" name="normalboldface"/>
<cd:command category="fonts" file="font-emp.mkvi" name="normaltypeface"/>
<cd:command category="fonts" file="font-emp.mkvi" name="swaptypeface"/>
<cd:command category="fonts" file="font-emp.mkvi" name="typeface"/>
<cd:command category="fonts" file="font-emp.mkvi" name="boldface"/>
+ <cd:command category="fonts" file="font-emp.mkvi" name="italicface"/>
+ <cd:command category="fonts" file="font-emp.mkvi" name="slantedface"/>
<cd:command category="fonts" file="font-emp.mkvi" name="swapface"/>
<cd:command category="fonts" file="font-fea.mkvi" level="style" name="definefontfeature">
<cd:arguments>
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index ba034bb5c..068bac6cb 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-fonts.xml b/tex/context/interface/mkiv/i-fonts.xml
index c774ef273..02da28a93 100644
--- a/tex/context/interface/mkiv/i-fonts.xml
+++ b/tex/context/interface/mkiv/i-fonts.xml
@@ -49,6 +49,10 @@
<cd:command name="emphasisboldface" category="fonts" file="font-emp.mkvi"/>
+ <cd:command name="normalitalicface" category="fonts" file="font-emp.mkvi"/>
+
+ <cd:command name="normalslantedface" category="fonts" file="font-emp.mkvi"/>
+
<cd:command name="normalboldface" category="fonts" file="font-emp.mkvi"/>
<cd:command name="normaltypeface" category="fonts" file="font-emp.mkvi"/>
@@ -59,6 +63,10 @@
<cd:command name="boldface" category="fonts" file="font-emp.mkvi"/>
+ <cd:command name="italicface" category="fonts" file="font-emp.mkvi"/>
+
+ <cd:command name="slantedface" category="fonts" file="font-emp.mkvi"/>
+
<cd:command name="swapface" category="fonts" file="font-emp.mkvi"/>
<!--
@@ -1689,5 +1697,5 @@
<cd:resolve name="keyword-text-list"/>
</cd:arguments>
</cd:command>
-
+
</cd:interface>
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index a32a5e82d..5c189abd8 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/mkii/m-streams.mkii b/tex/context/modules/mkii/m-streams.mkii
index a8589a89c..67ece4f66 100644
--- a/tex/context/modules/mkii/m-streams.mkii
+++ b/tex/context/modules/mkii/m-streams.mkii
@@ -1,3 +1,5 @@
+% engine=pdftex
+
%D \module
%D [ file=m-streams,
%D version=2006.03.21,
diff --git a/tex/context/modules/mkiv/m-matrix.mkiv b/tex/context/modules/mkiv/m-matrix.mkiv
index f59363e94..f61bad80a 100644
--- a/tex/context/modules/mkiv/m-matrix.mkiv
+++ b/tex/context/modules/mkiv/m-matrix.mkiv
@@ -124,25 +124,14 @@ function matrix.typeset(m,options)
end
end
--- interchange two rows (i-th, j-th)
-
--- function matrix.swaprows(t,i,j)
--- if i <= #t and j <= #t then
--- t[i], t[j] = t[j], t[i]
--- return t
--- else
--- return "error: out of bound"
--- end
--- end
-
function matrix.swaprows(t,i,j)
local ti = t[i]
if not ti then
- return "error: no row i"
+ return "error: no row"
end
local tj = t[j]
if not tj then
- return "error: no row j"
+ return "error: no row"
end
t[i], t[j] = tj, ti
return t
@@ -150,28 +139,14 @@ end
-- interchange two columns (i-th, j-th)
--- function matrix.swapcolumns(t, i, j)
--- if i <= #t[1] and j <= #t[1] then
--- for k = 1, #t do
--- t[k][i], t[k][j] = t[k][j], t[k][i]
--- end
--- return t
--- else
--- return "error: out of bound"
--- end
--- end
-
function matrix.swapcolumns(t, i, j)
local t1 = t[1]
if not t1 then
return "error: no rows"
end
local n = #t1
- if i <= n then
- return "error: no row i"
- end
- if j <= n then
- return "error: no row j"
+ if i > n or j > n then
+ return "error: no column"
end
for k = 1, #t do
local tk = t[k]
@@ -315,7 +290,7 @@ local function determinant(m)
end
return s*d
else
- return "error: not a square matrix"
+ return "error: not a square matrix" -- not context(..)
end
end
@@ -387,7 +362,7 @@ matrix.rowEchelon = rowechelon
-- make matrices until its determinant is not 0
-function matrix.make(n,m,low,high)
+function matrix.make(m,n,low,high) -- m and n swapped
if not n then
n = 10
end
@@ -398,17 +373,16 @@ function matrix.make(n,m,low,high)
low = 0
end
if not high then
- high = 100
+ high = 10
end
- local t = { } -- make an empty n1 x n2 array
- local again = true
- for i=1,n do
+ local t = { }
+ for i=1,m do
t[i] = { }
end
while true do
- for i=1,n do
+ for i=1,m do
local ti = t[i]
- for j=1,m do
+ for j=1,n do
ti[j] = random(low,high)
end
end
@@ -527,6 +501,9 @@ matrix.inverse = inverse
\continueifinputfile{m-matrix.mkiv}
+\usemodule[m-matrix]
+\usemodule[art-01]
+
\starttext
\startluacode
@@ -542,147 +519,323 @@ document.DemoMatrixA = {
document.DemoMatrixB = {
{ 0, 2, 4, -4, 1 },
{ 0, 0, 2, 3, 4 },
- { 2, 2, -6, 2, 4 },
+ { 2, 2, -6, 3, 4 },
{ 2, 0, -6, 9, 7 },
{ 2, 2, -6, 2, 4 },
- { 2, 2, -6, 2, 4 },
+}
+
+document.DemoMatrixC = {
+ { 3, 3, -1, 3 },
+ { -1, 4, 1, 3 },
+ { 5, 4, 0, 2 },
+ { 2, 4, 0, -1 },
}
\stopluacode
+\startbuffer[demo]
+\typebuffer
+\startalignment[middle]
+ \dontleavehmode\inlinebuffer
+\stopalignment
+\stopbuffer
+
+\setuphead[section][before={\testpage[5]\blank[2*big]}]
+
\startsubject[title={A symbolic matrix}]
+\startbuffer
\ctxmodulematrix{typeset(moduledata.matrix.symbolic("a", "m", "n"))}
\ctxmodulematrix{typeset(moduledata.matrix.symbolic("a", "m", "n", 4, 8))}
+\stopbuffer
+
+\getbuffer[demo]
+
+\stopsubject
+
+\startsubject[title={Generate a new $m \times n$ matrix}]
+
+\startbuffer
+\startluacode
+ moduledata.matrix.typeset(moduledata.matrix.make(4,3, 0,5))
+ context.qquad()
+ moduledata.matrix.typeset(moduledata.matrix.make(5,5,-1,5))
+\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
\startsubject[title={Swap two rows (2 and 4)}]
+\startbuffer
\startluacode
-moduledata.matrix.typeset(document.DemoMatrixA)
-context.blank()
-moduledata.matrix.swap(document.DemoMatrixA, 2, 4)
-context.blank()
-moduledata.matrix.typeset(document.DemoMatrixA)
+ moduledata.matrix.typeset(document.DemoMatrixA)
+ context("$\\qquad \\Rightarrow \\qquad$")
+ moduledata.matrix.typeset(moduledata.matrix.swaprows(document.DemoMatrixA,2,4))
\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
-\startsubject[title={Multiply $3 \times r_2$}]
+\startsubject[title={Swap two columns (2 and 4)}]
+\startbuffer
\startluacode
-moduledata.matrix.typeset(document.DemoMatrixA)
-context.blank()
-moduledata.matrix.typeset(moduledata.matrix.multiply(document.DemoMatrixA, 2, 3))
+ moduledata.matrix.typeset(document.DemoMatrixA)
+ context("$\\qquad \\Rightarrow \\qquad$")
+ moduledata.matrix.typeset(moduledata.matrix.swapcolumns(document.DemoMatrixA,2, 4))
\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
-\startsubject[title={Row 2 + $4 \times r_3$}]
+\startsubject[title={Multiply 3 to row 2($3 \times r_2$)}]
+\startbuffer
\startluacode
-moduledata.matrix.typeset(document.DemoMatrixA)
-context.blank()
-moduledata.matrix.sumrow(document.DemoMatrixA, 2, 3, 4)
-context.blank()
-moduledata.matrix.typeset(document.DemoMatrixA,{ fences = "bars" } )
+ moduledata.matrix.typeset(document.DemoMatrixA)
+ context("$\\qquad \\Rightarrow \\qquad$")
+ moduledata.matrix.typeset(moduledata.matrix.multiply(document.DemoMatrixA,2,3))
\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
-\startsubject[title={Transpose a matrix}]
+\startsubject[title={Add 4 times of row 3 to row 2($r_2 + 4 \times r_3$)}]
+\startbuffer
\startluacode
-moduledata.matrix.typeset(document.DemoMatrixA)
-context.blank()
-moduledata.matrix.typeset(moduledata.matrix.transpose(document.DemoMatrixA))
+ moduledata.matrix.typeset(document.DemoMatrixA)
+ context("$\\qquad \\Rightarrow \\qquad$")
+ moduledata.matrix.sumrow(document.DemoMatrixA,2,3,4)
+ moduledata.matrix.typeset(document.DemoMatrixA)
\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
+
+\stopsubject
+
+\startsubject[title={Transpose a matrix}]
+\startbuffer
+\startluacode
+ moduledata.matrix.typeset(document.DemoMatrixA)
+ context("$\\qquad \\Rightarrow \\qquad$")
+ moduledata.matrix.typeset(moduledata.matrix.transpose(document.DemoMatrixA))
+\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
\startsubject[title={The inner product of two vectors}]
+\startbuffer
\startluacode
-context(moduledata.matrix.inner({ 1, 2, 3 }, { 3, 1, 2 }))
-context.blank()
+ context("$<1,2,3> \\cdot <3,1,2> \\ =\\ $ ")
+ context( moduledata.matrix.inner({ 1, 2, 3 }, { 3, 1, 2 }))
+\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
+
+\startluacode
+context("$<1,2,3> \\cdot <3,1,2, 4> \\ =\\ $ ")
context(moduledata.matrix.inner({ 1, 2, 3 }, { 3, 1, 2, 4 }))
\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
+
+\stopsubject
\startsubject[title={The product of two matrices}]
+\startbuffer
\startluacode
-moduledata.matrix.typeset(document.DemoMatrixA)
-context.blank()
-moduledata.matrix.typeset(moduledata.matrix.product(document.DemoMatrixA,document.DemoMatrixA))
+ context("$\\ $")
+ moduledata.matrix.typeset(document.DemoMatrixB)
+ context("$\\cdot$")
+ moduledata.matrix.typeset(document.DemoMatrixA)
+ context("$ = $")
+ moduledata.matrix.typeset(moduledata.matrix.product
+ (document.DemoMatrixB,document.DemoMatrixB))
\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
\startsubject[title={An Upper Triangular Matrix}]
-\ctxmodulematrix{typeset(moduledata.matrix.uppertri(document.DemoMatrixB))}
+\startbuffer
+\startluacode
+ moduledata.matrix.typeset(document.DemoMatrixB)
+ context("$\\qquad \\Rightarrow \\qquad$")
+ moduledata.matrix.typeset(moduledata.matrix.uppertri(document.DemoMatrixB))
+\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
-\startsubject[title={A determinant}]
+\stopsubject
+
+\startsubject[title={Determinant: using triangulation}]
+\startbuffer
\startluacode
-local m = {
- { 1, 2, 4 },
- { 0, 0, 2 },
- { 2, 2, -6 },
-}
-context(moduledata.matrix.determinant(m, "determinant=yes" ))
+ local m = {
+ { 1, 2, 4 },
+ { 0, 0, 2 },
+ { 2, 2, -6 },
+ { 2, 2, -6 },
+ }
+ moduledata.matrix.typeset(m, {fences="bars"})
+ context("$\\qquad = \\qquad$")
+ moduledata.matrix.determinant(m)
+\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
+
+\startbuffer
+\startluacode
+ moduledata.matrix.typeset(document.DemoMatrixC, { fences = "bars" })
+ context("$\\qquad = \\qquad$")
+ context(moduledata.matrix.determinant(document.DemoMatrixC))
\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
-\startsubject[title={Row echelon form}]
+\startsubject[title={Determinant: using Laplace Expansion}]
+\startbuffer
\startluacode
-local m = {
- { 1, 3, -2, 0, 2, 0, 0 },
- { 2, 6, -5, -2, 4, -3, -1 },
- { 0, 0, 5, 10, 0, 15, 5 },
- { 2, 6, 0, 8, 4, 18, 6 },
-}
+ moduledata.matrix.typeset(document.DemoMatrixC, { fences = "bars" })
+ context("$\\qquad = \\qquad$")
+ context(moduledata.matrix.laplace(document.DemoMatrixC))
+\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
+
+\stopsubject
+
+\startsubject[title={Example of Laplace Expansion using submatrix function}]
-moduledata.matrix.typeset(m)
-context.blank()
-moduledata.matrix.typeset(moduledata.matrix.rowechelon(m,1), { determinant = "yes" })
+\startbuffer
+\startluacode
+ local m = {
+ { 1, 5, 4, 2 },
+ { 5, 2, 0, 4 },
+ { 2, 2, 1, 1 },
+ { 1, 0, 0, 5 },
+ }
+ local options = {fences = "bars"}
+
+ moduledata.matrix.typeset(m,options)
+ context("\\par $=$")
+ for j = 1, #m[1] do
+ local mm = moduledata.matrix.submatrix(m, 1, j)
+ local factor = (-1)^(1+j) *(m[1][j])
+ context("\\ ($%d$) \\cdot ", factor)
+ moduledata.matrix.typeset(mm, options)
+ if j < #m[1] then
+ context("\\ $+$ ")
+ end
+ end
\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
-\startsubject[title={Solving linear equation}]
+\startsubject[title={Row echelon form}]
+\startbuffer
\startluacode
-local m = {
- { 1, 3, -2, 0 },
- { 2, 0, 1, 2 },
- { 6, -5, -2, 4 },
- { -3, -1, 5, 10 },
-}
+ local m = {
+ { 1, 3, -2, 0, 2, 0, 0 },
+ { 2, 6, -5, -2, 4, -3, -1 },
+ { 0, 0, 5, 10, 0, 15, 5 },
+ { 2, 6, 0, 8, 4, 18, 6 },
+ }
+ moduledata.matrix.typeset(m)
+ context("$\\Rightarrow$")
+ moduledata.matrix.typeset(moduledata.matrix.rowechelon(m,1))
+\stopluacode
+
+\stopbuffer
+
+\getbuffer[demo]
-local c = { 5, 2, 6, 8 }
-
-moduledata.matrix.typeset(moduledata.matrix.solve(m,c))
-context.blank()
-moduledata.matrix.typeset(moduledata.matrix.solve(m,c), { template = 6 })
-context.blank()
-moduledata.matrix.typeset(moduledata.matrix.solve(m,c), { template = "no" })
-context.blank()
-moduledata.matrix.typeset(moduledata.matrix.solve(m,c), { template = "%0.3f" })
-context.blank()
-moduledata.matrix.typeset(moduledata.matrix.solve(m,c), { template = "%0.4F" })
+\stopsubject
+
+\startsubject[title={Solving linear equation}]
+
+\startbuffer
+\startluacode
+ local m = {
+ { 1, 3, -2, 0 },
+ { 2, 0, 1, 2 },
+ { 6, -5, -2, 4 },
+ { -3, -1, 5, 10 },
+ }
+
+ local c = { 5, 2, 6, 8 }
+
+ moduledata.matrix.typeset(moduledata.matrix.solve(m,c))
+ context.blank()
+ moduledata.matrix.typeset(moduledata.matrix.solve(m,c), { template = 6 })
+ context.blank()
+ moduledata.matrix.typeset(moduledata.matrix.solve(m,c), { template = "no" })
+ context.blank()
+ moduledata.matrix.typeset(moduledata.matrix.solve(m,c), { template = "%0.3f" })
+ context.blank()
+ moduledata.matrix.typeset(moduledata.matrix.solve(m,c), { template = "%0.4F" })
\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
\startsubject[title={Inverse matrix}]
-\startcombination[2*1]
- {\ctxlua{moduledata.matrix.typeset { { 1, 1, 1 }, { 0, 2, 3 }, { 3, 2, 1 } }}} {}
- {\ctxlua{moduledata.matrix.typeset(moduledata.matrix.inverse { { 1, 1, 1 }, { 0, 2, 3 }, { 3, 2, 1 } })}} {}
-\stopcombination
+\startbuffer
+\startluacode
+ local m = {
+ { 1, 1, 1 },
+ { 0, 2, 3 },
+ { 3, 2, 1 },
+ }
+ context("$A =\\quad$")
+ moduledata.matrix.typeset(m)
+ context("$\\qquad A^{-1} = \\quad$")
+ moduledata.matrix.typeset(moduledata.matrix.inverse(m))
+ context("\\blank\\ ")
+ moduledata.matrix.typeset(m)
+ context("$\\cdot$")
+ moduledata.matrix.typeset(moduledata.matrix.inverse(m))
+ context("$ = $")
+ moduledata.matrix.typeset(moduledata.matrix.product(m, moduledata.matrix.inverse(m)))
+\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
\stopsubject
diff --git a/tex/context/modules/mkiv/s-pre-30.mkiv b/tex/context/modules/mkiv/s-pre-30.mkiv
deleted file mode 100644
index 1be85d02b..000000000
--- a/tex/context/modules/mkiv/s-pre-30.mkiv
+++ /dev/null
@@ -1,257 +0,0 @@
-%D \module
-%D [ file=s-pre-30,
-%D version=2006.04.25,
-%D title=\CONTEXT\ Style File,
-%D subtitle=Presentation Environment 30,
-%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.
-
-\usemodule[streams]
-
-\setuppapersize
- [S6] [S6]
-
-\setupbodyfont
- [12pt,tt]
-
-\definemeasure[bleed][6pt]
-
-\definecolor[maincolor-3][r=.5,g=.2,b=.2]
-\definecolor[maincolor-1][r=.2,g=.5,b=.2]
-\definecolor[maincolor-2][r=.2,g=.2,b=.5]
-
-\definecolor[pagecolor] [s=.5]
-\definecolor[resultcolor][s=1,t=.85,a=1]
-\definecolor[maincolor] [maincolor-3]
-
-\definecolorgroup
- [maingroup]
- [.5:.2:.2,
- .2:.5:.2,
- .2:.2:.5]
-
-\definecolorgroup
- [resultgroup]
- [1:.85:.85,
- .85:1:.85,
- .85:.85:1]
-
-\def\CurrentColor{1}
-
-\definecolor[maincolor] [maingroup:\CurrentColor]
-\definecolor[resultcolor][resultgroup:\CurrentColor]
-
-\def\NextColor{\ifnum\CurrentColor=3 \def\CurrentColor{1}\else\doglobal\increment\CurrentColor\fi}
-
-\setuplayout
- [backspace=\measure{bleed},
- topspace=30pt,
- bottomdistance=\measure{bleed},
- bottom=\dimexpr30pt-\measure{bleed}\relax,
- header=0pt,
- footer=0pt,
- topdistance=\measure{bleed},
- top=\dimexpr30pt-\measure{bleed}\relax,
- width=middle,
- height=middle]
-
-\setuptop
- [before=\vfill,
- after=\vfill,
- strut=yes]
-
-\setupbackgrounds
- [text]
- [backgroundoffset=\measure{bleed},
- background=color,
- backgroundcolor=maincolor]
-
-\setupbackgrounds
- [page]
- [background=color,
- backgroundcolor=pagecolor]
-
-\setupcolors
- [state=start,
- textcolor=white]
-
-\setuphead
- [chapter]
- [style=\ttd]
-
-\setuphead
- [section]
- [style=\ttd]
-
-\defineviewerlayer
- [result]
- [state=stop]
-
-\definelayer
- [result]
-
-\setuplayer
- [result]
- [width=\textwidth,
- height=\textheight]
-
-\setupbackgrounds
- [text]
- [background={color,toggle,foreground,result}]
-
-\setupinteraction
- [state=start,
- click=no,
- menu=on,
- color=white,
- contrastcolor=white,
- closepageaction=HideLayer{result},
- openpageaction=HideLayer{result}]
-
-% We add a dummy color switch so that each page has at least one
-% transparency; else acrobat will render the pages differently
-% bug in 6 and 7).
-
-\startinteractionmenu[bottom]
-% \color[resultcolor]{ }%
- \hfill
- \got [content] content \\
- \got [previouspage] previous \\
- \got [nextpage] next \\
- \got [ToggleLayer{result}] result \\
- \got [CloseDocument] close \\
-\stopinteractionmenu
-
-\setuphead
- [section]
- [placehead=no,
- incrementnumber=list]
-
-\setuplist
- [section]
- [alternative=f]
-
-\defineoverlay
- [toggle]
- [\overlaybutton{ToggleLayer{result}}]
-
-\definestreamlayer
- [resultstream]
-
-\startsetups streamlayer:resultstream:flush
- \setlayer
- [result]
- [preset=middlebottom,
- hoffset=\measure{bleed},
-% voffset=-\measure{bleed}]
- voffset=\measure{bleed}]
- {\startviewerlayer[result]%
-% \framed
-% [offset=overlay,
-% frame=off,
-% background=color,
-% backgroundoffset=1\dimexpr\measure{bleed}\relax,
-% backgroundcolor=maincolor]
- {\framed
- [offset=overlay,
- frame=off,
- foregroundcolor=maincolor,
- background=color,
- backgroundoffset=1\dimexpr\measure{bleed}\relax,
- backgroundcolor=resultcolor]
- {\tightlayer[\currentstreamlayer]}}
- \stopviewerlayer}
-\stopsetups
-
-\startsetups show-definition
- \subject{definition}
- \typebuffer
- \getbuffer
- \page
-\stopsetups
-
-\startsetups show-result
- \startstreamlayer[resultstream]
- \subject{result}
- \getbuffer
- \stopstreamlayer
- \placestreamlayer[resultstream]
- \page
-\stopsetups
-
-\startsetups show-usage
- \subject{usage}
- \typebuffer
- \startstreamlayer[resultstream]
- \subject{result}
- \getbuffer
- \stopstreamlayer
- \placestreamlayer[resultstream]
- \page
-\stopsetups
-
-\startsetups show-usage-lines
- \subject{usage}
- \typebuffer
- \startstreamlayer[resultstream]
- \subject{result}
- \startlines
- \getbuffer
- \stoplines
- \stopstreamlayer
- \placestreamlayer[resultstream]
- \page
-\stopsetups
-
-\startsetups show-contents
- \startcolumns[n=3]
- \placelist[section][criterium=text]
- \stopcolumns
- \pagereference[content]
- \page
- \NextColor
-\stopsetups
-
-\def\TitlePage#1%
- {\title{#1}
- \setups{show-contents}}
-
-\def\StartSample#1%
- {\starttext
- \page
- \section{#1}
- \setuptoptexts[][\processedfile\enspace:\enspace\lowercase{#1}]}
-
-\def\StopSample
- {\page
- \setuptoptexts[][]
- \stoptext
- \NextColor}
-
-\endinput
-
-\usemodule[pre-30]
-
-% \TitlePage{Howling to the moon}
-
-\StartSample{Basics}
-
-\startbuffer
-\lua{a = 1.5 ; b = 1.8 ; c = a*b ; context(c) ;}
-
-\startlua
- a = 1
- b = 2
- c = a*b
- context(c)
-\stoplua
-\stopbuffer
-
-\setups{show-usage}
-
-\StopSample
diff --git a/tex/context/modules/mkiv/s-pre-17.mkiv b/tex/context/modules/mkiv/s-present-weird.mkiv
index 558d5afd2..27ef7b2c2 100644
--- a/tex/context/modules/mkiv/s-pre-17.mkiv
+++ b/tex/context/modules/mkiv/s-present-weird.mkiv
@@ -1,8 +1,8 @@
%D \module
-%D [ file=s-pre-17,
+%D [ file=s-present-weird, % s-pre-17,
%D version=1999.08.20,
%D title=\CONTEXT\ Style File,
-%D subtitle=Presentation Environment 17,
+%D subtitle=Presentation Environment Weird,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
@@ -11,6 +11,14 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\startmodule[present-balls]
+
+%D This is a rather old style, adn I used it for a presentation about \MATHML\
+%D around the turn of the century. Unfortunately I can't find back that weird
+%D presentation. I didn't change the code apart from loading the body font. One can
+%D clock on an area and get it large. Clicking elsewhere brings back the main page.
+%D It was actualy a zoom test at that time.
+
\setupbodyfont
[dejavu,11pt,ss]
@@ -30,7 +38,7 @@
\setupinteraction
[state=start,
-% click=off,
+ % click=off,
color=TitleColor,
contrastcolor=TitleColor]
@@ -146,7 +154,7 @@
next=connection:\NextBlaBla
}
\hbox to 600pt \bgroup
- \setupinteraction[focus=fitr]
+ \setupinteraction[focus=frame]
\getrandomdimen\scratchdimen{50pt}{75pt}
\hskip0pt plus \scratchdimen minus \scratchdimen
\hpos {
@@ -196,7 +204,7 @@
\hbox to \wd\scratchbox
}
\bgroup
- \setupinteraction[focus=fitr]
+ \setupinteraction[focus=frame]
\hss
\switchtobodyfont[big]%
\bfd
@@ -238,8 +246,8 @@
[MasterPage]
[MasterPage]
\setuplayout [
- topspace=25pt,
- backspace=25pt,
+ topspace=50pt,
+ backspace=50pt,
width=middle,
header=0pt,
footer=0pt,
@@ -287,118 +295,8 @@
\endgroup
\stoptexdefinition
-\continueifinputfile{s-pre-17.mkiv}
-
-\starttext
-
-\nopdfcompression
-
-\TitlePage{About Text\\Today's Talk\\Hans Hagen}
-
-\StartPage{The First Page}
-
- \StartTopic{Some Text}
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StartText \input knuth \StopText
- \StopTopic
-
- \StartTopic{Another Text}
- \StartText \input tufte \StopText
- \StartText \input zapf \StopText
- \StartText \input knuth \StopText
- \StopTopic
-
- \StartTopic{Some More Text}
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StartText \input tufte \StopText
- \StopTopic
-
- \StartTopic{Some Text Again}
- \StartText \input tufte \StopText
- \StartText \input zapf \StopText
- \StartText \input knuth \StopText
- \StartText \input tufte \StopText
- \StopTopic
-
-\StopPage
-
-\StartPage{The Second Page}
-
- \StartTopic{Some Text}
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StopTopic
-
- \StartTopic{Another Text}
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StopTopic
-
- \StartTopic{Some Nice Text}
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StartText \input tufte \StopText
- \StartText \input tufte \StopText
- \StopTopic
-
- \StartTopic{Some Funny Text}
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StopTopic
-
- \StartTopic{Quite Some Text}
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StopTopic
-
- \StartTopic{Even More Text}
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StopTopic
-
-\StopPage
-
-\StartPage{The Third Page}
-
- \StartTopic{Some Short Text}
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StopTopic
-
- \StartTopic{Some Minimal Text}
- \StartText \input tufte \StopText
- \StartText \input zapf \StopText
- \StopTopic
-
- \StartTopic{Some More Text}
- \StartText \input tufte \StopText
- \StartText \input knuth \StopText
- \StartText \input zapf \StopText
- \StartText \input tufte \StopText
- \StartText \input tufte \StopText
- \StopTopic
+\stopmodule
-\StopPage
+\continueifinputfile{s-present-balls.mkiv}
-\stoptext
+\inputpresentationfile{examples/present-weird-001.tex}
diff --git a/tex/generic/context/luatex/luatex-basics-nod.lua b/tex/generic/context/luatex/luatex-basics-nod.lua
index c51473a4b..35fc96b48 100644
--- a/tex/generic/context/luatex/luatex-basics-nod.lua
+++ b/tex/generic/context/luatex/luatex-basics-nod.lua
@@ -463,7 +463,7 @@ function nuts.copy_only_glyphs(current)
return head
end
-nuts.uses_font = direct.uses_font
+nuts.uses_font = direct.uses_font
if not nuts.uses_font then
local getdisc = nuts.getdisc
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 67aa5972c..6c5a87a9d 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 : 05/28/17 19:30:32
+-- merge date : 06/04/17 16:55:09
do -- begin closure to overcome local limits and interference
@@ -1833,7 +1833,9 @@ function table.unnest(t)
return unnest(t)
end
local function are_equal(a,b,n,m)
- if a and b and #a==#b then
+ if a==b then
+ return true
+ elseif a and b and #a==#b then
n=n or 1
m=m or #a
for i=n,m do
@@ -1853,15 +1855,17 @@ local function are_equal(a,b,n,m)
end
end
local function identical(a,b)
- for ka,va in next,a do
- local vb=b[ka]
- if va==vb then
- elseif type(va)=="table" and type(vb)=="table" then
- if not identical(va,vb) then
+ if a~=b then
+ for ka,va in next,a do
+ local vb=b[ka]
+ if va==vb then
+ elseif type(va)=="table" and type(vb)=="table" then
+ if not identical(va,vb) then
+ return false
+ end
+ else
return false
end
- else
- return false
end
end
return true
@@ -7534,7 +7538,9 @@ fonts.analyzers={}
fonts.readers={}
fonts.definers={ methods={} }
fonts.loggers={ register=function() end }
-fontloader=nil
+if context then
+ fontloader=nil
+end
end -- closure
@@ -22254,7 +22260,6 @@ local disc_code=nodecodes.disc
local math_code=nodecodes.math
local dir_code=nodecodes.dir
local localpar_code=nodecodes.localpar
-local discretionary_code=disccodes.discretionary
local ligature_code=glyphcodes.ligature
local a_state=attributes.private('state')
local a_noligature=attributes.private("noligature")
@@ -25115,7 +25120,8 @@ otf.helpers=otf.helpers or {}
otf.helpers.txtdirstate=txtdirstate
otf.helpers.pardirstate=pardirstate
do
- local fastdisc=false directives.register("otf.fastdisc",function(v) fastdisc=v end)
+ local fastdisc=context and LUATEXVERSION>=1.005
+ directives.register("otf.fastdisc",function(v) fastdisc=v end)
function otf.featuresprocessor(head,font,attr,direction,n)
local sequences=sequencelists[font]
if not sequencelists then
@@ -25261,9 +25267,9 @@ do
if ok then
done=true
end
- else
- start=getnext(start)
- end
+ else
+ start=getnext(start)
+ end
elseif id==math_code then
start=getnext(end_of_math(start))
elseif id==dir_code then
diff --git a/tex/generic/context/luatex/luatex-pdf.tex b/tex/generic/context/luatex/luatex-pdf.tex
index 57004c6f8..ff6eaedeb 100644
--- a/tex/generic/context/luatex/luatex-pdf.tex
+++ b/tex/generic/context/luatex/luatex-pdf.tex
@@ -138,10 +138,8 @@
\xdef\pdfminorversion {\pdfvariable minorversion}
\xdef\pdfuniqueresname {\pdfvariable uniqueresname}
- \ifnum\luatexversion>88
- \edef\pdfpkfixeddpi {\pdfvariable pkfixeddpi}
- \edef\pdfignoreunknownimages {\pdfvariable ignoreunknownimages}
- \fi
+ \xdef\pdfpkfixeddpi {\pdfvariable pkfixeddpi}
+ \xdef\pdfignoreunknownimages {\pdfvariable ignoreunknownimages}
\xdef\pdfhorigin {\pdfvariable horigin}
\xdef\pdfvorigin {\pdfvariable vorigin}
@@ -187,11 +185,6 @@
\global\pdfdestmargin 0pt
\global\pdfthreadmargin 0pt
- % maybe
-
- % \global\chardef\pdftexversion 140
- % \global\def \pdftexrevision {16}
-
\fi
\endgroup