diff options
49 files changed, 673 insertions, 230 deletions
diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf Binary files differindex 92efb55a1..a67ee0589 100644 --- a/doc/context/documents/general/manuals/luatex.pdf +++ b/doc/context/documents/general/manuals/luatex.pdf diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf Binary files differindex cb6a5f40e..e4704014d 100644 --- a/doc/context/documents/general/qrcs/setup-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf Binary files differindex b1fbd0426..b175ed75d 100644 --- a/doc/context/documents/general/qrcs/setup-de.pdf +++ b/doc/context/documents/general/qrcs/setup-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf Binary files differindex cb4dc61e3..3e39f95c8 100644 --- a/doc/context/documents/general/qrcs/setup-en.pdf +++ b/doc/context/documents/general/qrcs/setup-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf Binary files differindex f3766c2e1..8e6404ba3 100644 --- a/doc/context/documents/general/qrcs/setup-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf Binary files differindex a036e93ec..0059b48b6 100644 --- a/doc/context/documents/general/qrcs/setup-it.pdf +++ b/doc/context/documents/general/qrcs/setup-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf Binary files differindex d1fbaff54..009cd73e5 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf Binary files differindex 11812daf3..564fe5b12 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-de.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf Binary files differindex c1bde0dea..2516c75ab 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-en.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf Binary files differindex 3dd03f2bf..a589d7488 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf Binary files differindex e3d15e2f1..33c96190f 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-it.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf Binary files differindex b5924c749..e5e14316f 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf Binary files differindex 04e97eac8..6bb619ae9 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf Binary files differindex 83a8cc079..887f2cc0a 100644 --- a/doc/context/documents/general/qrcs/setup-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf Binary files differindex 1182375ab..0ddab643a 100644 --- a/doc/context/documents/general/qrcs/setup-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-ro.pdf diff --git a/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex b/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex index afae43e45..3ac82afb5 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-enhancements.tex @@ -55,6 +55,7 @@ There are three new primitives to test the version of \LUATEX: \starttabulate[|l|pl|pl|] \DB primitive \BC explanation \BC value \NC \NR +\TB[small,samepage] \NC \type {\luatexbanner} \NC the banner reported on the command line \NC \luatexbanner \NC \NR \NC \type {\luatexversion} \NC a combination of major and minor number \NC \the\luatexversion \NC \NR \NC \type {\luatexrevision} \NC the revision number, the current value is \NC \luatexrevision \NC \NR diff --git a/doc/context/sources/general/manuals/luatex/luatex-firstpage.tex b/doc/context/sources/general/manuals/luatex/luatex-firstpage.tex new file mode 100644 index 000000000..aef3902a5 --- /dev/null +++ b/doc/context/sources/general/manuals/luatex/luatex-firstpage.tex @@ -0,0 +1,32 @@ +\startcomponent luatex-firstpage + +\startstandardmakeup + + \start + \raggedleft + \definedfont[Bold*default at 48pt] + \setupinterlinespace + \blue Lua\TeX \endgraf Reference \endgraf Manual \endgraf + \stop + + \vfill + + \definedfont[Bold*default at 12pt] + + \starttabulate[|l|l|] + \NC copyright \EQ Lua\TeX\ development team \NC \NR + \NC more info \EQ www.luatex.org \NC \NR + \NC version \EQ \currentdate \doifsomething{\documentvariable{snapshot}}{(snapshot \documentvariable{snapshot})} \NC \NR + \stoptabulate + +\stopstandardmakeup + +\setupbackgrounds + [leftpage] + [setups=pagenumber:left] + +\setupbackgrounds + [rightpage] + [setups=pagenumber:right] + +\stopcomponent diff --git a/doc/context/sources/general/manuals/luatex/luatex-fonts.tex b/doc/context/sources/general/manuals/luatex/luatex-fonts.tex index 57a795b06..d3932a30b 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-fonts.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-fonts.tex @@ -23,6 +23,7 @@ The top|-|level keys in the table are as follows: \starttabulate[|l|c|c|c|l|pl|] \DB key \BC vf \BC tfm \BC used \BC value type \BC description \NC \NR +\TB[small,samepage] \NC \type{name} \NC yes \NC yes \NC yes \NC string \NC metric (file) name \NC \NR \NC \type{area} \NC no \NC yes \NC yes \NC string \NC (directory) location, typically empty \NC \NR \NC \type{used} \NC no \NC yes \NC yes \NC boolean \NC indicates usage (initial: false) \NC \NR @@ -125,6 +126,7 @@ possibilities: \starttabulate[|Tc|c|Tc|c|Tc|c|Tc|c|] \DB \# \BC dir \BC \# \BC dir \BC \# \BC dir \BC \# \BC dir \NC \NR +\TB[small,samepage] \NC 0 \NC LT \NC 4 \NC RT \NC 8 \NC TT \NC 12 \NC BT \NC \NR \NC 1 \NC LL \NC 5 \NC RL \NC 9 \NC TL \NC 13 \NC BL \NC \NR \NC 2 \NC LB \NC 6 \NC RB \NC 10 \NC TB \NC 14 \NC BB \NC \NR @@ -146,6 +148,7 @@ The names and their internal remapping are: \starttabulate[|l|c|] \DB name \BC remapping \NC \NR +\TB[small,samepage] \NC \type {slant} \NC 1 \NC \NR \NC \type {space} \NC 2 \NC \NR \NC \type {space_stretch} \NC 3 \NC \NR @@ -195,6 +198,7 @@ The following top|-|level keys can be present inside a character hash: \starttabulate[|l|c|c|c|l|p|] \DB key \BC vf \BC tfm \BC used \BC type \BC description \NC\NR +\TB[small,samepage] \NC \type{width} \NC yes \NC yes \NC yes \NC number \NC character's width, in sp (default 0) \NC\NR \NC \type{height} \NC no \NC yes \NC yes \NC number \NC character's height, in sp (default 0) \NC\NR \NC \type{depth} \NC no \NC yes \NC yes \NC number \NC character's depth, in sp (default 0) \NC\NR @@ -247,6 +251,7 @@ very simple: \starttabulate[|l|l|p|] \DB key \BC type \BC description \NC\NR +\TB[small,samepage] \NC \type{top} \NC number \NC top character index \NC\NR \NC \type{mid} \NC number \NC middle character index \NC\NR \NC \type{bot} \NC number \NC bottom character index \NC\NR @@ -258,6 +263,7 @@ Each of those components is itself a hash of up to five keys: \starttabulate[|l|l|p|] \DB key \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{glyph} \NC number \NC The character index. Note that this is an encoding number, not a name. \NC \NR \NC \type{extender} \NC number \NC One (1) if this part is repeatable, zero (0) otherwise. \NC \NR \NC \type{start} \NC number \NC The maximum overlap at the starting side (in scaled points). \NC \NR @@ -279,6 +285,7 @@ two fields: \starttabulate[|l|l|p|] \DB key \BC type \BC description \NC \NR +\TB[small,samepage] \NC \type{type} \NC number \NC the type of this ligature command, default 0 \NC \NR \NC \type{char} \NC number \NC the character index of the resultant ligature \NC \NR \stoptabulate @@ -295,6 +302,7 @@ point will become the next \quote {left}. \starttabulate[|l|c|l|l|] \DB textual (Knuth) \BC number \BC string \BC result \NC\NR +\TB[small,samepage] \NC \type{l + r =: n} \NC 0 \NC \type{=:} \NC \type{|n} \NC\NR \NC \type{l + r =:| n} \NC 1 \NC \type{=:|} \NC \type{|nr} \NC\NR \NC \type{l + r |=: n} \NC 2 \NC \type{|=:} \NC \type{|ln} \NC\NR @@ -321,6 +329,7 @@ inclusion mechanism will attempt to add the needed font object definitions to th \starttabulate[|l|p|] \DB value \BC description \NC\NR +\TB[small,samepage] \NC \type{real} \NC this is a base font \NC\NR \NC \type{virtual} \NC this is a virtual font \NC\NR \stoptabulate @@ -364,6 +373,7 @@ encoding options. \starttabulate[|l|p|] \DB value \BC description \NC \NR +\TB[small,samepage] \NC \type{type1} \NC this is a \POSTSCRIPT\ \TYPEONE\ font \NC \NR \NC \type{type3} \NC this is a bitmapped (\PK) font \NC \NR \NC \type{truetype} \NC this is a \TRUETYPE\ or \TRUETYPE|-|based \OPENTYPE\ font \NC \NR @@ -374,6 +384,7 @@ Valid values for the \type {embedding} variable are: \starttabulate[|l|p|] \DB value \BC description \NC \NR +\TB[small,samepage] \NC \type{no} \NC don't embed the font at all \NC \NR \NC \type{subset} \NC include and atttempt to subset the font \NC \NR \NC \type{full} \NC include this font in its entirety \NC \NR @@ -463,6 +474,7 @@ parameters to that command. The allowed commands and their arguments are: \starttabulate[|l|l|l|p|] \DB command \BC arguments \BC type \BC description \NC \NR +\TB[small,samepage] \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 @@ -479,7 +491,9 @@ parameters to that command. The allowed commands and their arguments are: \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 -\NC \type{lua} \NC 1 \NC string \NC execute a \LUA\ script (at \type {\latelua} time) \NC \NR +\NC \type{lua} \NC 1 \NC string, + function \NC execute a \LUA\ script when the glyph is embedded; in case of a + function it gets the font id and character code passed \NC \NR \NC \type{image} \NC 1 \NC image \NC output an image (the argument can be either an \type {<image>} variable or an \type {image_spec} table) \NC \NR \NC \type{comment} \NC any \NC any \NC the arguments of this command are ignored \NC \NR @@ -499,6 +513,7 @@ from \PDFTEX. \starttabulate[|l|p|] \DB mode \BC description \NC \NR +\TB[small,samepage] \NC \type {origin} \NC enter page mode and set the position \NC \NR \NC \type {page} \NC enter page mode \NC \NR \NC \type {text} \NC enter text mode \NC \NR diff --git a/doc/context/sources/general/manuals/luatex/luatex-introduction.tex b/doc/context/sources/general/manuals/luatex/luatex-introduction.tex index 9c41f7875..911a30653 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-introduction.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-introduction.tex @@ -47,7 +47,7 @@ The organization of the source code is adapted so that it can glue all these components together. We continue cleaning up side effects of the accumulated code in \TEX\ engines (especially code that is not needed any longer). -\startitemize[packed] +\startitemize % [packed] \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 @@ -118,6 +118,11 @@ we don't want to bloat the binary and also don't want to add more hard coded solutions. After all, with \LUA\ you can extend the core functionality. The less dependencies, the better. +You might find \LUA\ helpers that are not yet documented. These are considered +experimental, although when you encounter them in a \CONTEXT\ version that has +been around for a while you can assume that they will stay. Of course it can just +be that we forgot to document them yet. + The \TEXLIVE\ version is to be considered the current stable version. Any version between the yearly \TEXLIVE\ releases are to be considered beta and in the repository end up as trunk releases. We have an experimental branch that we use diff --git a/doc/context/sources/general/manuals/luatex/luatex-languages.tex b/doc/context/sources/general/manuals/luatex/luatex-languages.tex index c469c9944..3254fbfdb 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-languages.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-languages.tex @@ -195,6 +195,7 @@ indicate a start or end. You can omit the last set from the test by setting \starttabulate[|l|l|] \DB value \BC behaviour \NC \NR +\TB[small,samepage] \NC \type{0} \NC not strict \NC \NR \NC \type{1} \NC strict start \NC \NR \NC \type{2} \NC strict end \NC \NR @@ -205,6 +206,7 @@ The word start is determined as follows: \starttabulate[|l|l|] \DB node \BC behaviour \NC \NR +\TB[small,samepage] \BC boundary \NC yes when wordboundary \NC \NR \BC hlist \NC when hyphenationbounds 1 or 3 \NC \NR \BC vlist \NC when hyphenationbounds 1 or 3 \NC \NR @@ -221,6 +223,7 @@ The word end is determined as follows: \starttabulate[|l|l|] \DB node \BC behaviour \NC \NR +\TB[small,samepage] \BC boundary \NC yes \NC \NR \BC glyph \NC yes when different language \NC \NR \BC glue \NC yes \NC \NR @@ -490,6 +493,7 @@ resulting from an \type {\exhyphenchar}: \starttabulate[|c|l|l|] \DB mode \BC automatic disc \type{-} \BC explicit disc \type{\-} \NC \NR +\TB[small,samepage] \NC \type{0} \NC \type {\exhyphenpenalty} \NC \type {\exhyphenpenalty} \NC \NR \NC \type{1} \NC \type {\hyphenpenalty} \NC \type {\hyphenpenalty} \NC \NR \NC \type{2} \NC \type {\exhyphenpenalty} \NC \type {\hyphenpenalty} \NC \NR @@ -544,6 +548,7 @@ can always be generated from the values. Here are a few examples: \starttabulate[|l|l|l|] \DB value \BC implied key (input) \BC effect \NC\NR +\TB[small,samepage] \NC \type {ta-ble} \NC table \NC \type {ta\-ble} ($=$ \type {ta\discretionary{-}{}{}ble}) \NC\NR \NC \type {ba{k-}{}{c}ken} \NC backen \NC \type {ba\discretionary{k-}{}{c}ken} \NC\NR \stoptabulate @@ -776,6 +781,7 @@ Here is that nested solution again, in a different representation: \starttabulate[|l|c|c|c|c|c|c|] \DB \BC pre \BC \BC post \BC \BC replace \BC \NC \NR +\TB[small,samepage] \NC topdisc \NC \type {f-} \NC (1) \NC \NC sub 1 \NC \NC sub 2 \NC \NR \NC sub 1 \NC \type {f-} \NC (2) \NC \type {i} \NC (3) \NC \type {<fi>} \NC (4) \NC \NR \NC sub 2 \NC \type {<ff>-} \NC (5) \NC \type {i} \NC (6) \NC \type {<ffi>} \NC (7) \NC \NR @@ -812,6 +818,7 @@ pair is as follows: \starttabulate[|l|c|c|] \DB field \BC description \NC \NC \NR +\TB[small,samepage] \NC \type {disc1.pre} \NC \type {f-} \NC (1) \NC \NR \NC \type {disc1.post} \NC \type {<fi>} \NC (4) \NC \NR \NC \type {disc1.replace} \NC \type {<ffi>} \NC (7) \NC \NR diff --git a/doc/context/sources/general/manuals/luatex/luatex-lua.tex b/doc/context/sources/general/manuals/luatex/luatex-lua.tex index 0c9119240..64dcb42a4 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-lua.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-lua.tex @@ -146,6 +146,7 @@ in order. \starttabulate[|l|l|] \DB library \BC functions \NC \NR + \TB[small,samepage] \NC \type {os} \NC \type {execute} \type {exec} \type {spawn} \type {setenv} \type {rename} \type {remove} \type {tmpdir} \NC \NR \NC \type {io} \NC \type {popen} \type {output} \type {tmpfile} \NC \NR \NC \type {lfs} \NC \type {rmdir} \type {mkdir} \type {chdir} \type {lock} \type {touch} \NC \NR diff --git a/doc/context/sources/general/manuals/luatex/luatex-math.tex b/doc/context/sources/general/manuals/luatex/luatex-math.tex index a0e3936c7..6b037f735 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-math.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-math.tex @@ -194,18 +194,19 @@ The following new primitives are compatible with \XETEX: % somewhat fuzzy: \starttabulate[|l|l|r|c|l|r|] -\DB primitive \BC min \BC max \BC \kern 2em \BC min \BC max \NC \NR -\NC \type {\Umathchardef} \NC 0+0+0 \NC 7+FF+10FFFF\rlap{\high{1}} \NC \NC \NC \NC \NR -\NC \type {\Umathcharnumdef}\rlap{\high{5}} \NC -80000000 \NC 7FFFFFFF\rlap{\high{3}} \NC \NC \NC \NC \NR -\NC \type {\Umathcode} \NC 0 \NC 10FFFF \NC = \NC 0+0+0 \NC 7+FF+10FFFF\rlap{\high{1}} \NC \NR -\NC \type {\Udelcode} \NC 0 \NC 10FFFF \NC = \NC 0+0 \NC FF+10FFFF\rlap{\high{2}} \NC \NR -\NC \type {\Umathchar} \NC 0+0+0 \NC 7+FF+10FFFF \NC \NC \NC \NC \NR -\NC \type {\Umathaccent} \NC 0+0+0 \NC 7+FF+10FFFF\rlap{\high{2,4}} \NC \NC \NC \NC \NR -\NC \type {\Udelimiter} \NC 0+0+0 \NC 7+FF+10FFFF\rlap{\high{2}} \NC \NC \NC \NC \NR -\NC \type {\Uradical} \NC 0+0 \NC FF+10FFFF\rlap{\high{2}} \NC \NC \NC \NC \NR -\NC \type {\Umathcharnum} \NC -80000000 \NC 7FFFFFFF\rlap{\high{3}} \NC \NC \NC \NC \NR -\NC \type {\Umathcodenum} \NC 0 \NC 10FFFF \NC = \NC -80000000 \NC 7FFFFFFF\rlap{\high{3}} \NC \NR -\NC \type {\Udelcodenum} \NC 0 \NC 10FFFF \NC = \NC -80000000 \NC 7FFFFFFF\rlap{\high{3}} \NC \NR +\DB primitive \BC min \BC max \BC \kern 2em \BC min \BC max \NC \NR +\TB[small,samepage] +\NC \type {\Umathchardef} \NC 0+0+0 \NC 7+FF+10FFFF \NC \NC \NC \NC \NR +\NC \type {\Umathcharnumdef}\rlap{\high{5}} \NC -80000000 \NC 7FFFFFFF \NC \NC \NC \NC \NR +\NC \type {\Umathcode} \NC 0 \NC 10FFFF \NC = \NC 0+0+0 \NC 7+FF+10FFFF \NC \NR +\NC \type {\Udelcode} \NC 0 \NC 10FFFF \NC = \NC 0+0 \NC FF+10FFFF \NC \NR +\NC \type {\Umathchar} \NC 0+0+0 \NC 7+FF+10FFFF \NC \NC \NC \NC \NR +\NC \type {\Umathaccent} \NC 0+0+0 \NC 7+FF+10FFFF \NC \NC \NC \NC \NR +\NC \type {\Udelimiter} \NC 0+0+0 \NC 7+FF+10FFFF \NC \NC \NC \NC \NR +\NC \type {\Uradical} \NC 0+0 \NC FF+10FFFF \NC \NC \NC \NC \NR +\NC \type {\Umathcharnum} \NC -80000000 \NC 7FFFFFFF \NC \NC \NC \NC \NR +\NC \type {\Umathcodenum} \NC 0 \NC 10FFFF \NC = \NC -80000000 \NC 7FFFFFFF \NC \NR +\NC \type {\Udelcodenum} \NC 0 \NC 10FFFF \NC = \NC -80000000 \NC 7FFFFFFF \NC \NR \stoptabulate Specifications typically look like: @@ -215,29 +216,27 @@ Specifications typically look like: \Umathcode 123="1"0"789 \stoptyping -Note 1: The new primitives that deal with delimiter|-|style objects do not set up a +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 \type {\Umathoperatorsize} parameter (more information can be found in a following section). -Note 2: For these three primitives, all information is packed into a single -signed integer. For the first two (\type {\Umathcharnum} and \type -{\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 for math families 128--255 are actually negative). -For \type {\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 the two- and three|-|value commands, so -unless you know exactly what you are doing and absolutely require the speedup -resulting from the faster input scanning, it is better to use the verbose -commands instead. - -Note 3: The \type {\Umathaccent} command accepts optional keywords to control -various details regarding math accents. See \in {section} [mathacc] below for -details. - -New primitives that exist in \LUATEX\ only (all of these will be explained -in following sections): +For some of these primitives, all information is packed into a single signed +integer. For the first two (\type {\Umathcharnum} and \type {\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 +for math families 128--255 are actually negative. For \type {\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 +the two- and three|-|value commands, so unless you know exactly what you are +doing and absolutely require the speedup resulting from the faster input +scanning, it is better to use the verbose commands instead. + +The \type {\Umathaccent} command accepts optional keywords to control various +details regarding math accents. See \in {section} [mathacc] below for details. + +There are more new primitives and all of these will be explained in following +sections: \starttabulate[|l|l|] \DB primitive \BC value range (in hex) \NC \NR @@ -295,6 +294,8 @@ we get this: \startbuffer[demo] \starttabulate +\DB style \BC example \NC \NR +\TB[small,samepage] \NC default \NC $b_{x=xx}^{x=xx}$ \NC \NR \NC script \NC $b_{\scriptstyle x=xx}^{\scriptstyle x=xx}$ \NC \NR \NC crampedscript \NC $b_{\crampedscriptstyle x=xx}^{\crampedscriptstyle x=xx}$ \NC \NR @@ -446,13 +447,12 @@ Besides the parameters below, \LUATEX\ also looks at the \quote {space} font dimension parameter. For math fonts, this should be set to zero. \def\MathLine#1#2#3#4#5% - {\TB - \NC \llap{\high{\tx #2\enspace}}\ttbf \string #1 \NC #5 \NC \NR - \NC \tx #3 \NC #4 \NC \NR} + {\TB[small,samepage] + \NC \llap{\high{\tx #2\enspace}}\ttbf \string #1 \NC \tt #5 \NC \NR + \NC \tx #3 \NC \tt #4 \NC \NR} \starttabulate[|l|l|] \DB variable / style \BC tfm / opentype \NC \NR -\TB[small,samepage] \MathLine{\Umathaxis} {} {} {AxisHeight} {axis_height} \MathLine{\Umathoperatorsize} {6} {D, D'} {DisplayOperatorMinHeight} {\emdash} \MathLine{\Umathfractiondelsize} {9} {D, D'} {FractionDelimiterDisplayStyleSize} {delim1} diff --git a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex index 37d557926..16d5477fd 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex @@ -322,6 +322,7 @@ and images are also common. For that reason we also changed the names: \starttabulate[|l|l|] \DB new name \BC old name \NC \NR +\TB[small,samepage] \NC \type {\saveboxresource} \NC \type {\pdfxform} \NC \NR \NC \type {\saveimageresource} \NC \type {\pdfximage} \NC \NR \NC \type {\useboxresource} \NC \type {\pdfrefxform} \NC \NR @@ -1092,6 +1093,7 @@ by \type {\hangindent} and \type {\parshape}. This is controlled by a new parame \starttabulate[|c|c|c|] \DB value \BC \type {\hangindent} \BC \type {\parshape} \NC \NR +\TB[small,samepage] \BC \type{0} \NC normal \NC normal \NC \NR \BC \type{1} \NC mirrored \NC normal \NC \NR \BC \type{2} \NC normal \NC mirrored \NC \NR diff --git a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex index 065342b9b..e0d93d7c3 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex @@ -56,6 +56,7 @@ items. It has only one user-visible field: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{next} \NC node \NC pointer to the first attribute \NC \NR \stoptabulate @@ -68,6 +69,7 @@ defined \quote {attribute} item, whose \type {next} will point to the second \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{next} \NC node \NC pointer to the next attribute \NC \NR \NC \type{number} \NC number \NC the attribute type id \NC \NR \NC \type{value} \NC number \NC the attribute value \NC \NR @@ -84,6 +86,7 @@ present in all nodes regardless of their type, these are: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{next} \NC node \NC the next node in a list, or nil \NC \NR \NC \type{id} \NC number \NC the node's type (\type {id}) number \NC \NR \NC \type{subtype} \NC number \NC the node \type {subtype} identifier \NC \NR @@ -106,6 +109,7 @@ internal magic uses a leading \type {temp} nodes to temporarily store a state. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{list} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{width} \NC number \NC the width of the box \NC \NR @@ -140,6 +144,7 @@ intercepted by a callback. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \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 @@ -153,6 +158,7 @@ intercepted by a callback. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC the insertion class \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{cost} \NC number \NC the penalty associated with this insert \NC \NR @@ -174,6 +180,7 @@ names and both names are equally sensible). \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC unused \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{class} \NC number \NC the mark class \NC \NR @@ -184,6 +191,7 @@ names and both names are equally sensible). \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{adjust} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{head/list} \NC node \NC adjusted material \NC \NR @@ -196,6 +204,7 @@ its internal link structure is correct, otherwise an error may be result. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{disc} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{pre} \NC node \NC pointer to the pre|-|break text \NC \NR @@ -231,6 +240,7 @@ freeing it again might crash \LUATEX). \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{math} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{surround} \NC number \NC width of the \type {\mathsurround} kern \NC \NR @@ -248,6 +258,7 @@ called a \type {glue_spec}, and it has the following accessible fields: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{width} \NC number \NC the horizontal or vertical displacement \NC \NR \NC \type{stretch} \NC number \NC extra (positive) displacement or stretch amount \NC \NR \NC \type{stretch_order} \NC number \NC factor applied to stretch amount \NC \NR @@ -281,6 +292,7 @@ is only a few memory words larger than a spec). \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{glue} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{leader} \NC node \NC pointer to a box or rule for leaders \NC \NR @@ -298,6 +310,7 @@ a \type {userskip} with subtype zero). \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{kern} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{kern} \NC number \NC fixed horizontal or vertical advance \NC \NR @@ -307,6 +320,7 @@ a \type {userskip} with subtype zero). \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{penalty} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{penalty} \NC number \NC the penalty value \NC \NR @@ -320,6 +334,7 @@ accumulation of \type {club}, \type{widow} and other relevant penalties. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC bitfield \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 @@ -347,6 +362,7 @@ bits for the \type {subtype} field are: \starttabulate[|c|l|] \DB bit \BC meaning \NC \NR +\TB[small,samepage] \NC 0 \NC character \NC \NR \NC 1 \NC ligature \NC \NR \NC 2 \NC ghost \NC \NR @@ -381,6 +397,7 @@ and font id and returns true when a glyph or disc node references that font. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{boundary} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{value} \NC number \NC values 0--255 are reserved \NC \NR @@ -393,6 +410,7 @@ This node relates to the \type {\noboundary}, \type {\boundary}, \type \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{pen_inter} \NC number \NC local interline penalty (from \type {\localinterlinepenalty}) \NC \NR \NC \type{pen_broken} \NC number \NC local broken penalty (from \type {\localbrokenpenalty}) \NC \NR @@ -411,6 +429,7 @@ error may be result. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{dir} \NC string \NC the direction (but see below) \NC \NR \NC \type{level} \NC number \NC nesting level of this direction whatsit \NC \NR @@ -445,6 +464,7 @@ or popped from the direction stack. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{margin_kern} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{width} \NC number \NC the advance of the kern \NC \NR @@ -470,6 +490,7 @@ The \type {next} and \type {prev} fields for these subnodes are unused. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{char} \NC number \NC the character index \NC \NR \NC \type{fam} \NC number \NC the family number \NC \NR @@ -484,6 +505,7 @@ conversion (its sole function is to suppress a following italic correction). \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{head/list} \NC node \NC list of nodes \NC \NR \stoptabulate @@ -504,6 +526,7 @@ before, the \type {next} and \type {prev} fields are unused. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{small_char} \NC number \NC character index of base character \NC \NR \NC \type{small_fam} \NC number \NC family number of base character \NC \NR @@ -526,6 +549,7 @@ Some noads have an option field. The values in this bitset are common: \starttabulate[|l|r|] \DB meaning \BC bits \NC \NR +\TB[small,samepage] \NC set \NC \type{0x08} \NC \NR \NC internal \NC \type{0x00} + \type{0x08} \NC \NR \NC internal \NC \type{0x01} + \type{0x08} \NC \NR @@ -544,6 +568,7 @@ Some noads have an option field. The values in this bitset are common: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{noad} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{nucleus} \NC kernel node \NC base \NC \NR @@ -556,6 +581,7 @@ Some noads have an option field. The values in this bitset are common: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{accent} \NC \NR \NC \type{nucleus} \NC kernel node \NC base \NC \NR \NC \type{sub} \NC kernel node \NC subscript \NC \NR @@ -569,6 +595,7 @@ Some noads have an option field. The values in this bitset are common: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{style} \NC string \NC contains the style \NC \NR \stoptabulate @@ -580,6 +607,7 @@ be prefixed by \type {cramped}. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{display} \NC node \NC list of display size alternatives \NC \NR \NC \type{text} \NC node \NC list of text size alternatives \NC \NR @@ -595,6 +623,7 @@ structure is correct, otherwise an error may be result. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{radical} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{nucleus} \NC kernel node \NC base \NC \NR @@ -614,6 +643,7 @@ link structure is correct, otherwise an error may be result. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{width} \NC number \NC (optional) width of the fraction \NC \NR \NC \type{num} \NC kernel node \NC numerator \NC \NR @@ -632,6 +662,7 @@ may be result. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{subtype} \NC number \NC \showsubtypes{fence} \NC \NR \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{delim} \NC delimiter node \NC delimiter specification \NC \NR @@ -665,6 +696,7 @@ Whatsit nodes come in many subtypes that you can ask for by running \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{stream} \NC number \NC \TEX's stream id number \NC \NR \NC \type{name} \NC string \NC file name \NC \NR @@ -676,6 +708,7 @@ Whatsit nodes come in many subtypes that you can ask for by running \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{stream} \NC number \NC \TEX's stream id number \NC \NR \NC \type{data} \NC table \NC a table representing the token list to be written \NC \NR @@ -685,6 +718,7 @@ Whatsit nodes come in many subtypes that you can ask for by running \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{stream} \NC number \NC \TEX's stream id number \NC \NR \stoptabulate @@ -697,6 +731,7 @@ will simply step over such whatsits without ever looking at the contents. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{user_id} \NC number \NC id number \NC \NR \NC \type{type} \NC number \NC type of the value \NC \NR @@ -712,6 +747,7 @@ instead of \type {108}). \starttabulate[|r|c|p|] \DB value \BC meaning \BC explanation \NC \NR +\TB[small,samepage] \NC 97 \NC a \NC list of attributes (a node list) \NC \NR \NC 100 \NC d \NC a \LUA\ number \NC \NR \NC 108 \NC l \NC a \LUA\ value (table, number, boolean, etc) \NC \NR @@ -724,6 +760,7 @@ instead of \type {108}). \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \stoptabulate @@ -731,6 +768,7 @@ instead of \type {108}). \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{data} \NC string \NC data to execute \NC \NR \NC \type{string} \NC string \NC data to execute \NC \NR @@ -747,6 +785,7 @@ The difference between \type {data} and \type {string} is that on assignment, th \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{data} \NC string \NC the \type {\special} information \NC \NR \stoptabulate @@ -757,6 +796,7 @@ The difference between \type {data} and \type {string} is that on assignment, th \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{mode} \NC number \NC the \quote {mode} setting of this literal \NC \NR \NC \type{data} \NC string \NC the \type {\pdfliteral} information \NC \NR @@ -766,6 +806,7 @@ Possible mode values are: \starttabulate[|l|p|] \DB value \BC keyword \NC \NR +\TB[small,samepage] \NC 0 \NC \type{origin} \NC \NR \NC 1 \NC \type{page} \NC \NR \NC 2 \NC \type{direct} \NC \NR @@ -781,6 +822,7 @@ what you generate. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{objnum} \NC number \NC the referenced \PDF\ object number \NC \NR \stoptabulate @@ -789,6 +831,7 @@ what you generate. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{width} \NC number \NC the width (not used in calculations) \NC \NR \NC \type{height} \NC number \NC the height (not used in calculations) \NC \NR @@ -801,6 +844,7 @@ what you generate. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{width} \NC number \NC the width (not used in calculations) \NC \NR \NC \type{height} \NC number \NC the height (not used in calculations) \NC \NR @@ -814,6 +858,7 @@ what you generate. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC \NC \NR \stoptabulate @@ -821,6 +866,7 @@ what you generate. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{width} \NC number \NC the width (not used in calculations) \NC \NR \NC \type{height} \NC number \NC the height (not used in calculations) \NC \NR @@ -840,6 +886,7 @@ objects. \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{action_type} \NC number \NC the kind of action involved \NC \NR \NC \type{action_id} \NC number or string \NC token list reference or string \NC \NR \NC \type{named_id} \NC number \NC the index of the destination \NC \NR @@ -852,6 +899,7 @@ Valid action types are: \starttabulate[|l|l|] \DB value \BC meaning \NC \NR +\TB[small,samepage] \NC 0 \NC \type{page} \NC \NR \NC 1 \NC \type{goto} \NC \NR \NC 2 \NC \type{thread} \NC \NR @@ -862,6 +910,7 @@ Valid window types are: \starttabulate[|l|l|] \DB value \BC meaning \NC \NR +\TB[small,samepage] \NC 0 \NC \type{notset} \NC \NR \NC 1 \NC \type{new} \NC \NR \NC 2 \NC \type{nonew} \NC \NR @@ -871,6 +920,7 @@ Valid window types are: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{width} \NC number \NC the width (not used in calculations) \NC \NR \NC \type{height} \NC number \NC the height (not used in calculations) \NC \NR @@ -885,6 +935,7 @@ Valid window types are: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{width} \NC number \NC the width (not used in calculations) \NC \NR \NC \type{height} \NC number \NC the height (not used in calculations) \NC \NR @@ -899,6 +950,7 @@ Valid window types are: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC \NC \NR \stoptabulate @@ -906,6 +958,7 @@ Valid window types are: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{stack} \NC number \NC colorstack id number \NC \NR \NC \type{command} \NC number \NC command to execute \NC \NR @@ -916,6 +969,7 @@ Valid window types are: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \NC \type{data} \NC string \NC data \NC \NR \stoptabulate @@ -924,6 +978,7 @@ Valid window types are: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \stoptabulate @@ -931,6 +986,7 @@ Valid window types are: \starttabulate[|l|l|p|] \DB field \BC type \BC explanation \NC \NR +\TB[small,samepage] \NC \type{attr} \NC node \NC list of attributes \NC \NR \stoptabulate @@ -1875,6 +1931,7 @@ Some accessors are used frequently and for these we provide more efficient helpe \starttabulate[|l|p|] \DB function \BC explanation \NC \NR +\TB[small,samepage] \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{getboth} \NC returns the next and prev pointer of a node \NC \NR @@ -1921,6 +1978,7 @@ consistency. You can of course always define additional accessor using \type \starttabulate[|l|c|c|] \DB function \BC node \BC direct \NC \NR +\TB[small,samepage] %NC \type {do_ligature_n} \NC \yes \NC \yes \NC \NR % was never documented and experimental \NC \type {check_discretionaries}\NC \yes \NC \yes \NC \NR \NC \type {copy_list} \NC \yes \NC \yes \NC \NR diff --git a/doc/context/sources/general/manuals/luatex/luatex-preamble.tex b/doc/context/sources/general/manuals/luatex/luatex-preamble.tex new file mode 100644 index 000000000..036dd49fc --- /dev/null +++ b/doc/context/sources/general/manuals/luatex/luatex-preamble.tex @@ -0,0 +1,85 @@ +% language=uk + +\environment luatex-style + +\startcomponent luatex-preamble + +\startchapter[reference=preamble,title={Preamble}] + +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 +we will refer to concepts that we assume to be known or that might be explained +later. + +The average user doesn't need to know much about what is in this manual. For +instance fonts and languages are normally dealt with in the macro package that +you use. Messing around with node lists is also often not really needed at the +user level. If you do mess around, you'd better know what you're dealing with. +Reading \quotation {The \TEX\ Book} by Donald Knuth is a good investment of time +then also because it's good to know where it all started. A more summarizing +overview is given by \quotation {\TEX\ by Topic} by Victor Eijkhout. You might +want to peek in \quotation {The \ETEX\ manual} and documentation about \PDFTEX. + +But \unknown\ if you're here because of \LUA, then all you need to know is that +you can call it from within a run. The macro package that you use probably will +provide a few wrapper mechanisms but the basic command that does the job is: + +\starttyping +\directlua{tex.print("Hi there")} +\stoptyping + +You can put code between curly braces but if it's a lot you can also put it in a +file and load that file with the usual \LUA\ commands. + +If you still decide to read on, then it's good to know what nodes are, so we do a +quick introduction here. If you input this text: + +\starttyping +Hi There +\stoptyping + +eventually we will get a linked lists of nodes, which in \ASCII\ art looks like: + +\starttyping +H <=> i <=> [glue] <=> T <=> h <=> e <=> r <=> e +\stoptyping + +When we have a paragraph, we actually get something: + +\starttyping +[localpar] <=> H <=> i <=> [glue] <=> T <=> h <=> e <=> r <=> e <=> [glue] +\stoptyping + +Each character becomes a so called glyph node, a record with properties like the +current font, the character code and the current language. Spaces become glue +nodes. There are many node types that we will discuss later. Each node points +back to a previous node or next node, given that these exist. + +It's also good to know beforehand that \TEX\ is basically centered around +creating paragraphs and pages. The par builder takes a list and breaks it into +lines. We turn horizontal material into vertical. Lines are so called boxes and +can be separated by glue, penalties and more. The page builder accumulates lines +and when feasible triggers an output routine that will take the list so far. +Constructing the actual page is not part of \TEX\ but done using primitives that +permit manipulation of boxes. The result is handled back to \TEX\ and flushed to +a (often \PDF) file. + +The \LUATEX\ engine provides hooks for \LUA\ code at nearly every reasonable +point in the process: collecting content, hyphenating, applying font features, +breaking into lines, etc. This means that you can overload \TEX's natural +behaviour, which still is the benchmark. When we refer to \quote {callbacks} we +means these hooks. + +Where plain \TEX\ is basically a basic framework for writing a specific style, +macro packages like \CONTEXT\ and \LATEX\ provide the user a whole lot of +additional tools to make documents look good. They hide the dirty details of font +management, language demands, turning structure into typeset results, wrapping +pages, including images, and so on. You should be aware of the fact that when you +hook in your own code to manipulate lists, this can interfere with the macro +package that you use. + +For now this should be enough to enable you to understand the next chapters. + +\stopchapter + +\stopcomponent diff --git a/doc/context/sources/general/manuals/luatex/luatex-statistics.tex b/doc/context/sources/general/manuals/luatex/luatex-statistics.tex new file mode 100644 index 000000000..99941a8ab --- /dev/null +++ b/doc/context/sources/general/manuals/luatex/luatex-statistics.tex @@ -0,0 +1,13 @@ +% language=uk + +\environment luatex-style + +\startcomponent luatex-statistics + +\startchapter[title={Statistics}] + + \showfontusage + +\stopchapter + +\stopcomponent diff --git a/doc/context/sources/general/manuals/luatex/luatex-style.tex b/doc/context/sources/general/manuals/luatex/luatex-style.tex index a7aae444a..eedf05aab 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-style.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-style.tex @@ -2,6 +2,10 @@ % todo: use \useMPlibrary[lua] +\enabletrackers[fonts.usage] + +\usemodule[fonts-statistics] + \setuplayout [height=middle, width=middle, @@ -102,51 +106,13 @@ \definecolor[keptcolor] [b=.5] \definecolor[othercolor][r=.5,g=.5] -\usebodyfont[lucidaot] -\usebodyfont[pagella] -\usebodyfont[cambria] -%usebodyfont[dejavu] -\usebodyfont[modern] % we need this in examples so we predefine - -% \doifmodeelse {atpragma} { -% -% % \setupbodyfont -% % [lucidaot,10pt] -% -% \setupbodyfont -% [dejavu,10pt] -% -% \setuphead [chapter] [style=\bfd] -% \setuphead [section] [style=\bfb] -% \setuphead [subsection] [style=\bfa] -% \setuphead [subsubsection][style=\bf] -% -% } { -% -% \definetypeface[mainfacenormal] [ss][sans] [iwona] [default] -% \definetypeface[mainfacenormal] [rm][serif][palatino] [default] -% \definetypeface[mainfacenormal] [tt][mono] [modern] [default][rscale=1.1] -% \definetypeface[mainfacenormal] [mm][math] [iwona] [default] -% -% \definetypeface[mainfacemedium] [ss][sans] [iwona-medium][default] -% \definetypeface[mainfacemedium] [rm][serif][palatino] [default] -% \definetypeface[mainfacemedium] [tt][mono] [modern] [default][rscale=1.1] -% \definetypeface[mainfacemedium] [mm][math] [iwona-medium][default] -% -% \setupbodyfont -% [mainfacenormal,10pt] -% -% \setuphead [chapter] [style=\mainfacemedium\bfd] -% \setuphead [section] [style=\mainfacemedium\bfb] -% \setuphead [subsection] [style=\mainfacemedium\bfa] -% \setuphead [subsubsection][style=\mainfacemedium\bf] -% -% } - -\writestatus{luatex manual}{we assume that dejavu math is available} - -\setupbodyfont % assumes dejavu-math - [dejavu,10pt] +\writestatus{luatex manual}{} +\writestatus{luatex manual}{defining lucodaot} \usebodyfont [lucidaot] +\writestatus{luatex manual}{defining pagella} \usebodyfont [pagella] +\writestatus{luatex manual}{defining cambria} \usebodyfont [cambria] +\writestatus{luatex manual}{defining modern} \usebodyfont [modern] +\writestatus{luatex manual}{defining dejavu} \setupbodyfont[dejavu,10pt] +\writestatus{luatex manual}{} \setuphead [chapter] [align={flushleft,broad},style=\bfd] \setuphead [section] [align={flushleft,broad},style=\bfb] @@ -373,9 +339,14 @@ \setuplist [chapter] [style=bold, + before={\testpage[4]\blank}, color=keptcolor] \setuplist + [section] + [before={\testpage[3]}] + +\setuplist [subsection,subsubsection] [margin=3em, width=5em] @@ -395,10 +366,16 @@ % \setupinteractionscreen % [option=bookmark] -\normalexpanded{\definemeasure[spinewidth] [0pt]} -\normalexpanded{\definemeasure[paperwidth] [\the\paperwidth ]} -\normalexpanded{\definemeasure[paperheight][\the\paperheight]} -\normalexpanded{\definemeasure[spreadwidth][\measure{paperwidth}]} +\startbuffer[stylecalculations] + + \normalexpanded{\definemeasure[spinewidth] [0pt]} + \normalexpanded{\definemeasure[paperwidth] [\the\paperwidth ]} + \normalexpanded{\definemeasure[paperheight][\the\paperheight]} + \normalexpanded{\definemeasure[spreadwidth][\measure{paperwidth}]} + +\stopbuffer + +\getbuffer[stylecalculations] \dontcomplain diff --git a/doc/context/sources/general/manuals/luatex/luatex.tex b/doc/context/sources/general/manuals/luatex/luatex.tex index 96ab1460e..29dfdbb8b 100644 --- a/doc/context/sources/general/manuals/luatex/luatex.tex +++ b/doc/context/sources/general/manuals/luatex/luatex.tex @@ -80,4 +80,8 @@ \component luatex-backend \stopbodymatter +\startbackmatter + \component luatex-statistics +\stopbackmatter + \stopdocument diff --git a/metapost/context/base/mpiv/mp-blob.mpiv b/metapost/context/base/mpiv/mp-blob.mpiv index 5bd0a6a75..78fa6bfe9 100644 --- a/metapost/context/base/mpiv/mp-blob.mpiv +++ b/metapost/context/base/mpiv/mp-blob.mpiv @@ -47,8 +47,8 @@ newinternal tracingfollowtext ; tracingfollowtext := 0 ; newinternal autoscaleupfollowtext ; autoscaleupfollowtext := 2 ; newinternal autoscaledownfollowtext ; autoscaledownfollowtext := 0 ; -vardef followtext(expr txt, pth) = - draw image ( +vardef followtext(expr pth, txt) = + image ( mfun_blob_n := mfun_blob_n + 1 ; if mfun_trial_run : draw fullcircle scaled 100bp @@ -114,5 +114,5 @@ vardef followtext(expr txt, pth) = withprescript "ft_stage=final" withprescript "ft_category=" & decimal mfun_blob_n ; fi ; - ) ; + ) enddef ; diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index dab83b4de..58a6175f5 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -3576,7 +3576,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-os"] = package.loaded["l-os"] or true --- original size: 16586, stripped down to: 9456 +-- original size: 16592, stripped down to: 9462 if not modules then modules={} end modules ['l-os']={ version=1.001, @@ -3729,7 +3729,7 @@ elseif os.type=="windows" then elseif name=="linux" then function resolvers.platform(t,k) local architecture=os.getenv("HOSTTYPE") or resultof("uname -m") or "" - local platform=os.getenv("MTX_PLATFORM") + local platform=os.getenv("MTX_PLATFORM") or "" local musl=find(os.selfdir or "","linuxmusl") if platform~="" then elseif find(architecture,"x86_64",1,true) then @@ -6131,7 +6131,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 38734, stripped down to: 22142 +-- original size: 39663, stripped down to: 22608 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6341,21 +6341,35 @@ function number.signed(i) end local digit=patterns.digit local period=patterns.period -local three=digit*digit*digit +local two=digit*digit +local three=two*digit +local prefix=(Carg(1)*three)^1 local splitter=Cs ( - (((1-(three^1*period))^1+C(three))*(Carg(1)*three)^1+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) + (((1-(three^1*period))^1+C(three))*prefix+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) +) +local splitter3=Cs ( + three*prefix*P(-1)+two*prefix*P(-1)+digit*prefix*P(-1)+three+two+digit ) patterns.formattednumber=splitter function number.formatted(n,sep1,sep2) - local s=type(s)=="string" and n or format("%0.2f",n) - if sep1==true then - return lpegmatch(splitter,s,1,".",",") - elseif sep1=="." then - return lpegmatch(splitter,s,1,sep1,sep2 or ",") - elseif sep1=="," then - return lpegmatch(splitter,s,1,sep1,sep2 or ".") + if sep1==false then + if type(n)=="number" then + n=tostring(n) + end + return lpegmatch(splitter3,n,1,sep2 or ".") else - return lpegmatch(splitter,s,1,sep1 or ",",sep2 or ".") + if type(n)=="number" then + n=format("%0.2f",n) + end + if sep1==true then + return lpegmatch(splitter,n,1,".",",") + elseif sep1=="." then + return lpegmatch(splitter,n,1,sep1,sep2 or ",") + elseif sep1=="," then + return lpegmatch(splitter,n,1,sep1,sep2 or ".") + else + return lpegmatch(splitter,n,1,sep1 or ",",sep2 or ".") + end end end local p=Cs( @@ -6714,14 +6728,22 @@ local format_m=function(f) if not f or f=="" then f="," end - return format([[formattednumber(a%s,%q,".")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,".")]],n,f) + end end local format_M=function(f) n=n+1 if not f or f=="" then f="." end - return format([[formattednumber(a%s,%q,",")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,",")]],n,f) + end end local format_z=function(f) n=n+(tonumber(f) or 1) @@ -6818,8 +6840,8 @@ local builder=Cs { "start", ["W"]=(prefix_any*P("W"))/format_W, ["j"]=(prefix_any*P("j"))/format_j, ["J"]=(prefix_any*P("J"))/format_J, - ["m"]=(prefix_tab*P("m"))/format_m, - ["M"]=(prefix_tab*P("M"))/format_M, + ["m"]=(prefix_any*P("m"))/format_m, + ["M"]=(prefix_any*P("M"))/format_M, ["z"]=(prefix_any*P("z"))/format_z, ["a"]=(prefix_any*P("a"))/format_a, ["A"]=(prefix_any*P("A"))/format_A, @@ -8180,7 +8202,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-sto"] = package.loaded["util-sto"] or true --- original size: 6619, stripped down to: 3214 +-- original size: 6661, stripped down to: 3245 if not modules then modules={} end modules ['util-sto']={ version=1.001, @@ -8332,6 +8354,9 @@ function table.getmetatablekey(t,key,value) return m and m[key] end function table.makeweak(t) + if not t then + t={} + end local m=getmetatable(t) if m then m.__mode="v" @@ -21405,8 +21430,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 880132 --- stripped bytes : 318258 +-- original bytes : 881109 +-- stripped bytes : 318732 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index dab83b4de..58a6175f5 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -3576,7 +3576,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-os"] = package.loaded["l-os"] or true --- original size: 16586, stripped down to: 9456 +-- original size: 16592, stripped down to: 9462 if not modules then modules={} end modules ['l-os']={ version=1.001, @@ -3729,7 +3729,7 @@ elseif os.type=="windows" then elseif name=="linux" then function resolvers.platform(t,k) local architecture=os.getenv("HOSTTYPE") or resultof("uname -m") or "" - local platform=os.getenv("MTX_PLATFORM") + local platform=os.getenv("MTX_PLATFORM") or "" local musl=find(os.selfdir or "","linuxmusl") if platform~="" then elseif find(architecture,"x86_64",1,true) then @@ -6131,7 +6131,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 38734, stripped down to: 22142 +-- original size: 39663, stripped down to: 22608 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6341,21 +6341,35 @@ function number.signed(i) end local digit=patterns.digit local period=patterns.period -local three=digit*digit*digit +local two=digit*digit +local three=two*digit +local prefix=(Carg(1)*three)^1 local splitter=Cs ( - (((1-(three^1*period))^1+C(three))*(Carg(1)*three)^1+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) + (((1-(three^1*period))^1+C(three))*prefix+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) +) +local splitter3=Cs ( + three*prefix*P(-1)+two*prefix*P(-1)+digit*prefix*P(-1)+three+two+digit ) patterns.formattednumber=splitter function number.formatted(n,sep1,sep2) - local s=type(s)=="string" and n or format("%0.2f",n) - if sep1==true then - return lpegmatch(splitter,s,1,".",",") - elseif sep1=="." then - return lpegmatch(splitter,s,1,sep1,sep2 or ",") - elseif sep1=="," then - return lpegmatch(splitter,s,1,sep1,sep2 or ".") + if sep1==false then + if type(n)=="number" then + n=tostring(n) + end + return lpegmatch(splitter3,n,1,sep2 or ".") else - return lpegmatch(splitter,s,1,sep1 or ",",sep2 or ".") + if type(n)=="number" then + n=format("%0.2f",n) + end + if sep1==true then + return lpegmatch(splitter,n,1,".",",") + elseif sep1=="." then + return lpegmatch(splitter,n,1,sep1,sep2 or ",") + elseif sep1=="," then + return lpegmatch(splitter,n,1,sep1,sep2 or ".") + else + return lpegmatch(splitter,n,1,sep1 or ",",sep2 or ".") + end end end local p=Cs( @@ -6714,14 +6728,22 @@ local format_m=function(f) if not f or f=="" then f="," end - return format([[formattednumber(a%s,%q,".")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,".")]],n,f) + end end local format_M=function(f) n=n+1 if not f or f=="" then f="." end - return format([[formattednumber(a%s,%q,",")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,",")]],n,f) + end end local format_z=function(f) n=n+(tonumber(f) or 1) @@ -6818,8 +6840,8 @@ local builder=Cs { "start", ["W"]=(prefix_any*P("W"))/format_W, ["j"]=(prefix_any*P("j"))/format_j, ["J"]=(prefix_any*P("J"))/format_J, - ["m"]=(prefix_tab*P("m"))/format_m, - ["M"]=(prefix_tab*P("M"))/format_M, + ["m"]=(prefix_any*P("m"))/format_m, + ["M"]=(prefix_any*P("M"))/format_M, ["z"]=(prefix_any*P("z"))/format_z, ["a"]=(prefix_any*P("a"))/format_a, ["A"]=(prefix_any*P("A"))/format_A, @@ -8180,7 +8202,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-sto"] = package.loaded["util-sto"] or true --- original size: 6619, stripped down to: 3214 +-- original size: 6661, stripped down to: 3245 if not modules then modules={} end modules ['util-sto']={ version=1.001, @@ -8332,6 +8354,9 @@ function table.getmetatablekey(t,key,value) return m and m[key] end function table.makeweak(t) + if not t then + t={} + end local m=getmetatable(t) if m then m.__mode="v" @@ -21405,8 +21430,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 880132 --- stripped bytes : 318258 +-- original bytes : 881109 +-- stripped bytes : 318732 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index dab83b4de..58a6175f5 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -3576,7 +3576,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-os"] = package.loaded["l-os"] or true --- original size: 16586, stripped down to: 9456 +-- original size: 16592, stripped down to: 9462 if not modules then modules={} end modules ['l-os']={ version=1.001, @@ -3729,7 +3729,7 @@ elseif os.type=="windows" then elseif name=="linux" then function resolvers.platform(t,k) local architecture=os.getenv("HOSTTYPE") or resultof("uname -m") or "" - local platform=os.getenv("MTX_PLATFORM") + local platform=os.getenv("MTX_PLATFORM") or "" local musl=find(os.selfdir or "","linuxmusl") if platform~="" then elseif find(architecture,"x86_64",1,true) then @@ -6131,7 +6131,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 38734, stripped down to: 22142 +-- original size: 39663, stripped down to: 22608 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6341,21 +6341,35 @@ function number.signed(i) end local digit=patterns.digit local period=patterns.period -local three=digit*digit*digit +local two=digit*digit +local three=two*digit +local prefix=(Carg(1)*three)^1 local splitter=Cs ( - (((1-(three^1*period))^1+C(three))*(Carg(1)*three)^1+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) + (((1-(three^1*period))^1+C(three))*prefix+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) +) +local splitter3=Cs ( + three*prefix*P(-1)+two*prefix*P(-1)+digit*prefix*P(-1)+three+two+digit ) patterns.formattednumber=splitter function number.formatted(n,sep1,sep2) - local s=type(s)=="string" and n or format("%0.2f",n) - if sep1==true then - return lpegmatch(splitter,s,1,".",",") - elseif sep1=="." then - return lpegmatch(splitter,s,1,sep1,sep2 or ",") - elseif sep1=="," then - return lpegmatch(splitter,s,1,sep1,sep2 or ".") + if sep1==false then + if type(n)=="number" then + n=tostring(n) + end + return lpegmatch(splitter3,n,1,sep2 or ".") else - return lpegmatch(splitter,s,1,sep1 or ",",sep2 or ".") + if type(n)=="number" then + n=format("%0.2f",n) + end + if sep1==true then + return lpegmatch(splitter,n,1,".",",") + elseif sep1=="." then + return lpegmatch(splitter,n,1,sep1,sep2 or ",") + elseif sep1=="," then + return lpegmatch(splitter,n,1,sep1,sep2 or ".") + else + return lpegmatch(splitter,n,1,sep1 or ",",sep2 or ".") + end end end local p=Cs( @@ -6714,14 +6728,22 @@ local format_m=function(f) if not f or f=="" then f="," end - return format([[formattednumber(a%s,%q,".")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,".")]],n,f) + end end local format_M=function(f) n=n+1 if not f or f=="" then f="." end - return format([[formattednumber(a%s,%q,",")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,",")]],n,f) + end end local format_z=function(f) n=n+(tonumber(f) or 1) @@ -6818,8 +6840,8 @@ local builder=Cs { "start", ["W"]=(prefix_any*P("W"))/format_W, ["j"]=(prefix_any*P("j"))/format_j, ["J"]=(prefix_any*P("J"))/format_J, - ["m"]=(prefix_tab*P("m"))/format_m, - ["M"]=(prefix_tab*P("M"))/format_M, + ["m"]=(prefix_any*P("m"))/format_m, + ["M"]=(prefix_any*P("M"))/format_M, ["z"]=(prefix_any*P("z"))/format_z, ["a"]=(prefix_any*P("a"))/format_a, ["A"]=(prefix_any*P("A"))/format_A, @@ -8180,7 +8202,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-sto"] = package.loaded["util-sto"] or true --- original size: 6619, stripped down to: 3214 +-- original size: 6661, stripped down to: 3245 if not modules then modules={} end modules ['util-sto']={ version=1.001, @@ -8332,6 +8354,9 @@ function table.getmetatablekey(t,key,value) return m and m[key] end function table.makeweak(t) + if not t then + t={} + end local m=getmetatable(t) if m then m.__mode="v" @@ -21405,8 +21430,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 880132 --- stripped bytes : 318258 +-- original bytes : 881109 +-- stripped bytes : 318732 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index dab83b4de..58a6175f5 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -3576,7 +3576,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-os"] = package.loaded["l-os"] or true --- original size: 16586, stripped down to: 9456 +-- original size: 16592, stripped down to: 9462 if not modules then modules={} end modules ['l-os']={ version=1.001, @@ -3729,7 +3729,7 @@ elseif os.type=="windows" then elseif name=="linux" then function resolvers.platform(t,k) local architecture=os.getenv("HOSTTYPE") or resultof("uname -m") or "" - local platform=os.getenv("MTX_PLATFORM") + local platform=os.getenv("MTX_PLATFORM") or "" local musl=find(os.selfdir or "","linuxmusl") if platform~="" then elseif find(architecture,"x86_64",1,true) then @@ -6131,7 +6131,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 38734, stripped down to: 22142 +-- original size: 39663, stripped down to: 22608 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6341,21 +6341,35 @@ function number.signed(i) end local digit=patterns.digit local period=patterns.period -local three=digit*digit*digit +local two=digit*digit +local three=two*digit +local prefix=(Carg(1)*three)^1 local splitter=Cs ( - (((1-(three^1*period))^1+C(three))*(Carg(1)*three)^1+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) + (((1-(three^1*period))^1+C(three))*prefix+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) +) +local splitter3=Cs ( + three*prefix*P(-1)+two*prefix*P(-1)+digit*prefix*P(-1)+three+two+digit ) patterns.formattednumber=splitter function number.formatted(n,sep1,sep2) - local s=type(s)=="string" and n or format("%0.2f",n) - if sep1==true then - return lpegmatch(splitter,s,1,".",",") - elseif sep1=="." then - return lpegmatch(splitter,s,1,sep1,sep2 or ",") - elseif sep1=="," then - return lpegmatch(splitter,s,1,sep1,sep2 or ".") + if sep1==false then + if type(n)=="number" then + n=tostring(n) + end + return lpegmatch(splitter3,n,1,sep2 or ".") else - return lpegmatch(splitter,s,1,sep1 or ",",sep2 or ".") + if type(n)=="number" then + n=format("%0.2f",n) + end + if sep1==true then + return lpegmatch(splitter,n,1,".",",") + elseif sep1=="." then + return lpegmatch(splitter,n,1,sep1,sep2 or ",") + elseif sep1=="," then + return lpegmatch(splitter,n,1,sep1,sep2 or ".") + else + return lpegmatch(splitter,n,1,sep1 or ",",sep2 or ".") + end end end local p=Cs( @@ -6714,14 +6728,22 @@ local format_m=function(f) if not f or f=="" then f="," end - return format([[formattednumber(a%s,%q,".")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,".")]],n,f) + end end local format_M=function(f) n=n+1 if not f or f=="" then f="." end - return format([[formattednumber(a%s,%q,",")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,",")]],n,f) + end end local format_z=function(f) n=n+(tonumber(f) or 1) @@ -6818,8 +6840,8 @@ local builder=Cs { "start", ["W"]=(prefix_any*P("W"))/format_W, ["j"]=(prefix_any*P("j"))/format_j, ["J"]=(prefix_any*P("J"))/format_J, - ["m"]=(prefix_tab*P("m"))/format_m, - ["M"]=(prefix_tab*P("M"))/format_M, + ["m"]=(prefix_any*P("m"))/format_m, + ["M"]=(prefix_any*P("M"))/format_M, ["z"]=(prefix_any*P("z"))/format_z, ["a"]=(prefix_any*P("a"))/format_a, ["A"]=(prefix_any*P("A"))/format_A, @@ -8180,7 +8202,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-sto"] = package.loaded["util-sto"] or true --- original size: 6619, stripped down to: 3214 +-- original size: 6661, stripped down to: 3245 if not modules then modules={} end modules ['util-sto']={ version=1.001, @@ -8332,6 +8354,9 @@ function table.getmetatablekey(t,key,value) return m and m[key] end function table.makeweak(t) + if not t then + t={} + end local m=getmetatable(t) if m then m.__mode="v" @@ -21405,8 +21430,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 880132 --- stripped bytes : 318258 +-- original bytes : 881109 +-- stripped bytes : 318732 -- end library merge diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 49600d565..1c4691d8c 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2018.04.15 23:11} +\newcontextversion{2018.04.16 12:05} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 644aca35c..d10d2d600 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2018.04.15 23:11} +\edef\contextversion{2018.04.16 12:05} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index cc45fc559..e0353b955 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2018.04.15 23:11} +\newcontextversion{2018.04.16 12:05} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index b08b78ef4..9a05525a1 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -42,7 +42,7 @@ %D has to match \type {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2018.04.15 23:11} +\edef\contextversion{2018.04.16 12:05} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/l-os.lua b/tex/context/base/mkiv/l-os.lua index bf13baaa6..b4b1a8645 100644 --- a/tex/context/base/mkiv/l-os.lua +++ b/tex/context/base/mkiv/l-os.lua @@ -254,7 +254,7 @@ elseif name == "linux" then function resolvers.platform(t,k) -- we sometimes have HOSTTYPE set so let's check that first local architecture = os.getenv("HOSTTYPE") or resultof("uname -m") or "" - local platform = os.getenv("MTX_PLATFORM") + local platform = os.getenv("MTX_PLATFORM") or "" local musl = find(os.selfdir or "","linuxmusl") if platform ~= "" then -- we're done diff --git a/tex/context/base/mkiv/mlib-ctx.lua b/tex/context/base/mkiv/mlib-ctx.lua index c568b92a3..b51c4fd9d 100644 --- a/tex/context/base/mkiv/mlib-ctx.lua +++ b/tex/context/base/mkiv/mlib-ctx.lua @@ -337,17 +337,17 @@ implement { } } -statistics.register("metapost processing time", function() +statistics.register("metapost", function() local n = metapost.n if n and n > 0 then local nofconverted = metapost.makempy.nofconverted local elapsedtime = statistics.elapsedtime local elapsed = statistics.elapsed local instances, memory = metapost.getstatistics(true) - local str = format("%s seconds, loading: %s, execution: %s, n: %s, average: %s, instances: %i, memory: %0.3f M", + local str = format("%s seconds, loading: %s, execution: %s, n: %s, average: %s, instances: %i, luacalls: %i, memory: %0.3f M", elapsedtime(metapost), elapsedtime(mplib), elapsedtime(metapost.exectime), n, elapsedtime((elapsed(metapost) + elapsed(mplib) + elapsed(metapost.exectime)) / n), - instances, memory/(1024*1024)) + instances, metapost.nofscriptruns(),memory/(1024*1024)) if nofconverted > 0 then return format("%s, external: %s (%s calls)", str, elapsedtime(metapost.makempy), nofconverted) diff --git a/tex/context/base/mkiv/mlib-lua.lua b/tex/context/base/mkiv/mlib-lua.lua index d934e6472..189f207c7 100644 --- a/tex/context/base/mkiv/mlib-lua.lua +++ b/tex/context/base/mkiv/mlib-lua.lua @@ -359,35 +359,36 @@ end -- endfor ; -- \stopMPpage -local cache, n = { }, 0 -- todo: when > n then reset cache or make weak +local runs = 0 + +function metapost.nofscriptruns() + return runs +end + +-- local cache = table.makeweak() +-- +-- f = cache[code] +-- if not f then +-- f = loadstring(f_code(code)) +-- if f then +-- cache[code] = f +-- elseif be_tolerant then +-- f = loadstring(code) +-- if f then +-- cache[code] = f +-- end +-- end +-- end function metapost.runscript(code) local trace = trace_enabled and trace_luarun if trace then report_luarun("code: %s",code) end - local f - if n > 100 then - cache = nil -- forget about caching - f = loadstring(f_code(code)) - if not f and be_tolerant then - f = loadstring(code) - end - else - f = cache[code] - if not f then - f = loadstring(f_code(code)) - if f then - n = n + 1 - cache[code] = f - elseif be_tolerant then - f = loadstring(code) - if f then - n = n + 1 - cache[code] = f - end - end - end + runs = runs + 1 + local f = loadstring(f_code(code)) + if not f and be_tolerant then + f = loadstring(code) end if f then local result = f() diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 44f2a3e83..489383f73 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 6ac2e451c..f0e3e40b0 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/util-sto.lua b/tex/context/base/mkiv/util-sto.lua index 0da685e9f..a08d25ced 100644 --- a/tex/context/base/mkiv/util-sto.lua +++ b/tex/context/base/mkiv/util-sto.lua @@ -197,6 +197,9 @@ function table.getmetatablekey(t,key,value) end function table.makeweak(t) + if not t then + t = { } + end local m = getmetatable(t) if m then m.__mode = "v" diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua index 05ff9f304..56c5b011c 100644 --- a/tex/context/base/mkiv/util-str.lua +++ b/tex/context/base/mkiv/util-str.lua @@ -412,25 +412,46 @@ end local digit = patterns.digit local period = patterns.period -local three = digit * digit * digit +local two = digit * digit +local three = two * digit +local prefix = (Carg(1) * three)^1 + local splitter = Cs ( - (((1 - (three^1 * period))^1 + C(three)) * (Carg(1) * three)^1 + C((1-period)^1)) + (((1 - (three^1 * period))^1 + C(three)) * prefix + C((1-period)^1)) * (P(1)/"" * Carg(2)) * C(2) ) +local splitter3 = Cs ( + three * prefix * P(-1) + + two * prefix * P(-1) + + digit * prefix * P(-1) + + three + + two + + digit +) + patterns.formattednumber = splitter function number.formatted(n,sep1,sep2) - local s = type(s) == "string" and n or format("%0.2f",n) - if sep1 == true then - return lpegmatch(splitter,s,1,".",",") - elseif sep1 == "." then - return lpegmatch(splitter,s,1,sep1,sep2 or ",") - elseif sep1 == "," then - return lpegmatch(splitter,s,1,sep1,sep2 or ".") + if sep1 == false then + if type(n) == "number" then + n = tostring(n) + end + return lpegmatch(splitter3,n,1,sep2 or ".") else - return lpegmatch(splitter,s,1,sep1 or ",",sep2 or ".") + if type(n) == "number" then + n = format("%0.2f",n) + end + if sep1 == true then + return lpegmatch(splitter,n,1,".",",") + elseif sep1 == "." then + return lpegmatch(splitter,n,1,sep1,sep2 or ",") + elseif sep1 == "," then + return lpegmatch(splitter,n,1,sep1,sep2 or ".") + else + return lpegmatch(splitter,n,1,sep1 or ",",sep2 or ".") + end end end @@ -443,6 +464,14 @@ end -- print(number.formatted(1234567)) -- print(number.formatted(12345678)) -- print(number.formatted(12345678,true)) +-- print(number.formatted(1,false)) +-- print(number.formatted(12,false)) +-- print(number.formatted(123,false)) +-- print(number.formatted(1234,false)) +-- print(number.formatted(12345,false)) +-- print(number.formatted(123456,false)) +-- print(number.formatted(1234567,false)) +-- print(number.formatted(12345678,false)) -- print(number.formatted(1234.56,"!","?")) local p = Cs( @@ -882,7 +911,11 @@ local format_m = function(f) if not f or f == "" then f = "," end - return format([[formattednumber(a%s,%q,".")]],n,f) + if f == "0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,".")]],n,f) + end end local format_M = function(f) @@ -890,7 +923,11 @@ local format_M = function(f) if not f or f == "" then f = "." end - return format([[formattednumber(a%s,%q,",")]],n,f) + if f == "0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,",")]],n,f) + end end -- @@ -1029,8 +1066,8 @@ local builder = Cs { "start", ["j"] = (prefix_any * P("j")) / format_j, -- %j => %e (float) stripped exponent (irrational) ["J"] = (prefix_any * P("J")) / format_J, -- %J => %E (float) stripped exponent (irrational) -- - ["m"] = (prefix_tab * P("m")) / format_m, -- %m => xxx.xxx.xxx,xx (optional prefix instead of .) - ["M"] = (prefix_tab * P("M")) / format_M, -- %M => xxx,xxx,xxx.xx (optional prefix instead of ,) + ["m"] = (prefix_any * P("m")) / format_m, -- %m => xxx.xxx.xxx,xx (optional prefix instead of .) + ["M"] = (prefix_any * P("M")) / format_M, -- %M => xxx,xxx,xxx.xx (optional prefix instead of ,) -- ["z"] = (prefix_any * P("z")) / format_z, -- %z => skip n arguments -- diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex cb4dc61e3..3e39f95c8 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex f7bfb2747..5cf37dc48 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/context/modules/mkiv/s-fonts-basics.mkiv b/tex/context/modules/mkiv/s-fonts-basics.mkiv index e9d0a21a2..370be3598 100644 --- a/tex/context/modules/mkiv/s-fonts-basics.mkiv +++ b/tex/context/modules/mkiv/s-fonts-basics.mkiv @@ -1,5 +1,5 @@ %D \module -%D [ file=s-fnt-01, +%D [ file=s-fonts-basics, % was s-fnt-01, %D version=2006.10.10, % guess %D title=\CONTEXT\ Style File, %D subtitle=Listing Glyphs in Large Fonts, diff --git a/tex/context/modules/mkiv/s-fonts-statistics.mkiv b/tex/context/modules/mkiv/s-fonts-statistics.mkiv new file mode 100644 index 000000000..3b5cddd3c --- /dev/null +++ b/tex/context/modules/mkiv/s-fonts-statistics.mkiv @@ -0,0 +1,80 @@ +%D \module +%D [ file=s-fonts-statistics, +%D version=2018.03.21, % guess +%D title=\CONTEXT\ Style File, +%D subtitle=Listing font statistics, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startmodule[fonts-statistics] + +\startluacode + +moduledata.fonts = moduledata.fonts or { } +moduledata.fonts.statistics = moduledata.fonts.statistics or { } + +local context = context +local ctx_NC, ctx_BC, ctx_NR = context.NC, context.BC, context.NR + +function moduledata.fonts.statistics.showusage() + local t = table.load(tex.jobname.."-fonts-usage.lua") + if t then + local totalinstances = 0 + local totalfilesize = 0 + local totalfilenames = #t + if totalfilenames > 0 then + context.starttabulate { "|r|r|c||" } + context.FL() + ctx_BC() context("used") + ctx_BC() context("filesize") + ctx_BC() context("version") + ctx_BC() context("filename") + ctx_NR() + context.ML() + for i=1,#t do + local ti = t[i] + local version = tonumber(string.match(ti.version or "","^.-([%d%.]+)")) + local instances = ti.instances or 1 + local filename = file.basename(ti.filename) or "unknown" + local filesize = ti.size or 0 + totalinstances = totalinstances + instances + totalfilesize = totalfilesize + filesize + ctx_NC() context(instances) + ctx_NC() context("%0m",filesize) + ctx_NC() if version then context("%0.3f",version) end + ctx_NC() context.type(filename) + ctx_NR() + end + context.LL() + ctx_BC() context(totalinstances) + ctx_BC() context("%0m",totalfilesize) + ctx_BC() context() + ctx_BC() context("%i files loaded",totalfilenames) + ctx_NR() + context.stoptabulate() + end + end +end + +\stopluacode + +\installmodulecommandluasingle \showfontusage {moduledata.fonts.statistics.showusage} + +\stopmodule + +\continueifinputfile{s-fonts-statistics.mkiv} + +\enabletrackers[fonts.usage] + +\starttext + + \input klein + + \showfontusage + +\stoptext diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 6829fd982..519590bf8 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 04/15/18 23:11:48 +-- merge date : 04/16/18 12:05:06 do -- begin closure to overcome local limits and interference @@ -3974,21 +3974,35 @@ function number.signed(i) end local digit=patterns.digit local period=patterns.period -local three=digit*digit*digit +local two=digit*digit +local three=two*digit +local prefix=(Carg(1)*three)^1 local splitter=Cs ( - (((1-(three^1*period))^1+C(three))*(Carg(1)*three)^1+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) + (((1-(three^1*period))^1+C(three))*prefix+C((1-period)^1))*(P(1)/""*Carg(2))*C(2) +) +local splitter3=Cs ( + three*prefix*P(-1)+two*prefix*P(-1)+digit*prefix*P(-1)+three+two+digit ) patterns.formattednumber=splitter function number.formatted(n,sep1,sep2) - local s=type(s)=="string" and n or format("%0.2f",n) - if sep1==true then - return lpegmatch(splitter,s,1,".",",") - elseif sep1=="." then - return lpegmatch(splitter,s,1,sep1,sep2 or ",") - elseif sep1=="," then - return lpegmatch(splitter,s,1,sep1,sep2 or ".") + if sep1==false then + if type(n)=="number" then + n=tostring(n) + end + return lpegmatch(splitter3,n,1,sep2 or ".") else - return lpegmatch(splitter,s,1,sep1 or ",",sep2 or ".") + if type(n)=="number" then + n=format("%0.2f",n) + end + if sep1==true then + return lpegmatch(splitter,n,1,".",",") + elseif sep1=="." then + return lpegmatch(splitter,n,1,sep1,sep2 or ",") + elseif sep1=="," then + return lpegmatch(splitter,n,1,sep1,sep2 or ".") + else + return lpegmatch(splitter,n,1,sep1 or ",",sep2 or ".") + end end end local p=Cs( @@ -4347,14 +4361,22 @@ local format_m=function(f) if not f or f=="" then f="," end - return format([[formattednumber(a%s,%q,".")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,".")]],n,f) + end end local format_M=function(f) n=n+1 if not f or f=="" then f="." end - return format([[formattednumber(a%s,%q,",")]],n,f) + if f=="0" then + return format([[formattednumber(a%s,false)]],n) + else + return format([[formattednumber(a%s,%q,",")]],n,f) + end end local format_z=function(f) n=n+(tonumber(f) or 1) @@ -4451,8 +4473,8 @@ local builder=Cs { "start", ["W"]=(prefix_any*P("W"))/format_W, ["j"]=(prefix_any*P("j"))/format_j, ["J"]=(prefix_any*P("J"))/format_J, - ["m"]=(prefix_tab*P("m"))/format_m, - ["M"]=(prefix_tab*P("M"))/format_M, + ["m"]=(prefix_any*P("m"))/format_m, + ["M"]=(prefix_any*P("M"))/format_M, ["z"]=(prefix_any*P("z"))/format_z, ["a"]=(prefix_any*P("a"))/format_a, ["A"]=(prefix_any*P("A"))/format_A, |