summaryrefslogtreecommitdiff
path: root/doc/context
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2020-12-27 17:39:33 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2020-12-27 17:39:33 +0100
commit4a099fb402241bb64a08a0167b458bed09ec8a3e (patch)
treea06162bbffed3cb308f29e0176b0975a578213d7 /doc/context
parent34bc3e479e76b06633436a744a30719f4d7f20f7 (diff)
downloadcontext-4a099fb402241bb64a08a0167b458bed09ec8a3e.tar.gz
2020-12-27 16:37:00
Diffstat (limited to 'doc/context')
-rw-r--r--doc/context/documents/general/manuals/luametatex.pdfbin1361400 -> 1382144 bytes
-rw-r--r--doc/context/sources/general/manuals/followingup/followingup-fonts.tex259
-rw-r--r--doc/context/sources/general/manuals/followingup/followingup.tex1
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex-differences.tex3
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex105
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex148
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex-metapost.tex2
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex-modifications.tex5
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex71
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex.tex2
10 files changed, 499 insertions, 97 deletions
diff --git a/doc/context/documents/general/manuals/luametatex.pdf b/doc/context/documents/general/manuals/luametatex.pdf
index 63ebaa448..03bd4ef8a 100644
--- a/doc/context/documents/general/manuals/luametatex.pdf
+++ b/doc/context/documents/general/manuals/luametatex.pdf
Binary files differ
diff --git a/doc/context/sources/general/manuals/followingup/followingup-fonts.tex b/doc/context/sources/general/manuals/followingup/followingup-fonts.tex
new file mode 100644
index 000000000..fbcf05f34
--- /dev/null
+++ b/doc/context/sources/general/manuals/followingup/followingup-fonts.tex
@@ -0,0 +1,259 @@
+% language=us
+
+\startcomponent followingup-fonts
+
+\environment followingup-style
+
+\startchapter[title={Scaled fonts}]
+
+Although \CONTEXT\ is quite efficient with fonts there is always room for
+improvement. However, after years of fine tuning the font mechanisms there was
+not that much room left. On the average, given that \TEX\ is mostly about fonts,
+what we have is quite okay, but for some scripts, like \CJK\ the demands on
+resources can be rather high. This made me think of a different approach to
+scaling. Nowadays fonts seldom come in design sizes. Also, in \CONTEXT\ \MKIV\
+and therefore \LMTX\ we always had so called dynamic features: apply additional
+features locally, although that comes with a small penalty in performance, it
+saves additional font instances. It is a good approach for the occasional small
+stretch of glyphs, like small capped logos and such.
+
+Using a font at a larger size means that we need to provide \TEX\ with the right
+dimensions: it needs them for instance for for braking paragraph into lines or
+wrapping text in boxes. The amount of information that \TEX\ needs is small: only
+dimensions. Of course there are ligatures and kerns but in so called base mode we
+seldom have many. The data needed for node mode (used for more complex \OPENTYPE\
+fonts) can be shared and lives at the \LUA\ end. But even then the character
+table is copied and scaled. Actually, we seldom need that information but it is
+good to have it and in the case of virtual fonts it is needed. But, when a font
+is used at a different size, and al the features are the same, we can think of
+a different approach.
+
+That approach is tagged as \quote {dynamic font scaling}, which means that we
+don't need to define a new font instance when the same feature set is used. Or
+course in addition to this features one can still use the dynamic features. This
+means that for instance chapter titling can use the bodyfont instance and just
+apply additional scaling. Although for a normal run the number of loaded fonts is
+normally small, and the number of instances also isn't that impressive it can
+happen in a large document that you end up with a few dozen. That number can now
+be reduced to half a dozen.
+
+Of course there can be side effects, which is why it's currently tagged as
+experimental. There is also a small performance hit because we now need to track
+it but that is gained back because we load less fonts and have less glyph runs.
+
+So how does it work? Here is an example:
+
+\startbuffer
+\definescaledfont[MyLargerFontA][scale=2000,style=bold]
+
+test {\MyLargerFontA test} test
+\stopbuffer
+
+\typebuffer
+
+This gives:
+
+\getbuffer
+
+You can also say:
+
+\startbuffer
+\definescaledfont[MyLargerFontB][xscale=1200,yscale=2000,style=bold]
+
+test {\MyLargerFontB test} test
+\stopbuffer
+
+\typebuffer
+
+Which scaled the over two axis:
+
+\getbuffer
+
+The low level implementation uses the two variables \type {\glyphxscale} and
+\type {\glyphyscale} that take a number. As with other \TEX\ scaling related
+variables, a value of 1000 represents 1.0 so we have three digits precision.
+
+Because we just scale, the next also works:
+
+\startbuffer
+test {\MyLargerFontB test {\em test} test} test
+\stopbuffer
+
+\typebuffer
+
+The nested emphasis still works:
+
+\getbuffer
+
+For now we only have a simple user interface but it might eventually be more
+integrated. For instance, we can consider defining \type {\tfa} and friends this
+way.
+
+In order to make it useful, math is also supported:
+
+\startbuffer
+\definescaledfont[MyLargerFontC][xscale=1200,yscale=2000]
+
+test {\MyLargerFontC test $\sqrt{x}$ test} test
+\stopbuffer
+
+\typebuffer
+
+gives:
+
+\getbuffer
+
+You can actually use negative values, as is demonstrated in the following
+code:
+
+\startbuffer
+\bTABLE[align=middle]
+ \bTR
+ \bTD a{\glyphxscale 1000 \glyphyscale 1000 bc}d \eTD
+ \bTD a{\glyphxscale 1000 \glyphyscale -1000 bc}d \eTD
+ \bTD a{\glyphxscale -1000 \glyphyscale -1000 bc}d \eTD
+ \bTD a{\glyphxscale -1000 \glyphyscale 1000 bc}d \eTD
+ \eTR
+ \bTR
+ \bTD \tttf +1000 +1000 \eTD
+ \bTD \tttf +1000 -1000 \eTD
+ \bTD \tttf -1000 -1000 \eTD
+ \bTD \tttf -1000 +1000 \eTD
+ \eTR
+\eTABLE
+\stopbuffer
+
+\typebuffer
+
+gives:
+
+\startlinecorrection
+\getbuffer
+\stoplinecorrection
+
+Because loading and switching fonts in \CONTEXT\ is rather efficient, the gain in
+performance is less than you expect. After all, not all time is spent on fonts. Of
+course for huge \CJK\ fonts it does make a difference. But, when we do a massive switch
+to a different body font, we can save a little more. Think of definitions like:
+
+\starttyping
+\definescaledfontbody[BigBodyFont] [1.200]
+\definescaledfontbody[VeryBigBodyFont] [1.440]
+\definescaledfont [MyLargerFont] [xscale=1.200,yscale=2.000]
+\stoptyping
+
+And then:
+
+\starttyping
+\setuphead[title][style=\MyLargerFont\bf]
+\stoptyping
+
+The savings in runtime can be quite noticeable now, for instance this:
+
+\starttyping
+\dorecurse {100} {
+ \starttitle[title={Test #1]
+ \samplefile{ward}\par
+ \start \bf
+ \samplefile{ward}\par
+ \stop
+ \start \BigBodyFont \bf
+ \samplefile{ward}\par
+ \stop
+ \stoptitle
+}
+\stoptyping
+
+Speeds up a bit for Pagella and even more when we use Cambria. Keep in mind that
+that a body font switch also involves setting up some math. Anyway, as a proof of
+concept it worked out well.
+
+The scaled, as mentioned, works with pseudo scales but that is sometimes a bit
+cumbersome. This is why a special \type {\numericscale} primitive has been
+introduced.
+
+\startbuffer
+1200 : \the\numericscale1200
+1.20 : \the\numericscale1.200
+\stopbuffer
+
+\typebuffer
+
+Both these lines produce the same integer:
+
+\startlines\tttf
+\getbuffer
+\stoplines
+
+When there is a fraction, the value is multiplied by 1000.
+
+So how should this be further integrated? If we drop design sizes at the file
+definition level the whole font mechanism could be simplified a lot, but we cannot
+do that. Another approach is to let users use the previously mentioned more low
+level commands. A but of help can be provided with a command like
+
+\starttyping
+\enableautoglyphscaling
+\stoptyping
+
+which pays of when it is issues before \type {\starttext} and before a body fonts
+gets defined because it does some overloading of defining commands. At the brink
+of 2021 I'm not sure yet what is best. One reason is that a compatibility layer
+is not really compatible because glyph scaling gives slightly different scaled in
+practice (which relates to some old time accuracy hackery). This sounds worse
+that it is because in practice scaling is done for sections heads and so, which
+are less present and don't interfere with the running text.
+
+Let me stress once more: if you need this kind of scaling it pays off. If you
+load multiple instances of large (e.g.\ \CJK) fonts, it makes sense too. But, for
+instance on a document like the \LUAMETATEX\ manual it only saves 2 instances on
+158, and those are the few bold fonts used for titling.
+
+\stopchapter
+
+\stopcomponent
+
+% sample file
+
+\setuplayout[topspace=1cm,header=1cm] \setuplayout[middle]
+
+\setupbodyfont[pagella,10pt]
+
+\setupalign[verytolerant,stretch]
+
+\setupwhitespace[big]
+
+\starttext
+
+\startbuffer
+\definescaledfont[bfe][xscale=2000,yscale=6000,style=bf]
+
+\setuphead[chapter][style=\bfe]
+
+\dostepwiserecurse {10} {2020} {10} {
+ \title{Here we go #1!}
+ \start
+ \glyphxscale#1\relax
+ \glyphyscale#1\relax
+ \setupinterlinespace
+ \samplefile{ward}%
+ \start
+ \bf
+ \samplefile{ward}%
+ \glyphxscale\numexpr(#1*2)/3\relax
+ \glyphyscale#1\relax
+ \samplefile{ward}%
+ \par
+ \stop
+ \def\TEST{y = \sqrt{x^2 + 1}^3}%
+ \dontleavehmode
+ \ruledhbox{\glyphxscale #1 \glyphyscale #1 $\left{\TEST\right}$}
+ \ruledhbox{\glyphxscale #1 \glyphyscale \numexpr#1*3\relax $\left{\TEST\right}$}
+ \ruledhbox{\glyphxscale \numexpr#1/2\relax \glyphyscale \numexpr#1*2\relax $\left{\TEST\right}$}
+ \par
+ \stop
+ \page
+}
+\stopbuffer
+
+\getbuffer
diff --git a/doc/context/sources/general/manuals/followingup/followingup.tex b/doc/context/sources/general/manuals/followingup/followingup.tex
index a9aaaf71c..7d7d17851 100644
--- a/doc/context/sources/general/manuals/followingup/followingup.tex
+++ b/doc/context/sources/general/manuals/followingup/followingup.tex
@@ -28,6 +28,7 @@
\component followingup-mp
\component followingup-tex
\component followingup-retrospect
+ \component followingup-fonts
\stopbodymatter
\stopdocument
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-differences.tex b/doc/context/sources/general/manuals/luametatex/luametatex-differences.tex
index 67556a99a..5be5463e9 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex-differences.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex-differences.tex
@@ -82,8 +82,9 @@ what is gone. We start with the primitives that were dropped.
\type {\suppressoutererror}
\type {\mathoption}
\NC \NR
-\BC whatever \NC \type {\primitive}
+\BC system \NC \type {\primitive}
\type {\ifprimitive}
+ \type {\formatname}
\NC \NR
\BC ignored \NC \type {\long}
\type {\outer}
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex b/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex
index 057fddde4..43bb0429a 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex
@@ -111,17 +111,6 @@ The \LUAMETATEX\ version number starts at~2 in order to prevent a clash with
\LUATEX, and the version commands are the same. This is a way to indicate that
these projects are related.
-\startsubsubsection[title={\lpr {formatname}}]
-
-\topicindex{format}
-
-The \lpr {formatname} syntax is identical to \prm {jobname}. In \INITEX, the
-expansion is empty. Otherwise, the expansion is the value that \prm {jobname} had
-during the \INITEX\ run that dumped the currently loaded format. You can use this
-token list to provide your own version info.
-
-\stopsubsubsection
-
\stopsubsection
\stopsection
@@ -597,6 +586,8 @@ tokens and assume that the function is available when that token expands. On the
other hand, as we have tested this functionality in relative complex situations
normal usage should not give problems.
+{\em It makes sense to delegate the implementation of the primitives to \LUA.}
+
\stopsubsection
\startsubsection[title={\lpr {luabytecode} and \lpr {luabytecodecall}}]
@@ -626,6 +617,8 @@ 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).
+{\em It makes sense to delegate the implementation of the primitives to \LUA.}
+
\stopsubsection
\stopsection
@@ -841,6 +834,18 @@ but faster (only measurable with millions of calls) and probably more convenient
\stopsubsection
+\startsubsection[title={\lpr {defcsname}, \lpr {edefcsname}, \lpr {edefcsname} and \lpr {xdefcsname}}]
+
+Although we can implement these primitives easily using macros it makes sense,
+given the popularity of \prm {csname} to have these as primitives. It also saves
+some \prm {expandafter} usage and it looks a bit better in the source.
+
+\starttyping
+\def\gdefcsname foo\endcsname{oof}
+\stoptyping
+
+\stopsubsection
+
\startsubsection[title={\lpr {expanded}}]
\topicindex {expansion}
@@ -1367,7 +1372,7 @@ the acceptable range is from 0 to 65535.
\stopsubsection
-\startsubsection[title={\prm {hrule} and \prm {vrule}}]
+\startsubsection[title={\prm {hrule}, \prm {vrule}, \lpr {nohrule} and \lpr {novrule}}]
\topicindex {rules}
@@ -1375,6 +1380,11 @@ Both rule drawing commands take an optional \type {xoffset} and \type {yoffset}
parameter. The displacement is virtual and not taken into account when the
dimensions are calculated.
+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. Of course this assumes that the backend implements them
+being invisible but still taking space.
+
\stopsubsection
\startsubsection[title={\prm {vsplit}}]
@@ -1473,17 +1483,6 @@ mode.
\stopsubsection
-\startsubsection[title={\lpr {nohrule} and \lpr {novrule}}]
-
-\topicindex {rules}
-
-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.
-
-\stopsubsection
-
\startsubsection[title={\lpr {gleaders}},reference=sec:gleaders]
\topicindex {leaders}
@@ -1585,7 +1584,10 @@ they will be stable.
\stoptyping
This allows for embedded spaces, without the need for double quotes. Macro
-expansion takes place inside the argument.
+expansion takes place inside the argument. Keep in mind that as side effect of
+delegating \IO\ to \LUA\ the \prm {openin} primitive is nor provided by the
+engine and has to be implemented by the macro package. This also means that the
+limit on the number of open files is not enforced by the engine.
The \lpr {tracingfonts} primitive that has been inherited from \PDFTEX\ has
been adapted to support variants in reporting the font. The reason for this
@@ -1610,10 +1612,12 @@ extension is that a csname not always makes sense. The zero case is the default.
\topicindex {files+writing}
-You can now open upto 127 files with \prm {openout}. When no file is open writes
-will go to the console and log. The \type {write} related primitives have to be
-implemented as part of a backend! As a consequence a system command is no longer
-possible but one can use \type {os.execute} to do the same.
+Writing to a file in \TEX\ has two forms: delayed and immediate. Delayed writing
+means that the to be written text is anchored in the node list and flushed by the
+backend. As all \IO\ is delegated to \LUA, this also means that it has to deal
+with distinction. In \LUATEX\ the number of open files was already bumped to 127,
+but in \LUAMETATEX\ it depends on the macro package. The special meaning of
+channel 18 was already dropped in \LUATEX\ because we have \type {os.execute}.
\stopsubsection
@@ -1787,7 +1791,41 @@ convenience extra which could also have been implemented using node list parsing
\startsubsection[title={Normalizing lines}]
-{\em Experimental!}
+The original \TEX\ machinery was never meant to be opened up. As a consequence a
+constructed line can have different layouts. There can be left- and/or right
+skips and hanging indentation or parshape can result in a shift and adapted
+width. In \LUATEX\ glue got subtypes so we can recognize the left-, right and
+parfill skips, but still there is no hundred percent certainty about the shape.
+
+In \LUAMETATEX\ lines can be normalized. This is optional because we want to
+preserve the original (for comparison) and is controlled by \lpr
+{normalizelinemode}. That variable actually drives some more. An earlier version
+provided a few more granular options (for instance: does a leftskip comes before
+or after a left hanging indentation) but in the end that was dropped. Because
+this normalization only is seen at the \LUA\ end there is no need to go into much
+detail here.
+
+At this moment a line has this pattern: left parfill, left hang, left skip,
+indentation, content, right hang, right skip, right parfill. Of course the
+indentation and fill skips are not present in every line.
+
+Control over normalization happens via the mentioned mode variable and here is
+what the engine provides right now. We use a bitmap:
+
+\starttabulate[|l|l|]
+\DB value \BC reported \NC \NR
+\TB
+\NC \type{0x0001} \NC normalize line as described above \NC \NR
+\NC \type{0x0002} \NC use a skip for parindent instead of a box \NC \NR
+\NC \type{0x0004} \NC swap hangindent in l2r mode \NC \NR
+\NC \type{0x0008} \NC swap parshape in l2r mode \NC \NR
+\NC \type{0x0010} \NC put breaks after dir in l2r mode \NC \NR
+\NC \type{0x0020} \NC remove margin kerns (\PDFTEX\ left-over) \NC \NR
+\LL
+\stoptabulate
+
+Setting the bit enables the related normalization. More features might be added
+in future releases.
% Swapping shapes
%
@@ -1970,13 +2008,20 @@ had an issue that had to be fixed.
\stopsection
-\startsection[title=Expressions]
+\startsection[title=Expressions and \lpr {numericscale}]
The \type {*expr} parsers now accept \type {:} as operator for integer division
(the \type {/} operators does rounding. This can be used for division compatible
with \type {\divide}. I'm still wondering if adding a couple of bit operators
makes sense (for integers).
+The \lpr{numericscale} parser is kind of special (and might evolve). For now it
+converts a following number in a scale value as often used in \TEX, where 1000
+means scaling by~1.0. The trick is in the presence of a digit (or comma): 1.234
+becomes 1234 but 1234 stays 1234 and from this you can deduce that 12.34 becomes
+123400. Internally \TEX\ calculates with integers, but this permits the macro
+package to provide an efficient mix.
+
\stopsection
\startsection[title=Macro arguments]
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex b/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex
index c88e9faff..9a09f705c 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex
@@ -268,9 +268,25 @@ 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
-parameters to that command. The allowed commands and their arguments are:
+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 parameters
+to that command. The frontend is only interested in the dimensions, ligatures and
+kerns of a font, which is the reason why the \TEX\ engine didn't have to be
+extended when virtual fonts showed up: dealing with it is up to the driver that
+comes after the backend. In \PDFTEX\ and \LUATEX\ that driver is integrated so
+there the backend also deals with virtual fonts. The first block in the next
+table is what the standard mentions. The \type {special} command is indeed
+special because it is an extension container. The mentioned engines only support
+pseudo standards where the content starts with \type {pdf:}. The last block is
+\LUATEX\ specific and will not be found in native fonts. These entries can be
+used in virtual fonts that are constructed in \LUA.
+
+But \unknown\ in \LUAMETATEX\ there is no backend built in but we might assume
+that the one provided deals with these entries. However, a provided backend can
+provide more and that is indeed what happens in \CONTEXT. There, because we no
+longer have compacting (of passed tables) and unpacking (when embedding) of these
+tables going on we stay in the \LUA\ domain. None of the virtual specification is
+ever seen in the engine.
\starttabulate[|l|l|l|p|]
\DB command \BC arguments \BC type \BC description \NC \NR
@@ -278,16 +294,18 @@ parameters to that command. The allowed commands and their arguments are:
\NC \type{font} \NC 1 \NC number \NC select a new font from the local \type {fonts} table \NC \NR
\NC \type{char} \NC 1 \NC number \NC typeset this character number from the current font,
and move right by the character's width \NC \NR
-\NC \type{node} \NC 1 \NC node \NC output this node (list), and move right
- by the width of this list\NC \NR
-\NC \type{slot} \NC 2 \NC 2 numbers \NC a shortcut for the combination of a font and char command\NC \NR
\NC \type{push} \NC 0 \NC \NC save current position\NC \NR
-\NC \type{nop} \NC 0 \NC \NC do nothing \NC \NR
\NC \type{pop} \NC 0 \NC \NC pop position \NC \NR
\NC \type{rule} \NC 2 \NC 2 numbers \NC output a rule $ht*wd$, and move right. \NC \NR
\NC \type{down} \NC 1 \NC number \NC move down on the page \NC \NR
\NC \type{right} \NC 1 \NC number \NC move right on the page \NC \NR
+\HL
\NC \type{special} \NC 1 \NC string \NC output a \prm {special} command \NC \NR
+\HL
+\NC \type{nop} \NC 0 \NC \NC do nothing \NC \NR
+\NC \type{slot} \NC 2 \NC 2 numbers \NC a shortcut for the combination of a font and char command\NC \NR
+\NC \type{node} \NC 1 \NC node \NC output this node (list), and move right
+ by the width of this list\NC \NR
\NC \type{pdf} \NC 2 \NC 2 strings \NC output a \PDF\ literal, the first string is one of \type {origin},
\type {page}, \type {text}, \type {font}, \type {direct} or \type {raw}; if you
have one string only \type {origin} is assumed \NC \NR
@@ -362,10 +380,6 @@ The special can have a \type {pdf:}, \type {pdf:origin:}, \type {pdf:page:},
\type {pdf:direct:} or \type {pdf:raw:} prefix. When you have to concatenate
strings using the \type {pdf} command might be more efficient.
-The fields mentioned above can be found in external fonts. It is good to keep in
-mind that we can extend this model, given that the backend knows what to do with
-it.
-
\stopsection
\startsection[title={Additional \TEX\ commands}]
@@ -418,25 +432,88 @@ which of course needs to be a valid one.
\stopsubsection
-\startsubsection[title={\lpr {noligs} and \lpr {nokerns}}]
+\startsubsection[title={\lpr {glyphoptions}}]
\topicindex {ligatures+suppress}
\topicindex {kerns+suppress}
+\topicindex {expansion+suppress}
+\topicindex {protrusion+suppress}
-These primitives prohibit ligature and kerning insertion at the time when the
-initial node list is built by \LUATEX's main control loop. You can enable these
-primitives when you want to do node list processing of \quote {characters}, where
-\TEX's normal processing would get in the way.
+In \LUATEX\ the \type {\noligs} and \type {\nokerns} primitives suppress these
+features but in \LUAMETATEX\ these primitives are gone. They are replace by a more
+generic control primitive \lpr {glyphoptions}. This numerical parameter is a
+bitset with the following fields:
-\startsyntax
-\noligs <integer>!crlf
-\nokerns <integer>
-\stopsyntax
+\starttabulate[|l|pl|]
+\DB value \BC effect \NC\NR
+\TB
+\NC \type{0x01} \NC prevent left ligature \NC \NR
+\NC \type{0x02} \NC prevent right ligature \NC \NR
+\NC \type{0x04} \NC block left kern \NC \NR
+\NC \type{0x08} \NC block right kern \NC \NR
+\NC \type{0x10} \NC don't apply expansion \NC \NR
+\NC \type{0x20} \NC don't apply protrusion \NC \NR
+\NC \type{0x40} \NC apply xoffset to width \NC \NR
+\NC \type{0x80} \NC apply yoffset to height and depth \NC \NR
+\LL
+\stoptabulate
+
+The effects speak for themselves. They provide detailed control over individual
+glyph, this because the current value of this option is stored with glyphs.
+
+\stopsubsection
+
+\startsubsection[title={\lpr {glyphxscale}, \lpr {glyphyscale} and \lpr {scaledfontdimen}}]
+
+The two scale parameters control the current scaling. They are traditional \TEX\
+integer parameters that operate independent of each other. The scaling is
+reflected in the dimensions of glyphs as well as in the related font dimensions,
+which means that units like \type {ex} and \type {em} work as expected. If you
+query a font dimensions with \prm {fontdimen} you get the raw value but with \lpr
+{scaledfontdimen} you get the useable value.
+
+\stopsubsection
+
+\startsubsection[title={\lpr {glyphxoffset}, \lpr {glyphyoffset}}]
-These primitives can also be implemented by overloading the ligature building and
-kerning functions, i.e.\ by assigning dummy functions to their associated
-callbacks. Keep in mind that when you define a font (using \LUA) you can also
-omit the kern and ligature tables, which has the same effect as the above.
+These two parameters control the horizontal and vertical shift of glyphs with,
+when applied to a stretch of them, the horizontal offset probably being the least
+useful.
+
+\stopsubsection
+
+\startsubsection[title={\lpr {glyph}}]
+
+This command is a variation in \prm {char} that takes keywords:
+
+\starttabulate[|l|p|]
+\DB keyword \BC effect \NC type \NC \NR
+\TB
+\NC \type {xoffset} \NC (virtual) horizontal shift \NC dimension \NC \NR
+\NC \type {yoffset} \NC (virtual) vertical shift \NC dimension \NC \NR
+\NC \type {xscale} \NC horizontal scaling \NC integer \NC \NR
+\NC \type {yscale} \NC vertical scaling \NC integer \NC \NR
+\NC \type {options} \NC glyph options \NC bitset \NC \NR
+\NC \type {font} \NC font \NC identifier \NC \NR
+\NC \type {id} \NC font \NC integer \NC \NR
+\LL
+\stoptabulate
+
+The values default to the currently set values. Here is a \CONTEXT\ example:
+
+\startbuffer
+\ruledhbox{
+ \ruledhbox{\glyph yoffset 1ex options 0 123}
+ \ruledhbox{\glyph xoffset .5em yoffset 1ex options "C0 125}
+ \ruledhbox{baseline\glyphyoffset 1ex \glyphxscale 800 \glyphyscale\glyphxscale raised}
+}
+\stopbuffer
+
+\typebuffer
+
+Visualized:
+
+\getbuffer
\stopsubsection
@@ -499,29 +576,6 @@ instance content moved into the margin:
\stopsubsection
-\startsubsection[title={\lpr{glyphdimensionsmode}}]
-
-Already in the early days of \LUATEX\ the decision was made to calculate the
-effective height and depth of glyphs in a way that reflected the applied vertical
-offset. The height got that offset added, the depth only when the offset was
-larger than zero. We can now control this in more detail with this mode
-parameter. An offset is added to the height and|/|or subtracted from the depth.
-The effective values are never negative. The zero mode is the default.
-
-\starttabulate[|l|pl|]
-\DB value \BC effect \NC\NR
-\TB
-\NC \type {0} \NC the old behaviour: add the offset to the height and only subtract
- the offset only from the depth when it is positive \NC \NR
-\NC \type {1} \NC add the offset to the height and subtract it from the depth \NC \NR
-\NC \type {2} \NC add the offset to the height and subtract it from the depth but
- keep the maxima of the current and previous results \NC \NR
-\NC \type {3} \NC use the height and depth of the glyph, so no offset is applied \NC \NR
-\LL
-\stoptabulate
-
-\stopsubsection
-
\stopsection
\startsection[title={The \LUA\ font library}][library=font]
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-metapost.tex b/doc/context/sources/general/manuals/luametatex/luametatex-metapost.tex
index 9d25adb2f..c687a5a46 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex-metapost.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex-metapost.tex
@@ -49,7 +49,7 @@ can have a number of different fields, as follows:
\type {nonstop},
\type {scroll} or
\type {errorstop} \NC \type {errorstop} \NC \NR
-\NC \type{job_name} \NC string \NC a compatibility value \NC \type {mpout} \NC \NR
+\NC \type{job_name} \NC string \NC a compatibility value \NC \NC \NR
\NC \type{find_file} \NC function \NC a function to find files \NC only local files \NC \NR
\NC \type{utf8_mode} \NC boolean \NC permit characters in the
range 128 upto 255 to be
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-modifications.tex b/doc/context/sources/general/manuals/luametatex/luametatex-modifications.tex
index cc9fd3b8d..ac283bafd 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex-modifications.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex-modifications.tex
@@ -207,6 +207,11 @@ features, but with a few small adaptations.
\ETEX\ functionality is bit more natural, code wise.
\stopitem
+\startitem
+ The \prm {readline} primitive has to be implemented in \LUA. This is a side
+ effect of delegating all file \IO.
+\stopitem
+
\stopitemize
\stopsubsection
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex b/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex
index 3c9041e8d..6773d346d 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex
@@ -2206,22 +2206,23 @@ emulated in \LUA\ and not in the engine, so we retain downward compatibility.
\TB
\supported {check_discretionaries} \nop \yes \yes
\supported {check_discretionary} \nop \yes \yes
-\supported {copy} \yes \yes \relax
\supported {copy_list} \yes \yes \relax
%supported {copy_only} \nop \yes \relax
+\supported {copy} \yes \yes \relax
\supported {count} \nop \yes \yes
-\supported {current_attr} \yes \yes \relax
+\supported {current_attributes} \yes \yes \relax
\supported {dimensions} \nop \yes \yes
\supported {effective_glue} \nop \yes \yes
\supported {end_of_math} \nop \yes \yes
+\supported {find_attribute_range} \nop \yes \relax
\supported {find_attribute} \nop \yes \yes
-%supported {find_attribute_range} \nop \yes \relax
-%supported {find_node} \nop \yes \relax
+\supported {find_node} \nop \yes \relax
\supported {first_glyph} \nop \yes \yes
\supported {flatten_discretionaries} \nop \yes \yes
\supported {flush_list} \yes \yes \relax
\supported {flush_node} \yes \yes \relax
\supported {free} \yes \yes \relax
+\supported {get_attributes} \nop \yes \relax
\supported {get_attribute} \yes \yes \relax
\supported {get_properties_table} \yes \yes \relax
\supported {get_synctex_fields} \nop \yes \relax
@@ -2229,7 +2230,6 @@ emulated in \LUA\ and not in the engine, so we retain downward compatibility.
\supported {getboth} \nop \yes \relax
\supported {getbox} \nop \yes \relax
\supported {getchar} \nop \yes \relax
-\supported {getstate} \nop \yes \relax
\supported {getdata} \nop \yes \relax
\supported {getdepth} \nop \yes \relax
\supported {getdirection} \nop \yes \relax
@@ -2240,43 +2240,64 @@ emulated in \LUA\ and not in the engine, so we retain downward compatibility.
\supported {getfont} \nop \yes \relax
\supported {getglue} \nop \yes \yes
\supported {getglyphdata} \nop \yes \relax % old experiment
-\supported {getglyphstate} \nop \yes \relax % new experiment
+\supported {getglyphdimensions} \nop \yes \yes
\supported {getglyphscript} \nop \yes \relax % new experiment
+\supported {getglyphstate} \nop \yes \relax % new experiment
\supported {getheight} \nop \yes \relax
\supported {getid} \nop \yes \relax
+\supported {getindex} \nop \yes \relax
+\supported {getkerndimension} \nop \yes \yes
\supported {getkern} \nop \yes \relax
-\supported {getlang} \nop \yes \relax
+\supported {getlanguage} \nop \yes \relax
\supported {getleader} \nop \yes \relax
\supported {getlist} \nop \yes \relax
\supported {getnext} \nop \yes \relax
\supported {getnormalizedline} \nop \yes \relax
\supported {getnucleus} \nop \yes \relax
\supported {getoffsets} \nop \yes \relax
+\supported {getoptions} \nop \yes \relax
\supported {getorientation} \nop \yes \relax
+\supported {getparstate} \nop \yes \relax
\supported {getpenalty} \nop \yes \relax
\supported {getpost} \nop \yes \relax
-\supported {getpre} \nop \yes \relax
\supported {getprev} \nop \yes \relax
+\supported {getpre} \nop \yes \relax
\supported {getproperty} \yes \yes \relax
\supported {getreplace} \nop \yes \relax
+\supported {getscales} \nop \yes \relax
+\supported {getscript} \nop \yes \relax
\supported {getshift} \nop \yes \relax
-\supported {getsub} \nop \yes \relax
+\supported {getstate} \nop \yes \relax
+\supported {getsubpre} \nop \yes \relax
\supported {getsubtype} \nop \yes \relax
+\supported {getsub} \nop \yes \relax
+\supported {getsuppre} \nop \yes \relax
\supported {getsup} \nop \yes \relax
+\supported {gettotal} \yes \yes \relax
+%supported {getwhatever} \nop \yes \relax % experiment for myself
\supported {getwhd} \nop \yes \relax
\supported {getwidth} \nop \yes \relax
+\supported {getxscale} \nop \yes \relax
+\supported {getxyscale} \nop \yes \relax
+\supported {getyscale} \nop \yes \relax
\supported {has_attribute} \yes \yes \relax
\supported {has_dimensions} \nop \yes \relax
\supported {has_field} \yes \yes \relax
+\supported {has_glyph_option} \nop \yes \yes
\supported {has_glyph} \nop \yes \yes
\supported {hpack} \nop \yes \yes
-%supported {ignore_math_skip} \nop \yes \relax
+\supported {hyphenating} \nop \yes \yes
+\supported {ignore_math_skip} \nop \yes \relax
\supported {insert_after} \yes \yes \relax
\supported {insert_before} \yes \yes \relax
\supported {is_char} \nop \yes \relax
\supported {is_direct} \nop \yes \relax
\supported {is_glyph} \nop \yes \relax
+\supported {is_next_char} \nop \yes \relax
+\supported {is_next_glyph} \nop \yes \relax
\supported {is_node} \yes \yes \relax
+\supported {is_prev_char} \nop \yes \relax
+\supported {is_prev_glyph} \nop \yes \relax
\supported {is_valid} \nop \yes \relax
\supported {is_zero_glue} \nop \yes \yes
\supported {kerning} \nop \yes \yes
@@ -2284,22 +2305,23 @@ emulated in \LUA\ and not in the engine, so we retain downward compatibility.
\supported {length} \nop \yes \yes
\supported {ligaturing} \nop \yes \yes
\supported {make_extensible} \nop \yes \yes
+\supported {migrate} \nop \yes \relax
\supported {mlist_to_hlist} \nop \yes \yes
\supported {naturalwidth} \nop \yes \yes
\supported {new} \yes \yes \relax
-\supported {prepend_prevdepth} \nop \yes \yes
+%supported {prepend_prevdepth} \nop \yes \yes
\supported {protect_glyphs} \nop \yes \yes
\supported {protect_glyph} \nop \yes \yes
\supported {protrusion_skippable} \nop \yes \yes
\supported {rangedimensions} \nop \yes \yes
\supported {remove} \yes \yes \relax
+\supported {set_attributes} \nop \yes \relax
\supported {set_attribute} \yes \yes \relax
\supported {set_synctex_fields} \nop \yes \relax
\supported {setattributelist} \nop \yes \relax
\supported {setboth} \nop \yes \relax
\supported {setbox} \nop \yes \relax
\supported {setchar} \nop \yes \relax
-\supported {setstate} \nop \yes \relax
\supported {setdata} \nop \yes \relax
\supported {setdepth} \nop \yes \relax
\supported {setdirection} \nop \yes \relax
@@ -2310,48 +2332,61 @@ emulated in \LUA\ and not in the engine, so we retain downward compatibility.
\supported {setfont} \nop \yes \relax
\supported {setglue} \yes \yes \relax
\supported {setglyphdata} \nop \yes \relax % old experiment
-\supported {setglyphstate} \nop \yes \relax % new experiment
\supported {setglyphscript} \nop \yes \relax % new experiment
+\supported {setglyphstate} \nop \yes \relax % new experiment
\supported {setheight} \nop \yes \relax
+\supported {setindex} \nop \yes \relax
\supported {setkern} \nop \yes \relax
-\supported {setlang} \nop \yes \relax
+\supported {setlanguage} \nop \yes \relax
\supported {setleader} \nop \yes \relax
\supported {setlink} \nop \yes \relax
\supported {setlist} \nop \yes \relax
\supported {setnext} \nop \yes \relax
\supported {setnucleus} \nop \yes \relax
\supported {setoffsets} \nop \yes \relax
+\supported {setoptions} \nop \yes \relax
\supported {setorientation} \nop \yes \relax
\supported {setpenalty} \nop \yes \relax
+\supported {setpost} \nop \yes \relax
\supported {setprev} \nop \yes \relax
+\supported {setpre} \nop \yes \relax
\supported {setproperty} \yes \yes \relax
+\supported {setreplace} \nop \yes \relax
+\supported {setscales} \nop \yes \relax
+\supported {setscript} \nop \yes \relax
\supported {setshift} \nop \yes \relax
\supported {setsplit} \nop \yes \relax
-\supported {setsub} \nop \yes \relax
+\supported {setstate} \nop \yes \relax
+\supported {setsubpre} \nop \yes \relax
\supported {setsubtype} \nop \yes \relax
+\supported {setsub} \nop \yes \relax
+\supported {setsuppre} \nop \yes \relax
\supported {setsup} \nop \yes \relax
\supported {setwhd} \nop \yes \relax
\supported {setwidth} \nop \yes \relax
\supported {slide} \nop \yes \yes
-\supported {reverse} \nop \yes \relax
-\supported {exchange} \nop \yes \relax
\supported {start_of_par} \nop \yes \relax
\supported {subtype} \nop \nop \relax
\supported {tail} \yes \yes \relax
\supported {todirect} \nop \yes \relax
\supported {tonode} \nop \yes \relax
\supported {tostring} \yes \nop \relax
-\supported {traverse} \yes \yes \relax
+\supported {total} \nop \yes \relax
+\supported {tovaliddirect} \nop \yes \relax
\supported {traverse_char} \yes \yes \relax
+\supported {traverse_content} \yes \yes \relax
\supported {traverse_glyph} \yes \yes \relax
\supported {traverse_id} \yes \yes \relax
\supported {traverse_list} \yes \yes \relax
+\supported {traverse} \yes \yes \relax
\supported {type} \yes \nop \relax
\supported {unprotect_glyphs} \nop \yes \yes
\supported {unprotect_glyph} \nop \yes \yes
+\supported {unset_attributes} \nop \yes \relax
\supported {unset_attribute} \yes \yes \relax
\supported {usedlist} \nop \yes \yes
\supported {uses_font} \nop \yes \yes
+\supported {vertical_break} \nop \yes \relax
\supported {vpack} \nop \yes \yes
\supported {write} \yes \yes \relax
\LL
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex.tex b/doc/context/sources/general/manuals/luametatex/luametatex.tex
index 63a50d000..4615ea262 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex.tex
@@ -21,6 +21,8 @@
% \tracingonline \zerocount
% \tracingmacros \plusone
+% \enableautoglyphscaling % saves only a few instances ... no gain .. a few pages more
+
% \enabletexdirective{vspacing.experimental}
% \nopdfcompression