summaryrefslogtreecommitdiff
path: root/doc/context/sources
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 /doc/context/sources
parent8e51addbcecd962280c24a77de9ec1f6724e7a65 (diff)
downloadcontext-661fb34ced40815e1e5e9073de9c8475127da094.tar.gz
2018-02-23 22:19:00
Diffstat (limited to 'doc/context/sources')
-rw-r--r--doc/context/sources/general/fonts/fonts/fonts-appendix.tex3
-rw-r--r--doc/context/sources/general/fonts/fonts/fonts-extensions.tex20
-rw-r--r--doc/context/sources/general/fonts/fonts/fonts-features.tex74
-rw-r--r--doc/context/sources/general/fonts/fonts/fonts-formats.tex2
-rw-r--r--doc/context/sources/general/fonts/fonts/fonts-mkiv.tex2
-rw-r--r--doc/context/sources/general/manuals/cld/cld-specialcommands.tex55
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex.tex2
-rw-r--r--doc/context/sources/general/manuals/math/math-spacing.tex51
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex4
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-style.tex2
10 files changed, 152 insertions, 63 deletions
diff --git a/doc/context/sources/general/fonts/fonts/fonts-appendix.tex b/doc/context/sources/general/fonts/fonts/fonts-appendix.tex
index ae42b10fa..2eab26a93 100644
--- a/doc/context/sources/general/fonts/fonts/fonts-appendix.tex
+++ b/doc/context/sources/general/fonts/fonts/fonts-appendix.tex
@@ -456,7 +456,7 @@ to render this version. Because fonts might have changed in the meantime, some e
might come out other than intended.
\startluacode
-local list = table.load("fonts-mkiv-usedfonts.lua")
+local list = table.load("fonts-mkiv-usedfonts.lua") or { }
local NC, NR = context.NC, context.NR
@@ -473,7 +473,6 @@ for i=1,#list do
NC() context("version") NC() context.type(version) NC() NR()
context.stoptabulate()
end
-
\stopluacode
\stopsection
diff --git a/doc/context/sources/general/fonts/fonts/fonts-extensions.tex b/doc/context/sources/general/fonts/fonts/fonts-extensions.tex
index 5800f2c57..8de29fcaf 100644
--- a/doc/context/sources/general/fonts/fonts/fonts-extensions.tex
+++ b/doc/context/sources/general/fonts/fonts/fonts-extensions.tex
@@ -931,19 +931,16 @@ effect of expanded kerns is invisible. The used definitions are:
\startplacefigure[reference=hz:natural,title={The two expansion methods compared.}]
\showfontkerns
\dontcomplain
- \enabledirectives[fonts.injections.fontkern]
\startcombination[1*3]
{\ExtremeHzFont\ruledhpack{\startoverlay {\NoHzSample} {\HzSample } \stopoverlay}} {no hz \& hz}
{\ExtremeHzFont\ruledhpack{\startoverlay {\NoHzSample} {\FullHzSample} \stopoverlay}} {no hz \& full hz}
{\ExtremeHzFont\ruledhpack{\startoverlay {\HzSample } {\FullHzSample} \stopoverlay}} {hz \& full hz}
\stopcombination
- \disabledirectives[fonts.injections.fontkern]
\stopplacefigure
\startplacefigure[reference=hz:zoomed,title={The two expansion methods compared (zoomed in).}]
\showfontkerns
\dontcomplain
- \enabledirectives[fonts.injections.fontkern]
\startcombination[3*3]
{\ExtremeHzFont
@@ -968,20 +965,13 @@ effect of expanded kerns is invisible. The used definitions are:
\clip[nx=6,ny=5,x=2,y=2,sx=2]{\startoverlay {\HzSample } {\FullHzSample} \stopoverlay}} {minimal: hz \& full hz}
\stopcombination
- \disabledirectives[fonts.injections.fontkern]
\stopplacefigure
-In \CONTEXT\ the \type {hz} alignment option only enables expansion of glyphs, while \type
-{fullhz} also applies it to kerns. However, in the examples here we had to explicitly enable
-font kerns in node mode:
-
-\starttyping
-\enabledirectives[fonts.injections.fontkern]
-\stoptyping
-
-It will be clear that you can just stick to using the \type {hz} directive (if
-you want expansion at all) because this directive is normally disabled and
-because most fonts are processed in node mode.
+In \CONTEXT\ the \type {hz} alignment option only enables expansion of glyphs,
+while \type {fullhz} also applies it to kerns. It will be clear that you can just
+stick to using the \type {hz} directive (if you want expansion at all) because
+this directive is normally disabled and because most fonts are processed in node
+mode.
\stopsubsubject
diff --git a/doc/context/sources/general/fonts/fonts/fonts-features.tex b/doc/context/sources/general/fonts/fonts/fonts-features.tex
index 0ecd3c9d9..73d1cd96d 100644
--- a/doc/context/sources/general/fonts/fonts/fonts-features.tex
+++ b/doc/context/sources/general/fonts/fonts/fonts-features.tex
@@ -2543,48 +2543,40 @@ unlikely to show up in future versions of the Latin Modern fonts.
\stopsection
-\startsection[title=Discretionaries]
-
-% speed test:
+% \startsection[title=Discretionaries]
%
-% \edef\tufte{\cldloadfile{tufte}}
-% \enabledirectives[otf.alwaysdisc]
-% \testfeatureonce{100}{\setbox0\hbox{\tufte \smallcaps \tufte}}\elapsedtime\par
-% \disabledirectives[otf.alwaysdisc]
-% \testfeatureonce{100}{\setbox0\hbox{\tufte \smallcaps \tufte}}\elapsedtime\par
-
-\startbuffer
-\definedfont[cambria*default]
-12\discretionary
- {3} {4} {5}%
-67\par
-12{\oldstyle\discretionary
- {3} {4} {5}}%
-67\par
-12\discretionary
- {3{\oldstyle3}} {{\oldstyle4}4} {5{\oldstyle5}5}%
-67\par
-\stopbuffer
-
-The font handler has to do some magick to get features working with and across
-discretionaries. To some extend you can use font switches inside discretionaries
-but for sure border cases are not dealt with. This works:
-
-\startlinecorrection[blank]
-\startcombination[nx=4,ny=1,location=top]
- {\framed[align=normal]{\enabledirectives [otf.alwaysdisc]\setupwhitespace[line]\getbuffer}} {1}
- {\framed[align=normal]{\enabledirectives [otf.alwaysdisc]\hsize1mm\getbuffer}} {2}
- {\framed[align=normal]{\disabledirectives[otf.alwaysdisc]\setupwhitespace[line]\getbuffer}} {3}
- {\framed[align=normal]{\disabledirectives[otf.alwaysdisc]\hsize1mm\getbuffer}} {4}
-\stopcombination
-\stoplinecorrection
-
-The first two examples have \type {otf.alwaysdisk} enabled, the last two have it
-disabled.
-
-\typebuffer
-
-\stopsection
+% \startbuffer
+% \definedfont[cambria*default]
+% 12\discretionary
+% {3} {4} {5}%
+% 67\par
+% 12{\oldstyle\discretionary
+% {3} {4} {5}}%
+% 67\par
+% 12\discretionary
+% {3{\oldstyle3}} {{\oldstyle4}4} {5{\oldstyle5}5}%
+% 67\par
+% \stopbuffer
+%
+% The font handler has to do some magick to get features working with and across
+% discretionaries. To some extend you can use font switches inside discretionaries
+% but for sure border cases are not dealt with. This works:
+%
+% \startlinecorrection[blank]
+% \startcombination[nx=4,ny=1,location=top]
+% {\framed[align=normal]{\enabledirectives [otf.alwaysdisc]\setupwhitespace[line]\getbuffer}} {1}
+% {\framed[align=normal]{\enabledirectives [otf.alwaysdisc]\hsize1mm\getbuffer}} {2}
+% {\framed[align=normal]{\disabledirectives[otf.alwaysdisc]\setupwhitespace[line]\getbuffer}} {3}
+% {\framed[align=normal]{\disabledirectives[otf.alwaysdisc]\hsize1mm\getbuffer}} {4}
+% \stopcombination
+% \stoplinecorrection
+%
+% The first two examples have \type {otf.alwaysdisk} enabled, the last two have it
+% disabled.
+%
+% \typebuffer
+%
+% \stopsection
\startsection[title=Some remarks]
diff --git a/doc/context/sources/general/fonts/fonts/fonts-formats.tex b/doc/context/sources/general/fonts/fonts/fonts-formats.tex
index 68a28fadc..9ad6bc9bd 100644
--- a/doc/context/sources/general/fonts/fonts/fonts-formats.tex
+++ b/doc/context/sources/general/fonts/fonts/fonts-formats.tex
@@ -81,7 +81,7 @@ descender. The width of the bounding box is not by definition the width of the
glyph. In \TYPEONE\ and \OPENTYPE\ fonts each shape has a so called advance width
and that is the one that will be used.
-\usemodule[fnt-40]
+\usemodule[fonts-kerns]
\startplacefigure [location=here,reference=fig:glyph-kerns,title={Kerning in Latin Roman, Cambria, Pagella and Dejavu.}]
\scale[width=\textwidth]{\startcombination[1*4]
diff --git a/doc/context/sources/general/fonts/fonts/fonts-mkiv.tex b/doc/context/sources/general/fonts/fonts/fonts-mkiv.tex
index 6b05bb0c2..fa53492f0 100644
--- a/doc/context/sources/general/fonts/fonts/fonts-mkiv.tex
+++ b/doc/context/sources/general/fonts/fonts/fonts-mkiv.tex
@@ -21,7 +21,7 @@
%
% \usemodule[speedtest]
-\enabletrackers[fonts.files]
+\enabletrackers[fonts.usage]
\enablemode[simple] % ,oversized
diff --git a/doc/context/sources/general/manuals/cld/cld-specialcommands.tex b/doc/context/sources/general/manuals/cld/cld-specialcommands.tex
index 151952c53..37ecf45c6 100644
--- a/doc/context/sources/general/manuals/cld/cld-specialcommands.tex
+++ b/doc/context/sources/general/manuals/cld/cld-specialcommands.tex
@@ -63,7 +63,11 @@ Other examples of macros that have optimized functions are \type {\par},
\startsection[title=Steps]
-When you run the following code:
+% added and extended in sync with an article about a generic 'execute'
+% feature
+
+We already mentioned the stepper as a very special trick so let's give
+some more explanation here. When you run the following code:
\setbox0\emptybox
@@ -197,7 +201,54 @@ which gives:
A step returns control to \TEX\ immediately and after the \TEX\ code that it
feeds back is expanded, returns to \LUA. There are some limitations due to the
-input stack but normally that us no real issue.
+input stack but normally that is no real issue.
+
+You can run the following code:
+
+\starttyping
+\definenumber[LineCounter][way=bypage]
+\starttext
+\startluacode
+for i=1,2000 do
+ context.incrementnumber { "LineCounter" }
+ context.getnumber { "LineCounter" }
+ context.par()
+end
+\stopluacode
+\stoptext
+\stoptyping
+
+You will notice however that the number is not right on each page. This is
+because \TEX\ doesn't know yet that there is no room on the page. The next will
+work better:
+
+\starttyping
+\definenumber[LineCounter][way=bypage]
+\starttext
+\startluacode
+context.stepwise(function()
+ for i=1,2000 do
+ context.testpage { 0 }
+ context.incrementnumber { "LineCounter" }
+ context.getnumber { "LineCounter" }
+ context.par()
+ context.step()
+ end
+end)
+\stopluacode
+\stoptext
+\starttyping
+
+Instead of the \type {testpage} function you can also play directly with
+registers, like:
+
+\starttyping
+if tex.pagegtotal + tex.count.lineheight > tex.pagetotal then
+\starttyping
+
+but often an already defined helper does a better job. Of course you will
+probably never need this kind of hacks anyway, if only because much more is going
+on and there are better ways then.
\stopsection
diff --git a/doc/context/sources/general/manuals/luatex/luatex.tex b/doc/context/sources/general/manuals/luatex/luatex.tex
index 43f81ab5e..1d6f16f6a 100644
--- a/doc/context/sources/general/manuals/luatex/luatex.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex.tex
@@ -1,5 +1,7 @@
% macros=mkvi
+% \disabledirectives[vspacing.synchronizepage]
+
% author : Hans Hagen with Taco Hoekwater, Luigi Scarso & Hartmut Henkel
% copyright : PRAGMA ADE & ConTeXt Development Team
% license : Creative Commons Attribution ShareAlike 4.0 International
diff --git a/doc/context/sources/general/manuals/math/math-spacing.tex b/doc/context/sources/general/manuals/math/math-spacing.tex
index 3a665a7d8..913a90d9e 100644
--- a/doc/context/sources/general/manuals/math/math-spacing.tex
+++ b/doc/context/sources/general/manuals/math/math-spacing.tex
@@ -1,3 +1,5 @@
+% language=uk
+
\environment math-layout
\startcomponent math-spacing
@@ -689,6 +691,55 @@ We have
\stopsection
+\startsection[title=Choices]
+
+The next examples are generated using this macro:
+
+\startbuffer
+\starttexdefinition unexpanded Test#1#2
+
+ \begingroup
+
+ \showmakeup[depth]
+
+ \def\TestA{\dontleavehmode\ruledhbox{\dorecurse{8}{before }}}
+ \def\TestB{\dontleavehmode\ruledhbox{\dorecurse{8}{after }}}
+ \def\TestC{\dorecurse{18}{x+}x}
+
+ \setdisplaymathspacemodel[3]
+ \setupalign[flushleft] 1\space:\space\TestA \par
+ \startformula #2 \TestC \stopformula \par
+ \setupalign[flushleft] 2\space:\space\TestB \par
+
+ \setdisplaymathspacemodel[4]
+
+ \vskip#1\lineheight
+
+ \setupalign[flushright] \TestA\space:\space2 \par
+ \startformula #2 \TestC \stopformula \par
+ \setupalign[flushright] \TestB\space:\space2 \par
+
+ \endgroup
+
+\stoptexdefinition
+\stopbuffer
+
+\typebuffer \getbuffer
+
+It demonstrates the often hard decisions that we have to make with regards to
+spacing. On the one hand we want to be adaptive, on the other hand we want to be
+consistent, for instance in the depth of lines. These examples overlay the two
+variants (which is of course font and style dependent).
+
+\Test{-4.70}{} \blank[2*line]
+\Test{-6.00}{\frac{1}{2}} \blank[2*line]
+\Test{-6.55}{\frac{1}{\frac{1}{2}}}
+
+One side effect of these options is that at some point we need to choose a
+default and then easily forget about the other variants.
+
+\stopsection
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex b/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex
index c16afbf0a..525dd7490 100644
--- a/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex
+++ b/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex
@@ -6,6 +6,8 @@
\startchapter[title=Line correction]
+\startsection[title=Wrapping content]
+
\startbuffer[linecorrection]
\typebuffer
\blank
@@ -103,6 +105,8 @@ Because in this document we have set the whitespace this also gets added around
the box. So, in case your spacing around some special content looks bad, consider
using these commands.
+\stopsection
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/spacing/spacing-style.tex b/doc/context/sources/general/manuals/spacing/spacing-style.tex
index c9d168f1c..5514df729 100644
--- a/doc/context/sources/general/manuals/spacing/spacing-style.tex
+++ b/doc/context/sources/general/manuals/spacing/spacing-style.tex
@@ -1,6 +1,6 @@
\startenvironment spacing-style
-\usemodule[abr-03]
+\usemodule[abbreviations-words,typesetting]
\setupbodyfont
[pagella]