summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-07-25 20:24:04 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-07-25 20:24:04 +0200
commit669436bb34437aee17f1823836cbbb16c570a505 (patch)
tree3d8c61e22805ff719007c10a44a8de0417211b00 /doc/context/sources/general/manuals
parentdeab0bfe7f4be57121779e93bf291e518fda7cf3 (diff)
downloadcontext-669436bb34437aee17f1823836cbbb16c570a505.tar.gz
2018-07-25 19:49:00
Diffstat (limited to 'doc/context/sources/general/manuals')
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-000.tex116
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-001.tex15
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-002.tex16
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-003.tex15
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-005.tex17
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-006.tex17
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-007.tex31
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-008.tex32
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-009.tex15
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-010.tex15
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-011.tex20
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-speed-012.tex20
12 files changed, 329 insertions, 0 deletions
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-000.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-000.tex
new file mode 100644
index 000000000..f48af866d
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-000.tex
@@ -0,0 +1,116 @@
+% \startenvironment onandon-speed-000
+
+% \dontcomplain
+
+\edef\sapolsky{\ignorespaces\cldloadfile{sapolsky}\removeunwantedspaces}
+
+\startluacode
+
+ function document.ResetSample(title)
+ document.elapsed = {
+ title = title,
+ times = { },
+ }
+ end
+
+ function document.RegisterSample(bodyfont,elapsed)
+ table.insert(document.elapsed.times, {
+ bodyfont = bodyfont,
+ elapsed = elapsed
+ })
+ end
+
+ function document.SaveSample()
+ if LUATEXENGINE == "luajittex" then
+ table.save(tex.jobname.."-jit.lua",document.elapsed)
+ else
+ table.save(tex.jobname..".lua",document.elapsed)
+ end
+ end
+
+ function document.ShowSample(filename)
+ -- context.typefile(filename..".tex")
+ local elapsed = table.load(file.nameonly(filename)..".lua")
+ local elapsedjit = table.load(file.nameonly(filename).."-jit.lua")
+ if elapsed and elapsedjit then
+ context.testpage { 6 }
+ context.starttabulate { "|l|l|lp|" }
+ context.HL()
+ context.NC() context.formatted.rlap("\\bf %s",elapsed.title)
+ context.NC()
+ context.NC()
+ context.NC() context.NR()
+ context.HL()
+ local times = elapsed.times
+ local timesjit = elapsedjit.times
+ for j=1,#times do
+ local t = times[j]
+ local tjit = timesjit[j]
+ context.NC() context(t.bodyfont)
+ context.NC() context(t.elapsed)
+ context.NC() context(tjit.elapsed)
+ context.NC() context.NR()
+ end
+ context.HL()
+ context.stoptabulate()
+ end
+ end
+
+ function document.SampleTitle(filename)
+ local elapsed = table.load(filename..".lua")
+ if elapsed then
+ context(elapsed.title)
+ end
+ end
+\stopluacode
+
+\appendtoks
+ \ctxlua{document.SaveSample()}%
+\to \everystoptext
+
+\def\SampleCount{1000}
+\def\SampleCount{100}
+
+\unexpanded\def\RegisterSample#1%
+ {\ctxlua{document.RegisterSample("#1","\elapsedtime")}}
+
+\unexpanded\def\ProcessSample#1%
+ {\page
+ \ctxlua{document.ResetSample("#1")}%
+ \resettimer \Sample {modern} \RegisterSample {modern}
+ \resettimer \Sample {pagella} \RegisterSample {pagella}
+ \resettimer \Sample {termes} \RegisterSample {termes}
+ \resettimer \Sample {cambria} \RegisterSample {cambria}
+ \resettimer \Sample {dejavu} \RegisterSample {dejavu}
+ \resettimer \Sample {ebgaramond} \RegisterSample {ebgaramond}
+ \resettimer \Sample {lucidaot} \RegisterSample {lucidaot}
+ \page }
+
+\unexpanded\def\ProcessBaselineSample#1%
+ {\page
+ \ctxlua{document.ResetSample("#1")}%
+ \resettimer \Sample {baseline} \RegisterSample {baseline}
+ \page }
+
+\unexpanded\def\Sample#1%
+ {\setupbodyfont[#1]}
+
+\unexpanded\def\ShowSample#1%
+ {\ctxlua{document.ShowSample("#1")}}
+
+\unexpanded\def\SampleTitle#1%
+ {\ctxlua{document.SampleTitle("#1.lua")}}
+
+\continueifinputfile{onandon-speed-000.tex}
+
+\starttext
+
+\ProcessSample{bodyfont}
+
+\setbox\scratchbox\vbox{\hsize1pt\tttf\sapolsky} \getnoflines{\htdp\scratchbox}
+
+\writestatus{!!!!!!}{noflines : \the\noflines}
+
+\stoptext
+
+% \stopenvironment
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-001.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-001.tex
new file mode 100644
index 000000000..b6c241752
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-001.tex
@@ -0,0 +1,15 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\starttext
+
+\def\Sample#1%
+ {\start
+ \switchtobodyfont[#1]
+ \setbox\scratchbox\hbox{\tf\bf\it\bi}%
+ \stop}
+
+\ProcessSample{bodyfont switch and 4 style changes (first time)}
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-002.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-002.tex
new file mode 100644
index 000000000..edd6dd0f7
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-002.tex
@@ -0,0 +1,16 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\starttext
+
+\def\Sample#1%
+ {\start
+ \switchtobodyfont[#1]
+ \setbox\scratchbox\hbox{\tf\bf\it\bi}%
+ \stop}
+
+\ProcessSample{bodyfont switch and 4 style changes (first time)}
+\ProcessSample{bodyfont switch and 4 style changes (follow up)}
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-003.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-003.tex
new file mode 100644
index 000000000..4362ccb4f
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-003.tex
@@ -0,0 +1,15 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\starttext
+
+\def\Sample#1%
+ {\start
+ \switchtobodyfont[#1]
+ \dorecurse\SampleCount{\setbox\scratchbox\hbox{\sapolsky\space\sapolsky\space\sapolsky\space\sapolsky}}%
+ \stop}
+
+\ProcessSample{\SampleCount\space hboxes with 4 texts using one font}
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-005.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-005.tex
new file mode 100644
index 000000000..7aeb53b4b
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-005.tex
@@ -0,0 +1,17 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\starttext
+
+\def\Sample#1%
+ {\start
+ \switchtobodyfont[#1]
+ \dorecurse\SampleCount{\sapolsky\space\sapolsky\space\sapolsky\space\sapolsky\par}%
+ \stop}
+
+\startlayout[page]
+ \ProcessSample{\SampleCount\space times 4 texts on pages}
+\stoplayout
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-006.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-006.tex
new file mode 100644
index 000000000..d15ef428e
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-006.tex
@@ -0,0 +1,17 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\starttext
+
+\def\Sample#1%
+ {\start
+ \switchtobodyfont[#1]
+ \dorecurse\SampleCount{\tf\sapolsky\space\bf\sapolsky\space\it\sapolsky\space\bi\sapolsky\space\par}%
+ \stop}
+
+\startlayout[page]
+ \ProcessSample{\SampleCount\space times 4 texts on pages using 4 styles}
+\stoplayout
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-007.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-007.tex
new file mode 100644
index 000000000..7a4eed497
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-007.tex
@@ -0,0 +1,31 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\starttext
+
+\def\sapolsky{%
+ Agriculture is a fairly recent human invention, and in many ways it was one of
+ the great {\bf stupid} moves of all time. Hunter|-|gatherers have thousands of wild
+ sources of food to subsist on. Agriculture changed that all, generating an
+ overwhelming reliance on a few dozen domesticated food sources, making you
+ extremely vulnerable to the next famine, the next locust infestation, the next
+ potato blight. Agriculture allowed for stockpiling of surplus resources and thus,
+ {\bf inevitably}, the unequal stockpiling of them --- stratification of society and
+ the invention of classes. Thus, it allowed for the invention of poverty. I think
+ that the punch line of the primate|-|human difference is that when humans
+ invented poverty, they came up with a way of subjugating the low|-|ranking like
+ {\bf nothing ever seen before} in the primate world.
+}%
+
+\def\Sample#1%
+ {\start
+ \switchtobodyfont[#1]
+ \dorecurse\SampleCount{\sapolsky\par}%
+ \stop}
+
+\startlayout[page]
+ \ProcessSample{\SampleCount\space texts on pages with [1,2,4] bold font switches}
+\stoplayout
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-008.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-008.tex
new file mode 100644
index 000000000..ae968bc10
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-008.tex
@@ -0,0 +1,32 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\starttext
+
+\def\sapolsky{%
+ Agriculture is a fairly recent human invention, and in many ways it was one
+ of the great \type {stupid} moves of all time. Hunter|-|gatherers have
+ thousands of wild sources of food to subsist on. Agriculture changed that
+ all, generating an overwhelming reliance on a few dozen domesticated food
+ sources, making you extremely vulnerable to the next famine, the next locust
+ infestation, the next potato blight. Agriculture allowed for stockpiling of
+ surplus resources and thus, \type {inevitably}, the unequal stockpiling of
+ them --- stratification of society and the invention of classes. Thus, it
+ allowed for the invention of poverty. I think that the punch line of the
+ primate|-|human difference is that when humans invented poverty, they came up
+ with a way of subjugating the low|-|ranking like \type {nothing ever seen
+ before} in the primate world.
+}%
+
+\def\Sample#1%
+ {\start
+ \switchtobodyfont[#1]
+ \dorecurse\SampleCount{\sapolsky\par}%
+ \stop}
+
+\startlayout[page]
+ \ProcessSample{\SampleCount\space texts on pages with [1,2,4] word verbatim switches}
+\stoplayout
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-009.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-009.tex
new file mode 100644
index 000000000..61116e652
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-009.tex
@@ -0,0 +1,15 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\starttext
+
+\def\Sample#1%
+ {\start
+ \infofont
+ \dorecurse\SampleCount{\setbox\scratchbox\hpack{\sapolsky\space\sapolsky\space\sapolsky\space\sapolsky}}%
+ \stop}
+
+\ProcessBaselineSample{\SampleCount\space hboxes with 4 texts and no font handling}
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-010.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-010.tex
new file mode 100644
index 000000000..673c2b1e5
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-010.tex
@@ -0,0 +1,15 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\starttext
+
+\def\Sample#1%
+ {\start
+ \infofont
+ \dorecurse\SampleCount{\setbox\scratchbox\hbox{\sapolsky\space\sapolsky\space\sapolsky\space\sapolsky}}%
+ \stop}
+
+\ProcessBaselineSample{\SampleCount\space hboxes with 4 texts and no features}
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-011.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-011.tex
new file mode 100644
index 000000000..90d924c00
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-011.tex
@@ -0,0 +1,20 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\dontcomplain
+
+\starttext
+
+\def\Sample#1%
+ {\start
+ \tttf\tx
+ \dorecurse\SampleCount{\sapolsky\space\sapolsky\space\sapolsky\space\sapolsky\par}%
+ \stop}
+
+\startlayout[page]
+ \ProcessBaselineSample {\SampleCount\space paragraphs with 4 texts and no features}
+\stoplayout
+
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/onandon/onandon-speed-012.tex b/doc/context/sources/general/manuals/onandon/onandon-speed-012.tex
new file mode 100644
index 000000000..e2d51e195
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-speed-012.tex
@@ -0,0 +1,20 @@
+\environment onandon-speed-000
+
+\ProcessSample{bodyfont} \setupbodyfont[dejavu]
+
+\dontcomplain
+
+\starttext
+
+\def\SampleCount{1000}
+
+\def\Sample#1%
+ {\start
+% \switchtobodyfont[#1]
+ \dorecurse\SampleCount{\sapolsky\par}
+ \stop}
+
+% \ProcessSample{\SampleCount\space pages no features}
+\ProcessBaselineSample{\SampleCount\space paragraphs text}
+
+\stoptext