summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-02-23 23:32:32 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-02-23 23:32:32 +0100
commit661fb34ced40815e1e5e9073de9c8475127da094 (patch)
treee37efb780017271ef7d9d3b79673d6093b228c23 /tex/context/modules/mkiv
parent8e51addbcecd962280c24a77de9ec1f6724e7a65 (diff)
downloadcontext-661fb34ced40815e1e5e9073de9c8475127da094.tar.gz
2018-02-23 22:19:00
Diffstat (limited to 'tex/context/modules/mkiv')
-rw-r--r--tex/context/modules/mkiv/m-compatible.mkiv63
-rw-r--r--tex/context/modules/mkiv/m-typesetting.mkiv22
-rw-r--r--tex/context/modules/mkiv/s-abbreviations-mixed.mkiv28
-rw-r--r--tex/context/modules/mkiv/s-abbreviations-pseudocaps.mkiv30
-rw-r--r--tex/context/modules/mkiv/s-abbreviations-smallcaps.mkiv31
-rw-r--r--tex/context/modules/mkiv/s-abbreviations-words.mkiv28
-rw-r--r--tex/context/modules/mkiv/s-article-basic.mkiv (renamed from tex/context/modules/mkiv/s-art-01.mkiv)17
-rw-r--r--tex/context/modules/mkiv/s-fonts-kerns.mkiv215
-rw-r--r--tex/context/modules/mkiv/s-magazine-basic.mkiv (renamed from tex/context/modules/mkiv/s-mag-01.mkiv)2
-rw-r--r--tex/context/modules/mkiv/s-maps.mkiv (renamed from tex/context/modules/mkiv/s-map-10.mkiv)0
10 files changed, 433 insertions, 3 deletions
diff --git a/tex/context/modules/mkiv/m-compatible.mkiv b/tex/context/modules/mkiv/m-compatible.mkiv
new file mode 100644
index 000000000..0e056180a
--- /dev/null
+++ b/tex/context/modules/mkiv/m-compatible.mkiv
@@ -0,0 +1,63 @@
+%D \module
+%D [ file=m-compatibility,
+%D version=2018.02.21,
+%D title=\CONTEXT\ System Macros,
+%D subtitle=ConTeXt Compatibility Layer,
+%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.
+
+%D I fear that I will not keep up in this file so feel free to contribute to the
+%D following. The idea is nto to load this file but more to have some insight in
+%D how to control compatibility (to some extent).
+
+\writestatus{loading}{ConTeXt Compatibility Layer}
+
+%D The side float mechanism has been redone and is not space compatible. Hopefully
+%D it will become stable soon and after that we will not touch it unless we have a
+%D real bug. There might be more control options. The problem is that there are too
+%D many combinations of content before and after a side float possible.
+
+\ifnum\contextversionno<20180101\relax
+ % nothing here
+\fi
+
+%D Picking up the right last line depth is sort of tricky when we cross a page and
+%D have some left|-|over material. The sychronizer is normally not needed but for
+%D now turned on by default.
+
+\ifnum\contextversionno<20180221\relax
+ \disabledirectives[vspacing.synchronizepage]
+\fi
+
+%D Some day we might default to the following which is a bit more conistent but
+%D not compatible.
+
+% \setdisplaymathspacemodel[4]
+%
+% \ifnum\contextversionno<20180221\relax
+% \setdisplaymathspacemodel[3]
+% \fi
+
+%D Currently this is in \type {cont-loc.mkiv} but some day we might do:
+
+% \definemixedcolumns
+% [\v!columns]
+% % compatible with columns default :
+% [\c!balance=\v!yes,
+% \c!blank={\v!line,\v!fixed}]
+%
+% \unexpanded\def\setupcolumns
+% {\setupmixedcolumns[\v!columns]}
+
+%D as well as:
+
+% \input page-cst.mkiv
+
+
+
+\endinput
diff --git a/tex/context/modules/mkiv/m-typesetting.mkiv b/tex/context/modules/mkiv/m-typesetting.mkiv
index 56cf85bbe..4456778ff 100644
--- a/tex/context/modules/mkiv/m-typesetting.mkiv
+++ b/tex/context/modules/mkiv/m-typesetting.mkiv
@@ -99,6 +99,28 @@
\stoplinecorrection
\stoptexdefinition
+\starttexdefinition unexpanded FourPairs #1
+ \startlinecorrection[blank]
+ \startcombination[fourpages][2*2]
+ {\typesetfile[#1.tex][page=1,width=\measure{firstpages}]} {1}
+ {\WhenValidPage{2}{\typesetfile[#1.tex][page=2,width=\measure{firstpages}]}} {\WhenValidPage{2}{2}}
+ {\WhenValidPage{3}{\typesetfile[#1.tex][page=3,width=\measure{firstpages}]}} {\WhenValidPage{3}{3}}
+ {\WhenValidPage{4}{\typesetfile[#1.tex][page=4,width=\measure{firstpages}]}} {\WhenValidPage{4}{4}}
+ \stopcombination
+ \stoplinecorrection
+\stoptexdefinition
+
+% \starttexdefinition unexpanded FourPagesTwo #1#2
+% \startlinecorrection[blank]
+% \startcombination[fourpages][4*1]
+% {\typesetfile[#1.tex][page=1,width=\measure{fourpages}]} {1}
+% {\WhenValidPage{2}{\typesetfile[#1.tex][page=2,width=\measure{fourpages}]}} {\WhenValidPage{2}{2}}
+% {\typesetfile[#2.tex][page=1,width=\measure{fourpages}]} {1}
+% {\WhenValidPage{2}{\typesetfile[#2.tex][page=2,width=\measure{fourpages}]}} {\WhenValidPage{2}{2}}
+% \stopcombination
+% \stoplinecorrection
+% \stoptexdefinition
+
\starttexdefinition unexpanded FourSpread #1
\startlinecorrection[blank]
\startcombination[fourpages][4*1]
diff --git a/tex/context/modules/mkiv/s-abbreviations-mixed.mkiv b/tex/context/modules/mkiv/s-abbreviations-mixed.mkiv
new file mode 100644
index 000000000..f7b2121d0
--- /dev/null
+++ b/tex/context/modules/mkiv/s-abbreviations-mixed.mkiv
@@ -0,0 +1,28 @@
+%D \module
+%D [ file= s-abbreviations-mixed, % was: s-abr-04
+%D version=1996.01.01,
+%D title=\CONTEXT\ Style File,
+%D subtitle=General Abbreviations Mixed,
+%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.
+
+\unprotect
+
+\setupsorting
+ [logo]
+ [\c!style=\font_style_pseudoMixedCapped]
+
+\protect
+
+\startmodule[abbreviations-mixed]
+
+\usemodule[abbreviations-logos]
+\usemodule[abbreviations-extras]
+
+\stopmodule
+
diff --git a/tex/context/modules/mkiv/s-abbreviations-pseudocaps.mkiv b/tex/context/modules/mkiv/s-abbreviations-pseudocaps.mkiv
new file mode 100644
index 000000000..fa8606a7b
--- /dev/null
+++ b/tex/context/modules/mkiv/s-abbreviations-pseudocaps.mkiv
@@ -0,0 +1,30 @@
+%D \module
+%D [ file= s-abbreviations-pseudocaps, % was: s-abr-01
+%D version=1996.01.01,
+%D title=\CONTEXT\ Style File,
+%D subtitle=General Abbreviations Pseudocaps,
+%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.
+
+\unprotect
+
+\setupsorting
+ [logo]
+ [\c!style=\v!capital]
+
+\setupcapitals
+ [\c!title=\v!no]
+
+\protect
+
+\startmodule[abbreviations-pseudocaps]
+
+\usemodule[abbreviations-logos]
+\usemodule[abbreviations-extras]
+
+\stopmodule
diff --git a/tex/context/modules/mkiv/s-abbreviations-smallcaps.mkiv b/tex/context/modules/mkiv/s-abbreviations-smallcaps.mkiv
new file mode 100644
index 000000000..2ce86ca33
--- /dev/null
+++ b/tex/context/modules/mkiv/s-abbreviations-smallcaps.mkiv
@@ -0,0 +1,31 @@
+%D \module
+%D [ file= s-abbreviations-smallcaps, % was: s-abr-02
+%D version=1996.01.01,
+%D title=\CONTEXT\ Style File,
+%D subtitle=General Abbreviations Smallcaps,
+%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.
+
+\unprotect
+
+\setupsorting
+ [logo]
+ [\c!style=\v!smallcaps]
+
+\setupcapitals
+ [\c!title=\v!no]
+
+\protect
+
+\startmodule[abbreviations-smallcaps]
+
+\usemodule[abbreviations-logos]
+\usemodule[abbreviations-extras]
+
+\stopmodule
+
diff --git a/tex/context/modules/mkiv/s-abbreviations-words.mkiv b/tex/context/modules/mkiv/s-abbreviations-words.mkiv
new file mode 100644
index 000000000..2b7d7cedc
--- /dev/null
+++ b/tex/context/modules/mkiv/s-abbreviations-words.mkiv
@@ -0,0 +1,28 @@
+%D \module
+%D [ file= s-abbreviations-words, % was: s-abr-32
+%D version=1998.08.10,
+%D title=\CONTEXT\ Style File,
+%D subtitle=General Abbreviations Words,
+%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.
+
+\unprotect
+
+\setupsorting
+ [logo]
+ [\c!style=\v!WORD]
+
+\protect
+
+\startmodule[abbreviations-words]
+
+\usemodule[abbreviations-logos]
+\usemodule[abbreviations-extras]
+
+\stopmodule
+
diff --git a/tex/context/modules/mkiv/s-art-01.mkiv b/tex/context/modules/mkiv/s-article-basic.mkiv
index 601ee1adc..69a577961 100644
--- a/tex/context/modules/mkiv/s-art-01.mkiv
+++ b/tex/context/modules/mkiv/s-article-basic.mkiv
@@ -1,6 +1,19 @@
-\unprotect
+%D \module
+%D [ file=s-article-basic,
+%D version=2010.01.01, % long ago, just for me
+%D title=\CONTEXT\ Style File,
+%D subtitle=Article Basic Setup,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startmodule[article-basic]
-\startmodule[art-01]
+\unprotect
\definemeasure [article:margin] [\paperheight/20] % was 15, see xtables-mkiv for results
\definemeasure [overview:margin] [\paperheight/30]
diff --git a/tex/context/modules/mkiv/s-fonts-kerns.mkiv b/tex/context/modules/mkiv/s-fonts-kerns.mkiv
new file mode 100644
index 000000000..c3a5637c3
--- /dev/null
+++ b/tex/context/modules/mkiv/s-fonts-kerns.mkiv
@@ -0,0 +1,215 @@
+%D \module
+%D [ file=s-fonts-kerns,
+%D version=2018.02.20, % was s-fnt-40 (given the kin dof code < 2010)
+%D title=\CONTEXT\ Style File,
+%D subtitle=Show Fonts Kerns,
+%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.
+
+%D This is real old code but we keep it around for educational purposes. it's
+%D not that efficient and we have better ways.
+%D
+%D \starttyping
+%D \showfontkerns
+%D \stoptyping
+%D
+%D This one shows all kerns so it's s bit different and as we use it in the
+%D manual \unknown
+
+\startluacode
+
+ local nodecodes = nodes.nodecodes
+
+ local disc_code = nodecodes.disc
+ local kern_code = nodecodes.kern
+ local glyph_code = nodecodes.glyph
+ local hlist_code = nodecodes.hlist
+
+ -- local function flatten(l)
+ -- while l do
+ -- local id = l.id
+ -- if id == disc_code then
+ -- local r = l.replace
+ -- if r then
+ -- local p = l.prev
+ -- local n = l.next
+ -- if n and p and n.id == glyph_code and p.id == glyph_code then
+ -- local s = node.slide(r)
+ -- p.next = r
+ -- n.prev = s
+ -- r.prev = p
+ -- s.next= n
+ -- l.replace = nil
+ -- node.free(l)
+ -- end
+ -- end
+ -- elseif id == hlist_code then
+ -- flatten(l.list)
+ -- end
+ -- l = l.next
+ -- end
+ -- end
+
+ local function mark(l,c)
+ while l do
+ local id = l.id
+ if id == kern_code then
+ context.showkern(l.kern,c)
+ elseif id == disc_code then
+ mark(l.pre,2)
+ mark(l.post,3)
+ mark(l.replace,4)
+ elseif id == hlist_code then
+ mark(l.list,c)
+ end
+ l = l.next
+ end
+ end
+
+ local function collect(l)
+ local m = { }
+ while l do
+ local id = l.id
+ if id == hlist_code then
+ m[#m+1] = l
+ end
+ l = l.next
+ end
+ return m
+ end
+
+ local function inject(l,m,i)
+ local x = l
+ i = i or 0
+ while l do
+ local id = l.id
+ if id == kern_code then
+ i = i + 1
+ node.insert_before(x,l,node.copy(m[i]))
+ elseif id == disc_code then
+ i = inject(l.pre,m,i)
+ i = inject(l.post,m,i)
+ i = inject(l.replace,m,i)
+ elseif id == hlist_code then
+ i = inject(l.list,m,i)
+ end
+ l = l.next
+ end
+ return i
+ end
+
+ moduledata.fonts = moduledata.fonts or { }
+ moduledata.fonts.kerns = moduledata.fonts.kerns or { }
+
+ function moduledata.fonts.kerns._show_(n)
+ inject(tex.box[n].list,collect(tex.box[6].list))
+ end
+
+ function moduledata.fonts.kerns.show(n)
+ context("\\bgroup")
+ context("\\setbox6\\vbox\\bgroup\\forgetall")
+ -- flatten(tex.box[n].list)
+ mark(tex.box[n].list,1)
+ context("\\egroup")
+ context("\\ctxlua{moduledata.fonts.kerns._show_('%s')}",n)
+ context("\\egroup")
+ end
+
+\stopluacode
+
+\setupcolors[state=start]
+
+\definefont[VerySmall][Mono at 4pt]
+
+\definecolor[kern:0][s=.5]
+\definecolor[kern:1][b=.5]
+\definecolor[kern:2][r=.5]
+\definecolor[kern:3][g=.5]
+\definecolor[kern:4][r=.5,g=.5]
+
+\def\showkernwidthfactor{1}
+
+\newconditional\showkernstate
+\settrue \showexplicitkerns
+
+\unexpanded\def\showkern#1#2%
+ {\begingroup
+ \dontcomplain
+ \setbox\scratchbox\hbox to \zeropoint \bgroup
+ \ifcase#2\or
+ \ifconditional\showkernstate
+ \color[kern:0]{\dovlwdhtdp\showkernwidthfactor{0.75}{0.5}}%
+ \global\setfalse\showkernstate
+ \raise.8\strutht
+ \else
+ \color[kern:0]{\dovlwdhtdp\showkernwidthfactor{1.05}{0.5}}%
+ \global\settrue\showkernstate
+ \raise1.1\strutht
+ \fi
+ \else\ifconditional\showexplicitkerns % if other kerns
+ \color[kern:0]{\dovlwdhtdp\showkernwidthfactor{0.75}{0.5}}%
+ \lower1.2\strutdp
+ \fi\fi
+ \hbox to 0pt{\hss\VerySmall\color[kern:#2]{\expandafter\withoutpt\the\dimexpr#1sp}\hss}%
+ \egroup
+ \smashbox\scratchbox
+ \box\scratchbox
+ \endgroup
+ \par}
+
+\newbox\KernBox
+
+\unexpanded\def\ShowKerns#1%
+ {\global\setfalse
+ \showkernstate\ctxlua{moduledata.fonts.kerns.show("#1")}}
+
+\unexpanded\def\ShowKernedVBox#1%
+ {\global\setfalse\showkernstate
+ \setbox\KernBox\vbox{#1}%
+ \ShowKerns{KernBox}%
+ \unvbox\KernBox}
+
+\unexpanded\def\ShowKernedHBox#1%
+ {\global\setfalse\showkernstate
+ \setbox\KernBox\hbox{#1}%
+ \ShowKerns{KernBox}%
+ \unhbox\KernBox}
+
+\continueifinputfile{s-fonts-kerns.mkiv}
+
+\setupinterlinespace[1.5] % \setfalse\showexplicitkerns
+
+\definefontfeature[default][default][mode=node] % ,script=latn]
+
+\starttext
+
+% \enabletrackers[otf.kerns]
+
+\setuplayout[width=middle,height=middle]
+
+\usetypescript[modern] \setupbodyfont[modern]
+\setbox\KernBox\vbox{\input knuth } \ShowKerns{KernBox} \copy\KernBox \blank
+
+\ShowKernedHBox{Very often glyphs get very small spaces inserted horizontally.}
+
+\usetypescript[cambria] \setupbodyfont[cambria]
+\setbox\KernBox\vbox{\input knuth } \ShowKerns{KernBox} \copy\KernBox \blank
+
+\ShowKernedHBox{Very often glyphs get very small spaces inserted horizontally.}
+
+\usetypescript[palatino] \setupbodyfont[palatino]
+\setbox\KernBox\vbox{\input knuth } \ShowKerns{KernBox} \copy\KernBox \blank
+
+\ShowKernedHBox{Very often glyphs get very small spaces inserted horizontally.}
+
+\usetypescript[dejavu] \setupbodyfont[dejavu]
+\setbox\KernBox\vbox{\input knuth } \ShowKerns{KernBox} \copy\KernBox \blank
+
+\ShowKernedHBox{Very often glyphs get very small spaces inserted horizontally.}
+
+\stoptext
diff --git a/tex/context/modules/mkiv/s-mag-01.mkiv b/tex/context/modules/mkiv/s-magazine-basic.mkiv
index 7191d760c..267bf50d8 100644
--- a/tex/context/modules/mkiv/s-mag-01.mkiv
+++ b/tex/context/modules/mkiv/s-magazine-basic.mkiv
@@ -1,5 +1,5 @@
%D \module
-%D [ file=s-mag-01,
+%D [ file=s-magazine-basic, % was: s-mag-01
%D version=2016.09.12, % mkiv version of 2002.12.14,
%D title=\CONTEXT\ Style File,
%D subtitle=\CONTEXT\ Magazine Base Style,
diff --git a/tex/context/modules/mkiv/s-map-10.mkiv b/tex/context/modules/mkiv/s-maps.mkiv
index c7541babc..c7541babc 100644
--- a/tex/context/modules/mkiv/s-map-10.mkiv
+++ b/tex/context/modules/mkiv/s-maps.mkiv