summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-05-12 01:19:03 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-05-12 01:19:03 +0200
commit77e216e323271fb85d508b7206b13c980540b74b (patch)
tree5b4053c2bbe5190e28c0dce89653c7b13aea0642 /doc
parentd817aef76ab8b606c02bd0636661b634b43a68a6 (diff)
downloadcontext-77e216e323271fb85d508b7206b13c980540b74b.tar.gz
2018-05-12 00:16:00
Diffstat (limited to 'doc')
-rw-r--r--doc/context/documents/general/manuals/luatex.pdfbin1381658 -> 1378055 bytes
-rw-r--r--doc/context/documents/general/manuals/onandon.pdfbin2920276 -> 3312529 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-cs.pdfbin846226 -> 846210 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-de.pdfbin843986 -> 843971 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-en.pdfbin847750 -> 847896 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-fr.pdfbin843564 -> 843438 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-it.pdfbin845640 -> 845801 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-cs.pdfbin359451 -> 359362 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-de.pdfbin442459 -> 442395 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-en.pdfbin356265 -> 356333 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-fr.pdfbin359575 -> 359387 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-it.pdfbin358428 -> 358354 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-nl.pdfbin357080 -> 357011 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-ro.pdfbin611024 -> 611035 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-nl.pdfbin837704 -> 838222 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-ro.pdfbin842490 -> 842460 bytes
-rw-r--r--doc/context/scripts/mkiv/mtx-fonts.html81
-rw-r--r--doc/context/scripts/mkiv/mtx-fonts.man69
-rw-r--r--doc/context/scripts/mkiv/mtx-fonts.xml65
-rw-r--r--doc/context/sources/general/fonts/fonts/fonts-demo-rule.lua47
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-enhancements.tex206
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-fonts.tex71
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-introduction.tex18
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-languages.tex64
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-lua.tex34
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-math.tex203
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-modifications.tex97
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-nodes.tex196
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-preamble.tex4
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-statistics.tex2
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-style.tex2
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex.tex11
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-modern.tex1284
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon.tex20
34 files changed, 2121 insertions, 353 deletions
diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf
index 6f627bf47..b00546382 100644
--- a/doc/context/documents/general/manuals/luatex.pdf
+++ b/doc/context/documents/general/manuals/luatex.pdf
Binary files differ
diff --git a/doc/context/documents/general/manuals/onandon.pdf b/doc/context/documents/general/manuals/onandon.pdf
index fe291acf0..7fd98afb0 100644
--- a/doc/context/documents/general/manuals/onandon.pdf
+++ b/doc/context/documents/general/manuals/onandon.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 0038f1fbc..f5d14c68e 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 639ed3627..5a7b97c92 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 30f792944..38ba5c02c 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 020b41c53..74ed8db1a 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 4903bd406..011869e60 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-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
index 3a7d17715..917c20b38 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf
index 8996d2f5a..0fa208c4a 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-de.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-de.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf
index e16ec4684..71187cba2 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-en.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-en.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
index 9086d521b..952b31c58 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf
index 33e08abff..2b177bfc8 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-it.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-it.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
index 44710fbd1..35be0557c 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
index 36fbb9e38..ca73c2c09 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-ro.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 70a49b01d..9d226c26e 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 ed1ce452c..367087450 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/scripts/mkiv/mtx-fonts.html b/doc/context/scripts/mkiv/mtx-fonts.html
new file mode 100644
index 000000000..b175139c8
--- /dev/null
+++ b/doc/context/scripts/mkiv/mtx-fonts.html
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<!-- compare with lmx framework variant -->
+
+<!--
+ filename : context-base.xml
+ comment : companion to mtx-server-ctx-startup.tex
+ author : Hans Hagen, PRAGMA-ADE, Hasselt NL
+ copyright: PRAGMA ADE / ConTeXt Development Team
+ license : see context related readme files
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+ <head>
+ <title>ConTeXt Font Database Management 0.21</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <style type="text/css">
+ body { color: #FFFFFF; background-color: #808080; font-family: optima, verdana, futura, "lucida sans", arial, geneva, helvetica, sans; font-size: 12px; line-height: 18px; } a:link, a:active, a:visited { color: #FFFFFF; } a.dir-view:link, a.dir-view:active, a.dir-view:visited { color: #FFFFFF; text-decoration: underline; } .valid { color: #00FF00; } .invalid { color: #FF0000; } .invisible { visibility: hidden; } button, .commonlink, .smallbutton { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; border-color: #7F7F7F; border-style: solid; border-width: .125ex; background-color: #FFFFFF; padding: .5ex; } .smallbutton { width: 1em; } a.commonlink:link, a.commonlink:active, a.commonlink:visited, a.smalllink:link, a.smalllink:active, a.smalllink:visited { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; } h1, .title { font-style: normal; font-weight: normal; font-size: 18px; line-height: 18px; margin-bottom: 20px; } h2, .subtitle { font-style: normal; font-weight: normal; font-size: 12px; margin-top: 18px; margin-bottom: 18px; } table { line-height: 18px; font-size: 12px; margin: 0; } th { font-weight: bold; text-align: left; padding-bottom: 6px; } .tc { font-weight: bold; text-align: left; } p, li { max-width: 60em; } .empty-line { margin-top: 4px; } .more-room { margin-right: 1.5em; } .much-more-room { margin-right: 3em; } #main { position: absolute; left: 10%; top: 10%; right: 10%; bottom: 10%; z-index: 2; width: 80%; height: 80%; padding: 0%; margin: 0%; overflow: auto; border-style: none; border-width: 0; background-color: #3F3F3F; } #main-settings { margin: 12px; x_max-width: 60em; line-height: 18px; font-size: 12px; } #left { position: absolute; top : 10%; left: 0%; bottom: 0%; right: 90%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; } #right { position: absolute; top : 0%; left: 90%; bottom: 10%; right: 0%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; _margin-left: -15px; } #bottom { position: absolute; left: 10%; right: 0%; top: 90%; bottom: 0%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top { position: absolute; left: 0%; right: 10%; top: 0%; bottom: 90%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #top-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: right; vertical-align: middle; } #bottom-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #bottom-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: left; vertical-align: middle; } #left-one { position: absolute; width: 100%; buggedheight: 100%; } #left-two { position: relative; margin-top: 12px; line-height: 18px; text-align: center; vertical-align: top; } #right-one { display: table; height: 100%; width: 100%; } #right-two { display: table-row; height: 100%; width: 100%; } #right-three { display: table-cell; width: 100%; vertical-align: bottom; _position: absolute; _top: 100%; } #right-four { text-align: center; margin-bottom: 2ex; _position: relative; _top: -100%; } #more-top { position: absolute; top: 0%; left: 90%; bottom: 90%; right: 0%; z-index: 3; width: 10%; height: 10%; padding: 0%; margin: 0%; border-style: none; border-width: 0; } #more-top-settings { text-align: center; } #more-right-settings { margin-right: 12px; margin-left: 12px; line-height: 18px; font-size: 10px; text-align: center; } #right-safari { _display: table; width: 100%; height: 100%; }
+ </style>
+ <style type="text/css">
+ </style>
+ </head>
+ <body>
+ <div id="top"> <div id="top-one">
+ <div id="top-two">ConTeXt Font Database Management 0.21 </div>
+ </div>
+ </div>
+ <div id="bottom"> <div id="bottom-one">
+ <div id="bottom-two">wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl</div>
+ </div>
+ </div>
+ <div id="left"></div>
+ <div id="right"></div>
+ <div id="main">
+ <div id='main-settings'>
+ <h1>Command line options</h1>
+<table>
+ <tr><th style="width: 10em">flag</th><th style="width: 8em">value</th><th>description</th></tr>
+ <tr><th/><td/><td/></tr>
+ <tr><th>--convert</th><td></td><td>save open type font in raw table</td></tr>
+ <tr><th>--unpack</th><td></td><td>save a tma file in a more readable format</td></tr>
+ <tr><th/><td/><td/></tr>
+ <tr><th>--reload</th><td></td><td>generate new font database (use --force when in doubt)</td></tr>
+ <tr><th>--reload</th><td></td><td>--simple:generate luatex-fonts-names.lua (not for context!)</td></tr>
+ <tr><th/><td/><td/></tr>
+ <tr><th>--list</th><td></td><td>--name: list installed fonts, filter by name [--pattern]</td></tr>
+ <tr><th>--list</th><td></td><td>--spec: list installed fonts, filter by spec [--filter]</td></tr>
+ <tr><th>--list</th><td></td><td>--file: list installed fonts, filter by file [--pattern]</td></tr>
+ <tr><th/><td/><td/></tr>
+ <tr><th>--pattern</th><td>str</td><td>filter files using pattern</td></tr>
+ <tr><th>--filter</th><td>list</td><td>key-value pairs</td></tr>
+ <tr><th>--all</th><td></td><td>show all found instances (combined with other flags)</td></tr>
+ <tr><th>--info</th><td></td><td>give more details</td></tr>
+ <tr><th>--trackers</th><td>list</td><td>enable trackers</td></tr>
+ <tr><th>--statistics</th><td></td><td>some info about the database</td></tr>
+ <tr><th>--names</th><td></td><td>use name instead of unicodes</td></tr>
+ <tr><th>--cache</th><td>str</td><td>use specific cache (otl or otf)</td></tr>
+ </table>
+<br/>
+<h1>Examples</h1>
+<tt>mtxrun --script font --list somename (== --pattern=*somename*)</tt>
+<br/><br/><tt>mtxrun --script font --list --name somename</tt>
+<br/><tt>mtxrun --script font --list --name --pattern=*somename*</tt>
+<br/><br/><tt>mtxrun --script font --list --spec somename</tt>
+<br/><tt>mtxrun --script font --list --spec somename-bold-italic</tt>
+<br/><tt>mtxrun --script font --list --spec --pattern=*somename*</tt>
+<br/><tt>mtxrun --script font --list --spec --filter="fontname=somename"</tt>
+<br/><tt>mtxrun --script font --list --spec --filter="familyname=somename,weight=bold,style=italic,width=condensed"</tt>
+<br/><tt>mtxrun --script font --list --spec --filter="familyname=crap*,weight=bold,style=italic"</tt>
+<br/><br/><tt>mtxrun --script font --list --all</tt>
+<br/><tt>mtxrun --script font --list --file somename</tt>
+<br/><tt>mtxrun --script font --list --file --all somename</tt>
+<br/><tt>mtxrun --script font --list --file --pattern=*somename*</tt>
+<br/><br/><tt>mtxrun --script font --convert texgyrepagella-regular.otf</tt>
+<br/><tt>mtxrun --script font --convert --names texgyrepagella-regular.otf</tt>
+<br/><br/> </div>
+ </div>
+ </body>
+</html>
diff --git a/doc/context/scripts/mkiv/mtx-fonts.man b/doc/context/scripts/mkiv/mtx-fonts.man
new file mode 100644
index 000000000..c27731e33
--- /dev/null
+++ b/doc/context/scripts/mkiv/mtx-fonts.man
@@ -0,0 +1,69 @@
+.TH "mtx-fonts" "1" "01-01-2018" "version 1.00" "ConTeXt Font Database Management"
+.SH NAME
+.B mtx-fonts
+.SH SYNOPSIS
+.B mtxrun --script fonts [
+.I OPTIONS ...
+.B ] [
+.I FILENAMES
+.B ]
+.SH DESCRIPTION
+.B ConTeXt Font Database Management
+.SH OPTIONS
+.TP
+.B --convert
+save open type font in raw table
+.TP
+.B --unpack
+save a tma file in a more readable format
+.TP
+.B --reload
+generate new font database (use --force when in doubt)
+.TP
+.B --reload
+--simple:generate luatex-fonts-names.lua (not for context!)
+.TP
+.B --list
+--name: list installed fonts, filter by name [--pattern]
+.TP
+.B --list
+--spec: list installed fonts, filter by spec [--filter]
+.TP
+.B --list
+--file: list installed fonts, filter by file [--pattern]
+.TP
+.B --pattern=str
+filter files using pattern
+.TP
+.B --filter=list
+key-value pairs
+.TP
+.B --all
+show all found instances (combined with other flags)
+.TP
+.B --info
+give more details
+.TP
+.B --trackers=list
+enable trackers
+.TP
+.B --statistics
+some info about the database
+.TP
+.B --names
+use name instead of unicodes
+.TP
+.B --cache=str
+use specific cache (otl or otf)
+.SH AUTHOR
+More information about ConTeXt and the tools that come with it can be found at:
+
+
+.B "maillist:"
+ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
+
+.B "webpage:"
+http://www.pragma-ade.nl / http://tex.aanhet.net
+
+.B "wiki:"
+http://contextgarden.net
diff --git a/doc/context/scripts/mkiv/mtx-fonts.xml b/doc/context/scripts/mkiv/mtx-fonts.xml
new file mode 100644
index 000000000..d001f4f9a
--- /dev/null
+++ b/doc/context/scripts/mkiv/mtx-fonts.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<application>
+ <metadata>
+ <entry name="name">mtx-fonts</entry>
+ <entry name="detail">ConTeXt Font Database Management</entry>
+ <entry name="version">1.00</entry>
+ </metadata>
+ <flags>
+ <category name="basic">
+ <subcategory>
+ <flag name="convert"><short>save open type font in raw table</short></flag>
+ <flag name="unpack"><short>save a tma file in a more readable format</short></flag>
+ </subcategory>
+ <subcategory>
+ <flag name="reload"><short>generate new font database (use <ref name="force"/> when in doubt)</short></flag>
+ <flag name="reload"><short><ref name="simple"/>:generate luatex-fonts-names.lua (not for context!)</short></flag>
+ </subcategory>
+ <subcategory>
+ <flag name="list"><short><ref name="name"/>: list installed fonts, filter by name [<ref name="pattern"/>]</short></flag>
+ <flag name="list"><short><ref name="spec"/>: list installed fonts, filter by spec [<ref name="filter"/>]</short></flag>
+ <flag name="list"><short><ref name="file"/>: list installed fonts, filter by file [<ref name="pattern"/>]</short></flag>
+ </subcategory>
+ <subcategory>
+ <flag name="pattern" value="str"><short>filter files using pattern</short></flag>
+ <flag name="filter" value="list"><short>key-value pairs</short></flag>
+ <flag name="all"><short>show all found instances (combined with other flags)</short></flag>
+ <flag name="info"><short>give more details</short></flag>
+ <flag name="trackers" value="list"><short>enable trackers</short></flag>
+ <flag name="statistics"><short>some info about the database</short></flag>
+ <flag name="names"><short>use name instead of unicodes</short></flag>
+ <flag name="cache" value="str"><short>use specific cache (otl or otf)</short></flag>
+ </subcategory>
+ </category>
+ </flags>
+ <examples>
+ <category>
+ <title>Examples</title>
+ <subcategory>
+ <example><command>mtxrun --script font --list somename (== --pattern=*somename*)</command></example>
+ </subcategory>
+ <subcategory>
+ <example><command>mtxrun --script font --list --name somename</command></example>
+ <example><command>mtxrun --script font --list --name --pattern=*somename*</command></example>
+ </subcategory>
+ <subcategory>
+ <example><command>mtxrun --script font --list --spec somename</command></example>
+ <example><command>mtxrun --script font --list --spec somename-bold-italic</command></example>
+ <example><command>mtxrun --script font --list --spec --pattern=*somename*</command></example>
+ <example><command>mtxrun --script font --list --spec --filter="fontname=somename"</command></example>
+ <example><command>mtxrun --script font --list --spec --filter="familyname=somename,weight=bold,style=italic,width=condensed"</command></example>
+ <example><command>mtxrun --script font --list --spec --filter="familyname=crap*,weight=bold,style=italic"</command></example>
+ </subcategory>
+ <subcategory>
+ <example><command>mtxrun --script font --list --all</command></example>
+ <example><command>mtxrun --script font --list --file somename</command></example>
+ <example><command>mtxrun --script font --list --file --all somename</command></example>
+ <example><command>mtxrun --script font --list --file --pattern=*somename*</command></example>
+ </subcategory>
+ <subcategory>
+ <example><command>mtxrun --script font --convert texgyrepagella-regular.otf</command></example>
+ <example><command>mtxrun --script font --convert --names texgyrepagella-regular.otf</command></example>
+ </subcategory>
+ </category>
+ </examples>
+</application>
diff --git a/doc/context/sources/general/fonts/fonts/fonts-demo-rule.lua b/doc/context/sources/general/fonts/fonts/fonts-demo-rule.lua
new file mode 100644
index 000000000..667d1e43c
--- /dev/null
+++ b/doc/context/sources/general/fonts/fonts/fonts-demo-rule.lua
@@ -0,0 +1,47 @@
+local startactualtext = backends.codeinjections.startunicodetoactualtext
+local stopactualtext = backends.codeinjections.stopunicodetoactualtext
+
+return function(specification)
+ local features = specification.features.normal
+ local name = features.original or "dejavu-serif"
+ local option = features.option -- we only support "line"
+ local size = specification.size -- always set
+ local detail = specification.detail -- e.g. default
+ if detail then
+ name = name .. "*" .. detail
+ end
+ local f, id = fonts.constructors.readanddefine(name,size)
+ if f then
+ f.properties.name = specification.name
+ f.properties.virtualized = true
+ f.fonts = {
+ { id = id },
+ }
+ for s in string.gmatch("aeuioy",".") do
+ local n = utf.byte(s)
+ local c = f.characters[n]
+ if c then
+ local w = c.width or 0
+ local h = c.height or 0
+ local d = c.depth or 0
+ if option == "line" then
+ f.characters[n].commands = {
+ { "special", "pdf:direct:" .. startactualtext(n) },
+ { "rule", option == "line" and size/10, w },
+ { "special", "pdf:direct:" .. stopactualtext() },
+ }
+ else
+ f.characters[n].commands = {
+ { "special", "pdf:direct:" .. startactualtext(n) },
+ { "down", d },
+ { "rule", h + d, w },
+ { "special", "pdf:direct:" .. stopactualtext() },
+ }
+ end
+ else
+ -- probably a real bad font
+ end
+ end
+ end
+ return f
+end
diff --git a/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex b/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex
index e9fd951fc..8d53852ae 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex
@@ -56,11 +56,14 @@ chapters on fonts and math we discuss a few more new ones.
There are three new primitives to test the version of \LUATEX:
+\unexpanded\def\VersionHack#1% otherwise different luatex and luajittex runs
+ {\cldcontext{(string.gsub(string.match("\luatexbanner","(.+)\letterpercent("),"jit",""))}}
+
\starttabulate[|l|l|pl|]
\DB primitive \BC value
\BC explanation \NC \NR
\TB
-\NC \lpr {luatexbanner} \NC \cldcontext{string.match("\luatexbanner","(.+)\letterpercent(")}
+\NC \lpr {luatexbanner} \NC \VersionHack{\luatexbanner}
\NC the banner reported on the command line \NC \NR
\NC \lpr {luatexversion} \NC \the\luatexversion
\NC a combination of major and minor number \NC \NR
@@ -78,10 +81,10 @@ The official \LUATEX\ version is defined as follows:
its use with \prm {the} depending on the context.
\stopitem
\startitem
- The minor version is the two-digit result of \lpr {luatexversion} modulo 100.
+ The minor version is the two|-|digit result of \lpr {luatexversion} modulo 100.
\stopitem
\startitem
- The revision is the given by \lpr {luatexrevision}. This primitive expands to
+ The revision is reported by \lpr {luatexrevision}. This primitive expands to
a positive integer.
\stopitem
\startitem
@@ -113,7 +116,7 @@ always converted to a suitable graphic representation of that character in a
specific font. However, while processing a list of to|-|be|-|typeset nodes, its
contents may still be seen as a character. Inside \LUATEX\ there is no clear
separation between the two concepts. Because the subtype of a glyph node can be
-changed in \LUA\ it is up to the user: subtypes larger than 255 indicate that
+changed in \LUA\ it is up to the user. Subtypes larger than 255 indicate that
font processing has happened.
A few primitives are affected by this, all in a similar fashion: each of them has
@@ -121,15 +124,15 @@ to accommodate for a larger range of acceptable numbers. For instance, \prm
{char} now accepts values between~0 and $1{,}114{,}111$. This should not be a
problem for well|-|behaved input files, but it could create incompatibilities for
input that would have generated an error when processed by older \TEX|-|based
-engines. The affected commands with an altered initial (left of the equals sign)
-or secondary (right of the equals sign) value are: \prm {char}, \prm {lccode},
+engines. The affected commands with an altered initial (left of the equal sign)
+or secondary (right of the equal sign) value are: \prm {char}, \prm {lccode},
\prm {uccode}, \lpr {hjcode}, \prm {catcode}, \prm {sfcode}, \lpr {efcode}, \lpr
{lpcode}, \lpr {rpcode}, \prm {chardef}.
As far as the core engine is concerned, all input and output to text files is
\UTF-8 encoded. Input files can be pre|-|processed using the \type {reader}
callback. This will be explained in \in {section} [iocallback]. Normalization of
-the \UNICODE\ input is on purpose not built|-|in can be handled by a macro
+the \UNICODE\ input is on purpose not built|-|in and can be handled by a macro
package during callback processing.
Output in byte|-|sized chunks can be achieved by using characters just outside of
@@ -184,7 +187,7 @@ commands are:
\stopfourcolumns
Because font memory management has been rewritten, character properties in fonts
-are no longer shared among fonts instances that originate from the same metric
+are no longer shared among font instances that originate from the same metric
file.
\section{Attributes}
@@ -247,7 +250,7 @@ lines are broken into paragraphs, the lines are a linked list of \nod {hlist}
nodes.
We will see more of these nodes later on but for now that should be enough to be
-able to follow the rest oof this chapter.
+able to follow the rest of this chapter.
\subsection{Box attributes}
@@ -455,10 +458,9 @@ sequence is fully expanded.
\stopsyntax
Most often, this command is not actually the best way to deal with the
-differences between the \TEX\ and \LUA. In very short bits of \LUA\
-code it is often not needed, and for longer stretches of \LUA\ code it
-is easier to keep the code in a separate file and load it using \LUA's
-\type {dofile}:
+differences between \TEX\ and \LUA. In very short bits of \LUA\ code it is often
+not needed, and for longer stretches of \LUA\ code it is easier to keep the code
+in a separate file and load it using \LUA's \type {dofile}:
\starttyping
\directlua { dofile('mysetups.lua') }
@@ -500,6 +502,33 @@ in the following example the number \type {8} gets typeset.
The \lpr {luafunctioncall} primitive does the same but is unexpandable, for
instance in an \prm {edef}.
+\subsection{\lpr {luabytecode} and \lpr {luabytecodecall}}
+
+Analogue to the function callers discussed in the previous section we have byte
+code callers. Again the call variant is unexpandable.
+
+\starttyping
+\directlua {
+ lua.bytecode[9998] = function(s)
+ tex.sprint(s*token.scan_int())
+ end
+ lua.bytecode[5555] = function(s)
+ tex.sprint(s*token.scan_dimen())
+ end
+}
+\stoptyping
+
+This works with:
+
+\starttyping
+\luabytecode 9998 5 \luabytecode 5555 5sp
+\luabytecodecall9998 5 \luabytecodecall5555 5sp
+\stoptyping
+
+The variable \type {s} in the code is the number of the byte code register that
+can be used for diagnostic purposes. The advantage of bytecode registers over
+function calls is that they are stored in the format (but without upvalues).
+
\section {Alignments}
\subsection{\lpr {alignmark} and \lpr {aligntab}}
@@ -517,8 +546,8 @@ catcode regime in a single statement. You can have a practically unlimited numbe
of different tables. This subsystem is backward compatible: if you never use the
following commands, your document will not notice any difference in behaviour
compared to traditional \TEX. The contents of each catcode table is independent
-from any other catcode tables, and their contents is stored and retrieved from
-the format file.
+from any other catcode table, and its contents is stored and retrieved from the
+format file.
\subsection{\lpr {catcodetable}}
@@ -664,7 +693,7 @@ When set to a non|-|zero value the following command will not issue an error:
We will cover math extensions in its own chapter because not only the font
subsystem and spacing model have been enhanced (thereby introducing many new
primitives) but also because some more control has been added to existing
-functionality. Much of this relates to the differences approaches of traditional
+functionality. Much of this relates to the different approaches of traditional
\TEX\ fonts and \OPENTYPE\ math.
\section{Fonts}
@@ -799,7 +828,7 @@ expand the passed general text.
These are somewhat special. The \prm {csstring} primitive is like
\prm {string} but it omits the leading escape character. This can be
-somewhat more efficient that stripping it of afterwards.
+somewhat more efficient than stripping it afterwards.
The \lpr {begincsname} primitive is like \prm {csname} but doesn't create
a relaxed equivalent when there is no such name. It is equivalent to
@@ -822,7 +851,7 @@ is one that should be used with care. The above example could be written as:
This is slightly more efficient than constructing the string twice (deep down in
\LUATEX\ this also involves some \UTF8 juggling), but probably more relevant is
-that it saves a few tokens and can make code a bit more more readable.
+that it saves a few tokens and can make code a bit more readable.
\subsection{\lpr {clearmarks}}
@@ -844,7 +873,7 @@ This primitive can be used to assign a meaning to an active character, as in:
\def\foo{bar} \letcharcode123=\foo
\stoptyping
-This can be a bit nicer that using the uppercase tricks (using the property of
+This can be a bit nicer than using the uppercase tricks (using the property of
\prm {uppercase} that it treats active characters special).
\section{Boxes, rules and leaders}
@@ -874,7 +903,7 @@ The \prm {vsplit} primitive has to be followed by a specification of the require
height. As alternative for the \type {to} keyword you can use \type {upto} to get
a split of the given size but result has the natural dimensions then.
-\subsection[sec:imagedandforms]{Images and Forms}
+\subsection[sec:imagedandforms]{Images and reused box objects}
These two concepts are now core concepts and no longer whatsits. They are in fact
now implemented as rules with special properties. Normal rules have subtype~0,
@@ -890,7 +919,7 @@ should treat them as such and check for the current output mode if applicable.
\DB command \BC explanation \NC \NR
\TB
\NC \lpr {saveboxresource} \NC save the box as an object to be included later \NC \NR
-\NC \lpr {saveimageresource} \NC save the image as an object to be includes later \NC \NR
+\NC \lpr {saveimageresource} \NC save the image as an object to be included later \NC \NR
\NC \lpr {useboxresource} \NC include the saved box object here (by index) \NC \NR
\NC \lpr {useimageresource} \NC include the saved image object here (by index) \NC \NR
\NC \lpr {lastsavedboxresourceindex} \NC the index of the last saved box object \NC \NR
@@ -924,7 +953,7 @@ a \type {/Matrix}.
Because introducing a new keyword can cause incompatibilities, two new primitives
were introduced: \lpr {nohrule} and \lpr {novrule}. These can be used to
reserve space. This is often more efficient than creating an empty box with fake
-dimensions).
+dimensions.
\subsection{\lpr {gleaders}}
@@ -950,7 +979,7 @@ the value with the language.
\subsection{\prm {boundary}, \prm {noboundary}, \prm {protrusionboundary} and \prm {wordboundary}}
-The \prm {noboundary} commands used to inject a whatsit node but now injects a normal
+The \prm {noboundary} command is used to inject a whatsit node but now injects a normal
node with type \nod {boundary} and subtype~0. In addition you can say:
\starttyping
@@ -1035,6 +1064,137 @@ You can now open upto 127 files with \prm {openout}. When no file is open
writes will go to the console and log. As a consequence a system command is
no longer possible but one can use \type {os.execute} to do the same.
+\subsection{\lpr {expanded}, \lpr {immediateassignment}, \lpr {immediateassigned}}
+
+\topicindex {expansion}
+
+The \lpr {expanded} primitive takes a token list and expands it content which can
+come in handy: it avoids a tricky mix of \prm {expandafter} and \prm {noexpand}.
+You can compare it with what happens inside the body of an \prm {edef}. But this
+kind of expansion it still doesn't expand some primitive operations.
+
+\startbuffer
+\newcount\NumberOfCalls
+
+\def\TestMe{\advance\NumberOfCalls1 }
+
+\edef\Tested{\TestMe foo:\the\NumberOfCalls}
+\edef\Tested{\TestMe foo:\the\NumberOfCalls}
+\edef\Tested{\TestMe foo:\the\NumberOfCalls}
+
+\meaning\Tested
+\stopbuffer
+
+\typebuffer
+
+The result is a macro that has the not expanded code in its body:
+
+\getbuffer
+
+Instead we can define \tex {TestMe} in a way that expands the assignment
+immediately. You need of course to be aware of preventing look ahead interference
+by using a space or \tex {relax} (often an expression works better as it doesn't
+leave an \tex {relax}).
+
+\startbuffer
+\def\TestMe{\immediateassignment\advance\NumberOfCalls1 }
+
+\edef\Tested{\TestMe foo:\the\NumberOfCalls}
+\edef\Tested{\TestMe foo:\the\NumberOfCalls}
+\edef\Tested{\TestMe foo:\the\NumberOfCalls}
+
+\meaning\Tested
+\stopbuffer
+
+\typebuffer
+
+This time the counter gets updates and we don't see interference in the
+resulting \tex {Tested} macro:
+
+\getbuffer
+
+Here is a somewhat silly example of expanded comparison:
+
+\startbuffer
+\def\expandeddoifelse#1#2#3#4%
+ {\immediateassignment\edef\tempa{#1}%
+ \immediateassignment\edef\tempb{#2}%
+ \ifx\tempa\tempb
+ \immediateassignment\def\next{#3}%
+ \else
+ \immediateassignment\def\next{#4}%
+ \fi
+ \next}
+
+\edef\Tested
+ {(\expandeddoifelse{abc}{def}{yes}{nop}/%
+ \expandeddoifelse{abc}{abc}{yes}{nop})}
+
+\meaning\Tested
+\stopbuffer
+
+\typebuffer
+
+It gives:
+
+\getbuffer
+
+A variant is:
+
+\starttyping
+\def\expandeddoifelse#1#2#3#4%
+ {\immediateassigned{
+ \edef\tempa{#1}%
+ \edef\tempb{#2}%
+ }%
+ \ifx\tempa\tempb
+ \immediateassignment\def\next{#3}%
+ \else
+ \immediateassignment\def\next{#4}%
+ \fi
+ \next}
+\stoptyping
+
+The possible error messages are the same as using assignments in preambles of
+alignments and after the \prm {accent} command. The supported assignments are the
+so called prefixed commands (except box assignments).
+
+\subsection{\lpr {ifcondition}}
+
+\topicindex {conditions}
+
+This is a somewhat special one. When you write macros conditions need to be
+properly balanced in order to let \TEX's fast branch skipping work well. This new
+primitive is basically a no||op flagged as a condition so that the scanner can
+recognize it as an if|-|test. However, when a real test takes place the work is
+done by what follows, in the next example \tex {something}.
+
+\starttyping
+\unexpanded\def\something#1#2%
+ {\edef\tempa{#1}%
+ \edef\tempb{#2}
+ \ifx\tempa\tempb}
+
+\ifcondition\something{a}{b}%
+ \ifcondition\something{a}{a}%
+ true 1
+ \else
+ false 1
+ \fi
+\else
+ \ifcondition\something{a}{a}%
+ true 2
+ \else
+ false 2
+ \fi
+\fi
+\stoptyping
+
+If you are familiar with \METAPOST, this is a bit like \type {vardef} where the macro
+has a return value. Here the return value is a test.
+
+\stopsection
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/luatex/luatex-fonts.tex b/doc/context/sources/general/manuals/luatex/luatex-fonts.tex
index 8480d7f2f..189e3295e 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-fonts.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-fonts.tex
@@ -46,7 +46,7 @@ the table are as follows:
\NC \type{header} \NC yes \NC no \NC no \NC string \NC header comments, if any \NC \NR
\NC \type{hyphenchar} \NC no \NC no \NC yes \NC number \NC default: \TEX's \prm {hyphenchar} \NC \NR
\NC \type{parameters} \NC no \NC yes \NC yes \NC hash \NC default: 7 parameters, all zero \NC \NR
-\NC \type{size} \NC no \NC yes \NC yes \NC number \NC loaded (at) size. (default: same as designsize) \NC \NR
+\NC \type{size} \NC no \NC yes \NC yes \NC number \NC the required scaling (by default the same as designsize) \NC \NR
\NC \type{skewchar} \NC no \NC no \NC yes \NC number \NC default: \TEX's \prm {skewchar} \NC \NR
\NC \type{type} \NC yes \NC no \NC yes \NC string \NC basic type of this font \NC \NR
\NC \type{format} \NC no \NC no \NC yes \NC string \NC disk format type \NC \NR
@@ -62,11 +62,11 @@ the table are as follows:
\NC \type{cache} \NC no \NC no \NC yes \NC string \NC This key controls caching of the \LUA\ table on the
\TEX\ end where \type {yes} means: use a reference to
the table that is passed to \LUATEX\ (this is the
- default), and no \type {no} means: don't store the
+ default), and \type {no} means: don't store the
table reference, don't cache any \LUA\ data for this
font while \type {renew} means: don't store the table
reference, but save a reference to the table that is
- created at the first access to one of its fields in
+ created at the first access to one of its fields in the
font. \NC \NR
\NC \type{nomath} \NC no \NC no \NC yes \NC boolean \NC This key allows a minor speedup for text fonts. If it
is present and true, then \LUATEX\ will not check the
@@ -225,17 +225,20 @@ The following top|-|level keys can be present inside a character hash:
\stoptabulate
The values of \type {top_accent}, \type {bot_accent} and \type {mathkern} are
-used only for math accent and superscript placement, see the \at {math chapter}
-[math] in this manual for details. The values of \type {left_protruding} and
-\type {right_protruding} are used only when \lpr {protrudechars} is non-zero.
-Whether or not \type {expansion_factor} is used depends on the font's global
-expansion settings, as well as on the value of \lpr {adjustspacing}.
-
-The usage of \type {tounicode} is this: if this font specifies a \type {tounicode=1} at the top level, then \LUATEX\ will construct a \type {/ToUnicode}
-entry for the \PDF\ font (or font subset) based on the character|-|level \type {tounicode} strings, where they are available. If a character does not have a
+used only for math accent and superscript placement, see \at {page} [math] in
+this manual for details. The values of \type {left_protruding} and \type
+{right_protruding} are used only when \lpr {protrudechars} is non-zero. Whether
+or not \type {expansion_factor} is used depends on the font's global expansion
+settings, as well as on the value of \lpr {adjustspacing}.
+
+The usage of \type {tounicode} is this: if this font specifies a \type
+{tounicode=1} at the top level, then \LUATEX\ will construct a \type {/ToUnicode}
+entry for the \PDF\ font (or font subset) based on the character|-|level \type
+{tounicode} strings, where they are available. If a character does not have a
sensible \UNICODE\ equivalent, do not provide a string either (no empty strings).
-If the font level \type {tounicode} is not set, then \LUATEX\ will build up \type {/ToUnicode} based on the \TEX\ code points you used, and any character-level
+If the font level \type {tounicode} is not set, then \LUATEX\ will build up \type
+{/ToUnicode} based on the \TEX\ code points you used, and any character-level
\type {tounicodes} will be ignored. The string format is exactly the format that
is expected by Adobe \CMAP\ files (\UTF-16BE in hexadecimal encoding), minus the
enclosing angle brackets. For instance the \type {tounicode} for a \type {fi}
@@ -276,7 +279,7 @@ Each of those components is itself a hash of up to five keys:
The \type {kerns} table is a hash indexed by character index (and \quote
{character index} is defined as either a non|-|negative integer or the string
-value \type {right_boundary}), with the values the kerning to be applied, in
+value \type {right_boundary}), with the values of the kerning to be applied, in
scaled points.
The \type {ligatures} table is a hash indexed by character index (and \quote
@@ -369,7 +372,9 @@ If no special care is needed, \LUATEX\ falls back to the mapfile|-|based solutio
used by \PDFTEX\ and \DVIPS, so that legacy fonts are supported transparently. If
a \quote {wide} font is used, the new subsystem kicks in, and some extra fields
have to be present in the font structure. In this case, \LUATEX\ does not use a
-map file at all. These extra fields are: \type {format}, \type {embedding}, \type {fullname}, \type {cidinfo} (as explained above), \type {filename}, and the \type {index} key in the separate characters.
+map file at all. These extra fields are: \type {format}, \type {embedding}, \type
+{fullname}, \type {cidinfo} (as explained above), \type {filename}, and the \type
+{index} key in the separate characters.
The \type {format} variable can have the following values. \type {type3} fonts
are provided for backward compatibility only, and do not support the new wide
@@ -399,7 +404,8 @@ Valid values for the \type {embedding} variable are:
The other fields are used as follows. The \type {fullname} will be the
\POSTSCRIPT|/|\PDF\ font name. The \type {cidinfo} will be used as the character
set: the CID \type {/Ordering} and \type {/Registry} keys. The \type {filename}
-points to the actual font file. If you include the full path in the \type {filename} or if the file is in the local directory, \LUATEX\ will run a little
+points to the actual font file. If you include the full path in the \type
+{filename} or if the file is in the local directory, \LUATEX\ will run a little
bit more efficient because it will not have to re|-|run the \type {find_*_file}
callback in that case.
@@ -430,7 +436,7 @@ table from \cbk {define_font} as a virtual font:
\startitemize[packed]
\startitem
- Set the top|-|level key \type {type} to \type {virtual}. I most cases it's
+ Set the top|-|level key \type {type} to \type {virtual}. In most cases it's
optional because we look at the \type {commands} entry anyway.
\stopitem
\startitem
@@ -469,11 +475,11 @@ fonts = {
}
\stoptyping
-The the first referenced font (at index~1) in this virtual font is \type
-{ptrmr8a} loaded at 10pt, and the second is \type {psyr} loaded at a little over
-9pt. The third one is previously defined font that is known to \LUATEX\ as font
-id~38. The array index numbers are used by the character command definitions that
-are part of each character.
+The first referenced font (at index~1) in this virtual font is \type {ptrmr8a}
+loaded at 10pt, and the second is \type {psyr} loaded at a little over 9pt. The
+third one is a previously defined font that is known to \LUATEX\ as font id~38.
+The array index numbers are used by the character command definitions that are
+part of each character.
The \type {commands} array is a hash where each item is another small array,
with the first entry representing a command and the extra items being the
@@ -555,7 +561,7 @@ commands = {
The default value for \type {font} is always~1 at the start of the
\type {commands} array. Therefore, if the virtual font is essentially only a
-re|-|encoding, then you do usually not have create an explicit \quote {font}
+re|-|encoding, then you do usually not have created an explicit \quote {font}
command in the array.
Rules inside of \type {commands} arrays are built up using only two dimensions:
@@ -642,7 +648,7 @@ each time when a character is output.
\topicindex {fonts+library}
The font library provides the interface into the internals of the font system,
-and also it contains helper functions to load traditional \TEX\ font metrics
+and it also contains helper functions to load traditional \TEX\ font metrics
formats. Other font loading functionality is provided by the \type {fontloader}
library that will be discussed in the next section.
@@ -670,9 +676,6 @@ The number is a bit special:
\stopitem
\stopitemize
-The internal structure of the metrics font table that is returned is explained in
-\in {chapter} [fonts].
-
\subsection{Loading a \VF\ file}
\topicindex {fonts+vf}
@@ -699,8 +702,8 @@ font.fonts[n] = { ... }
<table> f = font.fonts[n]
\stoptyping
-See \in {chapter} [fonts] for the structure of the tables. Because this is a
-virtual array, you cannot call \type {pairs} on it, but see below for the \type {font.each} iterator.
+Because this is a virtual array, you cannot call \type {pairs} on it, but see
+below for the \type {font.each} iterator.
The two metatable functions implementing the virtual array are:
@@ -709,9 +712,10 @@ The two metatable functions implementing the virtual array are:
font.setfont(<number> n, <table> f)
\stopfunctioncall
-Note that at the moment, each access to the \type {font.fonts} or call to \type {font.getfont} creates a \LUA\ table for the whole font. This process can be quite
-slow. In a later version of \LUATEX, this interface will change (it will start
-using userdata objects instead of actual tables).
+Note that at the moment, each access to the \type {font.fonts} or call to \type
+{font.getfont} creates a \LUA\ table for the whole font. This process can be
+quite slow. In a later version of \LUATEX, this interface will change (it will
+start using userdata objects instead of actual tables).
Also note the following: assignments can only be made to fonts that have already
been defined in \TEX, but have not been accessed {\it at all\/} since that
@@ -742,9 +746,8 @@ You can define your own font into \type {font.fonts} by calling this function:
\stopfunctioncall
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]. An alternative call
-is:
+\type {font.fonts}). If the font creation fails, an error is raised. The table is
+a font structure. An alternative call is:
\startfunctioncall
<number> i =
diff --git a/doc/context/sources/general/manuals/luatex/luatex-introduction.tex b/doc/context/sources/general/manuals/luatex/luatex-introduction.tex
index 911a30653..b931cfcf6 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-introduction.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-introduction.tex
@@ -16,7 +16,7 @@ It took about a decade to reach stable version 1.0, but for good reason.
Successive versions brought new functionality, more control, some cleanup of
internals. Experimental features evolved into stable ones or were dropped.
Already quite early \LUATEX\ could be used for production and it was used on a
-daily basis by the authors. Successive versions sometimes demanded a adaption to
+daily basis by the authors. Successive versions sometimes demanded an adaption to
the \LUA\ interfacing, but the concepts were unchanged. The current version can
be considered stable in functionality and there will be no fundamental changes.
Of course we then can decide to move towards version 2.00 with different
@@ -51,13 +51,13 @@ code in \TEX\ engines (especially code that is not needed any longer).
\startitem
We started out with most of \PDFTEX\ version 1.40.9. The code base was
converted to \CCODE\ and split in modules. Experimental features were
- been removed and utility macros are not inherited because their
- functionality can be programmed in \LUA. The number of backend interface
- commands has been reduced to a few. The so called extensions are
- separated from the core (which we try to keep close to the original \TEX\
- core). Some mechanisms like expansion and protrusion can behave different
- from the original due to some cleanup and optimization. Some whatsit
- based functionality (image support and reusable content) is now core
+ removed and utility macros are not inherited because their functionality
+ can be programmed in \LUA. The number of backend interface commands has
+ been reduced to a few. The so called extensions are separated from the
+ core (which we try to keep close to the original \TEX\ core). Some
+ mechanisms like expansion and protrusion can behave different from the
+ original due to some cleanup and optimization. Some whatsit based
+ functionality (image support and reusable content) is now core
functionality. We don't stay in sync with \PDFTEX\ development.
\stopitem
\startitem
@@ -111,7 +111,7 @@ code in \TEX\ engines (especially code that is not needed any longer).
\stopitemize
We try to keep upcoming versions compatible but intermediate releases can contain
-experimental features. A general rule is that versions that end up on \TEX live
+experimental features. A general rule is that versions that end up on \TEXLIVE\
and|/|or are released around \CONTEXT\ meetings are stable. Future versions will
probably become a bit leaner and meaner. Some libraries might become external as
we don't want to bloat the binary and also don't want to add more hard coded
diff --git a/doc/context/sources/general/manuals/luatex/luatex-languages.tex b/doc/context/sources/general/manuals/luatex/luatex-languages.tex
index f7413a409..10ccc335f 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-languages.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-languages.tex
@@ -63,7 +63,7 @@ indicating whether this ligature was the result of a word boundary, and it was
stored in the same place as other nodes like boxes and kerns and glues.
In \LUATEX, these two types are merged into one, somewhat larger structure called
-a \nod {glyph} nodes. Besides having the old character, font, and component
+a \nod {glyph} node. Besides having the old character, font, and component
fields there are a few more, like \quote {attr} that we will see in \in {section}
[glyphnodes], these nodes also contain a subtype, that codes four main types and
two additional ghost types. For ligatures, multiple bits can be set at the same
@@ -79,25 +79,25 @@ time (in case of a single|-|glyph word).
not set.
\stopitem
\startitem
- \type {ligature}, for constructed ligatures bit 1 is set
+ \type {ligature}, for constructed ligatures bit 1 is set.
\stopitem
\startitem
- \type {ghost}, for so called \quote {ghost objects} bit 2 is set
+ \type {ghost}, for so called \quote {ghost objects} bit 2 is set.
\stopitem
\startitem
\type {left}, for ligatures created from a left word boundary and for
- ghosts created from \lpr {leftghost} bit 3 gets set
+ ghosts created from \lpr {leftghost} bit 3 gets set.
\stopitem
\startitem
\type {right}, for ligatures created from a right word boundary and
- for ghosts created from \lpr {rightghost} bit 4 is set
+ for ghosts created from \lpr {rightghost} bit 4 is set.
\stopitem
\stopitemize
The \nod {glyph} nodes also contain language data, split into four items that
-were current when the node was created: the \prm {setlanguage} (15 bits), \prm
-{lefthyphenmin} (8 bits), \prm {righthyphenmin} (8 bits), and \prm {uchyph} (1
-bit).
+were current when the node was created: the \prm {setlanguage} (15~bits), \prm
+{lefthyphenmin} (8~bits), \prm {righthyphenmin} (8~bits), and \prm {uchyph}
+(1~bit).
Incidentally, \LUATEX\ allows 16383 separate languages, and words can be 256
characters long. The language is stored with each character. You can set
@@ -105,7 +105,7 @@ characters long. The language is stored with each character. You can set
an ignored hyphenation language.
The new primitive \lpr {hyphenationmin} can be used to signal the minimal length
-of a word. This value stored with the (current) language.
+of a word. This value is stored with the (current) language.
Because the \prm {uchyph} value is saved in the actual nodes, its handling is
subtly different from \TEX82: changes to \prm {uchyph} become effective
@@ -155,7 +155,7 @@ Here are some examples (we assume that French patterns are used):
\stoptabulate
Carrying all this information with each glyph would give too much overhead and
-also make the process of setting up thee codes more complex. A solution with
+also make the process of setting up these codes more complex. A solution with
\type {hjcode} sets was considered but rejected because in practice the current
approach is sufficient and it would not be compatible anyway.
@@ -164,7 +164,7 @@ of \prm {savinghyphcodes} at the moment the format is dumped.
A boundary node normally would mark the end of a word which interferes with for
instance discretionary injection. For this you can use the \prm {wordboundary}
-as trigger. Here are a few examples of usage:
+as a trigger. Here are a few examples of usage:
\startbuffer
discrete---discrete
@@ -188,17 +188,17 @@ as trigger. Here are a few examples of usage:
\typebuffer \startnarrower \dontcomplain \hsize 1pt \getbuffer \par \stopnarrower
We only accept an explicit hyphen when there is a preceding glyph and we skip a
-sequence of explicit hyphens as that normally indicates a \type {--} or \type
+sequence of explicit hyphens since that normally indicates a \type {--} or \type
{---} ligature in which case we can in a worse case usage get bad node lists
later on due to messed up ligature building as these dashes are ligatures in base
-fonts. This is a side effect of the separating the hyphenation, ligaturing and
+fonts. This is a side effect of separating the hyphenation, ligaturing and
kerning steps.
-The start and end of a characters is signalled by a \nod {glue}, \nod {penalty},
-\nod {kern} or \nod {boundary} node. But by default also a \nod {hlist}, \nod
-{vlist}, \nod {rule}, \nod {dir}, \nod {whatsit}, \nod {ins}, and \nod {adjust}
-node indicate a start or end. You can omit the last set from the test by setting
-\lpr {hyphenationbounds} to a non|-|zero value:
+The start and end of a sequence of characters is signalled by a \nod {glue}, \nod
+{penalty}, \nod {kern} or \nod {boundary} node. But by default also a \nod
+{hlist}, \nod {vlist}, \nod {rule}, \nod {dir}, \nod {whatsit}, \nod {ins}, and
+\nod {adjust} node indicate a start or end. You can omit the last set from the
+test by setting \lpr {hyphenationbounds} to a non|-|zero value:
\starttabulate[|c|l|]
\DB value \BC behaviour \NC \NR
@@ -396,7 +396,7 @@ there are a few exceptions.
\startitemize[n]
\startitem
- The \prm {accent} primitives creates nodes with subtype \quote {glyph}
+ The \prm {accent} primitive creates nodes with subtype \quote {glyph}
instead of \quote {character}: one for the actual accent and one for the
accentee. The primary reason for this is that \prm {accent} in \TEX82 is
explicitly dependent on the current font encoding, so it would not make much
@@ -534,22 +534,24 @@ different from the one in \TEX82.
After expansion, the argument for \prm {patterns} has to be proper \UTF8 with
individual patterns separated by spaces, no \prm {char} or \prm {chardef}d
-commands are allowed. The current implementation quite strict and will reject all
-non|-|\UNICODE\ characters. Likewise, the expanded argument for \prm
+commands are allowed. The current implementation is quite strict and will reject
+all non|-|\UNICODE\ characters. Likewise, the expanded argument for \prm
{hyphenation} also has to be proper \UTF8, but here a bit of extra syntax is
provided:
\startitemize[n]
\startitem
- Three sets of arguments in curly braces (\type {{}{}{}}) indicates a desired
+ Three sets of arguments in curly braces (\type {{}{}{}}) indicate a desired
complex discretionary, with arguments as in \prm {discretionary}'s command in
normal document input.
\stopitem
\startitem
- A \type {-} indicates a desired simple discretionary, cf.\ \type {\-} and \type {\discretionary{-}{}{}} in normal document input.
+ A \type {-} indicates a desired simple discretionary, cf.\ \type {\-} and
+ \type {\discretionary{-}{}{}} in normal document input.
\stopitem
\startitem
- Internal command names are ignored. This rule is provided especially for \prm {discretionary}, but it also helps to deal with \prm {relax} commands that
+ Internal command names are ignored. This rule is provided especially for \prm
+ {discretionary}, but it also helps to deal with \prm {relax} commands that
may sneak in.
\stopitem
\startitem
@@ -647,7 +649,7 @@ words is very different from the ones in \TEX82, and that means there are some
noticeable differences in handling as well.
First and foremost, there is no \quote {compressed trie} involved in hyphenation.
-The algorithm still reads \PATGEN-generated pattern files, but \LUATEX\ uses a
+The algorithm still reads pattern files generated by \PATGEN, but \LUATEX\ uses a
finite state hash to match the patterns against the word to be hyphenated. This
algorithm is based on the \quote {libhnj} library used by \OPENOFFICE, which in
turn is inspired by \TEX.
@@ -803,6 +805,8 @@ the top-level discretionary that resulted from the first hyphenation point.
Here is that nested solution again, in a different representation:
+\testpage[4]
+
\starttabulate[|l|c|c|c|c|c|c|]
\DB \BC pre \BC \BC post \BC \BC replace \BC \NC \NR
\TB
@@ -834,9 +838,9 @@ the first node).
One can observe that the \type {of-f-ice} and \type {off-ice} cases both end with
the same actual post replacement list (\type {i}), and that this would be the
-case even if that \type {i} was the first item of a potential following ligature
-like \type {ic}. This allows \LUATEX\ to do away with one of the fields, and thus
-make the whole stuff fit into just two discretionary nodes.
+case even if \type {i} was the first item of a potential following ligature like
+\type {ic}. This allows \LUATEX\ to do away with one of the fields, and thus make
+the whole stuff fit into just two discretionary nodes.
The mapping of the seven list fields to the six fields in this discretionary node
pair is as follows:
@@ -881,7 +885,7 @@ approach.
\section{Breaking paragraphs into lines}
-\topicindex {line breaks}
+\topicindex {linebreaks}
\topicindex {paragraphs}
\topicindex {discretionaries}
@@ -889,7 +893,7 @@ This code is almost unchanged, but because of the above|-|mentioned changes
with respect to discretionaries and ligatures, line breaking will potentially be
different from traditional \TEX. The actual line breaking code is still based on
the \TEX82 algorithms, and it does not expect there to be discretionaries inside
-of discretionaries. But, as patterns evolve and fonts handling can influence
+of discretionaries. But, as patterns evolve and font handling can influence
discretionaries, you need to be aware of the fact that long term consistency is not
an engine matter only.
diff --git a/doc/context/sources/general/manuals/luatex/luatex-lua.tex b/doc/context/sources/general/manuals/luatex/luatex-lua.tex
index 226ece56d..165bdb614 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-lua.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-lua.tex
@@ -52,7 +52,7 @@ In this mode, \LUATEX\ is exactly like \type {luac} from the stand alone \LUA\
distribution, except that it does not have the \type {-l} switch, and that it
accepts (but ignores) the \type {--luaconly} switch. The current version of \LUA\
can dump bytecode using \type {string.dump} so we might decide to drop this
-version if \LUATEX.
+version of \LUATEX.
\subsection{Other commandline processing}
@@ -136,7 +136,7 @@ any other \WEBC|-|based typesetting engine, except that \LUATEX\ has a few extra
switches and lacks some others. Also, if the \type {--lua} option is present,
\LUATEX\ will enter an alternative mode of command line processing in comparison
to the standard \WEBC\ programs. In this mode, a small series of actions is taken
-in order.
+in the following order:
\startitemize[n]
@@ -160,6 +160,8 @@ in order.
\LUA\ commands that can easily be abused by a malicious document. At the
moment, \type {--safer} \type {nil}s the following functions:
+ \blank
+
\starttabulate[|c|l|]
\DB library \BC functions \NC \NR
\TB
@@ -171,18 +173,20 @@ in order.
\LL
\stoptabulate
+ \blank
+
Furthermore, it disables loading of compiled \LUA\ libraries and it makes
\type {io.open()} fail on files that are opened for anything besides reading.
\stopitem
\startitem
- When \LUATEX\ starts it set the locale to a neutral value. If for some reason
- you use \type {os.locale}, you need to make sure you \type {nil} it
- afterwards because otherwise it can interfere with code that for instance
- generates dates. You can nil the locale with
+ When \LUATEX\ starts it sets the \type {locale} to a neutral value. If for
+ some reason you use \type {os.locale}, you need to make sure you \type {nil}
+ it afterwards because otherwise it can interfere with code that for instance
+ generates dates. You can ignore the \type {locale} with:
\starttyping
- os.setlocale(nil.nil)
+ os.setlocale(nil,nil)
\stoptyping
The \type {--nosocket} option makes the socket library unavailable, so that \LUA\
@@ -296,19 +300,19 @@ the command line option \type {--luaonly} was not given), it will only run the
four functions above if the matching \type {texmf.cnf} variable(s) or their \type
{texconfig} (see \in {section} [texconfig]) counterparts allow execution of the
requested system command. In \quote {script interpreter} runs of \LUATEX, these
-settings have no effect, and all four functions function as normal.
+settings have no effect, and all four functions have their original meaning.
-Some libraries have a few more functions, either coded in \CCODE\ or in \LUA.
-For instance, when we started with \LUATEX\ we added some helpers to the \type
+Some libraries have a few more functions, either coded in \CCODE\ or in \LUA. For
+instance, when we started with \LUATEX\ we added some helpers to the \type
{luafilesystem} namespace \type {lfs}. The two boolean functions \type
{lfs.isdir} and \type {lfs.isfile} were speedy and better variants of what could
be done with \type {lfs.attributes}. The additional function \type
{lfs.shortname} takes a file name and returns its short name on \type {win32}
platforms. Finally, for non|-|\type {win32} platforms only, we provided \type
{lfs.readlink} that takes an existing symbolic link as argument and returns its
-name. However, the \type library evolved sop now we dropped these in favour of
-pure \LUA\ variants. The \type {shortname} helper is considered obsolete and now
-just returns the name.
+name. However, the \type library evolved so we have dropped these in favour of
+pure \LUA\ variants. The \type {shortname} helper is obsolete and now just
+returns the name.
The \type {string} library has a few extra functions like \type
{string.explode(s[,m])}. This function returns an array containing the string
@@ -514,7 +518,7 @@ The \type {os} library has a few extra functions and variables:
\startitem
\type {os.uname()} returns a table with specific operating system
information acquired at runtime. The keys in the returned table are all
- string valued, and their names are: \type {sysname}, \type {machine}, \type
+ string values, and their names are: \type {sysname}, \type {machine}, \type
{release}, \type {version}, and \type {nodename}.
\stopitem
@@ -627,7 +631,7 @@ complementary entry \type {use_utc_time} in the \type {texconfig} table.
There is some control possible, for instance prevent filename to be written to
the \PDF\ file. This is discussed elsewhere. In \CONTEXT\ we provide the command
-line argument \type {--nodates} that does bit more disabling of dates.
+line argument \type {--nodates} that does a bit more disabling of dates.
\stopchapter
diff --git a/doc/context/sources/general/manuals/luatex/luatex-math.tex b/doc/context/sources/general/manuals/luatex/luatex-math.tex
index 5f82eb142..9f99c7ab3 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-math.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-math.tex
@@ -30,7 +30,7 @@ possible, \LUATEX\ adds the new primitive: \lpr {mathstyle}. This is a \quote
not set.
The returned value is between 0 and 7 (in math mode), or $-1$ (all other modes).
-For easy testing, the eight math style commands have been altered so that the can
+For easy testing, the eight math style commands have been altered so that they can
be used as numeric values, so you can write code like this:
\starttyping
@@ -164,7 +164,7 @@ two now allow for a 21-bit character argument on the left hand side of the equal
sign.
Some of the new \LUATEX\ primitives read more than one separate value. This is
-shown in the tables below by a plus sign in the second column.
+shown in the tables below by a plus sign.
The input for such primitives would look like this:
@@ -229,13 +229,12 @@ Specifications typically look like:
The new primitives that deal with delimiter|-|style objects do not set up a
\quote {large family}. Selecting a suitable size for display purposes is expected
-to be dealt with by the font via the \lpr {Umathoperatorsize} parameter (more
-information can be found in a following section).
+to be dealt with by the font via the \lpr {Umathoperatorsize} parameter.
For some of these primitives, all information is packed into a single signed
integer. For the first two (\lpr {Umathcharnum} and \lpr {Umathcodenum}), the
lowest 21 bits are the character code, the 3 bits above that represent the math
-class, and the family data is kept in the topmost bits This means that the values
+class, and the family data is kept in the topmost bits. This means that the values
for math families 128--255 are actually negative. For \lpr {Udelcodenum} there
is no math class. The math family information is stored in the bits directly on
top of the character code. Using these three commands is not as natural as using
@@ -304,9 +303,9 @@ are described as follows:
\stopitemize
In \LUATEX\ one can set the styles in more detail which means that you sometimes
-have to set both normal and cramped styles to get the effect you want. If we
-force styles in the script using \prm {scriptstyle} and \lpr {crampedscriptstyle}
-we get this:
+have to set both normal and cramped styles to get the effect you want. (Even) if
+we force styles in the script using \prm {scriptstyle} and \lpr
+{crampedscriptstyle} we get this:
\startbuffer[demo]
\starttabulate
@@ -330,7 +329,7 @@ Now we set the following parameters
\typebuffer[setup]
-This gives:
+This gives a different result:
\start\getbuffer[setup,demo]\stop
@@ -355,7 +354,7 @@ Now we get:
In \LUATEX, the font dimension parameters that \TEX\ used in math typesetting are
now accessible via primitive commands. In fact, refactoring of the math engine
-has resulted in many more parameters than were accessible before.
+has resulted in many more parameters than were not accessible before.
\starttabulate
\DB primitive name \BC description \NC \NR
@@ -433,7 +432,7 @@ needed.
The injection of \prm {abovedisplayskip} and \prm {belowdisplayskip} is not
symmetrical. An above one is always inserted, also when zero, but the below is
-only inserted when larger than zero. Especially the later makes it sometimes hard
+only inserted when larger than zero. Especially the latter makes it sometimes hard
to fully control spacing. Therefore \LUATEX\ comes with a new directive: \lpr
{mathdisplayskipmode}. The following values apply:
@@ -463,7 +462,7 @@ case no attention is paid to which family is being assigned to: the \type
{MathConstants} tables in the last assigned family sets all parameters.
In the table below, the one|-|letter style abbreviations and symbolic tfm font
-dimension names match those using in the \TeX book. Assignments to \prm
+dimension names match those used in the \TeX book. Assignments to \prm
{textfont} set the values for the cramped and uncramped display and text styles,
\prm {scriptfont} sets the script styles, and \prm {scriptscriptfont} sets the
scriptscript styles, so we have eight parameters for three font sizes. In the
@@ -574,7 +573,7 @@ scaled point more than the initial attempt's size, so that always the \quote
{first next} will be tried, just like in \TEX82.
Note 7: The \lpr {Umathradicaldegreeraise} is a special case because it is the
-only parameter that is expressed in a percentage instead of as a number of scaled
+only parameter that is expressed in a percentage instead of a number of scaled
points.
Note 8: \type {SubscriptShiftDownWithSuperscript} does not actually exist in the
@@ -593,10 +592,10 @@ There are two extra math parameters \lpr {Umathnolimitsupfactor} and \lpr
{Umathnolimitsubfactor} that were added to provide some control over how limits
are spaced (for example the position of super and subscripts after integral
operators). They relate to an extra parameter \lpr {mathnolimitsmode}. The half
-corrections are what happens when scripts are placed on above and below. The
+corrections are what happens when scripts are placed above and below. The
problem with italic corrections is that officially that correction italic is used
for above|/|below placement while advanced kerns are used for placement at the
-right end. The question is: how often is this implemented, and if so, does the
+right end. The question is: how often is this implemented, and if so, do the
kerns assume correction too. Anyway, with this parameter one can control it.
\starttabulate[|l|ck1|ck1|ck1|ck1|ck1|ck1|]
@@ -678,10 +677,10 @@ math is bound to fuzzy rules. So, control is the solution.
\topicindex {math+kerning}
\topicindex {math+scripts}
-If you want typeset text in math macro packages often provide something \type
+If you want to typeset text in math macro packages often provide something \type
{\text} which obeys the script sizes. As the definition can be anything there is
-a good change that the kerning doesn't come out well when used in a script. Given
-that the first glyph ends up in an \prm {hbox} we have some control over this.
+a good chance that the kerning doesn't come out well when used in a script. Given
+that the first glyph ends up in a \prm {hbox} we have some control over this.
And, as a bonus we also added control over the normal sublist kerning. The \lpr
{mathscriptboxmode} parameter defaults to~1.
@@ -769,7 +768,7 @@ The \lpr {mathdelimitersmode} primitive is experimental and deals with the
following (potential) problems. Three bits can be set. The first bit prevents an
unwanted shift when the fence symbol is not scaled (a cambria side effect). The
second bit forces italic correction between a preceding character ordinal and the
-fenced subformula, while the third bit turns that subformula into a ordinary so
+fenced subformula, while the third bit turns that subformula into an ordinary so
that the same spacing applies as with unfenced variants. Here we show Cambria
(with \lpr {mathitalicsmode} enabled).
@@ -791,7 +790,7 @@ that the same spacing applies as with unfenced variants. Here we show Cambria
So, when set to 7 fenced subformulas with unscaled delimiters come out the same
as unfenced ones. This can be handy for cases where one is forced to use \prm
{left} and \prm {right} always because of unpredictable content. As said, it's an
-experimental features (which somehow fits in the exceptional way fences are dealt
+experimental feature (which somehow fits in the exceptional way fences are dealt
with in the engine). The full list of flags is given in the next table:
\starttabulate[|c|l|]
@@ -799,7 +798,7 @@ with in the engine). The full list of flags is given in the next table:
\TB
\NC \type{"01} \NC don't apply the usual shift \NC \NR
\NC \type{"02} \NC apply italic correction when possible \NC \NR
-\NC \type{"04} \NC force a ordinary subformula \NC \NR
+\NC \type{"04} \NC force an ordinary subformula \NC \NR
\NC \type{"08} \NC no shift when a base character \NC \NR
\NC \type{"10} \NC only shift when an extensible \NC \NR
\LL
@@ -896,7 +895,7 @@ They are all initialized by \type {initex} to the values mentioned in the table
in Chapter~18 of the \TEX book.
Note 1: for ease of use as well as for backward compatibility, \prm {thinmuskip},
-\prm {medmuskip} and \prm {thickmuskip} are treated especially. In their case a
+\prm {medmuskip} and \prm {thickmuskip} are treated specially. In their case a
pointer to the corresponding internal parameter is saved, not the actual \prm
{muskip} value. This means that any later changes to one of these three
parameters will be taken into account.
@@ -940,7 +939,7 @@ accentee. The accent will be shifted horizontally such that its own \type
followed by its italic correction is used instead.
The vertical placement of a top accent depends on the \type {x_height} of the
-font of the accentee (as explained in the \TEX book), but if value that turns out
+font of the accentee (as explained in the \TEX book), but if a value turns out
to be zero and the font had a \type {MathConstants} table, then \type
{AccentBaseHeight} is used instead.
@@ -1115,7 +1114,7 @@ will return:
[2] [3] [4]
\stoptyping
-These commands are provides as convenience. Before they came available you could
+These commands are provides as convenience. Before they come available you could
do the following:
\starttyping
@@ -1153,7 +1152,7 @@ The syntax used here is:
where the options can be \type {noaxis} and \type {exact}. By default we add half
the axis to the shifts and by default we zero the width of the middle character.
-For Latin Modern The result looks as follows:
+For Latin Modern the result looks as follows:
\def\ShowA#1#2#3{$x + { {#1} \Uskewed / #3 {#2} } + x$}
\def\ShowB#1#2#3{$x + { {#1} \Uskewedwithdelims / () #3 {#2} } + x$}
@@ -1276,7 +1275,7 @@ requested math family is used.
\topicindex {math+spacing}
-Inline math is surrounded by (optional) \prm {mathsurround} spacing but that is fixed
+Inline math is surrounded by (optional) \prm {mathsurround} spacing but that is a fixed
dimension. There is now an additional parameter \lpr {mathsurroundskip}. When set to a
non|-|zero value (or zero with some stretch or shrink) this parameter will replace
\prm {mathsurround}. By using an additional parameter instead of changing the nature
@@ -1358,11 +1357,11 @@ fields in a node when applicable in the first occasion that checks them
Normally you will force delimiters to certain sizes by putting an empty box or
rule next to it. The resulting delimiter will either be a character from the
stepwise size range or an extensible. The latter can be quite differently
-positioned that the characters as it depends on the fit as well as the fact if
+positioned than the characters as it depends on the fit as well as the fact if
the used characters in the font have depth or height. Commands like (plain \TEX
s) \type {\big} need use this feature. In \LUATEX\ we provide a bit more control
-by three variants that supporting optional parameters \type {height}, \type
-{depth} and \type {axis}. The following example uses this:
+by three variants that support optional parameters \type {height}, \type {depth}
+and \type {axis}. The following example uses this:
\startbuffer
\Uleft height 30pt depth 10pt \Udelimiter "0 "0 "000028
@@ -1406,7 +1405,7 @@ We have three parameters that are used for this fixed anchoring:
When we set \lpr {mathscriptsmode} to a value other than zero these are used
for calculating fixed positions. This is something that is needed for instance
-for chemistry. You can manipulate the mentioned variables to achive different
+for chemistry. You can manipulate the mentioned variables to achieve different
effects.
\def\SampleMath#1%
@@ -1479,17 +1478,15 @@ to limit tracing. Only when \type {tracingassigns} and|/|or \type
The logic in the math engine is rather complex and there are often no universal
solutions (read: what works out well for one font, fails for another). Therefore
-some variations in the implementation will be driven by options for which a new
-primitive \lpr {mathoption} has been introduced (so that we don't end up with
-many new commands). The approach of options also permits us to see what effect a
-specific solution has.
+some variations in the implementation are driven by parameters (modes). In addition
+there is a new primitive \lpr {mathoption} which will be used for testing.
\subsubsection {\type {\mathoption old}}
This option was introduced for testing purposes when the math engine got split
code paths and it forces the engine to treat new fonts as old ones with respect
to italic correction etc. There are no guarantees given with respect to the final
-result and unexpected side effects are not seens as bugs as they relate to font
+result and unexpected side effects are not seen as bugs as they relate to font
properties.
\startbuffer
@@ -1497,71 +1494,83 @@ properties.
\stopbuffer
The \type {oldmath} boolean flag in the \LUA\ font table is the official way to
-force old treatment as it's bound to fonts.
-
-\subsubsection {\type {\mathoption noitaliccompensation}}
-
-This option compensates placement for characters with a built|-|in italic
-correction.
-
-\startbuffer
-{\showboxes\int}\quad
-{\showboxes\int_{|}^{|}}\quad
-{\showboxes\int\limits_{|}^{|}}
-\stopbuffer
-
-\typebuffer
-
-Gives (with computer modern that has such italics):
-
-\startlinecorrection[blank]
- \switchtobodyfont[modern]
- \startcombination[nx=2,ny=2,distance=5em]
- {\mathoption noitaliccompensation 0\relax \mathematics{\getbuffer}}
- {\nohyphens\type{0:inline}}
- {\mathoption noitaliccompensation 0\relax \mathematics{\displaymath\getbuffer}}
- {\nohyphens\type{0:display}}
- {\mathoption noitaliccompensation 1\relax \mathematics{\getbuffer}}
- {\nohyphens\type{1:inline}}
- {\mathoption noitaliccompensation 1\relax \mathematics{\displaymath\getbuffer}}
- {\nohyphens\type{1:display}}
- \stopcombination
-\stoplinecorrection
-
-\subsubsection {\type {\mathoption nocharitalic}}
-
-When two characters follow each other italic correction can interfere. The
-following example shows what this option does:
-
-\startbuffer
-\catcode"1D443=11
-\catcode"1D444=11
-\catcode"1D445=11
-P( PP PQR
-\stopbuffer
-
-\typebuffer
+force old treatment as it's bound to fonts. Like with all options we may
+temporarily introduce with this command this feature is not meant for production.
-Gives (with computer modern that has such italics):
+\subsubsection {Obsolete options}
-\startlinecorrection[blank]
- \switchtobodyfont[modern]
- \startcombination[nx=2,ny=2,distance=5em]
- {\mathoption nocharitalic 0\relax \mathematics{\getbuffer}}
- {\nohyphens\type{0:inline}}
- {\mathoption nocharitalic 0\relax \mathematics{\displaymath\getbuffer}}
- {\nohyphens\type{0:display}}
- {\mathoption nocharitalic 1\relax \mathematics{\getbuffer}}
- {\nohyphens\type{1:inline}}
- {\mathoption nocharitalic 1\relax \mathematics{\displaymath\getbuffer}}
- {\nohyphens\type{1:display}}
- \stopcombination
-\stoplinecorrection
+The following options are gone: \typ {noitaliccompensation}, \typ {nocharitalic},
+\typ {useoldfractionscaling}, and \typ {umathcodemeaning}.
-\subsubsection {\type {\mathoption useoldfractionscaling}}
-
-This option has been introduced as solution for tracker item 604 for fuzzy cases
-around either or not present fraction related settings for new fonts.
+% % obsolete:
+%
+% \subsubsection {\type {\mathoption noitaliccompensation}}
+%
+% This option compensates placement for characters with a built|-|in italic
+% correction.
+%
+% \startbuffer
+% {\showboxes\int}\quad
+% {\showboxes\int_{|}^{|}}\quad
+% {\showboxes\int\limits_{|}^{|}}
+% \stopbuffer
+%
+% \typebuffer
+%
+% Gives (with computer modern that has such italics):
+%
+% \startlinecorrection[blank]
+% \switchtobodyfont[modern]
+% \startcombination[nx=2,ny=2,distance=5em]
+% {\mathoption noitaliccompensation 0\relax \mathematics{\getbuffer}}
+% {\nohyphens\type{0:inline}}
+% {\mathoption noitaliccompensation 0\relax \mathematics{\displaymath\getbuffer}}
+% {\nohyphens\type{0:display}}
+% {\mathoption noitaliccompensation 1\relax \mathematics{\getbuffer}}
+% {\nohyphens\type{1:inline}}
+% {\mathoption noitaliccompensation 1\relax \mathematics{\displaymath\getbuffer}}
+% {\nohyphens\type{1:display}}
+% \stopcombination
+% \stoplinecorrection
+
+% % obsolete:
+%
+% \subsubsection {\type {\mathoption nocharitalic}}
+%
+% When two characters follow each other italic correction can interfere. The
+% following example shows what this option does:
+%
+% \startbuffer
+% \catcode"1D443=11
+% \catcode"1D444=11
+% \catcode"1D445=11
+% P( PP PQR
+% \stopbuffer
+%
+% \typebuffer
+%
+% Gives (with computer modern that has such italics):
+%
+% \startlinecorrection[blank]
+% \switchtobodyfont[modern]
+% \startcombination[nx=2,ny=2,distance=5em]
+% {\mathoption nocharitalic 0\relax \mathematics{\getbuffer}}
+% {\nohyphens\type{0:inline}}
+% {\mathoption nocharitalic 0\relax \mathematics{\displaymath\getbuffer}}
+% {\nohyphens\type{0:display}}
+% {\mathoption nocharitalic 1\relax \mathematics{\getbuffer}}
+% {\nohyphens\type{1:inline}}
+% {\mathoption nocharitalic 1\relax \mathematics{\displaymath\getbuffer}}
+% {\nohyphens\type{1:display}}
+% \stopcombination
+% \stoplinecorrection
+
+% % obsolete:
+%
+% \subsubsection {\type {\mathoption useoldfractionscaling}}
+%
+% This option has been introduced as solution for tracker item 604 for fuzzy cases
+% around either or not present fraction related settings for new fonts.
\stopchapter
diff --git a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex
index 58280aaac..4e90f064e 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex
@@ -1,4 +1,4 @@
-% language=uk
+4% language=uk
\environment luatex-style
@@ -24,7 +24,7 @@ most of the adapted ones.
Besides the expected changes caused by new functionality, there are a number of
not|-|so|-|expected changes. These are sometimes a side|-|effect of a new
-(conflicting) feature, or, more often than not, a change neccessary to clean up
+(conflicting) feature, or, more often than not, a change necessary to clean up
the internal interfaces. These will also be mentioned.
\stopsubsection
@@ -42,7 +42,7 @@ most still comes from the original. But we divert a bit.
The current code base is written in \CCODE, not \PASCAL. We use \CWEB\ when
possible. As a consequence instead of one large file plus change files, we
now have multiple files organized in categories like \type {tex}, \type
- {pdf}, \type {lang}, \type {font}, \type {lua}, etc. There are some artefacts
+ {pdf}, \type {lang}, \type {font}, \type {lua}, etc. There are some artifacts
of the conversion to \CCODE, but in due time we will clean up the source code
and make sure that the documentation is done right. Many files are in the
\CWEB\ format, but others, like those interfacing to \LUA, are \CCODE\ files.
@@ -143,38 +143,38 @@ which in turn triggered renaming primitives.
For compatibility reasons we still refer to \type {\pdf...} commands but \LUATEX\
has a different backend interface. Instead of these primitives there are three
-interfacing primitives: \lpr {pdfextension}, \lpr {pdfvariable} and
-\lpr {pdffeedback} that take keywords and optional further arguments. This way
-we can extend the features when needed but don't need to adapt the core engine.
-The front- and backend are decoupled as much as possible.
+interfacing primitives: \lpr {pdfextension}, \lpr {pdfvariable} and \lpr
+{pdffeedback} that take keywords and optional further arguments (below we will
+still use the \tex {pdf} prefix names as reference). This way we can extend the
+features when needed but don't need to adapt the core engine. The front- and
+backend are decoupled as much as possible.
\startitemize
\startitem
The (experimental) support for snap nodes has been removed, because it is
much more natural to build this functionality on top of node processing and
- attributes. The associated primitives that are gone are: \type
- {\pdfsnaprefpoint}, \type {\pdfsnapy}, and \type {\pdfsnapycomp}.
+ attributes. The associated primitives that are gone are: \orm
+ {pdfsnaprefpoint}, \orm {pdfsnapy}, and \orm {pdfsnapycomp}.
\stopitem
\startitem
The (experimental) support for specialized spacing around nodes has also been
- removed. The associated primitives that are gone are: \type
- {\pdfadjustinterwordglue}, \type {\pdfprependkern}, and \type
- {\pdfappendkern}, as well as the five supporting primitives \type
- {\knbscode}, \type {\stbscode}, \type {\shbscode}, \type {\knbccode}, and
- \type {\knaccode}.
+ removed. The associated primitives that are gone are: \orm
+ {pdfadjustinterwordglue}, \orm {pdfprependkern}, and \orm {pdfappendkern}, as
+ well as the five supporting primitives \orm {knbscode}, \orm {stbscode}, \orm
+ {shbscode}, \orm {knbccode}, and \orm {knaccode}.
\stopitem
\startitem
A number of \quote {\PDFTEX\ primitives} have been removed as they can be
- implemented using \LUA: \type {\pdfelapsedtime}, \type {\pdfescapehex}, \type
- {\pdfescapename}, \type {\pdfescapestring}, \type {\pdffiledump}, \type
- {\pdffilemoddate}, \type {\pdffilesize}, \type {\pdfforcepagebox}, \type
- {\pdflastmatch}, \type {\pdfmatch}, \type {\pdfmdfivesum}, \type
- {\pdfmovechars}, \type {\pdfoptionalwaysusepdfpagebox}, \type
- {\pdfoptionpdfinclusionerrorlevel}, \type {\pdfresettimer}, \type
- {\pdfshellescape}, \type {\pdfstrcmp} and \type {\pdfunescapehex}
+ implemented using \LUA: \orm {pdfelapsedtime}, \orm {pdfescapehex}, \orm
+ {pdfescapename}, \orm {pdfescapestring}, \orm {pdffiledump}, \orm
+ {pdffilemoddate}, \orm {pdffilesize}, \orm {pdfforcepagebox}, \orm
+ {pdflastmatch}, \orm {pdfmatch}, \orm {pdfmdfivesum}, \orm {pdfmovechars},
+ \orm {pdfoptionalwaysusepdfpagebox}, \orm {pdfoptionpdfinclusionerrorlevel},
+ \orm {pdfresettimer}, \orm {pdfshellescape}, \orm {pdfstrcmp} and \orm
+ {pdfunescapehex}.
\stopitem
\startitem
@@ -186,7 +186,7 @@ The front- and backend are decoupled as much as possible.
\startitem
The experimental snapper mechanism has been removed and therefore also the
primitives \orm {pdfignoreddimen}, \orm {pdffirstlineheight}, \orm
- {pdfeachlineheight}, \orm {pdfeachlinedepth} and \orm {pdflastlinedepth}
+ {pdfeachlineheight}, \orm {pdfeachlinedepth} and \orm {pdflastlinedepth}.
\stopitem
\startitem
@@ -202,7 +202,7 @@ The front- and backend are decoupled as much as possible.
\stopitem
\startitem
- Two extra token lists are provides, \orm {pdfxformresources} and \orm
+ Two extra token lists are provided, \orm {pdfxformresources} and \orm
{pdfxformattr}, as an alternative to \orm {pdfxform} keywords.
\stopitem
@@ -390,39 +390,39 @@ we say next applies to both these programs.
\startitemize
\startitem
- The extended 16-bit math primitives (\type {\omathcode} etc.) have been
+ The extended 16-bit math primitives (\orm {omathcode} etc.) have been
removed.
\stopitem
\startitem
The \OCP\ processing has been removed completely and as a consequence, the
- following primitives have been removed: \type {\ocp}, \type {\externalocp},
- \type {\ocplist}, \type {\pushocplist}, \type {\popocplist}, \type
- {\clearocplists}, \type {\addbeforeocplist}, \type {\addafterocplist}, \type
- {\removebeforeocplist}, \type {\removeafterocplist} and \type
- {\ocptracelevel}.
+ following primitives have been removed: \orm {ocp}, \orm {externalocp}, \orm
+ {ocplist}, \orm {pushocplist}, \orm {popocplist}, \orm {clearocplists}, \orm
+ {addbeforeocplist}, \orm {addafterocplist}, \orm {removebeforeocplist}, \orm
+ {removeafterocplist} and \orm {ocptracelevel}.
\stopitem
\startitem
- \LUATEX\ only understands 4~of the 16~direction specifiers of \ALEPH: \type
- {TLT} (latin), \type {TRT} (arabic), \type {RTT} (cjk), \type {LTL}
- (mongolian). All other direction specifiers generate an error.
+ \LUATEX\ only understands 4~of the 16~direction specifiers of \ALEPH: \orm
+ {TLT} (latin), \orm {TRT} (arabic), \orm {RTT} (cjk), \orm {LTL} (mongolian).
+ All other direction specifiers generate an error. In addition to a keyword
+ driven model we also provide an integer driven one.
\stopitem
\startitem
The input translations from \ALEPH\ are not implemented, the related
- primitives are not available: \type {\DefaultInputMode}, \type
- {\noDefaultInputMode}, \type {\noInputMode}, \type {\InputMode}, \type
- {\DefaultOutputMode}, \type {\noDefaultOutputMode}, \type {\noOutputMode},
- \type {\OutputMode}, \type {\DefaultInputTranslation}, \type
- {\noDefaultInputTranslation}, \type {\noInputTranslation}, \type
- {\InputTranslation}, \type {\DefaultOutputTranslation}, \type
- {\noDefaultOutputTranslation}, \type {\noOutputTranslation} and \type
- {\OutputTranslation}.
+ primitives are not available: \orm {DefaultInputMode}, \orm
+ {noDefaultInputMode}, \orm {noInputMode}, \orm {InputMode}, \orm
+ {DefaultOutputMode}, \orm {noDefaultOutputMode}, \orm {noOutputMode}, \orm
+ {OutputMode}, \orm {DefaultInputTranslation}, \orm
+ {noDefaultInputTranslation}, \orm {noInputTranslation}, \orm
+ {InputTranslation}, \orm {DefaultOutputTranslation}, \orm
+ {noDefaultOutputTranslation}, \orm {noOutputTranslation} and \orm
+ {OutputTranslation}.
\stopitem
\startitem
- Several bugs have been fixed an confusing implementation details have been
+ Several bugs have been fixed and confusing implementation details have been
sorted out.
\stopitem
@@ -475,7 +475,7 @@ we say next applies to both these programs.
\stopitem
\startitem
- The promotion of primitives to core primitives as well as the removed of all
+ The promotion of primitives to core primitives as well as removing of all
others means that the initialization namespace \type {aleph} that early
versions of \LUATEX\ provided is gone.
\stopitem
@@ -548,7 +548,7 @@ order to separate the backend specific primitives in de code these commands are
now replaced by only a few. In traditional \TEX\ we only had the \DVI\ backend
but now we have two: \DVI\ and \PDF. Additional functionality is implemented as
\quote {extensions} in \TEX\ speak. By separating more strickly we are able to
-keep the core (fontend) clean and stable and isolate these extensions. If for
+keep the core (frontend) clean and stable and isolate these extensions. If for
some reason an extra backend option is needed, it can be implemented without
touching the core. The three \PDF\ backend related primitives are:
@@ -563,7 +563,7 @@ a (kind of) register and can be read and written, while a feedback is reporting
something (as it comes from the backend it's normally a sequence of tokens).
In order for \LUATEX\ to be more than just \TEX\ you need to enable primitives. That
-has already be the case right from the start. If you want the traditional \PDFTEX\
+has already been the case right from the start. If you want the traditional \PDFTEX\
primitives (for as far their functionality is still around) you now can do this:
\starttyping
@@ -669,7 +669,7 @@ macro:->[internal backend integer]
macro:->[internal backend tokenlist]
\stoptyping
-The \prm {edef} can also be an \prm {def} but it's a bit more efficient
+The \prm {edef} can also be a \prm {def} but it's a bit more efficient
to expand the lookup related register beforehand. After that you can adapt
the defaults; these are:
@@ -1199,14 +1199,9 @@ structures, some of the macros have been duplicated. For instance, there are now
{token_info}. All access to the variable memory array is now hidden behind a
macro called \type {vmem}. We mention this because using the \TEX book as
reference is still quite valid but not for memory related details. Another
-significate detail is that we have double linked node lists and that most nodes
+significant detail is that we have double linked node lists and that most nodes
carry more data.
-The implementation of the growth of two arrays (via reallocation) introduces a
-potential pitfall: the memory arrays should never be used as the left hand side
-of a statement that can modify the array in question. Details like this are
-of no concern to users.
-
The input line buffer and pool size are now also reallocated when needed, and the
\type {texmf.cnf} settings \type {buf_size} and \type {pool_size} are silently
ignored.
diff --git a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
index 4a36151a6..fa5f924d7 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
@@ -10,8 +10,8 @@
\topicindex {nodes}
-\TEX's nodes are represented in \LUA\ as userdata object with a variable set of
-fields. In the following syntax tables, such the type of such a userdata object
+\TEX's nodes are represented in \LUA\ as userdata objects with a variable set of
+fields. In the following syntax tables, such as the type of such a userdata object
is represented as \syntax {<node>}.
The current return value of \type {node.types()} is:
@@ -103,10 +103,10 @@ present in all nodes regardless of their type, these are:
\LL
\stoptabulate
-The \type {subtype} is sometimes just a stub entry. Not all nodes actually use
-the \type {subtype}, but this way you can be sure that all nodes accept it as a
-valid field name, and that is often handy in node list traversal. In the
-following tables \type {next} and \type {id} are not explicitly mentioned.
+The \type {subtype} is sometimes just a dummy entry because not all nodes
+actually use the \type {subtype}, but this way you can be sure that all nodes
+accept it as a valid field name, and that is often handy in node list traversal.
+In the following tables \type {next} and \type {id} are not explicitly mentioned.
Besides these three fields, almost all nodes also have an \type {attr} field, and
there is a also a field called \type {prev}. That last field is always present,
@@ -167,18 +167,19 @@ also use rules to store reuseable objects and images. User nodes are invisible
and can be intercepted by a callback.
\starttabulate[|l|l|p|]
-\DB field \BC type \BC explanation \NC \NR
+\DB field \BC type \BC explanation \NC \NR
\TB
-\NC \type{subtype} \NC number \NC \showsubtypes {rule} \NC \NR
-\NC \type{attr} \NC node \NC list of attributes \NC \NR
-\NC \type{width} \NC number \NC the width of the rule where the special value
- $-1073741824$ is used for \quote {running} glue dimensions \NC \NR
-\NC \type{height} \NC number \NC the height of the rule (can be negative) \NC \NR
-\NC \type{depth} \NC number \NC the depth of the rule (can be negative) \NC \NR
-\NC \type{left} \NC number \NC shift at the left end (also subtracted from width) \NC \NR
-\NC \type{right} \NC number \NC (subtracted from width) \NC \NR
-\NC \type{dir} \NC string \NC the direction of this rule, see~\in[dirnodes] \NC \NR
-\NC \type{index} \NC number \NC an optional index that can be referred to \NC \NR
+\NC \type{subtype} \NC number \NC \showsubtypes {rule} \NC \NR
+\NC \type{attr} \NC node \NC list of attributes \NC \NR
+\NC \type{width} \NC number \NC the width of the rule where the special value
+ $-1073741824$ is used for \quote {running} glue dimensions \NC \NR
+\NC \type{height} \NC number \NC the height of the rule (can be negative) \NC \NR
+\NC \type{depth} \NC number \NC the depth of the rule (can be negative) \NC \NR
+\NC \type{left} \NC number \NC shift at the left end (also subtracted from width) \NC \NR
+\NC \type{right} \NC number \NC (subtracted from width) \NC \NR
+\NC \type{dir} \NC string \NC the direction of this rule, see~\in[dirnodes] \NC \NR
+\NC \type{index} \NC number \NC an optional index that can be referred to \NC \NR
+\NC \type{transform} \NC number \NC an private variable (also used to specify outline width) \NC \NR
\LL
\stoptabulate
@@ -192,7 +193,9 @@ the auto settings also happen in the backend). For a vertical rule \type {left}
affects the height and \type {right} affects the depth. There is no matching
interface at the \TEX\ end (although we can have more keywords for rules it would
complicate matters and introduce a speed penalty.) However, you can just
-construct a rule node with \LUA\ and write it to the \TEX\ input.
+construct a rule node with \LUA\ and write it to the \TEX\ input. The \type
+{outline} subtype is just a convenient variant and the \type {transform} field
+specifies the width of the outline.
\subsubsection{\nod {ins} nodes}
@@ -218,8 +221,8 @@ There is a set of extra fields that concern the associated glue: \type {width},
These are all numbers.
A warning: never assign a node list to the \type {head} field unless you are sure
-its internal link structure is correct, otherwise an error may be result. You can use
-\type {list} instead (often in functions you want to use local variable swith similar
+its internal link structure is correct, otherwise an error may result. You can use
+\type {list} instead (often in functions you want to use local variable with similar
names and both names are equally sensible).
\subsubsection{\nod {mark} nodes}
@@ -256,7 +259,7 @@ This node comes from \prm {vadjust} primitive.
\stoptabulate
A warning: never assign a node list to the \type {head} field unless you are sure
-its internal link structure is correct, otherwise an error may be result.
+its internal link structure is correct, otherwise an error may be the result.
\subsubsection{\nod {disc} nodes}
@@ -299,7 +302,7 @@ Otherwise you can end up with an invalid internal perception of reality and
\LUATEX\ might even decide to crash on you. It also means that running forward
over for instance \type {pre} is ok but backward you need to stop at \type {pre}.
And you definitely must not mess with the node that \type {prev} points to, if
-only because it is not really an node but part of the disc data structure (so
+only because it is not really a node but part of the disc data structure (so
freeing it again might crash \LUATEX).
\subsubsection{\nod {math} nodes}
@@ -347,7 +350,7 @@ accessible fields:
The effective width of some glue subtypes depends on the stretch or shrink needed
to make the encapsulating box fit its dimensions. For instance, in a paragraph
-lines normally have glue representing spaces and these stretch of shrink to make
+lines normally have glue representing spaces and these stretch or shrink to make
the content fit in the available space. The \type {effective_glue} function that
takes a glue node and a parent (hlist or vlist) returns the effective width of
that glue item.
@@ -426,18 +429,18 @@ accumulation of \type {club}, \type{widow} and other relevant penalties.
\subsubsection[glyphnodes]{\nod {glyph} nodes}
\topicindex {nodes+glyph}
-\topicindex {glyph}
+\topicindex {glyphs}
-These are probably the mostly used nodes and although you can push on tin the
-list with for instance \prm {char} \TEX\ will normally do it for you when it
-considers some input to be text.
+These are probably the mostly used nodes and although you can push them in the
+current list with for instance \prm {char} \TEX\ will normally do it for you when
+it considers some input to be text.
\starttabulate[|l|l|p|]
\DB field \BC type \BC explanation \NC \NR
\TB
-\NC \type{subtype} \NC number \NC bitfield \NC \NR
+\NC \type{subtype} \NC number \NC bit field \NC \NR
\NC \type{attr} \NC node \NC list of attributes \NC \NR
-\NC \type{char} \NC number \NC the chatacter index in the font \NC \NR
+\NC \type{char} \NC number \NC the character index in the font \NC \NR
\NC \type{font} \NC number \NC the font identifier \NC \NR
\NC \type{lang} \NC number \NC the language identifier \NC \NR
\NC \type{left} \NC number \NC the frozen \type {\lefthyphenmnin} value \NC \NR
@@ -455,7 +458,7 @@ considers some input to be text.
\stoptabulate
The \type {width}, \type {height} and \type {depth} values are read|-|only. The
-\type {expansion_factor} is assigned in the parbuilder and used in the backend.
+\type {expansion_factor} is assigned in the par builder and used in the backend.
A warning: never assign a node list to the components field unless you are sure
its internal link structure is correct, otherwise an error may be result. Valid
@@ -517,7 +520,7 @@ This node relates to the \prm {noboundary}, \prm {boundary}, \prm
\topicindex {nodes+paragraphs}
\topicindex {paragraphs}
-This node in inserted a the start of a paragraph. You should not mess
+This node is inserted at the start of a paragraph. You should not mess
too much with this one.
\starttabulate[|l|l|p|]
@@ -536,7 +539,7 @@ too much with this one.
A warning: never assign a node list to the \type {box_left} or \type {box_right}
field unless you are sure its internal link structure is correct, otherwise an
-error may be result.
+error may result.
\subsubsection[dirnodes]{\nod {dir} nodes}
@@ -560,13 +563,13 @@ Direction specifiers are three|-|letter combinations of \type {T}, \type {B},
\startitemize[packed]
\startitem
- the first is the direction of the \quote{top} of paragraphs.
+ the first is the direction of the \quote{top} of paragraphs
\stopitem
\startitem
- the second is the direction of the \quote{start} of lines.
+ the second is the direction of the \quote{start} of lines
\stopitem
\startitem
- the third is the direction of the \quote{top} of glyphs.
+ the third is the direction of the \quote{top} of glyphs
\stopitem
\stopitemize
@@ -643,7 +646,7 @@ the \type {head} points to a \quote {normal} vbox or hbox. For \nod {sub_mlist},
the \type {head} points to a math list that is yet to be converted.
A warning: never assign a node list to the \type {head} field unless you are sure
-its internal link structure is correct, otherwise an error may be result.
+its internal link structure is correct, otherwise an error is triggered.
\subsubsubsection{\nod {delim} subnodes}
@@ -662,12 +665,12 @@ before, the \type {next} and \type {prev} fields are unused.
\stoptabulate
The fields \type {large_char} and \type {large_fam} can be zero, in that case the
-font that is sed for the \type {small_fam} is expected to provide the large
+font that is set for the \type {small_fam} is expected to provide the large
version as an extension to the \type {small_char}.
\subsubsection{Math core nodes}
-First, there are the objects (the \TEX book calls then \quote {atoms}) that are
+First, there are the objects (the \TEX book calls them \quote {atoms}) that are
associated with the simple math objects: ord, op, bin, rel, open, close, punct,
inner, over, under, vcent. These all have the same fields, and they are combined
into a single node type with separate subtypes for differentiation.
@@ -749,7 +752,7 @@ be prefixed by \type {cramped}.
Warning: never assign a node list to the \type {display}, \type {text}, \type
{script}, or \type {scriptscript} field unless you are sure its internal link
-structure is correct, otherwise an error may be result.
+structure is correct, otherwise an error can occur.
\subsubsubsection{\nod {radical} nodes}
@@ -770,7 +773,7 @@ structure is correct, otherwise an error may be result.
Warning: never assign a node list to the \type {nucleus}, \type {sub}, \type
{sup}, \type {left}, or \type {degree} field unless you are sure its internal
-link structure is correct, otherwise an error may be result.
+link structure is correct, otherwise an error can be triggered.
\subsubsubsection{\nod {fraction} nodes}
@@ -790,7 +793,7 @@ link structure is correct, otherwise an error may be result.
Warning: never assign a node list to the \type {num}, or \type {denom} field
unless you are sure its internal link structure is correct, otherwise an error
-may be result.
+can result.
\subsubsubsection{\nod {fence} nodes}
@@ -813,7 +816,7 @@ the process.
\subsection{whatsit nodes}
-Whatsit nodes come in many subtypes that you can ask for by running
+Whatsit nodes come in many subtypes that you can ask for them by running
\type {node.whatsits()}:
\startluacode
for id, name in table.sortedpairs(node.whatsits()) do
@@ -881,7 +884,7 @@ will simply step over such whatsits without ever looking at the contents.
\stoptabulate
The \type {type} can have one of six distinct values. The number is the \ASCII\
-value if the first character if the type name (so you can use string.byte("l")
+value if the first character of the type name (so you can use string.byte("l")
instead of \type {108}).
\starttabulate[|r|c|p|]
@@ -959,7 +962,7 @@ Possible mode values are:
\LL
\stoptabulate
-The higher the number, the less checking and the more you can run into troubles.
+The higher the number, the less checking and the more you can run into trouble.
Especially the \type {raw} variant can produce bad \PDF\ so you can best check
what you generate.
@@ -1031,7 +1034,7 @@ what you generate.
\subsubsubsection{\whs {pdf_action}}
-These are a special kind of item that only appears inside \PDF\ start link
+These are a special kind of items that only appear inside \PDF\ start link
objects.
\starttabulate[|l|l|p|]
@@ -1185,8 +1188,7 @@ Each node has at least the three fields \type {next}, \type {id}, and \type {sub
\stopitemize
The other available fields depend on the \type {id} (and for \quote {whatsits},
-the \type {subtype}) of the node. Further details on the various fields and their
-meanings are given in~\in{chapter}[nodes].
+the \type {subtype}) of the node.
Support for \nod {unset} (alignment) nodes is partial: they can be queried and
modified from \LUA\ code, but not created.
@@ -1203,7 +1205,8 @@ call the node freeing functions yourself when you are no longer in need of a nod
(list). Nodes form linked lists without reference counting, so you have to be
careful that when control returns back to \LUATEX\ itself, you have not deleted
nodes that are still referenced from a \type {next} pointer elsewhere, and that
-you did not create nodes that are referenced more than once.
+you did not create nodes that are referenced more than once. Normally the setters
+and getters handle this for you.
There are statistics available with regards to the allocated node memory, which
can be handy for tracing.
@@ -1309,13 +1312,11 @@ actually a node, and it has the field.
node.new(<number> id, <number> subtype)
\stopfunctioncall
-Creates a new node. All of the new node's fields are initialized to either zero
-or \type {nil} except for \type {id} and \type {subtype} (if supplied). If you
-want to create a new whatsit, then the second argument is required, otherwise it
-need not be present. As with all node functions, this function creates a node on
-the \TEX\ level.
-
-This function accepts string \type {id} and \type {subtype} values as well.
+The \type {new} function creates a new node. All its fields are initialized to
+either zero or \type {nil} except for \type {id} and \type {subtype}. Instead of
+numbers you can also use strings (names). If you create a new \nod {whatsit} node
+the second argument is required. As with all node functions, this function
+creates a node at the \TEX\ level.
\subsubsection{\type {node.free} and \type {node.flush_node}}
@@ -1601,7 +1602,7 @@ This function also accept string \type {id}'s.
\subsubsection{\type {node.traverse}}
\startfunctioncall
-<node> t =
+<node> t, id, subtype =
node.traverse(<node> n)
\stopfunctioncall
@@ -1647,7 +1648,7 @@ If the above is unclear to you, see the section \quote {For Statement} in the
\subsubsection{\type {node.traverse_id}}
\startfunctioncall
-<node> t =
+<node> t, subtype =
node.traverse_id(<number> id, <node> n)
\stopfunctioncall
@@ -1674,14 +1675,36 @@ See the previous section for details. The change is in the local function \type
\subsubsection{\type {node.traverse_char}}
-This iterators loops over the glyph nodes in a list. Only nodes with a subtype
-less than 256 are seen.
+This iterator loops over the \nod {glyph} nodes in a list. Only nodes with a
+subtype less than 256 are seen.
\startfunctioncall
-<node> n =
+<node> n, font, char =
node.traverse_char(<node> n)
\stopfunctioncall
+\subsubsection{\type {node.traverse_glyph}}
+
+This iterator loops over a list and returns the list and filters all glyphs:
+
+\startfunctioncall
+<node> n, font, char =
+ node.traverse_glyph(<node> n)
+\stopfunctioncall
+
+\subsubsection{\type {node.traverse_list}}
+
+This iterator loops over the \nod {hlist} and \nod {vlist} nodes in a list.
+
+\startfunctioncall
+<node> n, id, subtype, list =
+ node.traverse_list(<node> n)
+\stopfunctioncall
+
+The four return values can save some time compared to fetching these fields but
+in practice you seldom need them all. So consider it a (side effect of
+experimental) convenience.
+
\subsubsection{\type {node.has_glyph}}
This function returns the first glyph or disc node in the given list:
@@ -1699,8 +1722,8 @@ This function returns the first glyph or disc node in the given list:
\stopfunctioncall
Looks for and returns the next \type {math_node} following the \type {start}. If
-the given node is a math endnode this helper return that node, else it follows
-the list and return the next math endnote. If no such node is found nil is
+the given node is a math end node this helper returns that node, else it follows
+the list and returns the next math endnote. If no such node is found nil is
returned.
\subsubsection{\type {node.remove}}
@@ -1796,7 +1819,7 @@ node.unprotect_glyphs(<node> n,[<node> n])
Subtracts 256 from all glyph node subtypes. This and the next function are
helpers to convert from \type {characters} to \type {glyphs} during node
-processing. The second argument is option and indicates the end of a range.
+processing. The second argument is optional and indicates the end of a range.
\subsubsection{\type {node.protect_glyphs} and \type {node.protect_glyph}}
@@ -1809,7 +1832,7 @@ Adds 256 to all glyph node subtypes in the node list starting at \type {n},
except that if the value is 1, it adds only 255. The special handling of 1 means
that \type {characters} will become \type {glyphs} after subtraction of 256. A
single character can be marked by the singular call. The second argument is
-option and indicates the end of a range.
+optional and indicates the end of a range.
\subsubsection{\type {node.last_node}}
@@ -1827,9 +1850,9 @@ that node, or \type {nil} if the current list is empty.
node.write(<node> n)
\stopfunctioncall
-This is an experimental function that will append a node list to \TEX's \quote
-{current list} The node list is not deep|-|copied! There is no error checking
-either!
+This function that will append a node list to \TEX's \quote {current list}. The
+node list is not deep|-|copied! There is no error checking either! You mignt need
+to enforce horizontal mode in order for this to work as expected.
\subsubsection{\type {node.protrusion_skippable}}
@@ -1865,7 +1888,7 @@ When a list node is passed, you set the glue, order and sign instead.
\subsubsection{\type {node.getglue}}
-The next call will return 5 values (or northing when no glue is passed).
+The next call will return 5 values or nothing when no glue is passed.
\startfunctioncall
<integer> width, <integer> stretch, <integer> shrink, <integer> stretch_order,
@@ -1974,7 +1997,7 @@ usage.
When you fool around with disc nodes you need to be aware of the fact that they
have a special internal data structure. As long as you reassign the fields when
you have extended the lists it's ok because then the tail pointers get updated,
-but when you add to list without reassigning you might end up in troubles when
+but when you add to list without reassigning you might end up in trouble when
the linebreak routien kicks in. You can call this function to check the list for
issues with disc nodes.
@@ -1997,9 +2020,10 @@ field when set.
\subsubsection{\type {node.family_font}}
-When you pass it a proper family identifier the next helper will return the font
-currently associated with it. You can normally also access the font with the normal
-font field or getter because it will resolve the family automatically for noads.
+When you pass a proper family identifier the next helper will return the font
+currently associated with it. You can normally also access the font with the
+normal font field or getter because it will resolve the family automatically for
+noads.
\startfunctioncall
<integer> id =
@@ -2010,7 +2034,7 @@ font field or getter because it will resolve the family automatically for noads.
You can set and query the synctex fields, a file number aka tag and a line
number, for a glue, kern, hlist, vlist, rule and math nodes as well as glyph
-nodes (although this last one are not used in native synctex).
+nodes (although this last one is not used in native synctex).
\startfunctioncall
node.set_synctex_fields(<integer> f, <integer> l)
@@ -2027,15 +2051,15 @@ some assumptions (heuristics).
\topicindex{nodes+direct}
\topicindex{direct nodes}
-Deep down in \TEX\ a node has a number which is an numeric entry in a memory
+Deep down in \TEX\ a node has a number which is a numeric entry in a memory
table. In fact, this model, where \TEX\ manages memory is real fast and one of
the reasons why plugging in callbacks that operate on nodes is quite fast too.
Each node gets a number that is in fact an index in the memory table and that
-number often gets reported when you print node related information.
+number often is reported when you print node related information.
There are two access models, a robust one using a so called user data object that
provides a virtual interface to the internal nodes, and a more direct access which
-uses the node numbers directly. The first model provide key based access while
+uses the node numbers directly. The first model provides key based access while
the second always accesses fields via functions:
\starttyping
@@ -2044,19 +2068,19 @@ getfield(nodenumber,"char")
\stoptyping
If you use the direct model, even if you know that you deal with numbers, you
-should not depend on that property but treat it an abstraction just like
+should not depend on that property but treat it as an abstraction just like
traditional nodes. In fact, the fact that we use a simple basic datatype has the
penalty that less checking can be done, but less checking is also the reason why
it's somewhat faster. An important aspect is that one cannot mix both methods,
but you can cast both models. So, multiplying a node number makes no sense.
So our advice is: use the indexed (table) approach when possible and investigate
-the direct one when speed might be an real issue. For that reason we also provide
-the \type {get*} and \type {set*} functions in the top level node namespace.
-There is a limited set of getters. When implementing this direct approach the
-regular index by key variant was also optimized, so direct access only makes
-sense when we're accessing nodes millions of times (which happens in some font
-processing for instance).
+the direct one when speed might be a real issue. For that reason \LUATEX\ also
+provide the \type {get*} and \type {set*} functions in the top level node
+namespace. There is a limited set of getters. When implementing this direct
+approach the regular index by key variant was also optimized, so direct access
+only makes sense when nodes are accessed millions of times (which happens in some
+font processing for instance).
We're talking mostly of getters because setters are less important. Documents
have not that many content related nodes and setting many thousands of properties
@@ -2097,7 +2121,7 @@ Some accessors are used frequently and for these we provide more efficient helpe
\DB function \BC explanation \NC \NR
\TB
\NC \type{getnext} \NC parsing nodelist always involves this one \NC \NR
-\NC \type{getprev} \NC used less but is logical companion to \type {getnext} \NC \NR
+\NC \type{getprev} \NC used less but a logical companion to \type {getnext} \NC \NR
\NC \type{getboth} \NC returns the next and prev pointer of a node \NC \NR
\NC \type{getid} \NC consulted a lot \NC \NR
\NC \type{getsubtype} \NC consulted less but also a topper \NC \NR
@@ -2106,7 +2130,7 @@ Some accessors are used frequently and for these we provide more efficient helpe
\NC \type{getwhd} \NC returns the \type {width}, \type {height} and \type {depth} of a list, rule or
(unexpanded) glyph as well as glue (its spec is looked at) and unset nodes\NC \NR
\NC \type{getdisc} \NC returns the \type {pre}, \type {post} and \type {replace} fields and
- optionally when true is passed also the tail fields. \NC \NR
+ optionally when true is passed also the tail fields \NC \NR
\NC \type{getlist} \NC we often parse nested lists so this is a convenient one too \NC \NR
\NC \type{getleader} \NC comparable to list, seldom used in \TEX\ (but needs frequent consulting
like lists; leaders could have been made a dedicated node type) \NC \NR
@@ -2134,7 +2158,7 @@ directmode setter \type {setlink} takes a list of nodes and will link them,
thereby ignoring \type {nil} entries. The first valid node is returned (beware:
for good reason it assumes single nodes). For rarely used fields no helpers are
provided and there are a few that probably are used seldom too but were added for
-consistency. You can of course always define additional accessor using \type
+consistency. You can of course always define additional accessors using \type
{getfield} and \type {setfield} with little overhead.
\def\yes{$+$} \def\nop{$-$}
diff --git a/doc/context/sources/general/manuals/luatex/luatex-preamble.tex b/doc/context/sources/general/manuals/luatex/luatex-preamble.tex
index 98837e98d..1daef3c4d 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-preamble.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-preamble.tex
@@ -8,7 +8,7 @@
\topicindex{nodes}
\topicindex{boxes}
-\topicindex[lua]{\LUA}
+\topicindex{\LUA}
This is a reference manual, not a tutorial. This means that we discuss changes
relative to traditonal \TEX\ and also present new functionality. As a consequence
@@ -84,7 +84,7 @@ hook in your own code to manipulate lists, this can interfere with the macro
package that you use.
When you read about nodes in the following chapters it's good to keep in mind their
-commands that relate to then. here are a few:
+commands that relate to then. Here are a few:
\starttabulate[|l|l|p|]
\DB command \BC node \BC explanation \NC \NR
diff --git a/doc/context/sources/general/manuals/luatex/luatex-statistics.tex b/doc/context/sources/general/manuals/luatex/luatex-statistics.tex
index ad3c12488..efd7f1c75 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-statistics.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-statistics.tex
@@ -8,6 +8,8 @@
\topicindex{fonts+used}
+ The following fonts are used in this document:
+
\showfontusage
\stopchapter
diff --git a/doc/context/sources/general/manuals/luatex/luatex-style.tex b/doc/context/sources/general/manuals/luatex/luatex-style.tex
index 5245723c4..c588763a6 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-style.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-style.tex
@@ -411,4 +411,6 @@
\unexpanded\def\whs#1{\doifmode{*bodypart}{\nodeindex [#1]{\type {#1}}}\type{#1}}
\unexpanded\def\noa#1{\doifmode{*bodypart}{\nodeindex [#1]{\type {#1}}}\type{#1}}
+\hyphenation{sub-nodes}
+
\stopenvironment
diff --git a/doc/context/sources/general/manuals/luatex/luatex.tex b/doc/context/sources/general/manuals/luatex/luatex.tex
index 370092624..fe41cf6e3 100644
--- a/doc/context/sources/general/manuals/luatex/luatex.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex.tex
@@ -36,10 +36,13 @@
% after adding primitives: context mult-prm.mkiv
\environment luatex-style
-% \environment luatex-book
-\environment luatex-logos
-% \switchtobodyfont[small]
+\startmode[book]
+ \environment luatex-style-book
+\stopmode
+
+\environment luatex-logos
+\environment luatex-private
\startmode[export]
@@ -50,7 +53,7 @@
\startdocument
[status=experimental,
- version=1.08.0]
+ version=1.09]
\startnotmode[*export]
\component luatex-titlepage
diff --git a/doc/context/sources/general/manuals/onandon/onandon-modern.tex b/doc/context/sources/general/manuals/onandon/onandon-modern.tex
new file mode 100644
index 000000000..65b5d0490
--- /dev/null
+++ b/doc/context/sources/general/manuals/onandon/onandon-modern.tex
@@ -0,0 +1,1284 @@
+% language=uk
+
+% 284 instances, 234 shared in backend, 126 common vectors, 108 common hashes, load time 1.343 seconds
+
+%setupversion[alternative=concept,text={not corrected yet}]
+\setupversion[alternative=file,text={not corrected yet}]
+
+\definebodyfontenvironment[24pt]
+
+\usemodule[fonts-effects]
+
+\startcomponent onandon-modern
+
+\environment onandon-environment
+
+\startchapter[title={Modern Latin}]
+
+\startsection[title={Introduction}]
+
+In \CONTEXT, already in \MKII, we have a feature tagged \quote {effects} that can
+be used to render a font in outline or bolder versions. It uses some low level
+\PDF\ directives to accomplish this and it works quite well. When a user on the
+\CONTEXT\ list asked if we could also provide it as a font feature in the
+repertoire of additional features in \CONTEXT, I was a bit reluctant to provide
+that because it operates at another level than the glyph stream. Also, such a
+feature can be abused and result in a bad looking document. However, by adding a
+few simple options to the \LUATEX\ engine such a feature could actually be
+achieved rather easy: it was trivial to implement given that we can influence
+font handling at the \LUA\ end. In retrospect extended and pseudo slanted fonts
+could be done this way too but there we have some historic ballast. Also, the
+backend now handles such transformations very efficient because they are combined
+with font scaling. Anyway, by adding this feature in spite of possible
+objections, I could do some more advanced experiments.
+
+In the following pages I will demonstrate how we support effects as a feature in
+\CONTEXT. Instead of simply applying some magic \PDF\ text operators in the
+backend a more integrated approach is used. The difference with the normal effect
+mechanism is that where the one described here is bound to a font instance while
+the normal mechanism operates on the glyph stream.
+
+\stopsection
+
+\startsection[title={The basics}]
+
+\definefontsynonym[DemoSerif][file:lmroman10-regular]
+
+Let's start with a basic boldening example. First we demonstrate a regular Latin
+Modern sample (using \type {ward.tex}):
+
+\startnarrower
+ \definedfont[DemoSerif*default]
+ \samplefile{ward}
+\stopnarrower
+
+This font looks rather thin (light). Next we define an effect or \type {0.2} and
+typeset the same sample:
+
+\startbuffer
+\definefontfeature
+ [effect-1]
+ [effect=.2]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startnarrower
+ \definedfont[DemoSerif*default,effect-1]
+ \samplefile{ward}
+\stopnarrower
+
+This simple call gives reasonable default results. But you can have more control
+than this. The previous examples use the following properties:
+
+{\definedfont[DemoSerif*default,effect-1] \showfonteffect}
+
+\startbuffer
+\definefontfeature
+ [effect-2]
+ [effect={width=.3}]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startnarrower
+ \definedfont[DemoSerif*default,effect-2]
+ \samplefile{ward}
+\stopnarrower
+
+This time we use:
+
+{\definedfont[DemoSerif*default,effect-2] \showfonteffect}
+
+\startbuffer
+\definefontfeature
+ [effect-3]
+ [effect={width=.3,delta=0.4}]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startnarrower
+ \showfontkerns
+ \definedfont[DemoSerif*default,effect-3]
+ \samplefile{ward}
+\stopnarrower
+
+We have now tweaked one more property and show the fontkerns in order to see what
+happens with them:
+
+{\definedfont[DemoSerif*default,effect-3] \showfonteffect}
+
+\startbuffer
+\definefontfeature
+ [effect-4]
+ [effect={width=.3,delta=0.4,factor=0.3}]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startnarrower
+ \showfontkerns
+ \definedfont[DemoSerif*default,effect-4]
+ \samplefile{ward}
+\stopnarrower
+
+An additional parameter \type {factor} will influence the way (for instance)
+kerns get affected:
+
+{\definedfont[DemoSerif*effect-4] \showfonteffect}
+
+\stopsection
+
+\startsection[title=Outlines]
+
+There are four effects. Normally a font is rendered with effect \type {inner}.
+The \type {outer} effect just draws the outlines while \type {both} gives a
+rather fat result. The \type {hidden} effect hides the text.
+
+\startbuffer
+\definefontfeature
+ [effect-5]
+ [effect={width=0.2,delta=0.4,factor=0.3,effect=inner}]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startnarrower
+ \showfontkerns
+ \definedfont[DemoSerif*default,effect-5]
+ \samplefile{ward}
+\stopnarrower
+
+An inner effect is rather useless unless you want to use the other properties of
+this mechanism.
+
+\startbuffer
+\definefontfeature
+ [effect-6]
+ [effect={width=.2,delta=0.4,factor=0.3,effect=outer}]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startnarrower
+ \showfontkerns
+ \definedfont[DemoSerif*default,effect-6]
+ \samplefile{ward}
+\stopnarrower
+
+\startbuffer
+\definefontfeature
+ [effect-7]
+ [effect={width=.2,delta=0.4,factor=0.3,effect=both}]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startnarrower
+ \showfontkerns
+ \definedfont[DemoSerif*default,effect-7]
+ \samplefile{ward}
+\stopnarrower
+
+\startbuffer
+\definefontfeature
+ [effect-8]
+ [effect={width=.2,delta=0.4,factor=0.3,effect=hidden},
+ boundingbox=yes] % to show something
+\stopbuffer
+
+\typebuffer \getbuffer
+
+We also show the boundingboxes of the glyphs here so that you can see what you're
+missing. Actually this text is still there and you can select it in the viewer.
+
+\startnarrower
+ \showfontkerns
+ \showglyphs
+ \definedfont[DemoSerif*default,effect-8]
+ \samplefile{ward}
+\stopnarrower
+
+\stopsection
+
+\startsection[title=The logic]
+
+In order to support this I had to make some choices. The calculations involved
+are best explained in terms of \CONTEXT\ font machinery.
+
+\startformula
+ \Delta _{\text{wd}} = \text{effect} _{\text{wdelta}}
+ \times \text{parameter}_{\text{hfactor}}
+ \times \text{effect} _{\text{width}}
+ \times 100
+\stopformula
+
+\startformula
+ \Delta _{\text{ht}} = \text{effect} _{\text{hdelta}}
+ \times \text{parameter}_{\text{vfactor}}
+ \times \text{effect} _{\text{width}}
+ \times 100
+\stopformula
+
+\startformula
+ \Delta _{\text{dp}} = \text{effect} _{\text{ddelta}}
+ \times \text{parameter}_{\text{vfactor}}
+ \times \text{effect} _{\text{width}}
+ \times 100
+\stopformula
+
+The factors in the parameter namespace are adapted according to:
+
+\startformula
+ \Delta _{\text{factor}} = \text{effect} _{\text{factor}}
+ \times \text{parameters}_{\text{factor}}
+\stopformula
+
+\startformula
+ \Delta _{\text{hfactor}} = \text{effect} _{\text{hfactor}}
+ \times \text{parameters}_{\text{hfactor}}
+\stopformula
+
+\startformula
+ \Delta _{\text{vfactor}} = \text{effect} _{\text{vfactor}}
+ \times \text{parameters}_{\text{vfactor}}
+\stopformula
+
+The horizontal and vertical scaling factors default to the normal factor that
+defaults to zero so by default we have no additional scaling of for instance
+kerns. The width (wd), height (ht) and depth (dp) of a glyph are adapted in
+relation to the line width. A glyph is shifted in its bounding box by half the
+width correction. The delta defaults to one.
+
+\stopsection
+
+\startsection[title=About features]
+
+This kind of boldening has limitations especially because some fonts use
+positioning features that closely relate to the visual font properties. Let's
+give some examples. The most common positioning is kerning. Take for instance
+these shapes:
+
+\startlinecorrection
+\startMPcode
+ def SampleShapes(expr dx, offset, pw, k) =
+ picture p ; p := image (
+ draw fullcircle scaled 1cm ;
+ draw fullsquare scaled 1cm shifted (dx+k,0) ;
+ draw point 8 of (fullcircle scaled 1cm) withcolor white ;
+ draw point 3.5 of (fullsquare scaled 1cm) shifted (dx+k,0) withcolor white ;
+ ) shifted (offset,0) ;
+ draw p withpen pencircle scaled pw ;
+ draw boundingbox p withcolor white ;
+ enddef ;
+ SampleShapes(15mm, 0mm,1mm,0mm) ;
+ SampleShapes(15mm, 40mm,2mm,0mm) ;
+ SampleShapes(17mm, 80mm,2mm,0mm) ;
+\stopMPcode
+\stoplinecorrection
+
+The first one is that we start with. The circle and square have a line width of
+one unit and a distance (kern) of five units. The second pair has a line width of
+two units and the same distance while the third pair has a distance of seven
+units. So, in the last case we have just increased the kern with a value relative
+to the increase of line width.
+
+\startlinecorrection
+\startMPcode
+ SampleShapes(15mm, 0mm,1mm,0mm) ;
+ SampleShapes(15mm, 40mm,2mm,2mm) ;
+ SampleShapes(17mm, 80mm,2mm,2mm) ;
+\stopMPcode
+\stoplinecorrection
+
+In this example we have done the same but we started with a distance of zero. You
+can consider this a kind of anchoring. This happens in for instance cursive
+scripts where entry and exit points are used to connect shapes. In a latin script
+you can think of a poor|-|mans attachment of a cedilla or ogonek. But what to do
+with for instance an accent on top of a character? In that case we could do the
+same as with kerning. However, when we mix styles we would like to have a
+consistent height so maybe there scaling is not a good idea. This is why we can
+set the factors and deltas explictly for vertical and horizontal movements.
+However, this will only work well when a font is consistent in how it applies
+these movements. In this case, if could recognize cursive anchoring (the last
+pair in the example) we could compensate for it.
+
+\startMPinclusions
+ def SampleShapes(expr dx, offset, pw, k) =
+ picture p ; p := image (
+ draw fullcircle scaled 1cm ;
+ draw fullsquare scaled 1cm shifted (dx+k,0) ;
+ draw point 8 of (fullcircle scaled 1cm) withcolor white ;
+ draw point 3.5 of (fullsquare scaled 1cm) shifted (dx+k,0) withcolor white ;
+ ) shifted (offset,0) ;
+ draw p withpen pencircle scaled pw ;
+ draw boundingbox p withcolor white ;
+ enddef ;
+\stopMPinclusions
+
+\startlinecorrection
+\startMPcode
+ SampleShapes(10mm, 0mm,1mm,0mm) ;
+ SampleShapes(10mm, 40mm,1mm,1mm) ;
+ SampleShapes(10mm, 80mm,2mm,0mm) ;
+ SampleShapes(10mm,120mm,2mm,2mm) ;
+\stopMPcode
+\stoplinecorrection
+
+So, an interesting extension to the positioning part of the font handler could be
+to influence all the scaling factors: anchors, cursives, single and pair wise
+positioning in both directions (so eight independent factors). Technically this
+is no big deal so I might give it a go when I have a need for it.
+
+\stopsection
+
+\startsection[title=Some (extreme) examples]
+
+The last decade buying a font has become a bit of a nightmare simply because you
+have to choose the weights that you need. It's the business model to not stick to
+four shapes in a few weights but offer a whole range and each of course costs
+money.
+
+Latin Modern is based on Computer Modern and is meant for high resolution rendering.
+The design of the font is such that you can create instances but in practice that
+isn't done. One property that let the font stand out is its bold which runs rather
+wide. However, how about cooking up a variant? For this we will use a series of
+definitions:
+
+\startbuffer
+\definefontfeature[effect-2-0-0]
+ [effect={width=0.2,delta=0}]
+\definefontfeature[effect-2-3-0]
+ [effect={width=0.2,delta=0.3}]
+\definefontfeature[effect-2-6-0]
+ [effect={width=0.2,delta=0.6}]
+\definefontfeature[effect-4-0-0]
+ [effect={width=0.4,delta=0}]
+\definefontfeature[effect-4-3-0]
+ [effect={width=0.4,delta=0.3}]
+\definefontfeature[effect-4-6-0]
+ [effect={width=0.4,delta=0.6}]
+\definefontfeature[effect-8-0-0]
+ [effect={width=0.8,delta=0}]
+\definefontfeature[effect-8-3-0]
+ [effect={width=0.8,delta=0.3}]
+\definefontfeature[effect-8-6-0]
+ [effect={width=0.8,delta=0.6}]
+\definefontfeature[effect-8-6-2]
+ [effect={width=0.8,delta=0.6,factor=0.2}]
+\definefontfeature[effect-8-6-4]
+ [effect={width=0.8,delta=0.6,factor=0.4}]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+And a helper macro:
+
+\startbuffer
+\starttexdefinition ShowOneSample #1#2#3#4
+ %\testpage[5]
+ %\startsubsubsubject[title=\type{#1}]
+ \start
+ \definedfont[#2*#3 @ 10pt]
+ \setupinterlinespace
+ \startlinecorrection
+ \showglyphs \showfontkerns
+ \scale[sx=#4,sy=#4]{effective n\"ots}
+ \stoplinecorrection
+ \blank[samepage]
+ \dontcomplain
+ \showfontkerns
+ \margintext{\tt\txx\maincolor#1}
+ \samplefile{ward}
+ \par
+ \stop
+ %\stopsubsubsubject
+\stoptexdefinition
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\starttexdefinition ShowSamples #1
+ \startsubsubject[title=#1]
+ \start
+ \ShowOneSample{no effect} {#1}{default} {5}
+ \ShowOneSample{width=0.2\\delta=0} {#1}{default,effect-2-0-0}{5}
+ \ShowOneSample{width=0.2\\delta=0.3} {#1}{default,effect-2-3-0}{5}
+ \ShowOneSample{width=0.2\\delta=0.6} {#1}{default,effect-2-6-0}{5}
+ \ShowOneSample{width=0.4\\delta=0} {#1}{default,effect-4-0-0}{5}
+ \ShowOneSample{width=0.4\\delta=0.3} {#1}{default,effect-4-3-0}{5}
+ \ShowOneSample{width=0.4\\delta=0.6} {#1}{default,effect-4-6-0}{5}
+ \ShowOneSample{width=0.8\\delta=0} {#1}{default,effect-8-0-0}{5}
+ \ShowOneSample{width=0.8\\delta=0.3} {#1}{default,effect-8-3-0}{5}
+ \ShowOneSample{width=0.8\\delta=0.6} {#1}{default,effect-8-6-0}{5}
+ \ShowOneSample{width=0.8\\delta=0.6\\factor=0.2}{#1}{default,effect-8-6-2}{5}
+ \ShowOneSample{width=0.8\\delta=0.6\\factor=0.4}{#1}{default,effect-8-6-4}{5}
+ \stop
+ \stopsubsubject
+\stoptexdefinition
+
+We show some extremes, using the font used in this document. so don't complain
+about beauty here.
+
+\texdefinition{ShowSamples}{Serif}
+\texdefinition{ShowSamples}{SerifBold}
+\texdefinition{ShowSamples}{SerifItalic}
+\texdefinition{ShowSamples}{SerifBoldItalic}
+\texdefinition{ShowSamples}{Sans}
+
+\start
+ \setupalign[flushleft,broad,nothyphenated,verytolerant]
+ \texdefinition{ShowSamples}{Mono}
+\stop
+
+\stopsection
+
+\startsection[title=Pitfall]
+
+The quality of the result depends on how the font is made. For instance,
+ligatures can be whole shapes, replaced glyphs and|/|or repositioned
+glyphs, or whatever the designer thinks reasonable. In \in {figure}
+[fig:ligature-effects-mess] this is demonstrated. We use the following
+feature sets:
+
+\startbuffer
+\definefontfeature
+ [demo-1]
+ [default]
+ [hlig=yes]
+
+\definefontfeature
+ [demo-2]
+ [demo-1]
+ [effect=0.5]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startplacefigure[title={The effects on ligatures.},reference=fig:ligature-effects-mess]
+ \startcombination[1*3]
+ { \scale [scale=5000] {
+ \definedfont[texgyrepagellaregular*demo-1]fist effe
+ \par
+ \definedfont[texgyrepagellaregular*demo-2]fist effe
+ } } {
+ texgyre pagella regular
+ } { \scale [scale=5000] {
+ \definedfont[cambria*demo-1]fist effe
+ \par
+ \definedfont[cambria*demo-2]fist effe
+ } } {
+ cambria
+ } { \scale [scale=5000] {
+ \definedfont[ebgaramond12regular*demo-1]fist effe
+ \par
+ \definedfont[ebgaramond12regular*demo-2]fist effe
+ } } {
+ ebgaramond 12 regular
+ }
+ \stopcombination
+\stopplacefigure
+
+Normally the artifacts (as in the fi ligature in ebgaramond as of 2018) will go
+unnoticed at small sized. Also, when the user has a low res display, printer or
+when the publishers is one of those who print a scanned \PDF\ the reader might
+not notice it at all. Most readers don't even know what to look at.
+
+\stopsection
+
+\startsection[title=A modern Modern]
+
+So how can we make an effective set of Latin Modern that fits in todays look and
+feel. Of course this is a very subjective experiment but we've seen experiments
+with these fonts before (like these cm super collections). Here is an example of
+a typescript definition:
+
+\starttyping
+\starttypescriptcollection[modernlatin]
+
+ \definefontfeature[lm-rm-regular][effect={width=0.15,delta=1.00}]
+ \definefontfeature[lm-rm-bold] [effect={width=0.30,delta=1.00}]
+ \definefontfeature[lm-ss-regular][effect={width=0.10,delta=1.00}]
+ \definefontfeature[lm-ss-bold] [effect={width=0.20,delta=1.00}]
+ \definefontfeature[lm-tt-regular][effect={width=0.15,delta=1.00}]
+ \definefontfeature[lm-tt-bold] [effect={width=0.30,delta=1.00}]
+ \definefontfeature[lm-mm-regular][effect={width=0.15,delta=1.00}]
+ \definefontfeature[lm-mm-bold] [effect={width=0.30,delta=1.00}]
+
+ \starttypescript [serif] [modern-latin]
+ \definefontsynonym
+ [Serif] [file:lmroman10-regular]
+ [features={default,lm-rm-regular}]
+ \definefontsynonym
+ [SerifItalic] [file:lmroman10-italic]
+ [features={default,lm-rm-regular}]
+ \definefontsynonym
+ [SerifSlanted] [file:lmromanslant10-regular]
+ [features={default,lm-rm-regular}]
+ \definefontsynonym
+ [SerifBold] [file:lmroman10-regular]
+ [features={default,lm-rm-bold}]
+ \definefontsynonym
+ [SerifBoldItalic] [file:lmroman10-italic]
+ [features={default,lm-rm-bold}]
+ \definefontsynonym
+ [SerifBoldSlanted] [file:lmromanslant10-regular]
+ [features={default,lm-rm-bold}]
+ \stoptypescript
+
+ \starttypescript [sans] [modern-latin]
+ \definefontsynonym
+ [Sans] [file:lmsans10-regular]
+ [features={default,lm-ss-regular}]
+ \definefontsynonym
+ [SansItalic] [file:lmsans10-oblique]
+ [features={default,lm-ss-regular}]
+ \definefontsynonym
+ [SansSlanted] [file:lmsans10-oblique]
+ [features={default,lm-ss-regular}]
+ \definefontsynonym
+ [SansBold] [file:lmsans10-regular]
+ [features={default,lm-ss-bold}]
+ \definefontsynonym
+ [SansBoldItalic] [file:lmsans10-oblique]
+ [features={default,lm-ss-bold}]
+ \definefontsynonym
+ [SansBoldSlanted] [file:lmsans10-oblique]
+ [features={default,lm-ss-bold}]
+ \stoptypescript
+
+ \starttypescript [mono] [modern-latin]
+ \definefontsynonym
+ [Mono] [file:lmmono10-regular]
+ [features={default,lm-tt-regular}]
+ \definefontsynonym
+ [MonoItalic] [file:lmmono10-italic]
+ [features={default,lm-tt-regular}]
+ \definefontsynonym
+ [MonoSlanted] [file:lmmonoslant10-regular]
+ [features={default,lm-tt-regular}]
+ \definefontsynonym
+ [MonoBold] [file:lmmono10-regular]
+ [features={default,lm-tt-bold}]
+ \definefontsynonym
+ [MonoBoldItalic] [file:lmmono10-italic]
+ [features={default,lm-tt-bold}]
+ \definefontsynonym
+ [MonoBoldSlanted] [file:lmmonoslant10-regular]
+ [features={default,lm-tt-bold}]
+ \stoptypescript
+
+ \starttypescript [math] [modern-latin]
+ \loadfontgoodies[lm]
+ \definefontsynonym
+ [MathRoman] [file:latinmodern-math-regular.otf]
+ [features={math\mathsizesuffix,lm-mm-regular,mathextra},
+ goodies=lm]
+ \definefontsynonym
+ [MathRomanBold] [file:latinmodern-math-regular.otf]
+ [features={math\mathsizesuffix,lm-mm-bold,mathextra},
+ goodies=lm]
+ \stoptypescript
+
+ \starttypescript [modern-latin]
+ \definetypeface [\typescriptone]
+ [rm] [serif] [modern-latin] [default]
+ \definetypeface [\typescriptone]
+ [ss] [sans] [modern-latin] [default]
+ \definetypeface [\typescriptone]
+ [tt] [mono] [modern-latin] [default]
+ \definetypeface [\typescriptone]
+ [mm] [math] [modern-latin] [default]
+ \quittypescriptscanning
+ \stoptypescript
+
+\stoptypescriptcollection
+\stoptyping
+
+We show some more samples now for which we use\type {zapf.tex}.
+
+\startbuffer
+ {\tf\samplefile{zapf}}\blank {\bf\samplefile{zapf}}\blank
+ {\it\samplefile{zapf}}\blank {\bi\samplefile{zapf}}\blank
+ {\sl\samplefile{zapf}}\blank {\bs\samplefile{zapf}}\blank
+\stopbuffer
+
+\startsubsubsubject[title={\type{\switchtobodyfont[modern-latin,rm,10pt]}}]
+ \start
+ \switchtobodyfont[modern-latin,rm,10pt]
+ \getbuffer
+ \stop
+\stopsubsubsubject
+
+\startsubsubsubject[title={\type{\switchtobodyfont[modern-latin,ss,10pt]}}]
+ \start
+ \switchtobodyfont[modern-latin,ss,10pt]
+ \getbuffer
+ \stop
+\stopsubsubsubject
+
+\startsubsubsubject[title={\type{\switchtobodyfont[modern-latin,tt,10pt]}}]
+ \start
+ \switchtobodyfont[modern-latin,tt,10pt]
+ \setupalign[flushleft,broad,nothyphenated,verytolerant]
+ \getbuffer
+ \stop
+\stopsubsubsubject
+
+\stopsection
+
+\startsection[title=Finetuning]
+
+In practice we only need to compensate the width but can leave the height
+and depth untouched. In the following examples we see the normal bold next
+to the regular as well as the boldened version. For this we will use a couple
+of definitions:
+
+\startbuffer
+\definefontfeature[lm-bald][effect={width=0.25,effect=both}]
+\definefontfeature[pg-bald][effect={width=0.25,effect=both}]
+\definefontfeature[dj-bald][effect={width=0.35,effect=both}]
+
+\definefontfeature
+ [lm-bold]
+ [effect={width=0.25,hdelta=0,ddelta=0,effect=both},
+ extend=1.10]
+
+\definefontfeature
+ [pg-bold]
+ [effect={width=0.25,hdelta=0,ddelta=0,effect=both},
+ extend=1.00]
+
+\definefontfeature
+ [dj-bold]
+ [effect={width=0.35,hdelta=0,ddelta=0,effect=both},
+ extend=1.05]
+
+\definefont[lmbald][Serif*default,lm-bald sa d]
+\definefont[pgbald][Serif*default,pg-bald sa d]
+\definefont[djbald][Serif*default,dj-bald sa d]
+
+\definefont[lmbold][Serif*default,lm-bold sa d]
+\definefont[pgbold][Serif*default,pg-bold sa d]
+\definefont[djbold][Serif*default,dj-bold sa d]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+We can combine the extend and effect features to get a bold running as wide as a
+normal bold. We limit the height and depth so that we can use regular and bold in
+the same sentence. It's all a matter of taste, but some control is there.
+
+\starttabulate[|l|l|l|l|]
+\NC
+ \BC
+ \tt modern \BC
+ \tt pagella \BC
+ \tt dejavu \NC
+\NR
+\NC
+ \type{\tfd} \NC
+ \switchtobodyfont [modern,24pt]\strut\ruledhbox{\tfd ABC}\NC
+ \switchtobodyfont[pagella,24pt]\strut\ruledhbox{\tfd ABC}\NC
+ \switchtobodyfont [dejavu,24pt]\strut\ruledhbox{\tfd ABC}\NC
+\NR
+\NC
+ \type{\..bald} \NC
+ \switchtobodyfont [modern,24pt]\strut\ruledhbox{\lmbald ABC}\NC
+ \switchtobodyfont[pagella,24pt]\strut\ruledhbox{\pgbald ABC}\NC
+ \switchtobodyfont [dejavu,24pt]\strut\ruledhbox{\djbald ABC}\NC
+\NR
+\NC
+ \type{\bfd} \NC
+ \switchtobodyfont [modern,24pt]\strut\ruledhbox{\bfd ABC}\NC
+ \switchtobodyfont[pagella,24pt]\strut\ruledhbox{\bfd ABC}\NC
+ \switchtobodyfont [dejavu,24pt]\strut\ruledhbox{\bfd ABC}\NC
+\NR
+\NC
+ \type{\..bold} \NC
+ \switchtobodyfont [modern,24pt]\strut\ruledhbox{\lmbold ABC}\NC
+ \switchtobodyfont[pagella,24pt]\strut\ruledhbox{\pgbold ABC}\NC
+ \switchtobodyfont [dejavu,24pt]\strut\ruledhbox{\djbold ABC}\NC
+\NR
+\stoptabulate
+
+Let's take another go at Pagella. We define a few features, colors
+and fonts first:
+
+\startbuffer
+\definefontfeature
+ [pg-fake-1]
+ [effect={width=0.25,effect=both}]
+
+\definefontfeature
+ [pg-fake-2]
+ [effect={width=0.25,hdelta=0,ddelta=0,effect=both}]
+
+\definefont[pgregular] [Serif*default]
+\definefont[pgbold] [SerifBold*default]
+\definefont[pgfakebolda][Serif*default,pg-fake-1]
+\definefont[pgfakeboldb][Serif*default,pg-fake-2]
+
+\definecolor[color-pgregular] [t=.5,a=1,r=.6]
+\definecolor[color-pgbold] [t=.5,a=1,g=.6]
+\definecolor[color-pgfakebolda][t=.5,a=1,b=.6]
+\definecolor[color-pgfakeboldb][t=.5,a=1,r=.6,g=.6]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+When we apply these we get the results of \in {figure} [fig:pagella-compared]
+while we show the same overlayed in \in {figure} [fig:pagella-overlayed]. As you
+can see, the difference in real bold and fake bold is subtle: the inner shape of
+the \quote {o} differs. Also note that the position of the accents doesn't change
+in the vertical direction but moves along with the width.
+
+\def\SampleWord{\^o\"ep\c s}
+
+\startplacefigure[title={Four pagella style variants compared.},reference=fig:pagella-compared]
+ \startcombination[2*2]
+ {
+ \scale [scale=7500] {
+ \ruledhbox{\showglyphs\pgregular \SampleWord}
+ }
+ } {
+ regular (red)
+ } {
+ \scale [scale=7500] {
+ \ruledhbox{\showglyphs\pgbold \SampleWord}
+ }
+ } {
+ bold (green)
+ } {
+ \scale [scale=7500] {
+ \ruledhbox{\showglyphs\pgfakebolda \SampleWord}
+ }
+ } {
+ fakebolda (blue)
+ } {
+ \scale [scale=7500] {
+ \ruledhbox{\showglyphs\pgfakeboldb \SampleWord}
+ }
+ } {
+ fakeboldb (yellow)
+ }
+ \stopcombination
+\stopplacefigure
+
+\startplacefigure[title={Four pagella style variants overlayed.},reference=fig:pagella-overlayed]
+ \startcombination[2*3]
+ {
+ \scale [scale=7500] {
+ \startoverlay
+ {\color[color-pgregular] {\pgregular \SampleWord}}
+ {\color[color-pgbold] {\pgbold \SampleWord}}
+ \stopoverlay
+ }
+ } {
+ bold over regular
+ } {
+ \scale [scale=7500] {
+ \startoverlay
+ {\color[color-pgregular] {\pgregular \SampleWord}}
+ {\color[color-pgfakeboldb]{\pgfakeboldb \SampleWord}}
+ \stopoverlay
+ }
+ } {
+ fakebolda over regular
+ } {
+ \scale [scale=7500] {
+ \startoverlay
+ {\color[color-pgregular] {\pgregular \SampleWord}}
+ {\color[color-pgfakebolda]{\pgfakeboldb \SampleWord}}
+ \stopoverlay
+ }
+ } {
+ fakeboldb over regular
+ } {
+ \scale [scale=7500] {
+ \startoverlay
+ {\color[color-pgbold] {\pgbold \SampleWord}}
+ {\color[color-pgfakeboldb]{\pgfakeboldb \SampleWord}}
+ \stopoverlay
+ }
+ } {
+ fakeboldb over bold
+ } {
+ \scale [scale=7500] {
+ \startoverlay
+ {\color[color-pgfakebolda]{\pgfakebolda \SampleWord}}
+ {\color[color-pgfakeboldb]{\pgfakeboldb \SampleWord}}
+ \stopoverlay
+ }
+ } {
+ fakeboldb over fakebolda
+ } {
+ \scale [scale=7500] {
+ \startoverlay
+ {\color[color-pgregular] {\pgregular \SampleWord}}
+ {\color[color-pgbold] {\pgbold \SampleWord}}
+ {\color[color-pgfakebolda]{\pgfakebolda \SampleWord}}
+ {\color[color-pgfakeboldb]{\pgfakeboldb \SampleWord}}
+ \stopoverlay
+ }
+ } {
+ all four overlayed
+ }
+ \stopcombination
+\stopplacefigure
+
+\stopsection
+
+\startsection[title=The code]
+
+The amount of code involved is not that large and is a nice illustration of what
+\LUATEX\ provides (I have omitted a few lines of tracing and error reporting).
+The only thing added to the font scaler elsewhere is that we pass the \type
+{mode} and \type {width} parameters to \TEX\ so that they get used in the backend
+to inject the few operators needed.
+
+\starttyping
+local effects = {
+ inner = 0,
+ outer = 1,
+ both = 2,
+ hidden = 3,
+}
+
+local function initialize(tfmdata,value)
+ local spec
+ if type(value) == "number" then
+ spec = { width = value }
+ else
+ spec = utilities.parsers.settings_to_hash(value)
+ end
+ local effect = spec.effect or "both"
+ local width = tonumber(spec.width) or 0
+ local mode = effects[effect]
+ if mode then
+ local factor = tonumber(spec.factor) or 0
+ local hfactor = tonumber(spec.vfactor) or factor
+ local vfactor = tonumber(spec.hfactor) or factor
+ local delta = tonumber(spec.delta) or 1
+ local wdelta = tonumber(spec.wdelta) or delta
+ local hdelta = tonumber(spec.hdelta) or delta
+ local ddelta = tonumber(spec.ddelta) or hdelta
+ tfmdata.parameters.mode = mode
+ tfmdata.parameters.width = width * 1000
+ tfmdata.properties.effect = {
+ effect = effect, width = width,
+ wdelta = wdelta, factor = factor,
+ hdelta = hdelta, hfactor = hfactor,
+ ddelta = ddelta, vfactor = vfactor,
+ }
+ end
+end
+
+local function manipulate(tfmdata)
+ local effect = tfmdata.properties.effect
+ if effect then
+ local characters = tfmdata.characters
+ local parameters = tfmdata.parameters
+ local multiplier = effect.width * 100
+ local wdelta = effect.wdelta * parameters.hfactor * multiplier
+ local hdelta = effect.hdelta * parameters.vfactor * multiplier
+ local ddelta = effect.ddelta * parameters.vfactor * multiplier
+ local hshift = wdelta / 2
+ local factor = (1 + effect.factor) * parameters.factor
+ local hfactor = (1 + effect.hfactor) * parameters.hfactor
+ local vfactor = (1 + effect.vfactor) * parameters.vfactor
+ for unicode, char in next, characters do
+ local oldwidth = char.width
+ local oldheight = char.height
+ local olddepth = char.depth
+ if oldwidth and oldwidth > 0 then
+ char.width = oldwidth + wdelta
+ char.commands = {
+ { "right", hshift },
+ { "char", unicode },
+ }
+ end
+ if oldheight and oldheight > 0 then
+ char.height = oldheight + hdelta
+ end
+ if olddepth and olddepth > 0 then
+ char.depth = olddepth + ddelta
+ end
+ end
+ parameters.factor = factor
+ parameters.hfactor = hfactor
+ parameters.vfactor = vfactor
+ end
+end
+
+local specification = {
+ name = "effect",
+ description = "apply effects to glyphs",
+ initializers = {
+ base = initialize,
+ node = initialize,
+ },
+ manipulators = {
+ base = manipulate,
+ node = manipulate,
+ },
+}
+
+fonts.handlers.otf.features.register(specification)
+fonts.handlers.afm.features.register(specification)
+\stoptyping
+
+The real code is slightly more complex because we want to stack virtual features
+properly but the principle is the same.
+
+\stopsection
+
+\startsection[title=Arabic]
+
+It is tempting to test effects with arabic but we need to keep in mind that for
+that we should add some more support in the \CONTEXT\ font handler. Let's define
+some features.
+
+\startbuffer
+\definefontfeature
+ [bolden-arabic-1]
+ [effect={width=0.4}]
+
+\definefontfeature
+ [bolden-arabic-2]
+ [effect={width=0.4,effect=outer}]
+
+\definefontfeature
+ [bolden-arabic-3]
+ [effect={width=0.5,wdelta=0.5,ddelta=.2,hdelta=.2,factor=.1}]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+
+\setupalign
+ [righttoleft]
+
+\setupinterlinespace
+ [1.5]
+
+\start
+ \definedfont[arabictest*arabic,bolden-arabic-1 @ 30pt]
+ \samplefile{khatt-ar}\par
+ \definedfont[arabictest*arabic,bolden-arabic-2 @ 30pt]
+ \samplefile{khatt-ar}\par
+ \definedfont[arabictest*arabic,bolden-arabic-3 @ 30pt]
+ \samplefile{khatt-ar}\par
+\stop
+\stopbuffer
+
+With \MICROSOFT\ Arabtype the \type {khatt-ar.tex} looks as follows:
+
+\typebuffer \start \definefontsynonym[arabictest][arabtype] \getbuffer\stop
+
+And with Idris' Husayni we get:
+
+\typebuffer \start \definefontsynonym[arabictest][husayni] \getbuffer\stop
+
+Actually, quite okay are the following. We don't over do bold here and to get
+a distinction we make the original thinner.
+
+\startbuffer
+\definefontfeature[effect-ar-thin] [effect={width=0.01,effect=inner}]
+\definefontfeature[effect-ar-thick][effect={width=0.20,extend=1.05}]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\start
+ \setupalign
+ [righttoleft]
+
+ \setupinterlinespace
+ [1.5]
+
+ \definedfont[husayni*arabic,effect-ar-thin @ 30pt]
+ \samplefile{khatt-ar}\par
+ \definedfont[husayni*arabic,effect-ar-thick @ 30pt]
+ \samplefile{khatt-ar}\par
+\stop
+
+The results are acceptable at small sizes but at larger sizes you will start to
+see kerning, anchoring and cursive artifacts. The outline examples show that the
+amount of overlap differs per font and the more overlap we have the better
+boldening will work.
+
+\startMPinclusions
+ def DrawShapes(expr how) =
+ def SampleShapes(expr offset, pw, xc, xs, xt, yc, ys, yt, txt, more) =
+ numeric l ; l := pw * mm ;
+ picture p ; p := image (
+ draw fullcircle scaled 10 ;
+ draw fullcircle scaled 3 shifted (-3+xc ,8+yc) withcolor "darkred" ;
+ draw fullsquare scaled 3 shifted ( 6+xs ,7+ys) withcolor "darkblue";
+ draw fulltriangle scaled 4 shifted ( 6+xt+5,6+yt) withcolor "darkgreen";
+ ) shifted (offset,0) scaled mm ;
+ draw p
+ withpen pencircle
+ if how = 2 :
+ xscaled l yscaled (l/2) rotated 30 ;
+ else :
+ scaled l ;
+ fi ;
+ draw boundingbox p
+ withcolor "darkyellow" ;
+ draw textext(txt)
+ shifted (xpart center p, -8mm) ;
+ draw textext(more)
+ shifted (xpart center p, -11mm) ;
+ enddef ;
+ SampleShapes( 0,1, 0,0,0, 0, 0, 0, "\tinyfont \setstrut \strut original", "\tinyfont \setstrut \strut ") ;
+ SampleShapes( 25,2, 0,0,0, 0, 0, 0, "\tinyfont \setstrut \strut instance", "\tinyfont \setstrut \strut ") ;
+ SampleShapes( 50,2,-1,1,0, 0, 0, 0, "\tinyfont \setstrut \strut mark", "\tinyfont \setstrut \strut x only") ;
+ SampleShapes( 75,2,-1,1,1, 0, 0, 0, "\tinyfont \setstrut \strut mark + mkmk","\tinyfont \setstrut \strut x only") ;
+ SampleShapes(100,2,-1,1,1, 1, 1, 1, "\tinyfont \setstrut \strut mark + mkmk","\tinyfont \setstrut \strut x and y") ;
+ SampleShapes(125,2,-1,2,2,-1/2,-1/2,-1/2,"\tinyfont \setstrut \strut mark + mkmk","\tinyfont \setstrut \strut x and -y") ;
+ enddef ;
+\stopMPinclusions
+
+In arabic (and sometimes latin) fonts the marks (or accents in latin) are
+attached to base shapes and normally one will use the \type {mark} to anchor a
+mark to a base character or specific component of a ligature. The \type {mkmk}
+feature is then used to anchor marks to other marks. Consider the following
+example.
+
+\startlinecorrection
+\scale
+ [width=\textwidth]
+ {\startMPcode DrawShapes(1) ; \stopMPcode}
+\stoplinecorrection
+
+We start with \type {original}: a base shape with three marks: the red circle and
+blue square anchor to the base and the green triangle anchors to the blue square.
+When we bolden, the shapes will start touching. In the case of latin scripts,
+it's normal to keep the accents on the same height so this is why the third
+picture only shifts in the horizontal direction. The fourth picture demonstrates
+that we need to compensate the two bound marks. One can decide to move the lot up
+as in the fifth picture but that is no option here.
+
+Matters can be even more complex when a non circular pen is introduced. In that
+case a transformation from one font to another using the transformed \OPENTYPE\
+positioning logic (values) is even more tricky and unless one knows the
+properties (and usage) of a mark it makes no sense at all. Actually the sixths
+variant is probably nicer here but there we actually move the marks down!
+
+\startlinecorrection
+\scale
+ [width=\textwidth]
+ {\startMPcode DrawShapes(2) ; \stopMPcode}
+\stoplinecorrection
+
+For effects this means that when it gets applied to such a font, only small
+values work out well.
+
+\stopsection
+
+\startsection[title=Math]
+
+Math is dubious as there is all kind of positioning involved. Future versions
+might deal with this, although bolder math (math itself has bold, so actually
+we're talking of bold with some heavy) is needed for titling. If we keep that
+in mind we can actually just bolden math and probably most will come out
+reasonable well. One of the potential troublemakers is the radical (root) sign
+that can be bound to a rule. Bumping the rules is no big deal and patching the
+relevant radical properties neither, so indeed we can do:
+
+\startbuffer[mathblob]
+2\times\sqrt{\frac{\sqrt{\frac{\sqrt{2}}{\sqrt{2}}}}
+ {\sqrt{\frac{\sqrt{2}}{\sqrt{2}}}}}
+\stopbuffer
+
+\startbuffer
+\switchtobodyfont [modernlatin,17.3pt]
+$
+ \mr \darkblue \getbuffer[mathblob] \quad
+ \mb \darkgreen \getbuffer[mathblob]
+$
+\stopbuffer
+
+\typebuffer \blank \start \getbuffer \stop \blank
+
+Where the \type {mathblob} buffer is:
+
+\typebuffer[mathblob]
+
+Here you also see a fraction rule that has been bumped. In display mode we
+get:
+
+\startbuffer
+\switchtobodyfont[modernlatin,17.3pt]
+\startformula
+ \mr \darkblue \getbuffer[mathblob] \quad
+ \mb \darkgreen \getbuffer[mathblob]
+\stopformula
+\stopbuffer
+
+\typebuffer \blank \start \getbuffer \stop \blank
+
+Extensibles behave well too:
+
+\startbuffer
+\switchtobodyfont [modernlatin,17.3pt]
+\dostepwiserecurse {1} {30} {5} {
+ $
+ \mr \sqrt{\blackrule[width=2mm,height=#1mm,color=darkblue]}
+ \quad
+ \mb \sqrt{\blackrule[width=2mm,height=#1mm,color=darkgreen]}
+ $
+}
+\stopbuffer
+
+\typebuffer \blank \start \getbuffer \stop \blank
+
+\definecolor[colormr] [t=.5,a=1,b=.6]
+\definecolor[colormb] [t=.5,a=1,g=.6]
+
+In \in {figure} [fig:regular-over-bold] we overlay regular and bold. The result
+doesn't look that bad after all, does it? It took however a bit of experimenting
+and a fix in \LUATEX: pickup the value from the font instead of the currently
+used (but frozen) math parameter.
+
+\startplacefigure[title={Modern Latin regular over bold.},reference=fig:regular-over-bold]
+\switchtobodyfont[modernlatin,17.3pt]
+\scale[width=.25\textwidth]{\startoverlay
+ {\color[colormb]{$\mb\sqrt{\frac{1}{x}}$}}
+ {\color[colormr]{$ \sqrt{\frac{1}{x}}$}}
+\stopoverlay}
+\stopplacefigure
+
+In case you wonder how currently normal Latin Modern bold looks, here we go:
+
+\startbuffer
+\switchtobodyfont[latinmodern,17.3pt]
+\startformula
+ \mr \darkblue \getbuffer[mathblob] \quad
+ \mb \darkgreen \getbuffer[mathblob]
+\stopformula
+\stopbuffer
+
+\typebuffer \blank \start \getbuffer \stop \blank
+
+\unexpanded\def\ShowMathSample#1%
+ {\switchtobodyfont[#1,14.4pt]%
+ \mathematics{%
+ \mr \darkblue \getbuffer[mathblob] \quad
+ \mb \darkgreen \getbuffer[mathblob]
+ }}
+
+\unexpanded\def\ShowMathCaption#1%
+ {\switchtobodyfont[#1]%
+ #1:
+ $
+ {\mr2\enspace \scriptstyle2\enspace \scriptscriptstyle2}
+ \enspace
+ {\mb2\enspace \scriptstyle2\enspace \scriptscriptstyle2}
+ $}
+
+\startcombination[3*2]
+ {\ShowMathSample {dejavu}} {\ShowMathCaption{dejavu}}
+ {\ShowMathSample{pagella}} {\ShowMathCaption{pagella}}
+ {\ShowMathSample {termes}} {\ShowMathCaption{termes}}
+ {\ShowMathSample {bonum}} {\ShowMathCaption{bonum}}
+ {\ShowMathSample {schola}} {\ShowMathCaption{schola}}
+ {\ShowMathSample{cambria}} {\ShowMathCaption{cambria}}
+\stopcombination
+
+I must admit that I cheat a bit. In order to get a better looking pseudo math
+we need to extend the shapes horizontally as well as squeeze them a bit vertically.
+So, the real effect definitions more look like this:
+
+\starttyping
+\definefontfeature
+ [boldened-30]
+ [effect={width=0.3,extend=1.15,squeeze=0.985,%
+ delta=1,hdelta=0.225,ddelta=0.225,vshift=0.225}]
+\stoptyping
+
+and because we can calculate the funny values sort of automatically, this gets
+simplified to:
+
+\starttyping
+\definefontfeature
+ [boldened-30]
+ [effect={width=0.30,auto=yes}]
+\stoptyping
+
+We leave it to your imagination to figure out what happens behind the screens.
+Just think of some virtual font magic combined with the engine supported \type
+{extend} and \type {squeeze} function. And because we already support bold math
+in \CONTEXT, you will get it when you are doing bold titling.
+
+\startbuffer
+\def\MathSample
+ {\overbrace{2 +
+ \sqrt{\frac{\sqrt{\frac{\sqrt{2}}{\sqrt{2}}}}
+ {\sqrt{\frac{\sqrt{\underbar{2}}}{\sqrt{\overbar{2}}}}}}}}
+
+\definehead
+ [mysubject]
+ [subject]
+
+\setuphead
+ [mysubject]
+ [style=\tfc,
+ color=darkblue,
+ before=\blank,
+ after=\blank]
+
+\mysubject{Regular\quad$\MathSample\quad\mb\MathSample$}
+
+\setuphead
+ [mysubject]
+ [style=\bfc,
+ color=darkred]
+
+\mysubject{Bold \quad$\MathSample\quad\mb\MathSample$}
+\stopbuffer
+
+\typebuffer
+
+\getbuffer
+
+Of course one can argue about the right values for boldening and compensation if
+dimensions so don't expect the current predefined related features to be frozen
+yet.
+
+For sure this mechanism will create more fonts than normal but fortunately it
+can use the low level optimizations for sharing instances so in the end the
+overhead is not that large. This chapter uses 36 different fonts, creates 270
+font instances (different scaling and properties) of which 220 are shared in the
+backend. The load time is 5 seconds in \LUATEX\ and 1.2 seconds in \LUAJITTEX\ on
+a somewhat old laptop with a i7-3840QM processor running 64 bit \MSWINDOWS. Of
+course we load a lot of bodyfonts at different sizes so in a normal run the extra
+loading is limited to just a couple of extra instances for math (normally 3, one
+for each math size).
+
+\stopsection
+
+\startsection[title=Conclusion]
+
+So what can we conclude? When we started with \LUATEX, right from the start
+\CONTEXT\ supported true \UNICODE\ math by using virtual \UNICODE\ math fonts.
+One of the objectives of the \TEX Gyre project is to come up with a robust
+complete set of math fonts, text fonts with a bunch of useful symbols, and
+finally a subset bold math font for titling. Now we have real \OPENTYPE\ math
+fonts, although they are still somewhat experimental. Because we're impatient, we
+now provide bold math by using effects but the future will learn to what extent
+the real bold math fonts will differ and be more pleasant to look at. After all,
+what we describe he is just an experiment that got a bit out of hands.
+
+% And if you wonder if this kind of messing with fonts is okay? Well, you don't
+% know what specs we sometimes get (and then ignore).
+
+\stopsection
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/onandon/onandon.tex b/doc/context/sources/general/manuals/onandon/onandon.tex
index 60b626a5e..593de3e75 100644
--- a/doc/context/sources/general/manuals/onandon/onandon.tex
+++ b/doc/context/sources/general/manuals/onandon/onandon.tex
@@ -34,23 +34,39 @@
\startbodymatter
\component onandon-decade
+
\component onandon-ffi
+
% \startchapter[title=Variable fonts] First published in user group magazines. \stopchapter
\component onandon-variable
+
\component onandon-emoji
+
\startchapter[title={Children of \TEX}] First published in user group magazines. \stopchapter
% \component onandon-children
+
\component onandon-performance
+
\component onandon-editing
+
\startchapter[title={Advertising \TEX}] First published in user group magazines. \stopchapter
% \component onandon-perception
+
\startchapter[title={Tricky fences}] First published in user group magazines. \stopchapter
% \component onandon-fences
+
% \component onandon-media
- \startchapter[title={From 5.2 to 5.3}] Maybe first published in user group magazines. \stopchapter
+
+ \startchapter[title={From 5.2 to 5.3}] First published in user group magazines. \stopchapter
% \component onandon-53
- \startchapter[title={Executing \TEX}] Maybe first published in user group magazines. \stopchapter
+
+ \startchapter[title={Executing \TEX}] First published in user group magazines. \stopchapter
% \component onandon-execute
+
+ \component onandon-modern
+
+ \startchapter[title={More expansion}] Maybe first published in user group magazines. \stopchapter
+ % \component onandon-expansion
\stopbodymatter
\stopproduct