diff options
Diffstat (limited to 'tex')
68 files changed, 821 insertions, 509 deletions
diff --git a/tex/context/base/anch-pos.mkiv b/tex/context/base/anch-pos.mkiv index 2e13eeba2..7ecaa296e 100644 --- a/tex/context/base/anch-pos.mkiv +++ b/tex/context/base/anch-pos.mkiv @@ -361,9 +361,9 @@ \startcolor[blue]% \llap{\infofont\number\c_anch_positions_paragraph}% \vrule - \!!width 4\onepoint - \!!height2\onepoint - \!!depth 2\onepoint + \s!width 4\onepoint + \s!height2\onepoint + \s!depth 2\onepoint \stopcolor \hss}} @@ -377,7 +377,7 @@ {\smashedhbox {#1{\infofont#2#3}% \kern-\onepoint - \vrule\!!width2\onepoint\!!height\halfapoint\!!depth\halfapoint}} + \vrule\s!width2\onepoint\s!height\halfapoint\s!depth\halfapoint}} \unexpanded\def\anch_positions_trace_left_indeed {\anch_positions_trace\llap\darkmagenta{\currentposition>}} diff --git a/tex/context/base/attr-eff.mkiv b/tex/context/base/attr-eff.mkiv index f76e498d9..43f575a7a 100644 --- a/tex/context/base/attr-eff.mkiv +++ b/tex/context/base/attr-eff.mkiv @@ -28,8 +28,8 @@ \c!alternative=\v!normal] \appendtoks - \edef\p_method{\effectparameter\c!command}% - \ifx\p_method\v!command + \edef\p_method{\effectparameter\c!method}% + \ifx\p_method\v!method \setuxvalue{\e!start\currenteffect}{\starteffect[#1]}% \setuxvalue{\e!stop \currenteffect}{\stopeffect}% \fi diff --git a/tex/context/base/blob-ini.lua b/tex/context/base/blob-ini.lua index b97485b1b..4debaf94c 100644 --- a/tex/context/base/blob-ini.lua +++ b/tex/context/base/blob-ini.lua @@ -74,7 +74,7 @@ function blobs.dispose(t) end end -function blobs.append(t,str) -- will be link nodes.link +function blobs.append(t,str) -- compare concat and link local typ = type(str) local dummy = nil if typ == "number" then diff --git a/tex/context/base/buff-ver.mkiv b/tex/context/base/buff-ver.mkiv index 5ba0487e9..74e8e392f 100644 --- a/tex/context/base/buff-ver.mkiv +++ b/tex/context/base/buff-ver.mkiv @@ -328,7 +328,7 @@ \unexpanded\def\specialfixedspace {\kern\interwordspace\relax} \unexpanded\def\specialobeyedspace {\hskip\interwordspace\relax} % better than spaceskip -\unexpanded\def\specialstretchedspace{\hskip.5\interwordspace\!!plus.125\interwordstretch\relax} % more but not less +\unexpanded\def\specialstretchedspace{\hskip.5\interwordspace\s!plus.125\interwordstretch\relax} % more but not less \unexpanded\def\specialcontrolspace {\hskip\zeropoint\hbox{\normalcontrolspace}\hskip\zeropoint\relax} \unexpanded\def\obeyhyphens diff --git a/tex/context/base/chem-str.mkiv b/tex/context/base/chem-str.mkiv index aa244d75a..c0eaa8c28 100644 --- a/tex/context/base/chem-str.mkiv +++ b/tex/context/base/chem-str.mkiv @@ -292,8 +292,8 @@ \def\chem_arrow_construct#1#2#3% {\enspace \mathematics{#1% - {\strut\hbox \!!spread 2\emwidth{\hss\ctxlua{chemicals.inline(\!!bs#2\!!es)}\hss}}% {\strut\hbox \!!spread 2em{\hss#2\hss}}% - {\strut\hbox \!!spread 2\emwidth{\hss\ctxlua{chemicals.inline(\!!bs#3\!!es)}\hss}}}% {\strut\hbox \!!spread 2em{\hss#3\hss}}}% + {\strut\hbox \s!spread 2\emwidth{\hss\ctxlua{chemicals.inline(\!!bs#2\!!es)}\hss}}% {\strut\hbox \s!spread 2em{\hss#2\hss}}% + {\strut\hbox \s!spread 2\emwidth{\hss\ctxlua{chemicals.inline(\!!bs#3\!!es)}\hss}}}% {\strut\hbox \s!spread 2em{\hss#3\hss}}}% \enspace} % special macros (probably needs some more work) @@ -446,7 +446,7 @@ \hbox{\usechemicalstyleandcolor\c!style\c!color\ctxlua{chemicals.inline(\!!bs#1\!!es)}}} \unexpanded\def\chemicalbondrule - {\hbox{\vrule\!!height.75ex\!!depth-\dimexpr.75ex-\linewidth\relax\!!width1em\relax}} + {\hbox{\vrule\s!height.75\exheight\s!depth-\dimexpr.75\exheight-\linewidth\relax\s!width\emwidth\relax}} \definechemicalsymbol[i:space] [\enspace\quad\enspace] \definechemicalsymbol[i:plus] [\enspace\mathematics{+}\enspace] diff --git a/tex/context/base/colo-ext.mkiv b/tex/context/base/colo-ext.mkiv index af6c3830e..7920b20fc 100644 --- a/tex/context/base/colo-ext.mkiv +++ b/tex/context/base/colo-ext.mkiv @@ -32,7 +32,7 @@ % \unexpanded\def\negatecolorbox#1% % {\setbox#1\hbox % {\startnegative % might change -% \startcolor[\s!white]\vrule\!!height\ht#1\!!depth\dp#1\!!width\wd#1\stopcolor +% \startcolor[\s!white]\vrule\s!height\ht#1\s!depth\dp#1\s!width\wd#1\stopcolor % \hskip-\wd#1% % \box#1% % \stopnegative}} @@ -40,7 +40,7 @@ \unexpanded\def\negatecolorbox#1% {\setbox#1\hbox {\startnegative % might change -% \startcolor[\s!white]\vrule\!!height\ht#1\!!depth\dp#1\!!width\wd#1\stopcolor + % \startcolor[\s!white]\vrule\s!height\ht#1\s!depth\dp#1\s!width\wd#1\stopcolor \blackrule[\c!color=\s!white,\c!height=\ht#1,\c!depth=\dp#1,\c!width=\wd#1]% \hskip-\wd#1% \box#1% diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv index 6b4f1be10..629f2b96a 100644 --- a/tex/context/base/colo-ini.mkiv +++ b/tex/context/base/colo-ini.mkiv @@ -981,7 +981,7 @@ % ignores in attribute handler % -% \def\forcecolorhack{\vrule\!!width\zeropoint\!!height\zeropoint\!!depth\zeropoint} +% \def\forcecolorhack{\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\zeropoint} % \normal added else fails in metafun manual (leaders do a hard scan) diff --git a/tex/context/base/colo-run.mkiv b/tex/context/base/colo-run.mkiv index c330accf3..c41a133d3 100644 --- a/tex/context/base/colo-run.mkiv +++ b/tex/context/base/colo-run.mkiv @@ -59,8 +59,8 @@ \tabskip\zeropoint \def\colo_palets_show_palet##1% {\doifinsetelse\v!number{#2}{##1\hskip.5em}{}& - \color[##1]{\vrule\!!width3em\!!height\strutht\!!depth\strutdp}% - \graycolor[##1]{\vrule\!!width3em\!!height\strutht\!!depth\strutdp}& + \color[##1]{\vrule\s!width3em\s!height\strutht\s!depth\strutdp}% + \graycolor[##1]{\vrule\s!width3em\s!height\strutht\s!depth\strutdp}& \doifinset\v!value{#2}{\hskip.5em\colorvalue{##1}}\crcr} \halign {\hss##&\hss##\hss&##\cr @@ -92,11 +92,11 @@ \colo_palets_process[#1]\colo_palets_show_palet}\cr \doifinset\v!name{#2}{#1\hskip.5em}% \def\colo_palets_show_palet##1% - {&\strut\color[##1]{\vrule\!!width\!!widtha\!!height\strutht\!!depth\zeropoint}}% + {&\strut\color[##1]{\vrule\s!width\!!widtha\s!height\strutht\s!depth\zeropoint}}% \colo_palets_process[#1]\colo_palets_show_palet\crcr \noalign{\vskip-\strutdepth}% \def\colo_palets_show_palet##1% - {&\graycolor[##1]{\vrule\!!width\!!widtha\!!height\zeropoint\!!depth\strutdp}}% + {&\graycolor[##1]{\vrule\s!width\!!widtha\s!height\zeropoint\s!depth\strutdp}}% \colo_palets_process[#1]\colo_palets_show_palet\crcr \doifinset\v!value{#2} {\def\colo_palets_show_palet##1% @@ -137,13 +137,13 @@ \def\colo_palets_compare##1% {\hbox {\setbox0\hbox - {#1[##1]{\vrule\!!width\hsize\!!height3ex}}% + {#1[##1]{\vrule\s!width\hsize\s!height3ex}}% \wd0\zeropoint \box0 \hbox to \hsize {\def\colo_palets_compare####1% {\hbox to \!!widtha - {\hss#1[####1]{\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex}\hss}}% + {\hss#1[####1]{\vrule\s!width.5\!!widtha\s!height2.25ex\s!depth-.75ex}\hss}}% \processcommacommand[\getvalue{\??colorpalet#2}]\colo_palets_compare}} \endgraf} \processcommacommand[\getvalue{\??colorpalet#2}]\colo_palets_compare}} @@ -171,8 +171,8 @@ {\halign {\hss####\hss\cr \doifinset\v!number{#2}{\strut##1}\cr - \color[#1:##1]{\vrule\!!width4em\!!height\strutht\!!depth\zeropoint}\cr - \graycolor[#1:##1]{\vrule\!!width4em\!!height\zeropoint\!!depth\strutdp}\cr + \color[#1:##1]{\vrule\s!width4em\s!height\strutht\s!depth\zeropoint}\cr + \graycolor[#1:##1]{\vrule\s!width4em\s!height\zeropoint\s!depth\strutdp}\cr \doifinset\v!value{#2}{\colorvalue{#1:##1}\strut}\crcr}}}}% \hbox {\doifinset\v!name{#2} @@ -195,8 +195,8 @@ \def\colo_groups_show_group##1% {\doifcolor{#1:##1} {\doifinset\v!number{#2}{##1\hskip.5em}& - \color[#1:##1]{\vrule\!!width2.5em\!!height\strutht\!!depth\strutdp}% - \graycolor[#1:##1]{\vrule\!!width2.5em\!!height\strutht\!!depth\strutdp}& + \color[#1:##1]{\vrule\s!width2.5em\s!height\strutht\s!depth\strutdp}% + \graycolor[#1:##1]{\vrule\s!width2.5em\s!height\strutht\s!depth\strutdp}& \doifinset\v!value{#2}{\hskip.5em\colorvalue{#1:##1}}\crcr}}% \halign {\hss##&\hss##\hss&##\hss\cr @@ -228,11 +228,11 @@ \def\colo_groups_compare_step#1#2#3% {\hbox to \hsize {\setbox0\hbox - {#1[#2:#3]{\vrule\!!width\hsize\!!height3ex}}% + {#1[#2:#3]{\vrule\s!width\hsize\s!height3ex}}% \wd0\zeropoint \box0 \hbox to \hsize - {\hss\dorecurse\!!counta{#1[#2:\recurselevel]{\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex}\hss}}} + {\hss\dorecurse\!!counta{#1[#2:\recurselevel]{\vrule\s!width.5\!!widtha\s!height2.25ex\s!depth-.75ex}\hss}}} \endgraf} \protect \endinput diff --git a/tex/context/base/cont-log.mkiv b/tex/context/base/cont-log.mkiv index a83417ffd..5d4133143 100644 --- a/tex/context/base/cont-log.mkiv +++ b/tex/context/base/cont-log.mkiv @@ -118,7 +118,7 @@ \logofont} \def\syst_logos_meta_hyphen % there is no hyphenchar in this font - {\discretionary{\vrule\!!height.33em\!!depth-.27em\!!width.33em}{}{}} + {\discretionary{\vrule\s!height.33em\s!depth-.27em\s!width.33em}{}{}} \unexpanded\def\MetaFont {\dontleavehmode diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 141f6d85f..bed8dbec7 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.07.18 14:11} +\newcontextversion{2012.07.19 12:56} %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/cont-new.mkiv b/tex/context/base/cont-new.mkiv index c670b08fb..6513dbae1 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.07.18 14:11} +\newcontextversion{2012.07.19 12:56} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new @@ -219,7 +219,7 @@ \unexpanded\def\asciistr#1{\dontleavehmode{\defconvertedargument\ascii{#1}\verbatimfont\ascii}} -\def\shapefill{\vskip\zeropoint\!!plus\lineheight\!!minus\lineheight\relax} +\def\shapefill{\vskip\zeropoint\s!plus\lineheight\s!minus\lineheight\relax} % \ruledhbox % {\startignorespaces @@ -289,7 +289,7 @@ %\def\tabulaterule % to be redone, not correct % {\dotabulaterule -% {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax +% {\hrule\s!height.5\scratchdimen\s!depth.5\scratchdimen\relax % \doif{\tabulateparameter\c!distance}\v!grid % {\kern-\scratchdimen}}} % experimental tm-prikkels % diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex a57dcfe16..4bae955bf 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png Binary files differindex f0cf5684b..d6439c186 100644 --- a/tex/context/base/context-version.png +++ b/tex/context/base/context-version.png diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index c5605cebc..4c3d2b8a7 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2012.07.18 14:11} +\edef\contextversion{2012.07.19 12:56} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 2029b6e75..3681b09a0 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2012.07.18 14:11} +\edef\contextversion{2012.07.19 12:56} %D For those who want to use this: diff --git a/tex/context/base/core-con.mkiv b/tex/context/base/core-con.mkiv index 5979bfe37..be173c293 100644 --- a/tex/context/base/core-con.mkiv +++ b/tex/context/base/core-con.mkiv @@ -153,13 +153,19 @@ \endgroup} \unexpanded\def\oldstyleromannumerals#1% will become obsolete - {\begingroup - \leftrulefalse - \rightrulefalse + {\dontleavehmode + \hbox\bgroup \ss\txx - \boxrulewidth.15ex - \ruledhbox spread .15em{\hss\uppercased{\romannumerals{#1}}\hss}% - \endgroup} + \setbox\scratchbox\hbox \s!spread .15\emwidth{\hss\uppercased{\romannumerals{#1}}\hss}% + \scratchwidth \wd\scratchbox + \scratchheight\ht\scratchbox + \scratchdimen .1\exheight + \vrule\s!width\scratchwidth\s!height\dimexpr\scratchheight+\scratchdimen\relax\s!depth-\dimexpr\scratchheight-+\scratchdimen\relax + \hskip-\scratchwidth + \vrule\s!width\scratchwidth\s!height\scratchdimen\s!depth\scratchdimen + \hskip-\scratchwidth + \box\scratchbox + \egroup} %D \macros %D {protectconversion} diff --git a/tex/context/base/enco-ini.mkiv b/tex/context/base/enco-ini.mkiv index 6e4e1a479..3b0cbc9fc 100644 --- a/tex/context/base/enco-ini.mkiv +++ b/tex/context/base/enco-ini.mkiv @@ -235,7 +235,7 @@ % left-overs (some day in private unicode space, so that we can roundtrip) -\unexpanded\def\textblacksquare {\dontleavehmode\hbox{\vrule\!!width.3\s!em\!!height.4\s!em\!!depth-.1\s!em}} +\unexpanded\def\textblacksquare {\dontleavehmode\hbox{\vrule\s!width.3\s!em\s!height.4\s!em\s!depth-.1\s!em}} \unexpanded\def\schwa {\hbox{\rotate[\c!rotation=180,\c!location=\v!high]{\hbox{e}}}} \unexpanded\def\schwagrave {\buildtextgrave\schwa} @@ -301,10 +301,10 @@ % from enco-mis: \unexpanded\def\fakepercent - {\mathematics{\normalsuperscript{\scriptscriptstyle0}\kern-.25em/\kern-.2em\normalsubscript{\scriptscriptstyle0}}} + {\mathematics{\normalsuperscript{\scriptscriptstyle0}\kern-.25\emwidth/\kern-.2\emwidth\normalsubscript{\scriptscriptstyle0}}} \unexpanded\def\fakeperthousand - {\mathematics{\normalsuperscript{\scriptscriptstyle0}\kern-.25em/\kern-.2em\normalsubscript{\scriptscriptstyle00}}} + {\mathematics{\normalsuperscript{\scriptscriptstyle0}\kern-.25\emwidth/\kern-.2\emwidth\normalsubscript{\scriptscriptstyle00}}} \unexpanded\def\fakepermine {\dontleavehmode @@ -313,7 +313,7 @@ {\mathematics{+}}% \hbox to \wd\scratchbox {\hss - \mathematics{\normalsuperscript{\scriptscriptstyle-}\kern-.4em/\kern-.3em\normalsubscript{\scriptscriptstyle-}}% + \mathematics{\normalsuperscript{\scriptscriptstyle-}\kern-.4\emwidth/\kern-.3\emwidth\normalsubscript{\scriptscriptstyle-}}% \hss}% \egroup} @@ -321,9 +321,9 @@ \unexpanded\def\fakeunderscore {\relax\ifmmode - \vrule\!!depth .12\fontexheight\mathstylefont\normalmathstyle\!!width \fontinterwordspace\mathstylefont\normalmathstyle\!!height\zeropoint\relax + \vrule\s!depth .12\fontexheight\mathstylefont\normalmathstyle\s!width \fontinterwordspace\mathstylefont\normalmathstyle\s!height\zeropoint\relax \else - \dontleavehmode\hbox{\vrule\!!depth .12\fontexheight\font\!!width \fontinterwordspace\font\!!height\zeropoint}% + \dontleavehmode\hbox{\vrule\s!depth .12\fontexheight\font\s!width \fontinterwordspace\font\s!height\zeropoint}% \fi} \unexpanded\def\fakeunderscores{\let\_\fakeunderscore} diff --git a/tex/context/base/font-run.mkiv b/tex/context/base/font-run.mkiv index b2ccd0dda..66f1acc91 100644 --- a/tex/context/base/font-run.mkiv +++ b/tex/context/base/font-run.mkiv @@ -13,7 +13,7 @@ %C details. %D [This code is hooked into the core macros and saves some -%D format space.] +%D format space. It needs a cleanup.] \unprotect @@ -31,7 +31,7 @@ {\doifnot{[\fontclass]}\title {\edef\title{[\fontclass]\space\title}}}} -\gdef\showbodyfont +\unexpanded\gdef\showbodyfont {\dosingleempty\doshowbodyfont} \gdef\doshowbodyfont[#1]% @@ -40,9 +40,9 @@ {\dosetshowfonttitle{#1}% \def\bigstrut##1##2% {\hbox{\vrule - \!!height##1\strutht - \!!depth ##2\strutdp - \!!width \zeropoint}} + \s!height##1\strutht + \s!depth ##2\strutdp + \s!width \zeropoint}} \def\next##1##2##3% {&&##1&&##2\tf##3&&##2\sc##3% &&##2\sl##3&&##2\it##3&&##2\bf##3&&##2\bs##3&&##2\bi##3% @@ -50,7 +50,7 @@ &&##2\tfa##3&&##2\tfb##3&&##2\tfc##3&&##2\tfd##3&\cr}% \halign to \localhsize {\bigstrut{1.5}{2}##&\vrule## - \tabskip\zeropoint \!!plus 1fill + \tabskip\zeropoint \s!plus 1\s!fill &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## @@ -69,7 +69,7 @@ \noalign{\hrule}}} \ifinsidefloat\else\stopbaselinecorrection\fi} -\gdef\showbodyfontenvironment +\unexpanded\gdef\showbodyfontenvironment {\dosingleempty\doshowbodyfontenvironment} \gdef\doshowbodyfontenvironment[#1]% @@ -89,7 +89,7 @@ \noalign{\hrule}} \halign to \localhsize {##&\vrule##\strut - \tabskip=\zeropoint \!!plus 1fill + \tabskip=\zeropoint \s!plus 1\s!fill &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule @@ -104,7 +104,7 @@ \@EA\globalprocesscommalist\@EA[\bodyfontenvironmentlist]\next}} \ifinsidefloat\else\stopbaselinecorrection\fi} -\gdef\showfont +\unexpanded\gdef\showfont {\dodoubleempty\doshowfont} \gdef\doshowfont[#1][#2]% @@ -132,7 +132,6 @@ \gdef\dodoshowfont#1#2% {\bgroup \edef\charplane{\number#2}% - \boxrulewidth=.1pt \iffirstargument % \definefont[\s!dummy][#1]\dummy \else\ifdim2.5em>.05\hsize \tx @@ -159,7 +158,7 @@ \donetrue \else \donefalse \fi \else - \setbox\scratchbox\hbox{\gray\vrule\!!width1ex\!!height.5ex\!!depth.5ex}% + \setbox\scratchbox\hbox{\gray\vrule\s!width1ex\s!height.5ex\s!depth.5ex}% \fi \startoverlay {\tf\vbox to 2.5em @@ -206,9 +205,9 @@ % \showfontstyle[modern][rm][tf][all] % #2, #3 and #4 can be 'all' -\gdef\showfontstyle {\dodoubleempty \dodoshowfontstyle} -\gdef\redoshowfontstyle {\dotripleempty \dododoshowfontstyle} -\gdef\redodoshowfontstyle{\doquadrupleempty\dodododoshowfontstyle} +\unexpanded\gdef\showfontstyle {\dodoubleempty \dodoshowfontstyle} +\unexpanded\gdef\redoshowfontstyle {\dotripleempty \dododoshowfontstyle} +\unexpanded\gdef\redodoshowfontstyle{\doquadrupleempty\dodododoshowfontstyle} % no lists any more, so no 'all' any longer @@ -254,10 +253,10 @@ \processcommalist[#2]\docommand \egroup} -\gdef\showligature#1% +\unexpanded\gdef\showligature#1% {\hbox{\type{#1}\enspace\red\ruledhbox{\black#1}}} -\gdef\showligatures[#1]% +\unexpanded\gdef\showligatures[#1]% {\ifx\starttabulate\undefined \@@onlyenglish\showligatures \else @@ -273,7 +272,7 @@ \egroup \fi} -\gdef\showfontstrip +\unexpanded\gdef\showfontstrip {\dosingleempty\doshowfontstrip} \gdef\doshowfontstrip[#1]% @@ -310,9 +309,9 @@ \egroup \fi} -\ifx\databox\undefined \newbox\databox \fi +\ifdefined\databox \else \newbox\databox \fi -\gdef\testminimalbaseline#1% +\unexpanded\gdef\testminimalbaseline#1% {\setbox\databox\ruledhbox{#1}% \scratchdimen\ht\databox \advance\scratchdimen\dp\databox @@ -332,7 +331,7 @@ \noexpand \NC (\ifdim\scratchdimen>\baselineskip not \fi ok) \noexpand \NC \noexpand \NR }} -\gdef\showminimalbaseline +\unexpanded\gdef\showminimalbaseline {\ifx\starttabulate\undefined \@@onlyenglish\showminimalbaseline \else @@ -343,20 +342,20 @@ \stoptabulate \fi} -\gdef\showkerning#1% +\unexpanded\gdef\showkerning#1% {\bgroup \let\MPfshowcommand\ruledhbox \setMPtext\s!dummy{#1}% \startMPcode draw textext(\MPstring\s!dummy);\stopMPcode \egroup} -\gdef\showcharratio +\unexpanded\gdef\showcharratio {\dowithnextboxcontent {\switchtobodyfont[10pt]}% {(\withoutpt\the\nextboxht,\withoutpt\the\nextboxdp)}% \hbox} -\gdef\showfontparameters +\unexpanded\gdef\showfontparameters {\starttabulate[|tl|l|] \NC slantperpoint \NC \the\fontslantperpoint \font \NC\NR \NC interwordspace \NC \the\fontinterwordspace \font \NC\NR diff --git a/tex/context/base/font-sty.mkvi b/tex/context/base/font-sty.mkvi index 3e1bb96da..d704aae8a 100644 --- a/tex/context/base/font-sty.mkvi +++ b/tex/context/base/font-sty.mkvi @@ -216,11 +216,19 @@ \installcommandhandler \??style {style} \??style +\setupstyle + [%\c!style=, + %\c!color=, + \c!method=\v!command] + \appendtoks \letvalue{\??stylecheck\currentstyle}\relax - \setuevalue{\e!start\currentstyle}{\font_styles_apply_start{\currentstyle}}% - \setuevalue{\e!stop \currentstyle}{\font_styles_apply_stop}% - \setuevalue {\currentstyle}{\font_styles_apply_grouped{\currentstyle}}% no longer groupedcommand here + \edef\p_method{\styleparameter\c!method}% + \ifx\p_method\v!command + \setuevalue{\e!start\currentstyle}{\font_styles_apply_start{\currentstyle}}% + \setuevalue{\e!stop \currentstyle}{\font_styles_apply_stop}% + \setuevalue {\currentstyle}{\font_styles_apply_grouped{\currentstyle}}% no longer groupedcommand here + \fi \to \everydefinestyle \unexpanded\def\font_styles_apply_start#name% @@ -242,7 +250,9 @@ \unexpanded\def\font_styles_use_generic#specification% {\let\currentstyle\s!unknown % reasonable generic tag - \setupcurrentstyle[\c!style=,\c!color=,#specification]% + \letstyleparameter\c!style\empty + \letstyleparameter\c!color\empty + \setupcurrentstyle[#specification]% \usestylestyleandcolor\c!style\c!color} % commands @@ -251,17 +261,23 @@ \unexpanded\def\style[#name]% as this is can be a switch we use groupedcommand {\csname\??styleargument - \ifcsname#name\endcsname1\else\ifcsname\??stylecheck#name\endcsname2\else3\fi\fi + \ifcsname\??stylecheck#name\endcsname + 2% defined as style + \else\ifcsname#name\endcsname + 1% defined as command + \else + 3% specification + \fi\fi \endcsname{#name}} \setvalue{\??styleargument1}#name% - {\csname#name\endcsname} + {\groupedcommand{\csname#name\endcsname}{}} \setvalue{\??styleargument2}#name% - {\groupedcommand{\font_styles_use_defined{#name}}{}} + {\groupedcommand{\font_styles_use_defined{#name}}{}} % or {\font_styles_apply_grouped{#name}} \setvalue{\??styleargument3}#specification% - {\doifassignmentelse{#specification}\font_styles_assignment\font_styles_direct{#specification}} + {\doifassignmentelse{#specification}\font_styles_assignment\font_styles_checked{#specification}} \def\font_styles_assignment#specification{\groupedcommand{\font_styles_use_generic{#specification}}{}} \def\font_styles_direct #specification{\groupedcommand{\definedfont[#specification]}{}} @@ -273,7 +289,13 @@ \unexpanded\def\startstyle[#name]% {\begingroup \csname\??styleenvironment - \ifcsname#name\endcsname1\else\ifcsname\??stylecheck#name\endcsname2\else3\fi\fi + \ifcsname\??stylecheck#name\endcsname + 2% defined as style + \else\ifcsname#name\endcsname + 1% defined as command + \else + 3% specification + \fi\fi \endcsname{#name}} \unexpanded\def\stopstyle @@ -289,7 +311,7 @@ \setvalue{\??styleenvironment3}#specification% {\doifassignmentelse{#specification}\font_styles_start_assignment\font_styles_start_direct{#specification}} -\def\font_styles_start_assignment#specification{\usegenericstyle{#specification}} +\def\font_styles_start_assignment#specification{\font_styles_use_generic{#specification}} \def\font_styles_start_direct #specification{\definedfont[#specification]\relax} %D Still experimental (might even go away). diff --git a/tex/context/base/m-ipsum.mkiv b/tex/context/base/m-ipsum.mkiv new file mode 100644 index 000000000..3ac54044d --- /dev/null +++ b/tex/context/base/m-ipsum.mkiv @@ -0,0 +1,189 @@ +%D \module +%D [ file=m-ipsum, +%D version=2012.07.19, +%D title=\CONTEXT\ Extra Modules, +%D subtitle=Ipsum, +%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. + +%D After some discussing on the mailing list I made this example of +%D an implementation. Of course there can be alternatives as it's a +%D nice exercise in module writing. + +\startluacode + +local word = lpeg.R("az","AZ")^1 +local period = lpeg.S(".") +local rest = lpeg.P(1) +local whitespace = lpeg.patterns.whitespace^1 / " " + +local oneword = lpeg.Cs(word / characters.lower) +local onesentence = lpeg.Cs(word * (whitespace + word + (1-period))^0 * period) + +local allwords = lpeg.Ct((oneword + rest)^1) +local allsentences = lpeg.Ct((onesentence + rest)^1) + +local variables = interfaces.variables + +local v_paragraph = variables.paragraph +local v_lines = variables.lines +local v_words = variables.words +local v_random = variables.random + +local ipsum = { } moduledata.ipsum = ipsum + +local data = { } + +local function getfiledata(settings) + local filename = settings.filename or "" + local filedata = data[filename] + if not filedata then + local text = resolvers.loadtexfile(filename) or "" + filedata = { + [v_paragraph] = { text or "" }, + [v_lines] = lpeg.match(allsentences,text) or { }, + [v_words] = lpeg.match(allwords,text) or { }, + } + data[filename] = filedata + end + local d = filedata[settings.alternative or v_paragraph] or filedata[v_paragraph] or { } + local n = settings.n + if n ~= v_random then + n = tonumber(n) or 0 + if n == 0 then + n = #d + end + end + return d, n +end + +function moduledata.ipsum.typeset(settings) + local d, n = getfiledata(settings) + context(settings.before) + if n == v_random then + context(settings.left) + context(d[math.random(1,#d)]) + context(settings.right) + else + for i=1,n do + context(settings.left) + context(d[i]) + context(settings.right) + if i < n then + context(settings.inbetween) + end + end + end + context(settings.after) +end + +function moduledata.ipsum.direct(settings) + local d, n = getfiledata(settings) + if n == v_random then + context(d[math.random(1,#d)]) + else + for i=1,n do + context(d[i]) + if i < n then + context(settings.separator) + end + end + end +end + +\stopluacode + +\unprotect + +\installnamespace {ipsum} + +\installcommandhandler \????ipsum {ipsum} \????ipsum + +\setupipsum + [\c!file=lorem, + \c!alternative=\v!paragraph, + \c!n=0, + \c!left=, + \c!right=, + \c!before=, + \c!after=, + \c!separator=, + \c!inbetween=] + +\installactionhandler{ipsum} % grouped + +\startsetups[handler:action:ipsum] + \useipsumstyleandcolor\c!style\c!color + \ctxlua{moduledata.ipsum.typeset { + alternative = "\ipsumparameter\c!alternative", + filename = "\ipsumparameter\c!file", + n = "\ipsumparameter\c!n", + left = "\luaescapestring{\ipsumparameter\c!left}", + right = "\luaescapestring{\ipsumparameter\c!right}", + before = "\luaescapestring{\ipsumparameter\c!before}", + after = "\luaescapestring{\ipsumparameter\c!after}", + inbetween = "\luaescapestring{\ipsumparameter\c!inbetween}", + }} +\stopsetups + +\def\directipsum#1% only one argument, expanded + {\ctxlua{moduledata.ipsum.typeset { + alternative = "\namedipsumparameter{#1}\c!alternative", + filename = "\namedipsumparameter{#1}\c!file", + n = "\namedipsumparameter{#1}\c!n", + separator = "\luaescapestring{\ipsumparameter\c!separator}", + }} +} + +\protect + +\continueifinputfile{m-ipsum.mkiv} + +\setupbodyfont[dejavu,11pt] + +\starttext + + \ipsum[alternative=paragraph,before=\blank,after=\blank] + + \ipsum[alternative=lines,n=2,right=\par,before=\blank,after=\blank] + + \ipsum[alternative=lines,n=random,before=\blank,after=\blank] + + \ipsum[alternative=lines,before=\startitemize,after=\stopitemize,left=\startitem,right=\stopitem] + + \ipsum[alternative=words,left=(,right=),inbetween=\space] + + \page + + \defineipsum + [ward] + [file=ward, + before=\blank, + after=\blank] + + \defineipsum + [ward:itemize] + [ward] + [alternative=lines, + before={\startitemize[packed]}, + after=\stopitemize, + left=\startitem, + right=\stopitem] + + \defineipsum + [ward:title] + [ward] + [alternative=lines, + n=random] + + \subject{\directipsum{ward:title}} + + \ipsum[ward] + \ipsum[ward:itemize] + +\stoptext diff --git a/tex/context/base/m-visual.mkiv b/tex/context/base/m-visual.mkiv index af6bb72fd..504c0d0c5 100644 --- a/tex/context/base/m-visual.mkiv +++ b/tex/context/base/m-visual.mkiv @@ -31,11 +31,11 @@ \begingroup \directcolored[fakerulecolor]% \iffakebaseline - \vrule\!!height1.25ex\!!depth-.05ex\!!width#1% + \vrule\s!height1.25ex\s!depth-.05ex\s!width#1% \kern-#1% - \vrule\!!height-.05ex\!!depth .25ex\!!width#1% + \vrule\s!height-.05ex\s!depth .25ex\s!width#1% \else - \vrule\!!height1.25ex\!!depth .25ex\!!width#1% + \vrule\s!height1.25ex\s!depth .25ex\s!width#1% \fi \endgroup \allowbreak} @@ -119,9 +119,9 @@ \ifx\dofakedroppedcaps\relax {\fakeparindentcolor \vrule - \!!height \strutheight % not longer .5ex - \!!depth \strutdepth % not longer 0pt - \!!width \parindent}% + \s!height \strutheight % not longer .5ex + \s!depth \strutdepth % not longer 0pt + \s!width \parindent}% \else \dofakedroppedcaps \let\dofakedroppedcaps\relax \fi @@ -140,9 +140,9 @@ \advance\scratchdimen -\lineheight \advance\scratchdimen \dp\strutbox \vrule - \!!width#1\wd\scratchbox - \!!height\ht\scratchbox - \!!depth\scratchdimen}% + \s!width#1\wd\scratchbox + \s!height\ht\scratchbox + \s!depth\scratchdimen}% \ht\scratchbox\ht\strutbox \dp\scratchbox\dp\strutbox \hangindent\wd\scratchbox @@ -217,7 +217,7 @@ {\hss\lower.5\ht\scratchbox\box\scratchbox\hss}% \hbox to \zeropoint {\hss - \black\vrule\!!width6\linewidth\!!height3\linewidth\!!depth3\linewidth + \black\vrule\s!width6\linewidth\s!height3\linewidth\s!depth3\linewidth \hss}}} \unexpanded\def\bodyfontgrid @@ -301,11 +301,11 @@ \scratchdimen#1\relax \dontinterfere \dontcomplain - \boxrulewidth5\testrulewidth + %boxrulewidth5\testrulewidth #3#4\relax \setbox\scratchbox\normalhbox to \scratchdimen {#2{\ruledhbox to \scratchdimen - {\vrule #5 20\testrulewidth \!!width \zeropoint + {\vrule #5 20\testrulewidth \s!width \zeropoint \normalhss}}}% \smashbox\scratchbox \normalpenalty\plustenthousand @@ -316,14 +316,14 @@ {\ifdim\hangindent>\zeropoint \ifnum\hangafter<\zerocount \normalhbox - {\boxrulewidth5\testrulewidth + {%boxrulewidth5\testrulewidth \setbox\scratchbox\ruledhbox to \hangindent {\scratchdimen\strutht \advance\scratchdimen \strutdp \vrule - \!!width \zeropoint - \!!height \zeropoint - \!!depth -\hangafter\scratchdimen}% + \s!width \zeropoint + \s!height \zeropoint + \s!depth -\hangafter\scratchdimen}% \normalhskip-\hangindent \smashbox\scratchbox \raise\strutht\box\scratchbox}% @@ -349,7 +349,7 @@ \unexpanded\def\ruledpar {\relax \ifhmode - \showparagraphcue{40\testrulewidth}\relax\rightrulefalse\relax\!!height + \showparagraphcue{40\testrulewidth}\relax\rightrulefalse\relax\s!height \fi \normalpar} @@ -357,16 +357,16 @@ {\relax \normalnoindent \ruledparagraphcues - \showparagraphcue{40\testrulewidth}\llap\leftrulefalse\relax\!!height} + \showparagraphcue{40\testrulewidth}\llap\leftrulefalse\relax\s!height} \unexpanded\def\ruledindent {\relax \normalnoindent \ruledparagraphcues \ifdim\parindent>\zeropoint - \showparagraphcue\parindent\relax\relax\relax\!!height + \showparagraphcue\parindent\relax\relax\relax\s!height \else - \showparagraphcue{40\testrulewidth}\llap\relax\relax\!!height + \showparagraphcue{40\testrulewidth}\llap\relax\relax\s!height \fi \normalhskip\parindent} @@ -419,7 +419,7 @@ \def\nofruledbaselines{3} \unexpanded\def\ruledbaseline - {\vrule \!!width \zeropoint + {\vrule \s!width \zeropoint \bgroup \dontinterfere \doglobal\increment\ruledbaselines @@ -429,9 +429,9 @@ \normalhbox {\strut \vrule - \!!height \testrulewidth - \!!depth \testrulewidth - \!!width 120\points} + \s!height \testrulewidth + \s!depth \testrulewidth + \s!width 120\points} \normalvfill}% \smashbox\scratchbox \advance\scratchdimen \strutheightfactor\baselineskip @@ -481,7 +481,7 @@ \def\colormarklength{\cutmarklength} \def\dodocolorrangeA#1% - {\fastcolored[#1]{\hrule\!!width3em\!!height\scratchdimen\!!depth\zeropoint}} + {\fastcolored[#1]{\hrule\s!width3em\s!height\scratchdimen\s!depth\zeropoint}} \def\docolorrangeA#1 #2 % {\vbox @@ -514,7 +514,7 @@ \def\docolorrangeB #1 #2 #3 #4 #5 % {\fastcolored [\c!c=#2,\c!m=#3,\c!y=#4,\c!k=#5] - {\vrule\!!width\scratchdimen\!!height\colormarklength\!!depth\zeropoint}% + {\vrule\s!width\scratchdimen\s!height\colormarklength\s!depth\zeropoint}% \ifdim\scratchdimen>2em \hskip-\scratchdimen \vbox to \colormarklength @@ -541,7 +541,7 @@ \def\docolorrangeC#1 % {\fastcolored [\c!s=#1]% - {\vrule\!!width\scratchdimen\!!height\colormarklength\!!depth\zeropoint}% + {\vrule\s!width\scratchdimen\s!height\colormarklength\s!depth\zeropoint}% \ifdim\scratchdimen>2em \hskip-\scratchdimen \vbox to \colormarklength @@ -676,9 +676,9 @@ \fi}% \setbox\scratchbox\hbox {\ifdone - \colored[r=#1,g=#2,b=#3]{\vrule\!!width\wd\scratchbox}% temp hack + \colored[r=#1,g=#2,b=#3]{\vrule\s!width\wd\scratchbox}% temp hack \else - \colored[s=0]{\vrule\!!width\wd\scratchbox}% temp hack + \colored[s=0]{\vrule\s!width\wd\scratchbox}% temp hack \fi \hskip-\wd\scratchbox\box\scratchbox}% \scratchdimen1ex diff --git a/tex/context/base/math-ali.mkiv b/tex/context/base/math-ali.mkiv index 567e41f42..f1d4fca30 100644 --- a/tex/context/base/math-ali.mkiv +++ b/tex/context/base/math-ali.mkiv @@ -73,7 +73,7 @@ \ifnum\mathraggedstatus=\plusone \c_math_align_c{\hfil&\span\math_text_in_eqalign{##}\tabskip\zeropoint}% \else\ifnum\mathraggedstatus=\plusthree - \c_math_align_c{\hfil\tabskip\zeropoint\!!plus 1\!!fill&\span\math_text_in_eqalign{##}\tabskip\zeropoint}% + \c_math_align_c{\hfil\tabskip\zeropoint\s!plus 1\s!fill&\span\math_text_in_eqalign{##}\tabskip\zeropoint}% \else \c_math_align_c{\hfil\tabskip\centering&\llap{\span\math_text_in_eqalign{##}}\tabskip\zeropoint}% \fi\fi @@ -89,7 +89,7 @@ \ifnum\mathraggedstatus=\plusone \c_math_align_c{\hfil&\kern-\displaywidth\rlap{\span\math_text_in_eqalign{##}}\tabskip\displaywidth}% \else\ifnum\mathraggedstatus=\plusthree - \c_math_align_c{\hfil\tabskip\zeropoint\!!plus 1\!!fill&\kern-\displaywidth\span\math_rlap{\span\math_text_in_eqalign{##}}\tabskip\displaywidth}% + \c_math_align_c{\hfil\tabskip\zeropoint\s!plus 1\s!fill&\kern-\displaywidth\span\math_rlap{\span\math_text_in_eqalign{##}}\tabskip\displaywidth}% \else \c_math_align_c{\hfil\tabskip\centering&\kern-\displaywidth\rlap{\span\math_text_in_eqalign{##}}\tabskip\displaywidth}% \fi\fi diff --git a/tex/context/base/math-arr.mkiv b/tex/context/base/math-arr.mkiv index ddce05ece..6de27f4af 100644 --- a/tex/context/base/math-arr.mkiv +++ b/tex/context/base/math-arr.mkiv @@ -64,7 +64,7 @@ \setbox4\hbox to \wd0{\mr#2\leaders\hbox{#3}\hfill#4}% \delimitershortfall\zeropoint \nulldelimiterspace\zeropoint - \setbox2\hbox{$\left\delimiter"0270370 \vrule \!!height\ht0 \!!depth \dp0 \!!width\zeropoint\right.$}% is this the right code point? + \setbox2\hbox{$\left\delimiter"0270370 \vrule \s!height\ht0 \s!depth \dp0 \s!width\zeropoint\right.$}% is this the right code point? \mathord{\vcenter{\hbox{\copy2\rlap{\raise\dimexpr\ht2-\ht4\relax\copy4}\copy0}}}% \endgroup} diff --git a/tex/context/base/math-def.mkiv b/tex/context/base/math-def.mkiv index 3dac9a96b..0fc8d1b3d 100644 --- a/tex/context/base/math-def.mkiv +++ b/tex/context/base/math-def.mkiv @@ -119,7 +119,7 @@ \dorightbigmath#2\relax \else \doleftbigmath#2\relax - \vbox\!!to\getvalue{\??mathbig\number#1}\bodyfontsize{}% + \vbox to\getvalue{\??mathbig\number#1}\bodyfontsize{}% \dorightbigmath#2\relax \fi \nulldelimiterspace\zeropoint\relax diff --git a/tex/context/base/meta-pdh.mkiv b/tex/context/base/meta-pdh.mkiv index 6d85a8dc1..b65fe6ac6 100644 --- a/tex/context/base/meta-pdh.mkiv +++ b/tex/context/base/meta-pdh.mkiv @@ -565,7 +565,7 @@ % {\ifcase\pdfoutput\or % will be hooked into the special driver % \doiffileelse{#7} % {\doifundefinedelse{mps:x:#7} -% {\immediate\pdfximage\!!width\onebasepoint\!!height\onebasepoint{#7}% +% {\immediate\pdfximage\s!width\onebasepoint\s!height\onebasepoint{#7}% % \setxvalue{mps:x:#7}{\pdfrefximage\the\pdflastximage}}% % {\message{[reusing figure #7]}}% % \pdfliteral{q #1 #2 #3 #4 #5 #6 cm}% diff --git a/tex/context/base/mult-aux.mkiv b/tex/context/base/mult-aux.mkiv index 81b9b84c8..db636d9a1 100644 --- a/tex/context/base/mult-aux.mkiv +++ b/tex/context/base/mult-aux.mkiv @@ -581,6 +581,34 @@ \unexpanded\def\relateparameterhandlers#1#2#3#4% {from} {instance} {to} {instance} {\expandafter\edef\csname\csname#1namespace\endcsname#2:\s!parent\endcsname{\csname#3namespace\endcsname#4}} +%D Here is another experiment: + +\unexpanded\def\installactionhandler#1% + {\normalexpanded + {\mult_interfaces_install_action_handler + {#1}% + \expandafter\noexpand\csname current#1\endcsname + \expandafter\noexpand\csname setupcurrent#1\endcsname + \expandafter\noexpand\csname #1_action\endcsname}} + +\unexpanded\def\mult_interfaces_install_action_handler#1#2#3#4% + {\unexpanded\expandafter\def\csname#1\endcsname{\dodoubleempty#4}% + \unexpanded\def#4[##1][##2]% + {\begingroup + \ifsecondargument + \edef#2{##1}% + #3[##2]% + \else\iffirstargument + \doifassignmentelse{##1} + {\let#2\empty + #3[##1]}% + {\edef#2{##1}}% + \else + \let#2\empty + \fi\fi + \directsetup{handler:action:#1}% + \endgroup}} + % First we had, in tune with the regular system variables: % % \starttyping diff --git a/tex/context/base/mult-ini.mkiv b/tex/context/base/mult-ini.mkiv index f0d47103d..29fa8390e 100644 --- a/tex/context/base/mult-ini.mkiv +++ b/tex/context/base/mult-ini.mkiv @@ -101,24 +101,27 @@ %D %D \starttyping %D \hrule width 10pt height 2pt depth 1pt -%D \hrule \!!width 10pt \!!height 2pt \!!depth 1pt +%D \hrule \s!width 10pt \s!height 2pt \s!depth 1pt %D \stoptyping %D -%D One condition is that we have defined \type{\!!height}, -%D \type{\!!width} and \type{\!!depth} as respectively -%D \type{height}, \type{width} and \type{depth}. Using this +%D One condition is that we have defined \type {\s!height}, +%D \type {\s!width} and \type {\s!depth} as respectively +%D \type {height}, \type {width} and \type {depth}. Using this %D scheme therefore only makes sense when a token sequence is %D used more than once. Savings like this should of course be %D implemented in english, just because \TEX\ is english. -\def\!!width {width} -\def\!!height{height} -\def\!!depth {depth} -\def\!!plus {plus} -\def\!!minus {minus} -\def\!!fill {fill} -\def\!!to {to} -\def\!!spread{spread} +\def\s!width {width} \let\!!width \s!width % obsolete +\def\s!height{height} \let\!!height\s!height % obsolete +\def\s!depth {depth} \let\!!depth \s!depth % obsolete +\def\s!spread{spread} \let\!!spread\s!spread % obsolete +\def\s!plus {plus} \let\!!plus \s!plus % obsolete +\def\s!minus {minus} \let\!!minus \s!minus % obsolete +\def\s!fil {fil} +\def\s!fill {fill} \let\!!fill \s!fill % obsolete +\def\s!filll {filll} +\def\s!to {to} \let\!!to \s!to % obsolete +\def\s!attr {attr} %D Kind of special: diff --git a/tex/context/base/node-aux.lua b/tex/context/base/node-aux.lua index 139f25046..03a8789f7 100644 --- a/tex/context/base/node-aux.lua +++ b/tex/context/base/node-aux.lua @@ -19,6 +19,7 @@ local nodecodes = nodes.nodecodes local glyph_code = nodecodes.glyph local hlist_code = nodecodes.hlist local vlist_code = nodecodes.vlist +local attributelist_code = nodecodes.attributelist -- temporary local nodepool = nodes.pool @@ -35,14 +36,17 @@ local get_attribute = node.get_attribute local unset_attribute = node.unset_attribute local first_glyph = node.first_glyph or node.first_character local copy_node = node.copy +local copy_node_list = node.copy_list local slide_nodes = node.slide local insert_node_after = node.insert_after local isnode = node.is_node -local current_font = font.current() +local current_font = font.current local texbox = tex.box +local report_error = logs.reporter("node-aux:error") + function nodes.repackhlist(list,...) --~ nodes.showsimplelist(list) local temp, b = hpack_nodes(list,...) @@ -264,7 +268,7 @@ end nodes.tonodes = tonodes -local function link(head,tail,list,currentfont,currentattr) +local function link(list,currentfont,currentattr,head,tail) for i=1,#list do local n = list[i] if n then @@ -272,6 +276,9 @@ local function link(head,tail,list,currentfont,currentattr) if not tn then local tn = type(n) if tn == "number" then + if not currentfont then + currentfont = current_font() + end local h, t = tonodes(tostring(n),currentfont,currentattr) if not h then -- skip @@ -282,7 +289,10 @@ local function link(head,tail,list,currentfont,currentattr) end elseif tn == "string" then if #tn > 0 then - local h, t = tonodes(n,font.current(),currentattr) + if not currentfont then + currentfont = current_font() + end + local h, t = tonodes(n,currentfont,currentattr) if not h then -- skip elseif not head then @@ -293,7 +303,10 @@ local function link(head,tail,list,currentfont,currentattr) end elseif tn == "table" then if #tn > 0 then - head, tail = link(head,tail,n,currentfont,currentattr) + if not currentfont then + currentfont = current_font() + end + head, tail = link(n,currentfont,currentattr,head,tail) end end elseif not head then @@ -303,6 +316,18 @@ local function link(head,tail,list,currentfont,currentattr) else tail = n end + elseif n.id == attributelist_code then + -- weird case + report_error("weird node type in list at index %s:",i) + for i=1,#list do + local l = list[i] + if l.id == attributelist_code then + report_error("%3i: ! %s",i,tostring(l)) + else + report_error("%3i: > %s",i,tostring(l)) + end + end + os.exit() else tail.next = n n.prev = tail @@ -319,10 +344,7 @@ local function link(head,tail,list,currentfont,currentattr) return head, tail end -function nodes.link(...) - local currentfont = font.current - return link(nil,nil,{...},currentfont,currentattr) -end +nodes.link = link local function locate(start,wantedid,wantedsubtype) for n in traverse_nodes(start) do diff --git a/tex/context/base/pack-bar.mkiv b/tex/context/base/pack-bar.mkiv index 692b6f1f3..06eeebd14 100644 --- a/tex/context/base/pack-bar.mkiv +++ b/tex/context/base/pack-bar.mkiv @@ -55,38 +55,38 @@ {\hbox to \hsize {\setuppositionbar[#1]% \usepositionbarstyleandcolor\c!style\c!color - \hskip\zeropoint\!!plus \positionbarparameter\c!n \!!fill - \hskip\zeropoint\!!plus-\positionbarparameter\c!min\!!fill + \hskip\zeropoint\s!plus \positionbarparameter\c!n \s!fill + \hskip\zeropoint\s!plus-\positionbarparameter\c!min\s!fill \positionbarparameter\c!text\relax - \hskip\zeropoint\!!plus \positionbarparameter\c!max\!!fill - \hskip\zeropoint\!!plus-\positionbarparameter\c!n \!!fill}} + \hskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill + \hskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} \unexpanded\def\verticalpositionbar[#1]% {\vbox to \vsize {\setuppositionbar[#1]% \usepositionbarstyleandcolor\c!style\c!color - \vskip\zeropoint\!!plus \positionbarparameter\c!n \!!fill - \vskip\zeropoint\!!plus-\positionbarparameter\c!min\!!fill + \vskip\zeropoint\s!plus \positionbarparameter\c!n \s!fill + \vskip\zeropoint\s!plus-\positionbarparameter\c!min\s!fill \positionbarparameter\c!text\relax - \vskip\zeropoint\!!plus \positionbarparameter\c!max\!!fill - \vskip\zeropoint\!!plus-\positionbarparameter\c!n \!!fill}} + \vskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill + \vskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} \unexpanded\def\horizontalgrowingbar[#1]% {\hbox to \hsize {\setuppositionbar[#1]% \usepositionbarstyleandcolor\c!style\c!color - \leaders\vrule\hskip\zeropoint\!!plus \numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\!!fill - \vrule\!!width\zeropoint\!!height\positionbarparameter\c!height\!!depth\positionbarparameter\c!depth - \hskip\zeropoint\!!plus \positionbarparameter\c!max\!!fill - \hskip\zeropoint\!!plus-\positionbarparameter\c!n \!!fill}} + \leaders\vrule\hskip\zeropoint\s!plus \numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill + \vrule\s!width\zeropoint\s!height\positionbarparameter\c!height\s!depth\positionbarparameter\c!depth + \hskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill + \hskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} \unexpanded\def\verticalgrowingbar[#1]% {\vbox to \vsize {\setuppositionbar[#1]% \usepositionbarstyleandcolor\c!style\c!color - \leaders\hrule\vskip\zeropoint\!!plus\numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\!!fill - \hrule\!!width\positionbarparameter\c!width\!!height\zeropoint\!!depth\zeropoint - \vskip\zeropoint\!!plus \positionbarparameter\c!max\!!fill - \vskip\zeropoint\!!plus-\positionbarparameter\c!n \!!fill}} + \leaders\hrule\vskip\zeropoint\s!plus\numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill + \hrule\s!width\positionbarparameter\c!width\s!height\zeropoint\s!depth\zeropoint + \vskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill + \vskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}} \protect \endinput diff --git a/tex/context/base/pack-com.mkiv b/tex/context/base/pack-com.mkiv index 4d50bf7c7..8b4d5c0c6 100644 --- a/tex/context/base/pack-com.mkiv +++ b/tex/context/base/pack-com.mkiv @@ -210,7 +210,7 @@ \alignmark\alignmark \m_pack_combinations_rightfiller \aligntab - \tabskip\zeropoint \!!plus 1fill + \tabskip\zeropoint \s!plus 1fill \alignmark\alignmark \cr \pack_combinations_pickup} diff --git a/tex/context/base/pack-cut.mkiv b/tex/context/base/pack-cut.mkiv index 1afccee50..63f4524a8 100644 --- a/tex/context/base/pack-cut.mkiv +++ b/tex/context/base/pack-cut.mkiv @@ -56,31 +56,32 @@ \newcount\verticalcutmarks \verticalcutmarks \plustwo \newcount\cutmarkoffset \cutmarkoffset \plusone -\let\cutmarksymbol \relax -\let\cutmarktoptext \empty -\let\cutmarkbottomtext\empty -\let\cutmarkhoffset \empty -\let\cutmarkvoffset \empty -\def\cutmarklength {2\bodyfontsize} +\let\cutmarksymbol \relax +\let\cutmarktoptext \empty +\let\cutmarkbottomtext \empty +\let\cutmarkhoffset \empty +\let\cutmarkvoffset \empty +\def\cutmarklength {2\bodyfontsize} +\def\cutmarkrulethickness{\onepoint} \unexpanded\def\horizontalcuts {\normalhbox to \d_pack_cutmarks_width - {\dorecurse\horizontalcutmarks{\vrule\!!width\boxrulewidth\!!height\cutmarklength\normalhfill}% + {\dorecurse\horizontalcutmarks{\vrule\s!width\cutmarkrulethickness\s!height\cutmarklength\normalhfill}% \unskip}} \unexpanded\def\verticalcuts {\normalvbox to \dimexpr\d_pack_cutmarks_height+\d_pack_cutmarks_depth\relax {\hsize\cutmarklength - \dorecurse\verticalcutmarks{\vrule\!!height\boxrulewidth\!!width\hsize\normalvfill}% + \dorecurse\verticalcutmarks{\vrule\s!height\cutmarkrulethickness\s!width\hsize\normalvfill}% \unskip}} \unexpanded\def\baselinecuts {\ifdim\d_pack_cutmarks_depth>\zeropoint \normalvbox to \dimexpr\d_pack_cutmarks_height+\d_pack_cutmarks_depth\relax {\hsize\dimexpr\cutmarklength/2\relax - \normalvskip\zeropoint\!!plus\d_pack_cutmarks_height - \vrule\!!height\boxrulewidth\!!width\hsize - \normalvskip\zeropoint\!!plus\d_pack_cutmarks_depth}% + \normalvskip\zeropoint\s!plus\d_pack_cutmarks_height + \vrule\s!height\cutmarkrulethickness\s!width\hsize + \normalvskip\zeropoint\s!plus\d_pack_cutmarks_depth}% \fi} \unexpanded\def\cutmarksymbols#1% diff --git a/tex/context/base/pack-mrl.mkiv b/tex/context/base/pack-mrl.mkiv index 72b12d639..2ba6434fa 100644 --- a/tex/context/base/pack-mrl.mkiv +++ b/tex/context/base/pack-mrl.mkiv @@ -57,9 +57,9 @@ \fi\fi \useblackrulesstyleandcolor\c!style\c!color \vrule - \!!width \ifx\p_width \v!max\emwidth\else\p_width \fi - \!!height\ifx\p_height\v!max\strutht\else\p_height\fi - \!!depth \ifx\p_depth \v!max\strutdp\else\p_depth \fi + \s!width \ifx\p_width \v!max\emwidth\else\p_width \fi + \s!height\ifx\p_height\v!max\strutht\else\p_height\fi + \s!depth \ifx\p_depth \v!max\strutdp\else\p_depth \fi \egroup} \setupblackrules @@ -119,9 +119,9 @@ \useblackrulesstyleandcolor\c!style\c!color \dorecurse\scratchcounter % a typical case of where we can use a simple loop {\vrule - \!!width \scratchwidth - \!!height\scratchheight - \!!depth \scratchdepth + \s!width \scratchwidth + \s!height\scratchheight + \s!depth \scratchdepth \hskip\scratchdistance}% \unskip \egroup} @@ -148,9 +148,9 @@ {\bgroup \setbox\scratchbox\hbox {\vrule - \!!width #1\linewidth - \!!height#2\strutht - \!!depth #3\strutdp}% + \s!width #1\linewidth + \s!height#2\strutht + \s!depth #3\strutdp}% \dp\scratchbox\strutdp \ht\scratchbox\strutht \box\scratchbox @@ -162,9 +162,9 @@ \def\pack_rule_hl[#1]% {\hbox {\vrule - \!!width #1\emwidth - \!!height\linewidth - \!!depth \zeropoint}} + \s!width #1\emwidth + \s!height\linewidth + \s!depth \zeropoint}} \unexpanded\def\vl{\dosingleempty\pack_rule_vl} \unexpanded\def\hl{\dosingleempty\pack_rule_hl} @@ -279,14 +279,14 @@ \ifnum\c_pack_thinrules_type=\plustwo % prevent overshoot due to rounding \leaders \hrule - \!!height\dimexpr\scratchheight-\linewidth\relax - \!!depth \dimexpr\scratchdepth -\linewidth\relax + \s!height\dimexpr\scratchheight-\linewidth\relax + \s!depth \dimexpr\scratchdepth -\linewidth\relax \hfill \else \leaders \hrule - \!!height\scratchheight - \!!depth \scratchdepth + \s!height\scratchheight + \s!depth \scratchdepth \hfill \fi \stopcolor @@ -297,8 +297,8 @@ \hfillneg \leaders \hrule - \!!height\linewidth - \!!depth \linewidth + \s!height\linewidth + \s!depth \linewidth \hfill \stopcolor \or @@ -306,14 +306,14 @@ \hfillneg \leaders \hrule - \!!height\dimexpr-\scratchdepth+\linewidth\relax - \!!depth \scratchdepth + \s!height\dimexpr-\scratchdepth+\linewidth\relax + \s!depth \scratchdepth \hfill \hfillneg \leaders \hrule - \!!height\scratchheight - \!!depth \dimexpr-\scratchheight+\linewidth\relax + \s!height\scratchheight + \s!depth \dimexpr-\scratchheight+\linewidth\relax \hfill \stopcolor \fi @@ -324,8 +324,8 @@ \startcolor[\directthinrulesparameter\c!color]% \leaders \hrule - \!!height\scratchheight - \!!depth \scratchdepth + \s!height\scratchheight + \s!depth \scratchdepth \hfill \stopcolor \fi @@ -554,14 +554,14 @@ #1% \hskip\leftmargindistance}} {\color[\directtextrulesparameter\c!rulecolor] - {\vrule\!!height\scratchheight\!!depth\scratchdepth\!!width\directtextrulesparameter\c!width}% + {\vrule\s!height\scratchheight\s!depth\scratchdepth\s!width\directtextrulesparameter\c!width}% \hbox spread 2\dimexpr\directtextrulesparameter\c!distance\relax {\hss \usetextrulesstyleandcolor\c!style\c!color \strut#1% \hss}}}% \color[\directtextrulesparameter\c!rulecolor] - {\leaders\hrule\!!height\scratchheight\!!depth\scratchdepth\hfill}}% + {\leaders\hrule\s!height\scratchheight\s!depth\scratchdepth\hfill}}% \ht\scratchbox\strutht \dp\scratchbox\strutdp \noindent\box\scratchbox @@ -583,7 +583,7 @@ {\nointerlineskip \dontleavehmode\vbox {\color[\directtextrulesparameter\c!rulecolor] - {\hrule\!!depth\directtextrulesparameter\c!rulethickness\!!height\zeropoint\!!width\availablehsize}}} + {\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}} {\pack_textrule_with_text{#1}}% \ifvmode \prevdepth\zeropoint @@ -773,7 +773,7 @@ \ifdim\scratchwidth>\directfillinlinesparameter\c!margin\else\expandafter\rlap\fi {\kern\directfillinlinesparameter\c!distance \scratchheight\dimexpr\directfillinlinesparameter\c!rulethickness/\plustwo\relax - \color[\directfillinlinesparameter\c!color]{\vrule\!!width\scratchwidth\!!height\scratchheight\!!depth\scratchheight}}% + \color[\directfillinlinesparameter\c!color]{\vrule\s!width\scratchwidth\s!height\scratchheight\s!depth\scratchheight}}% \endpar \endgroup \endpar @@ -797,7 +797,7 @@ \ifdim\scratchwidth>\directfillinlinesparameter\c!margin\else\expandafter\rlap\fi {\kern\directfillinlinesparameter\c!distance \scratchheight\dimexpr\directfillinlinesparameter\c!rulethickness/\plustwo\relax - \color[\directfillinlinesparameter\c!color]{\vrule\!!width\scratchwidth\!!height\scratchheight\!!depth\scratchheight}}% + \color[\directfillinlinesparameter\c!color]{\vrule\s!width\scratchwidth\s!height\scratchheight\s!depth\scratchheight}}% \endgraf \endgroup \endgraf diff --git a/tex/context/base/pack-obj.mkiv b/tex/context/base/pack-obj.mkiv index 1e2c392a2..356a0b7eb 100644 --- a/tex/context/base/pack-obj.mkiv +++ b/tex/context/base/pack-obj.mkiv @@ -285,9 +285,9 @@ \expanded % freeze the dimensions since \dostartobject may use \nextbox {\dostartobject{#2}{#3}{\the\wd\nextbox}{\the\ht\nextbox}{\the\dp\nextbox}}% \ifcase#1\relax\else \ifdim\objectoffset>\zeropoint - \setbox\nextbox\vbox \!!spread 2\scratchdimen + \setbox\nextbox\vbox \s!spread 2\scratchdimen {\forgetall \offinterlineskip - \vss\hbox \!!spread 2\scratchdimen{\hss\box\nextbox\hss}\vss}% + \vss\hbox \s!spread 2\scratchdimen{\hss\box\nextbox\hss}\vss}% \fi \fi \box\nextbox \dostopobject diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv index 2a1f430ba..13fc2486e 100644 --- a/tex/context/base/pack-rul.mkiv +++ b/tex/context/base/pack-rul.mkiv @@ -252,9 +252,9 @@ \def\pack_framed_filled_box_normal {\vrule - \!!width \d_framed_target_wd - \!!height\d_framed_target_ht - \!!depth \d_framed_target_dp + \s!width \d_framed_target_wd + \s!height\d_framed_target_ht + \s!depth \d_framed_target_dp \relax} \def\pack_framed_filled_box_radius @@ -665,10 +665,10 @@ \dp\scratchbox\d_framed_target_dp \box\scratchbox} -\def\pack_framed_t_rule{\hrule\!!height\d_framed_linewidth\kern-\d_framed_linewidth} -\def\pack_framed_b_rule{\kern-\d_framed_linewidth\hrule\!!height\d_framed_linewidth} -\def\pack_framed_r_rule{\kern-\d_framed_linewidth\vrule\!!width\d_framed_linewidth} -\def\pack_framed_l_rule{\vrule\!!width\d_framed_linewidth\kern-\d_framed_linewidth} +\def\pack_framed_t_rule{\hrule\s!height\d_framed_linewidth\kern-\d_framed_linewidth} +\def\pack_framed_b_rule{\kern-\d_framed_linewidth\hrule\s!height\d_framed_linewidth} +\def\pack_framed_r_rule{\kern-\d_framed_linewidth\vrule\s!width\d_framed_linewidth} +\def\pack_framed_l_rule{\vrule\s!width\d_framed_linewidth\kern-\d_framed_linewidth} \letvalue{\??framedtop \v!on \v!on}\pack_framed_t_rule \letvalue{\??framedtop \v!off\v!on}\pack_framed_t_rule @@ -688,10 +688,10 @@ % no overlapping rules -\def\pack_framed_t_rules{\hbox{\kern\d_framed_linewidth\vrule\!!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\!!height\d_framed_linewidth}\nointerlineskip\kern-\d_framed_linewidth} -\def\pack_framed_b_rules{\kern-\d_framed_linewidth\nointerlineskip\hbox{\kern\d_framed_linewidth\vrule\!!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\!!height\d_framed_linewidth}} -\def\pack_framed_r_rules{\kern-\d_framed_linewidth\vrule\!!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\!!depth-\d_framed_linewidth\!!width\d_framed_linewidth} -\def\pack_framed_l_rules{\vrule\!!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\!!depth-\d_framed_linewidth\!!width\d_framed_linewidth\kern-\d_framed_linewidth} +\def\pack_framed_t_rules{\hbox{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}\nointerlineskip\kern-\d_framed_linewidth} +\def\pack_framed_b_rules{\kern-\d_framed_linewidth\nointerlineskip\hbox{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}} +\def\pack_framed_r_rules{\kern-\d_framed_linewidth\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth} +\def\pack_framed_l_rules{\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth\kern-\d_framed_linewidth} \letvalue{\??framedtop \v!small\v!small}\pack_framed_t_rules \letvalue{\??framedtop \v!off \v!small}\pack_framed_t_rules @@ -2217,13 +2217,13 @@ \nointerlineskip \kern\scratchoffset \dontleavehmode - \hrule\!!height\d_framed_linewidth\!!depth\zeropoint + \hrule\s!height\d_framed_linewidth\s!depth\zeropoint \par \kern-\d_framed_linewidth \dontleavehmode - \hbox to \zeropoint{\normalhss\vrule\!!height\d_framed_linewidth\!!depth\zeropoint\!!width\scratchwidth}% + \hbox to \zeropoint{\normalhss\vrule\s!height\d_framed_linewidth\s!depth\zeropoint\s!width\scratchwidth}% \hfill - \hbox to \zeropoint{\vrule\!!height\d_framed_linewidth\!!depth\zeropoint\!!width\scratchwidth\normalhss}% + \hbox to \zeropoint{\vrule\s!height\d_framed_linewidth\s!depth\zeropoint\s!width\scratchwidth\normalhss}% \par \nointerlineskip \kern\scratchoffset @@ -2246,7 +2246,7 @@ \unskip \setbox\scratchbox\hbox {\hskip\scratchoffset - \vrule\!!height\dimen\scratchheight\!!depth\dimen\scratchdepth\!!width\d_framed_linewidth + \vrule\s!height\dimen\scratchheight\s!depth\dimen\scratchdepth\s!width\d_framed_linewidth \hskip\scratchoffset}% \ht\scratchbox\strutht \dp\scratchbox\strutdp diff --git a/tex/context/base/page-grd.mkiv b/tex/context/base/page-grd.mkiv index e882978ca..281d0bfbe 100644 --- a/tex/context/base/page-grd.mkiv +++ b/tex/context/base/page-grd.mkiv @@ -70,9 +70,9 @@ {\hskip\layoutcolumnwidth \ifnum\recurselevel<\layoutcolumns \vrule - \!!height\ht\scratchbox - \!!depth\dp\scratchbox - \!!width\layoutcolumndistance + \s!height\ht\scratchbox + \s!depth \dp\scratchbox + \s!width \layoutcolumndistance \fi}}% \hskip-\makeupwidth \fi diff --git a/tex/context/base/page-lin.mkiv b/tex/context/base/page-lin.mkiv index d8aaa2e7e..a8a0a248e 100644 --- a/tex/context/base/page-lin.mkiv +++ b/tex/context/base/page-lin.mkiv @@ -507,7 +507,7 @@ \def\page_lines_reference_show_start#1% {\ifconditional\tracelinenumbering \setbox\scratchbox\hbox{\llap - {\vrule\!!width\onepoint\!!depth\strutdp\!!height.8\strutht\raise.85\strutht\hbox{\llap{\tt\txx#1}}}}% + {\vrule\s!width\onepoint\s!depth\strutdp\s!height.8\strutht\raise.85\strutht\hbox{\llap{\tt\txx#1}}}}% \smashbox\scratchbox \box\scratchbox \fi} @@ -515,7 +515,7 @@ \def\page_lines_reference_show_stop#1% {\ifconditional\tracelinenumbering \setbox\scratchbox\hbox{\rlap - {\raise.85\strutht\hbox{\rlap{\tt\txx#1}}\vrule\!!width\onepoint\!!depth\strutdp\!!height.8\strutht}}% + {\raise.85\strutht\hbox{\rlap{\tt\txx#1}}\vrule\s!width\onepoint\s!depth\strutdp\s!height.8\strutht}}% \smashbox\scratchbox \box\scratchbox \fi} diff --git a/tex/context/base/page-mix.mkiv b/tex/context/base/page-mix.mkiv index 58bc24f33..8c41d97fd 100644 --- a/tex/context/base/page-mix.mkiv +++ b/tex/context/base/page-mix.mkiv @@ -264,7 +264,7 @@ \setvalue{\??mixedcolumnsseparator\v!rule}% {\starttextproperties \usemixedcolumnscolorparameter\c!rulecolor - \vrule\!!width\mixedcolumnsparameter\c!rulethickness + \vrule\s!width\mixedcolumnsparameter\c!rulethickness \stoptextproperties} \unexpanded\def\page_mix_command_inject_separator diff --git a/tex/context/base/page-mul.mkiv b/tex/context/base/page-mul.mkiv index 00075633a..45a9dfa5c 100644 --- a/tex/context/base/page-mul.mkiv +++ b/tex/context/base/page-mul.mkiv @@ -130,9 +130,9 @@ \scratchdistance\dimexpr\columnsparameter\c!distance/2\relax \hskip\scratchdistance\relax \vrule - \!!width\linewidth + \s!width\linewidth \ifnum\bottomraggednessmode=\plustwo % baselinebottom - \!!depth\strutdepth + \s!depth\strutdepth \fi \hskip\scratchdistance\relax \stoptextproperties @@ -502,9 +502,9 @@ \advance\scratchdimen \ht\columnpagebox \setbox\scratchbox\hbox to \makeupwidth {\vrule - \!!width\zeropoint - \!!height\scratchdimen - \!!depth\dp\columnpagebox + \s!width\zeropoint + \s!height\scratchdimen + \s!depth\dp\columnpagebox \dostepwiserecurse\plustwo\nofcolumns\plusone{\hfil\page_mul_between_columns}\hfil}% \setbox\columnpagebox\hbox {\box\columnpagebox diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv index f0981443c..58ec2eb14 100644 --- a/tex/context/base/page-set.mkiv +++ b/tex/context/base/page-set.mkiv @@ -1944,7 +1944,7 @@ {\setbox\scratchbox\hbox to \hsize {\iftracecolumnset \hskip-.5ex% - \startcolor[columnset:#2]\vrule\!!width1ex\!!height.5ex\!!depth.5ex\stopcolor + \startcolor[columnset:#2]\vrule\s!width\exheight\s!height.5\exheight\s!depth.5\exheight\stopcolor \fi \hss}% \ifcase#1\relax diff --git a/tex/context/base/page-sid.mkiv b/tex/context/base/page-sid.mkiv index 8989b04b5..07388e7cf 100644 --- a/tex/context/base/page-sid.mkiv +++ b/tex/context/base/page-sid.mkiv @@ -678,7 +678,7 @@ \iftracesidefloats \hskip-\d_page_sides_width % kern \color[darkgray]% - {\vrule\!!height.5\points\!!depth.5\points\!!width\d_page_sides_width + {\vrule\s!height.5\points\s!depth.5\points\s!width\d_page_sides_width \llap{\showstruts\strut\kern.25\bodyfontsize}}% \fi} diff --git a/tex/context/base/ppchtex.mkiv b/tex/context/base/ppchtex.mkiv index 37ab4d412..0f42f91ce 100644 --- a/tex/context/base/ppchtex.mkiv +++ b/tex/context/base/ppchtex.mkiv @@ -576,7 +576,7 @@ \!!widtha=50.8mm \divide\!!widtha by \@@chemicalresolution\relax \plotsymbolspacing=\!!widtha - \setplotsymbol({\vrule\!!height\!!widtha\!!width\!!widtha})% + \setplotsymbol({\vrule\s!height\!!widtha\s!width\!!widtha})% \fi} % Something for Dirk: diff --git a/tex/context/base/spac-ali.lua b/tex/context/base/spac-ali.lua index effd26fe4..7ce108172 100644 --- a/tex/context/base/spac-ali.lua +++ b/tex/context/base/spac-ali.lua @@ -20,7 +20,7 @@ local unset_attribute = node.unset_attribute local slide_nodes = node.slide local hpack_nodes = node.hpack -- nodes.fasthpack not really faster here -local link_nodes = nodes.link +local concat_nodes = nodes.concat local nodecodes = nodes.nodecodes local listcodes = nodes.listcodes @@ -77,12 +77,12 @@ local function handler(head,leftpage,realpageno) action = leftpage and 2 or 1 end if action == 1 then - current.list = hpack_nodes(link_nodes(current.list,new_stretch(3)),current.width,"exactly") + current.list = hpack_nodes(concat_nodes(current.list,new_stretch(3)),current.width,"exactly") if trace_realign then report_realign("flush left: align %s, page %s, realpage %s",align,pageno,realpageno) end elseif action == 2 then - current.list = hpack_nodes(link_nodes(new_stretch(3),current.list),current.width,"exactly") + current.list = hpack_nodes(concat_nodes(new_stretch(3),current.list),current.width,"exactly") if trace_realign then report_realign("flush right: align %s, page %s, realpage %s",align,pageno,realpageno) end diff --git a/tex/context/base/spac-ali.mkiv b/tex/context/base/spac-ali.mkiv index 0afbe313b..100e3ab82 100644 --- a/tex/context/base/spac-ali.mkiv +++ b/tex/context/base/spac-ali.mkiv @@ -268,7 +268,7 @@ \newskip\s_zero_plus_one_fil \s_zero_plus_one_fil = 0pt plus 1fil \newskip\s_zero_plus_zero \s_zero_plus_zero = 0pt plus 0pt -% \!!plus ... slower than inline +% \s!plus ... slower than inline \unexpanded\def\spac_align_set_horizontal_none % should also relax \updateraggedskips {\raggedstatus\zerocount @@ -285,8 +285,8 @@ {\setraggedness\spac_align_set_raggedness_left \raggedstatus\plusone \attribute\alignstateattribute\plusone - \leftskip \plusone\leftskip \!!plus\spac_align_set_raggedness_left - \rightskip \plusone\rightskip\!!plus\zeropoint + \leftskip \plusone\leftskip \s!plus\spac_align_set_raggedness_left + \rightskip \plusone\rightskip\s!plus\zeropoint \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x \parfillskip\s_zero_plus_zero @@ -297,8 +297,8 @@ {\setraggedness\spac_align_set_raggedness_middle \raggedstatus\plustwo \attribute\alignstateattribute\plustwo - \leftskip \plusone\leftskip \!!plus\spac_align_set_raggedness_middle - \rightskip \plusone\rightskip\!!plus\spac_align_set_raggedness_middle + \leftskip \plusone\leftskip \s!plus\spac_align_set_raggedness_middle + \rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_middle \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x \parfillskip\s_zero_plus_zero @@ -309,8 +309,8 @@ {\setraggedness\spac_align_set_raggedness_right \raggedstatus\plusthree \attribute\alignstateattribute\plusthree - \leftskip \plusone\leftskip \!!plus\zeropoint - \rightskip \plusone\rightskip\!!plus\spac_align_set_raggedness_right + \leftskip \plusone\leftskip \s!plus\zeropoint + \rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_right \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x \parfillskip\s_zero_plus_one_fil @@ -320,8 +320,8 @@ \unexpanded\def\spac_align_set_horizontal_very_left {\raggedstatus\plusone \attribute\alignstateattribute\plusone - \leftskip \plusone\leftskip \!!plus\v_spac_align_fill_amount - \rightskip \plusone\rightskip\!!plus\zeropoint + \leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount + \rightskip \plusone\rightskip\s!plus\zeropoint \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x \parfillskip\s_zero_plus_zero @@ -331,8 +331,8 @@ \unexpanded\def\spac_align_set_horizontal_very_center {\raggedstatus\plustwo \attribute\alignstateattribute\plustwo - \leftskip \plusone\leftskip \!!plus\v_spac_align_fill_amount - \rightskip \plusone\rightskip\!!plus\v_spac_align_fill_amount + \leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount + \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x \parfillskip\s_zero_plus_zero @@ -342,8 +342,8 @@ \unexpanded\def\spac_align_set_horizontal_very_right {\raggedstatus\plusthree \attribute\alignstateattribute\plusthree - \leftskip \plusone\leftskip \!!plus\zeropoint - \rightskip \plusone\rightskip\!!plus\v_spac_align_fill_amount + \leftskip \plusone\leftskip \s!plus\zeropoint + \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x \parfillskip\s_zero_plus_zero @@ -354,8 +354,8 @@ {\setraggedness\spac_align_set_raggedness_middle \raggedstatus\plustwo \attribute\alignstateattribute\plustwo - \leftskip \plusone\leftskip \!!plus\v_spac_align_fill_amount_half - \rightskip \plusone\rightskip\!!plus\v_spac_align_fill_amount_half + \leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount_half + \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_half \spaceskip \v_spac_align_space_amount \xspaceskip \v_spac_align_space_amount_x \parfillskip\s_zero_plus_zero @@ -365,11 +365,11 @@ \unexpanded\def\spac_align_set_horizontal_centered_last_line {\raggedstatus\zerocount \attribute\alignstateattribute\attributeunsetvalue - \leftskip \plusone\leftskip \!!plus\v_spac_align_fill_amount\relax - \rightskip \plusone\rightskip\!!plus\v_spac_align_fill_amount_negative\relax + \leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount\relax + \rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_negative\relax \spaceskip \zeropoint\relax \xspaceskip \zeropoint\relax - \parfillskip\zeropoint\!!plus\v_spac_align_fill_amount_double\relax + \parfillskip\zeropoint\s!plus\v_spac_align_fill_amount_double\relax \parindent \zeropoint \relax} @@ -377,8 +377,8 @@ {\tttf % brrr \raggedstatus\plusthree \attribute\alignstateattribute\plusthree - \leftskip \plusone\leftskip \!!plus\zeropoint\relax - \rightskip \plusone\rightskip\!!plus\spac_align_set_raggedness_right\relax + \leftskip \plusone\leftskip \s!plus\zeropoint\relax + \rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_right\relax \spaceskip \zeropoint\relax \xspaceskip \zeropoint\relax \parfillskip\s_zero_plus_zero @@ -386,7 +386,7 @@ \relax} \unexpanded\def\spac_align_set_horizontal_extra - {\xspaceskip\zeropoint\!!plus\v_spac_align_fill_amount_space\relax} + {\xspaceskip\zeropoint\s!plus\v_spac_align_fill_amount_space\relax} \def\spac_align_flush_horizontal {\ifcase\c_spac_align_state_horizontal @@ -739,11 +739,11 @@ \def\dosetraggedskips#1#2#3#4#5#6#7% {\raggedstatus #1\relax - \leftskip 1\leftskip \!!plus#2\relax - \rightskip 1\rightskip\!!plus#3\relax + \leftskip 1\leftskip \s!plus#2\relax + \rightskip 1\rightskip\s!plus#3\relax \spaceskip #4\relax \xspaceskip #5\relax - \parfillskip \zeropoint\!!plus#6\relax + \parfillskip \zeropoint\s!plus#6\relax \parindent #7\relax \attribute\alignstateattribute\ifcase\raggedstatus\attributeunsetvalue\else\raggedstatus\fi} diff --git a/tex/context/base/spac-grd.mkiv b/tex/context/base/spac-grd.mkiv index 369c147e3..7b3ee6d6c 100644 --- a/tex/context/base/spac-grd.mkiv +++ b/tex/context/base/spac-grd.mkiv @@ -154,9 +154,9 @@ \egroup \prevdepth\strutdp}% \def\dotopbaselinecorrection - {\hrule\!!height\d_spac_lines_correction_before}% + {\hrule\s!height\d_spac_lines_correction_before}% \def\dobotbaselinecorrection - {\hrule\!!height\d_spac_lines_correction_after}} + {\hrule\s!height\d_spac_lines_correction_after}} \def\dobaselinecorrection % beware, this one is redefined / used locally elsewhere {\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi diff --git a/tex/context/base/spac-hor.mkiv b/tex/context/base/spac-hor.mkiv index 18460b1c6..9e9843e61 100644 --- a/tex/context/base/spac-hor.mkiv +++ b/tex/context/base/spac-hor.mkiv @@ -477,15 +477,15 @@ % Bovendien definieren we enkele extra \fill's: -\unexpanded\def\hfilll {\hskip\zeropoint\!!plus1filll\relax} -\unexpanded\def\vfilll {\vskip\zeropoint\!!plus1filll\relax} +\unexpanded\def\hfilll {\hskip\zeropoint\s!plus1\s!filll\relax} +\unexpanded\def\vfilll {\vskip\zeropoint\s!plus1\s!filll\relax} -%unexpanded\def\hfilneg {\hskip\zeropoint\!!plus-1fil\relax} -\unexpanded\def\hfillneg {\hskip\zeropoint\!!plus-1fill\relax} -\unexpanded\def\hfilllneg{\hskip\zeropoint\!!plus-1filll\relax} -%unexpanded\def\vfilneg {\vskip\zeropoint\!!plus-1fil\relax} -\unexpanded\def\vfillneg {\vskip\zeropoint\!!plus-1fill\relax} -\unexpanded\def\vfilllneg{\vskip\zeropoint\!!plus-1filll\relax} +%unexpanded\def\hfilneg {\hskip\zeropoint\s!plus-1\s!fil\relax} +\unexpanded\def\hfillneg {\hskip\zeropoint\s!plus-1\s!fill\relax} +\unexpanded\def\hfilllneg{\hskip\zeropoint\s!plus-1\s!filll\relax} +%unexpanded\def\vfilneg {\vskip\zeropoint\s!plus-1\s!fil\relax} +\unexpanded\def\vfillneg {\vskip\zeropoint\s!plus-1\s!fill\relax} +\unexpanded\def\vfilllneg{\vskip\zeropoint\s!plus-1\s!filll\relax} \unexpanded\def\tfskip {\begingroup\tf\hskip\emwidth\endgroup} \unexpanded\def\dotfskip#1{\begingroup\tf\hskip #1\endgroup} % used elsewhere @@ -657,7 +657,7 @@ \installtolerancemethod \v!vertical \v!verytolerant {\def\bottomtolerance{.100}} \installtolerancemethod \v!horizontal \v!stretch {\emergencystretch\bodyfontsize} -\installtolerancemethod \v!horizontal \v!space {\spaceskip.5em\!!plus.25em\!!minus.25em\relax} +\installtolerancemethod \v!horizontal \v!space {\spaceskip.5em\s!plus.25em\s!minus.25em\relax} \installtolerancemethod \v!horizontal \v!verystrict {\tolerance 200 } \installtolerancemethod \v!horizontal \v!strict {\tolerance1500 } \installtolerancemethod \v!horizontal \v!tolerant {\tolerance3000 } @@ -892,8 +892,8 @@ \def\flexiblespaceamount#1#2#3% {#1\interwordspace - \!!plus#2\interwordstretch - \!!minus#3\interwordshrink} + \s!plus#2\interwordstretch + \s!minus#3\interwordshrink} \def\fixedspaceamount#1% {#1\interwordspace} @@ -978,7 +978,7 @@ \mskip#1% \else \scratchdimen#1\hspaceamount\empty{#2}% - \scratchskip\scratchdimen\!!plus.5\scratchdimen\!!minus.3\scratchdimen + \scratchskip\scratchdimen\s!plus.5\scratchdimen\s!minus.3\scratchdimen \hskip\scratchskip \fi \endgroup} diff --git a/tex/context/base/spac-ver.mkiv b/tex/context/base/spac-ver.mkiv index 68bbe81b0..1c14266ee 100644 --- a/tex/context/base/spac-ver.mkiv +++ b/tex/context/base/spac-ver.mkiv @@ -68,8 +68,8 @@ \def\normalskipamount {\openlineheight \ifgridsnapping \else \ifblankflexible - \!!plus \skipgluefactor\openlineheight - \!!minus\skipgluefactor\openlineheight + \s!plus \skipgluefactor\openlineheight + \s!minus\skipgluefactor\openlineheight \fi \fi \relax} @@ -300,7 +300,7 @@ \def\spac_helpers_vglue_indeed {\par \d_spac_prevdepth\prevdepth - \hrule\!!height\zeropoint + \hrule\s!height\zeropoint \nobreak \vskip\s_spac_lastskip \prevdepth\d_spac_prevdepth} @@ -308,7 +308,7 @@ \def\spac_helpers_hglue_indeed {\dontleavehmode % \leavevmode \c_spac_spacefactor\spacefactor - \vrule\!!width\zeropoint + \vrule\s!width\zeropoint \nobreak \hskip\s_spac_lastskip \spacefactor\c_spac_spacefactor} @@ -696,7 +696,7 @@ \else \systemtopskipfactor\globalbodyfontsize \ifcase\bottomraggednessmode % ragged bottom - \!!plus5\globalbodyfontsize + \s!plus5\globalbodyfontsize \fi \fi %\relax @@ -740,8 +740,8 @@ \fi \normalbaselineskip\openlineheight \ifgridsnapping\else - \!!plus \m_spac_vertical_baseline_stretch_factor\openlineheight - \!!minus\m_spac_vertical_baseline_shrink_factor \openlineheight + \s!plus \m_spac_vertical_baseline_stretch_factor\openlineheight + \s!minus\m_spac_vertical_baseline_shrink_factor \openlineheight \fi \normallineskip\minimumlinedistance\relax % \onepoint\relax \normallineskiplimit\zeropoint\relax @@ -795,7 +795,7 @@ \newbox\strutbox -\setbox\strutbox\hbox{\vrule\!!height8.5pt\!!depth3.5pt\!!width\zeropoint} % just a start +\setbox\strutbox\hbox{\vrule\s!height8.5pt\s!depth3.5pt\s!width\zeropoint} % just a start \def\strut{\relax\ifmmode\copy\else\unhcopy\fi\strutbox} @@ -861,13 +861,13 @@ \unexpanded\def\charhtstrut {\begingroup \setcharstrut{GJY}% - \vrule\!!width\zeropoint\!!depth\zeropoint\!!height\strutht + \vrule\s!width\zeropoint\s!depth\zeropoint\s!height\strutht \endgroup} \unexpanded\def\chardpstrut {\begingroup \setcharstrut{gjy}% - \vrule\!!width\zeropoint\!!depth\strutdp\!!height\zeropoint + \vrule\s!width\zeropoint\s!depth\strutdp\s!height\zeropoint \endgroup} % because of all the callbacks in mkiv, we avoid unnecessary boxes ... @@ -896,18 +896,18 @@ \def\spac_struts_set_hide {\setbox\strutbox\hbox {\vrule - \!!width \zeropoint - \!!height\strutht - \!!depth \strutdp}} + \s!width \zeropoint + \s!height\strutht + \s!depth \strutdp}} \def\spac_struts_set_vide {\setbox\strutbox\hbox {\spac_struts_vide_hbox to \zeropoint {% \hss % new, will be option \vrule - \!!width \strutwidth - \!!height\strutht - \!!depth \strutdp + \s!width \strutwidth + \s!height\strutht + \s!depth \strutdp \hss}}} \let\spac_struts_vide_hbox\hbox % overloaded in trac-vis.mkiv @@ -1528,9 +1528,9 @@ \hskip.2\bodyfontsize}% \fi \vrule - \!!height \gridboxwidth - \!!depth \gridboxwidth - \!!width \scratchdimen + \s!height \gridboxwidth + \s!depth \gridboxwidth + \s!width \scratchdimen \par}} \vfill}} @@ -1621,8 +1621,8 @@ \appendtoks \s_spac_vspacing_temp\plusone\s_spac_vspacing_temp \ifconditional\c_space_vspacing_fixed \else - \!!plus \skipgluefactor\s_spac_vspacing_temp - \!!minus\skipgluefactor\s_spac_vspacing_temp + \s!plus \skipgluefactor\s_spac_vspacing_temp + \s!minus\skipgluefactor\s_spac_vspacing_temp \fi \relax \to \everyafterblankhandling diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 75b251198..893b7bab8 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 9d54ad55f..684b971c1 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/strc-doc.lua b/tex/context/base/strc-doc.lua index 46320eb8c..758c7f0e9 100644 --- a/tex/context/base/strc-doc.lua +++ b/tex/context/base/strc-doc.lua @@ -768,27 +768,31 @@ function sections.findnumber(depth,what) -- needs checking (looks wrong and slow if what == v_first or what == v_previous then for i=index,1,-1 do local s = collected[i] - local n = s.numbers - if #n == depth and n[depth] and n[depth] ~= 0 then - sectiondata = s - if quit then + if s then + local n = s.numbers + if #n == depth and n[depth] and n[depth] ~= 0 then + sectiondata = s + if quit then + break + end + elseif #n < depth then break end - elseif #n < depth then - break end end elseif what == v_last or what == v_next then for i=index,#collected do local s = collected[i] - local n = s.numbers - if #n == depth and n[depth] and n[depth] ~= 0 then - sectiondata = s - if quit then + if s then + local n = s.numbers + if #n == depth and n[depth] and n[depth] ~= 0 then + sectiondata = s + if quit then + break + end + elseif #n < depth then break end - elseif #n < depth then - break end end end diff --git a/tex/context/base/strc-mar.lua b/tex/context/base/strc-mar.lua index 66ec04739..89fc66b01 100644 --- a/tex/context/base/strc-mar.lua +++ b/tex/context/base/strc-mar.lua @@ -83,7 +83,7 @@ local function resolve(t,k) if trace_marks_set or trace_marks_get then report_marks("undefined: name=%s",k) end - local crap = { autodefined = true } + local crap = { autodefined = true } -- maybe set = 0 and reset = 0 t[k] = crap return crap else @@ -264,13 +264,16 @@ function marks.set(name,value) dn = data[name] end dn.set = topofstack + if not dn.reset then + dn.reset = 0 -- in case of selfdefined + end local top = stack[topofstack] local new = { } if top then for k, v in next, top do local d = data[k] - local r = d.reset - local s = d.set + local r = d.reset or 0 + local s = d.set or 0 if r <= topofstack and s < r then new[k] = false else diff --git a/tex/context/base/strc-pag.lua b/tex/context/base/strc-pag.lua index e154c4d26..0b921a4ba 100644 --- a/tex/context/base/strc-pag.lua +++ b/tex/context/base/strc-pag.lua @@ -86,8 +86,10 @@ function counters.specials.userpage() end local u = texcount.userpageno if u == 0 then - report_pages("forcing pagenumber of realpage %s to %s (probably a bug)",r,1) - counter.setvalue("userpage",1) + if trace_pages then + report_pages("forcing pagenumber of realpage %s to %s (probably a bug)",r,1) + end + counters.setvalue("userpage",1) texcount.userpageno = 1 end end diff --git a/tex/context/base/strc-reg.mkiv b/tex/context/base/strc-reg.mkiv index 973c6effd..44bca68d1 100644 --- a/tex/context/base/strc-reg.mkiv +++ b/tex/context/base/strc-reg.mkiv @@ -831,7 +831,7 @@ % not yet ok : new internal handler names \unexpanded\def\registerpagebuttonsymbol - {\vrule\!!width1em\!!height1ex\!!depth\zeropoint\relax} + {\vrule\s!width\emwidth\s!height\exheight\s!depth\zeropoint\relax} \installcorenamespace{registersymbol} diff --git a/tex/context/base/strc-ren.mkiv b/tex/context/base/strc-ren.mkiv index f22df120f..d9cebc17f 100644 --- a/tex/context/base/strc-ren.mkiv +++ b/tex/context/base/strc-ren.mkiv @@ -359,7 +359,7 @@ \flushnotes % new, here since we're in par mode \unhbox\b_strc_rendering_head \getheadsyncs - \hskip\headnumberdistance\!!plus\headnumberdistance\!!minus.25\dimexpr\headnumberdistance\relax + \hskip\headnumberdistance\s!plus\headnumberdistance\s!minus.25\dimexpr\headnumberdistance\relax \strc_sectioning_inject_continuous_signal \fi \ifconditional\headisdisplay diff --git a/tex/context/base/supp-box.mkiv b/tex/context/base/supp-box.mkiv index f1a9cfabc..5925c591b 100644 --- a/tex/context/base/supp-box.mkiv +++ b/tex/context/base/supp-box.mkiv @@ -1236,7 +1236,7 @@ \ifdone \else \parfillskip\zeropoint \rightskip\zeropoint - \hskip\zeropoint \!!plus 1\!!fill % \hsize + \hskip\zeropoint \s!plus 1\s!fill % \hsize \fi \unhcopy0}% \ifdim\ht\nextbox>\strutht @@ -1513,8 +1513,8 @@ \bgroup \dontcomplain \forgetall - \setbox0\hbox{\vrule\!!width \zeropoint#1}% - \setbox2\vbox{\hrule\!!height\zeropoint#1}% + \setbox0\hbox{\vrule\s!width \zeropoint#1}% + \setbox2\vbox{\hrule\s!height\zeropoint#1}% \advance\vsize \ht2 \advance\hsize \wd0 \vbox to \vsize @@ -1573,9 +1573,9 @@ {\bgroup \dowithnextbox {\setlocalhsize - \setbox\scratchbox\hbox{\vrule\!!width \zeropoint#1}% + \setbox\scratchbox\hbox{\vrule\s!width \zeropoint#1}% \ifzeropt\wd\scratchbox\else\hsize\wd\scratchbox\fi - \setbox\scratchbox\vbox{\hrule\!!height\zeropoint#1}% + \setbox\scratchbox\vbox{\hrule\s!height\zeropoint#1}% \ifzeropt\ht\scratchbox\else\vsize\ht\scratchbox\fi \vbox to \vsize{\vss\hbox to \hsize{\hss\box\nextbox\hss}\vss}% \egroup}% @@ -1791,7 +1791,7 @@ \ifvoid\unhhedbox \exitloop \else - \hskip\zeropoint \!!plus \zeropoint + \hskip\zeropoint \s!plus \zeropoint \fi}% \egroup} @@ -2169,7 +2169,7 @@ \newbox\fakedboxcursor \setbox\fakedboxcursor\hbox - {\vrule\!!width\zeropoint\!!height\zeropoint\!!depth\zeropoint} + {\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\zeropoint} \unexpanded\def\boxcursor % overloaded in core-vis {\iftraceboxplacement @@ -2178,9 +2178,9 @@ \setbox\scratchbox\hbox to \zeropoint {\hss \vrule - \!!width \scratchdimen - \!!height\scratchdimen - \!!depth \scratchdimen + \s!width \scratchdimen + \s!height\scratchdimen + \s!depth \scratchdimen \hss}% \smashedbox\scratchbox \egroup diff --git a/tex/context/base/supp-vis.mkiv b/tex/context/base/supp-vis.mkiv index 96fef9729..de7c4288d 100644 --- a/tex/context/base/supp-vis.mkiv +++ b/tex/context/base/supp-vis.mkiv @@ -185,12 +185,12 @@ %D offers \type{\hfilneg} and \type{\vfilneg}, we define our %D own alternative double \type{ll}'ed ones. -\def\hfilneg {\normalhskip\zeropoint\!!plus-1fil\relax} -\def\vfilneg {\normalvskip\zeropoint\!!plus-1fil\relax} -\def\hfillneg {\normalhskip\zeropoint\!!plus-1fill\relax} -\def\vfillneg {\normalvskip\zeropoint\!!plus-1fill\relax} -\def\hfilllneg{\normalhskip\zeropoint\!!plus-1filll\relax} -\def\vfilllneg{\normalvskip\zeropoint\!!plus-1filll\relax} +\def\hfilneg {\normalhskip\zeropoint\s!plus-1\s!fil\relax} +\def\vfilneg {\normalvskip\zeropoint\s!plus-1\s!fil\relax} +\def\hfillneg {\normalhskip\zeropoint\s!plus-1\s!fill\relax} +\def\vfillneg {\normalvskip\zeropoint\s!plus-1\s!fill\relax} +\def\hfilllneg{\normalhskip\zeropoint\s!plus-1\s!filll\relax} +\def\vfilllneg{\normalvskip\zeropoint\s!plus-1\s!filll\relax} %D \macros %D {normalhss,normalhfil,normalhfill, @@ -322,14 +322,14 @@ {\dontcomplain \normaloffinterlineskip \visualhrule - \!!height\boxrulewidth - \iftoprule\else\!!width\zeropoint\fi + \s!height\boxrulewidth + \iftoprule\else\s!width\zeropoint\fi \normalvskip-\boxrulewidth \normalhbox to \boxrulewd {\visualvrule - \!!height\boxruleht - \!!depth \boxruledp - \!!width \ifleftrule\boxrulewidth\else\zeropoint\fi + \s!height\boxruleht + \s!depth \boxruledp + \s!width \ifleftrule\boxrulewidth\else\zeropoint\fi \ifdim\boxruleht>\zeropoint \else \baselinerulefalse \fi \ifdim\boxruledp>\zeropoint \else \baselinerulefalse \fi \ifbaselinerule @@ -339,23 +339,23 @@ \cleaders \ifbaselinefill \visualhrule - \!!height\boxrulewidth + \s!height\boxrulewidth \else \normalhbox {\normalhskip2.5\boxrulewidth \visualvrule - \!!height\boxrulewidth - \!!width5\boxrulewidth + \s!height\boxrulewidth + \s!width5\boxrulewidth \normalhskip2.5\boxrulewidth}% \fi \fi \normalhfill \visualvrule - \!!width\ifrightrule\boxrulewidth\else\zeropoint\fi}% + \s!width\ifrightrule\boxrulewidth\else\zeropoint\fi}% \normalvskip-\boxrulewidth \visualhrule - \!!height\boxrulewidth - \ifbottomrule\else\!!width\zeropoint\fi}% + \s!height\boxrulewidth + \ifbottomrule\else\s!width\zeropoint\fi}% \wd#1\zeropoint \setbox#1=\ifhbox#1\normalhbox\else\normalvbox\fi {\normalhbox @@ -725,9 +725,9 @@ \def\setvisiblehfilbox#1\to#2#3#4% {\setbox#1\normalhbox {\visualvrule - \!!width #2\testrulewidth - \!!height#3\testrulewidth - \!!depth #4\testrulewidth}% + \s!width #2\testrulewidth + \s!height#3\testrulewidth + \s!depth #4\testrulewidth}% \smashbox#1} \def\doruledhfiller#1#2#3#4% @@ -826,9 +826,9 @@ \def\setvisiblevfilbox#1\to#2#3#4% {\setbox#1\normalhbox {\visualvrule - \!!width #2\testrulewidth - \!!height#3\testrulewidth - \!!depth #4\testrulewidth}% + \s!width #2\testrulewidth + \s!height#3\testrulewidth + \s!depth #4\testrulewidth}% \smashbox#1}% \def\doruledvfiller#1#2#3% @@ -939,22 +939,22 @@ \setbox0\normalhbox {\normalhskip-\testrulewidth \visualvrule - \!!width4\testrulewidth - \!!height16\testrulewidth - \!!depth16\testrulewidth}% + \s!width4\testrulewidth + \s!height16\testrulewidth + \s!depth16\testrulewidth}% \else \setbox0\normalhbox to \ifnegative-\fi\scratchskip {\visualvrule - \!!width2\testrulewidth - \ifnegative\!!depth\else\!!height\fi16\testrulewidth + \s!width2\testrulewidth + \ifnegative\s!depth\else\s!height\fi16\testrulewidth \cleaders \visualhrule \ifnegative - \!!depth2\testrulewidth - \!!height\zeropoint + \s!depth2\testrulewidth + \s!height\zeropoint \else - \!!height2\testrulewidth - \!!depth\zeropoint + \s!height2\testrulewidth + \s!depth\zeropoint \fi \normalhfill \ifflexible @@ -964,15 +964,15 @@ \normalhbox {\normalhskip 2\testrulewidth \visualvrule - \!!width2\testrulewidth - \!!height\ifnegative-7\else9\fi\testrulewidth - \!!depth\ifnegative9\else-7\fi\testrulewidth + \s!width2\testrulewidth + \s!height\ifnegative-7\else9\fi\testrulewidth + \s!depth\ifnegative9\else-7\fi\testrulewidth \normalhskip 2\testrulewidth}% \normalhfill \fi \visualvrule - \!!width2\testrulewidth - \ifnegative\!!depth\else\!!height\fi16\testrulewidth}% + \s!width2\testrulewidth + \ifnegative\s!depth\else\s!height\fi16\testrulewidth}% \setbox0\normalhbox {\ifnegative\else\normalhskip-\scratchskip\fi \box0}% @@ -1075,14 +1075,14 @@ \ifzero \setbox0\normalvcue {\visualvrule - \!!width32\testrulewidth - \!!height2\testrulewidth - \!!depth2\testrulewidth}% + \s!width32\testrulewidth + \s!height2\testrulewidth + \s!depth2\testrulewidth}% \else \setbox0\normalvbox to \ifnegative-\fi\scratchskip {\visualhrule - \!!width16\testrulewidth - \!!height2\testrulewidth + \s!width16\testrulewidth + \s!height2\testrulewidth \ifflexible \cleaders \normalhbox to 16\testrulewidth @@ -1090,8 +1090,8 @@ \normalvbox {\normalvskip 2\testrulewidth \visualhrule - \!!width2\testrulewidth - \!!height2\testrulewidth + \s!width2\testrulewidth + \s!height2\testrulewidth \normalvskip 2\testrulewidth}% \normalhss}% \normalvfill @@ -1099,12 +1099,12 @@ \normalvfill \fi \visualhrule - \!!width16\testrulewidth - \!!height2\testrulewidth}% + \s!width16\testrulewidth + \s!height2\testrulewidth}% \setbox2\normalvbox to \ht0 {\visualhrule - \!!width2\testrulewidth - \!!height\ht0}% + \s!width2\testrulewidth + \s!height\ht0}% \ifnegative \ht0\zeropoint \setbox0\normalhbox @@ -1191,25 +1191,25 @@ \ifzero \setbox0\ruledhbox to 8\testrulewidth {\visualvrule - \!!width\zeropoint - \!!height16\testrulewidth - \!!depth16\testrulewidth}% + \s!width\zeropoint + \s!height16\testrulewidth + \s!depth16\testrulewidth}% \setbox0\normalhbox {\normalhskip-4\testrulewidth\box0}% \else \setbox0\ruledhbox to \ifnegative-\fi\scratchskip {\visualvrule - \!!width\zeropoint - \ifnegative\!!depth\else\!!height\fi16\testrulewidth + \s!width\zeropoint + \ifnegative\s!depth\else\s!height\fi16\testrulewidth \ifflexible \normalhskip2\testrulewidth \cleaders \normalhbox {\normalhskip 2\testrulewidth \visualvrule - \!!width2\testrulewidth - \!!height\ifnegative-7\else9\fi\testrulewidth - \!!depth\ifnegative9\else-7\fi\testrulewidth + \s!width2\testrulewidth + \s!height\ifnegative-7\else9\fi\testrulewidth + \s!depth\ifnegative9\else-7\fi\testrulewidth \normalhskip 2\testrulewidth}% \normalhfill \else @@ -1267,9 +1267,9 @@ \ifzero \setbox0\ruledhbox to 32\testrulewidth {\visualvrule - \!!width\zeropoint - \!!height4\testrulewidth - \!!depth4\testrulewidth}% + \s!width\zeropoint + \s!height4\testrulewidth + \s!depth4\testrulewidth}% \else \setbox0\ruledvbox to \ifnegative-\fi\scratchskip {\hsize16\testrulewidth @@ -1280,15 +1280,15 @@ \normalvbox {\normalvskip 2\testrulewidth \visualhrule - \!!width2\testrulewidth - \!!height2\testrulewidth + \s!width2\testrulewidth + \s!height2\testrulewidth \normalvskip 2\testrulewidth}% \normalhss}% \normalvfill \else \visualvrule - \!!width\zeropoint - \!!height\ifnegative-\fi\scratchskip + \s!width\zeropoint + \s!height\ifnegative-\fi\scratchskip \normalhfill \fi} \fi @@ -1362,7 +1362,7 @@ \def\supp_visualizers_hglue_indeed {\leavevmode \scratchcounter\spacefactor - \visualvrule\!!width\zeropoint + \visualvrule\s!width\zeropoint \normalpenalty\plustenthousand \ruledhkern\normalhskip\scratchskip \spacefactor\scratchcounter @@ -1392,7 +1392,7 @@ \def\supp_visualizers_vglue_indeed {\endgraf % \par \nextdepth\prevdepth - \visualhrule\!!height\zeropoint + \visualhrule\s!height\zeropoint \normalpenalty\plustenthousand \ruledvkern\normalvskip\scratchskip \prevdepth\nextdepth @@ -1418,26 +1418,26 @@ {$\normalmkern\ifnegative-\fi\scratchskip$}% \setbox\boxrulescratchbox\normalhbox to \wd\boxrulescratchbox {\visualvrule - \!!height16\testrulewidth - \!!depth 16\testrulewidth - \!!width \testrulewidth + \s!height16\testrulewidth + \s!depth 16\testrulewidth + \s!width \testrulewidth \leaders \visualhrule - \!!height\ifpositive 16\else-14\fi\testrulewidth - \!!depth \ifpositive-14\else 16\fi\testrulewidth + \s!height\ifpositive 16\else-14\fi\testrulewidth + \s!depth \ifpositive-14\else 16\fi\testrulewidth \normalhfill \ifflexible \normalhskip-\wd\boxrulescratchbox \leaders \visualhrule - \!!height\testrulewidth - \!!depth \testrulewidth + \s!height\testrulewidth + \s!depth \testrulewidth \normalhfill \fi \visualvrule - \!!height16\testrulewidth - \!!depth 16\testrulewidth - \!!width \testrulewidth}% + \s!height16\testrulewidth + \s!depth 16\testrulewidth + \s!width \testrulewidth}% \smashbox0% \ifnegative #1\scratchskip @@ -1568,19 +1568,19 @@ \normalhskip-\scratchdimen \normalhskip-2\testrulewidth \visualvrule - \!!width 2\testrulewidth - \!!height#3\testrulewidth - \!!depth #4\testrulewidth + \s!width 2\testrulewidth + \s!height#3\testrulewidth + \s!depth #4\testrulewidth \fi \visualvrule - \!!width \scratchdimen - \!!height#5\testrulewidth - \!!depth #6\testrulewidth + \s!width \scratchdimen + \s!height#5\testrulewidth + \s!depth #6\testrulewidth \ifnum#2>\zerocount \visualvrule - \!!width 2\testrulewidth - \!!height#3\testrulewidth - \!!depth #4\testrulewidth + \s!width 2\testrulewidth + \s!height#3\testrulewidth + \s!depth #4\testrulewidth \fi \fi}% \smashbox#1} @@ -1599,8 +1599,8 @@ \setbox0\ruledhbox to 8\testrulewidth {\ifnegative\else\normalhss\fi \visualvrule - \!!depth8\testrulewidth - \!!width\ifzero\zeropoint\else4\testrulewidth\fi + \s!depth8\testrulewidth + \s!width\ifzero\zeropoint\else4\testrulewidth\fi \ifpositive\else\normalhss\fi}% \supp_visualizers_penalty_box{2}{\scratchcounter}{0}{8}{-3.5}{4.5}% \normalpenalty\plustenthousand @@ -1650,13 +1650,13 @@ \boxrulewidth\testrulewidth \setbox0\ruledhbox {\visualvrule - \!!height4\testrulewidth - \!!depth 4\testrulewidth - \!!width \zeropoint + \s!height4\testrulewidth + \s!depth 4\testrulewidth + \s!width \zeropoint \visualvrule - \!!height\ifnegative.5\else4\fi\testrulewidth + \s!height\ifnegative.5\else4\fi\testrulewidth \!!dept \ifpositive.5\else4\fi\testrulewidth - \!!width 8\testrulewidth}% + \s!width 8\testrulewidth}% \supp_visualizers_penalty_box{2}{\scratchcounter}{4}{4}{.5}{.5}% \setbox0\normalhbox {\normalhskip-4\testrulewidth diff --git a/tex/context/base/syst-fnt.mkiv b/tex/context/base/syst-fnt.mkiv index f5c9ea349..625b952b7 100644 --- a/tex/context/base/syst-fnt.mkiv +++ b/tex/context/base/syst-fnt.mkiv @@ -38,7 +38,7 @@ \def\mathsubcombined {\fontdimen17 } % to be remapped \def\mathaxisheight {\fontdimen22 } % to be remapped -\def\currentspaceskip {\interwordspace\!!plus\interwordstretch\!!minus\interwordshrink\relax} +\def\currentspaceskip {\interwordspace\s!plus\interwordstretch\s!minus\interwordshrink\relax} \def\mathstacktotal {\dimexpr\Umathstacknumup\scriptstyle+\Umathstackdenomdown\scriptstyle\relax} \def\mathstackvgap {\Umathstackvgap\scriptstyle} diff --git a/tex/context/base/tabl-mis.mkiv b/tex/context/base/tabl-mis.mkiv index e1ab77ecd..9a0f13853 100644 --- a/tex/context/base/tabl-mis.mkiv +++ b/tex/context/base/tabl-mis.mkiv @@ -54,11 +54,11 @@ \scratchmx\directdummyparameter\c!m\relax \edef\kindoftabposition{\the\scratchmx}% \ifnum\scratchmx>\plusone - #2\zeropoint \!!plus \the\numexpr\scratchmx-\plusone \relax\!!fill\relax + #2\zeropoint \s!plus \the\numexpr\scratchmx-\plusone \relax\s!fill\relax \fi #4% can use \kindoftabposition \ifnum\scratchmx<\scratchnx\relax - #2\zeropoint \!!plus \the\numexpr\scratchnx-\scratchmx\relax\!!fill\relax + #2\zeropoint \s!plus \the\numexpr\scratchnx-\scratchmx\relax\s!fill\relax \fi \egroup \egroup} @@ -282,7 +282,7 @@ {\scratchwidth\paragraphsparameter\c!rulethickness \scratchdistance\dimexpr(\scratchdistance-\scratchwidth)/2\relax \hskip\scratchdistance - \color[\paragraphsparameter\c!rulecolor]{\vrule\!!width\scratchwidth}}% + \color[\paragraphsparameter\c!rulecolor]{\vrule\s!width\scratchwidth}}% \hskip\scratchdistance} \protect \endinput diff --git a/tex/context/base/tabl-tab.mkiv b/tex/context/base/tabl-tab.mkiv index b2cffbd4a..b9b519620 100644 --- a/tex/context/base/tabl-tab.mkiv +++ b/tex/context/base/tabl-tab.mkiv @@ -80,7 +80,7 @@ \appendtoks \parindent\zeropoint \raggedright - \rightskip\zeropoint \!!plus 4em \relax + \rightskip\zeropoint \s!plus 4em \relax \to \everytableparbox \newskip \tablelefttabskip @@ -875,9 +875,9 @@ \def\donormaltablelineformat#1#2% {\vrule - \!!width \zeropoint - \!!height\dimexpr\tablestrutheightfactor\tablestrutunit+#1\tablestrutunit\relax - \!!depth \dimexpr\tablestrutdepthfactor \tablestrutunit+#2\tablestrutunit\relax + \s!width \zeropoint + \s!height\dimexpr\tablestrutheightfactor\tablestrutunit+#1\tablestrutunit\relax + \s!depth \dimexpr\tablestrutdepthfactor \tablestrutunit+#2\tablestrutunit\relax \relax \cr} @@ -974,7 +974,7 @@ \def\donormaltablefullrule {\starttablenoalign \!ttGetHalfRuleThickness - \hrule\!!height\scratchdimen\!!depth\scratchdimen + \hrule\s!height\scratchdimen\s!depth\scratchdimen \stoptablenoalign} \def\donormaltableshortrule % was: \!ttShortHrule @@ -983,7 +983,7 @@ \ifx\tablecurrenthrulecolor\empty\else \switchtocolor[\tablecurrenthrulecolor]% see *DL* \fi - \leaders\hrule\!!height\scratchdimen\!!depth\scratchdimen\hfill + \leaders\hrule\s!height\scratchdimen\s!depth\scratchdimen\hfill \emptyhbox \ignorespaces} @@ -1019,7 +1019,7 @@ % SetTableToWidth -> textwidth=dimension [to dimension] % Expand -> textwidth=max [to \hsize] % WidenTableBy -> [spread #1] -% \tablelefttabskip\zeropoint\!!plus1fill +% \tablelefttabskip\zeropoint\s!plus1\s!fill % \tablerighttabskip\tablelefttabskip % LongLines -> [spread \hsize] diff --git a/tex/context/base/tabl-tbl.mkiv b/tex/context/base/tabl-tbl.mkiv index e4792efa1..d38b7e22e 100644 --- a/tex/context/base/tabl-tbl.mkiv +++ b/tex/context/base/tabl-tbl.mkiv @@ -221,6 +221,8 @@ \newconstant \c_tabl_tabulate_localcolorspan \newconstant \c_tabl_tabulate_modus +\let\tabulatesplitlinemode\c_tabl_tabulate_splitlinemode % temp hack, we need an interface + \let \m_tabl_tabulate_separator_factor \empty % fraction \newif \iftracetabulate % will become a tracker @@ -305,7 +307,7 @@ \def\tabl_tabulate_nobreak_inject_tracer {\red % maybe use the fast color switcher here - \hrule\!!height.5\linewidth\!!depth.5\linewidth + \hrule\s!height.5\linewidth\s!depth.5\linewidth \par \kern-\linewidth \nobreak} @@ -1261,11 +1263,11 @@ \tabl_tabulate_column_normal#1} \def\tabl_tabulate_column_vruled_normal - {\vrule\!!width\d_tabl_tabulate_vrulethickness\relax} + {\vrule\s!width\d_tabl_tabulate_vrulethickness\relax} \def\tabl_tabulate_column_vruled_colored {\dousecolorparameter\m_tabl_tabulate_vrule_color - \vrule\!!width\d_tabl_tabulate_vrulethickness\relax} + \vrule\s!width\d_tabl_tabulate_vrulethickness\relax} \unexpanded\def\tabl_tabulate_column_vrule_inject_first {\ifcase\d_tabl_tabulate_vrulethickness\else @@ -1354,8 +1356,8 @@ \def\tabl_tabulate_hrule_inject_normal {\hrule - \!!height.5\d_tabl_tabulate_hrulethickness_local - \!!depth .5\d_tabl_tabulate_hrulethickness_local + \s!height.5\d_tabl_tabulate_hrulethickness_local + \s!depth .5\d_tabl_tabulate_hrulethickness_local \relax} \def\tabl_tabulate_hrule_inject_colored @@ -1390,8 +1392,8 @@ % % \def\donormaltabulatehlinerule % {\leaders \hrule -% \!!height\dimexpr.5\lineheight-\strutdepth -% \!!depth-\dimexpr.5\lineheight-\strutdepth+\d_tabl_tabulate_hrulethickness_local +% \s!height\dimexpr.5\lineheight-\strutdepth +% \s!depth-\dimexpr.5\lineheight-\strutdepth+\d_tabl_tabulate_hrulethickness_local % \hfill} % % \def\docoloredtabulatehlinerule diff --git a/tex/context/base/trac-vis.lua b/tex/context/base/trac-vis.lua index ca606939b..81994c38f 100644 --- a/tex/context/base/trac-vis.lua +++ b/tex/context/base/trac-vis.lua @@ -125,16 +125,20 @@ local trace_whatsit local report_visualize = logs.reporter("visualize") local modes = { - hbox = 1, - vbox = 2, - vtop = 4, - kern = 8, - glue = 16, - penalty = 32, - fontkern = 64, - strut = 128, - whatsit = 256, - glyph = 512, + hbox = 1, + vbox = 2, + vtop = 4, + kern = 8, + glue = 16, + penalty = 32, + fontkern = 64, + strut = 128, + whatsit = 256, + glyph = 512, + simple = 1024, + simplehbox = 1024 + 1, + simplevbox = 1024 + 2, + simplevtop = 1024 + 4, } -- local modes_makeup = { "hbox", "vbox", "vtop", "kern", "glue", "penalty" } @@ -352,65 +356,74 @@ end local b_cache = { } -local function ruledbox(head,current,vertical,layer,what) +local function ruledbox(head,current,vertical,layer,what,simple) local wd = current.width if wd ~= 0 then local ht, dp = current.height, current.depth local next, prev = current.next, current.prev current.next, current.prev = nil, nil local linewidth = emwidth/10 - local baseline + local baseline, baseskip if dp ~= 0 and ht ~= 0 then - baseline = b_cache.baseline - if not baseline then - -- due to an optimized leader color/transparency we need to set the glue node in order - -- to trigger this mechanism - local leader = concat_nodes { - new_glue(2.5*linewidth), - new_rule(5*linewidth,linewidth,0), - new_glue(2.5*linewidth), - } - -- setlisttransparency(leader,c_text) - leader = fast_hpack(leader) - -- setlisttransparency(leader,c_text) - baseline = new_glue(0) - baseline.leader = leader - baseline.subtype = cleaders_code - baseline.spec.stretch = 65536 - baseline.spec.stretch_order = 2 - setlisttransparency(baseline,c_text) - b_cache.baseline = baseline + if wd > 20*linewidth then + baseline = b_cache.baseline + if not baseline then + -- due to an optimized leader color/transparency we need to set the glue node in order + -- to trigger this mechanism + local leader = concat_nodes { + new_glue(2*linewidth), -- 2.5 + new_rule(6*linewidth,linewidth,0), -- 5.0 + new_glue(2*linewidth), -- 2.5 + } + -- setlisttransparency(leader,c_text) + leader = fast_hpack(leader) + -- setlisttransparency(leader,c_text) + baseline = new_glue(0) + baseline.leader = leader + baseline.subtype = cleaders_code + baseline.spec.stretch = 65536 + baseline.spec.stretch_order = 2 + setlisttransparency(baseline,c_text) + b_cache.baseline = baseline + end + baseline = copy_list(baseline) + baseline = fast_hpack(baseline,wd-2*linewidth) + -- or new hpack node, set head and also: + -- baseline.width = wd + -- baseline.glue_set = wd/65536 + -- baseline.glue_order = 2 + -- baseline.glue_sign = 1 + baseskip = new_kern(-wd+linewidth) + else + baseline = new_rule(wd-2*linewidth,linewidth,0) + baseskip = new_kern(-wd+2*linewidth) end - baseline = copy_list(baseline) - baseline = fast_hpack(baseline,wd-2*linewidth) - -- or new hpack node, set head and also: - -- baseline.width = wd - -- baseline.glue_set = wd/65536 - -- baseline.glue_order = 2 - -- baseline.glue_sign = 1 end - local this = b_cache[what] - if not this then - local text = fast_hpack_string(what,usedfont) - this = concat_nodes { - new_kern(-text.width), - text, - } - setlisttransparency(this,c_text) - this = fast_hpack(this) - this.width = 0 - this.height = 0 - this.depth = 0 - b_cache[what] = this + local this + if not simple then + this = b_cache[what] + if not this then + local text = fast_hpack_string(what,usedfont) + this = concat_nodes { + new_kern(-text.width), + text, + } + setlisttransparency(this,c_text) + this = fast_hpack(this) + this.width = 0 + this.height = 0 + this.depth = 0 + b_cache[what] = this + end end local info = concat_nodes { - copy_list(this), -- this also triggets the right mode (else sometimes no whatits) + this and copy_list(this) or nil, -- this also triggers the right mode (else sometimes no whatits) new_rule(linewidth,ht,dp), new_rule(wd-2*linewidth,-dp+linewidth,dp), new_rule(linewidth,ht,dp), new_kern(-wd+linewidth), new_rule(wd-2*linewidth,ht,-ht+linewidth), - new_kern(-wd+linewidth), + baseskip, baseline, } setlisttransparency(info,c_text) @@ -420,8 +433,6 @@ local function ruledbox(head,current,vertical,layer,what) info.depth = 0 set_attribute(info,a_layer,layer) local info = concat_nodes { --- info, --- current, current, new_kern(-wd), info, @@ -430,9 +441,6 @@ local function ruledbox(head,current,vertical,layer,what) if vertical then info = vpack_nodes(info) end --- info.width = wd --- info.height = ht --- info.depth = dp if next then info.next = next next.prev = info @@ -631,6 +639,7 @@ local function visualize(head,vertical) local trace_strut = false local trace_whatsit = false local trace_glyph = false + local trace_simple = false local current = head local prev_trace_fontkern = nil local attr = unsetvalue @@ -650,17 +659,19 @@ local function visualize(head,vertical) trace_strut = false trace_whatsit = false trace_glyph = false - else - trace_hbox = hasbit(a, 1) - trace_vbox = hasbit(a, 2) - trace_vtop = hasbit(a, 4) - trace_kern = hasbit(a, 8) - trace_glue = hasbit(a, 16) - trace_penalty = hasbit(a, 32) - trace_fontkern = hasbit(a, 64) - trace_strut = hasbit(a,128) - trace_whatsit = hasbit(a,256) - trace_glyph = hasbit(a,512) + trace_simple = false + else -- dead slow: + trace_hbox = hasbit(a, 1) + trace_vbox = hasbit(a, 2) + trace_vtop = hasbit(a, 4) + trace_kern = hasbit(a, 8) + trace_glue = hasbit(a, 16) + trace_penalty = hasbit(a, 32) + trace_fontkern = hasbit(a, 64) + trace_strut = hasbit(a, 128) + trace_whatsit = hasbit(a, 256) + trace_glyph = hasbit(a, 512) + trace_simple = hasbit(a,1024) end attr = a end @@ -718,7 +729,7 @@ local function visualize(head,vertical) current.list = visualize(content,false) end if trace_hbox then - head, current = ruledbox(head,current,false,l_hbox,"H__") + head, current = ruledbox(head,current,false,l_hbox,"H__",trace_simple) end elseif id == vlist_code then local content = current.list @@ -726,9 +737,9 @@ local function visualize(head,vertical) current.list = visualize(content,true) end if trace_vtop then - head, current = ruledbox(head,current,true,l_vtop,"_T_") + head, current = ruledbox(head,current,true,l_vtop,"_T_",trace_simple) elseif trace_vbox then - head, current = ruledbox(head,current,true,l_vbox,"__V") + head, current = ruledbox(head,current,true,l_vbox,"__V",trace_simple) end elseif id == whatsit_code then if trace_whatsit then diff --git a/tex/context/base/trac-vis.mkiv b/tex/context/base/trac-vis.mkiv index defe35a5f..70968fb35 100644 --- a/tex/context/base/trac-vis.mkiv +++ b/tex/context/base/trac-vis.mkiv @@ -45,9 +45,9 @@ \let\syst_visualizers_vbox\vbox \let\syst_visualizers_vtop\vtop -\unexpanded\def\ruledhbox{\syst_visualizers_hbox attr \visualattribute \ctxcommand{visual("hbox")} } -\unexpanded\def\ruledvbox{\syst_visualizers_vbox attr \visualattribute \ctxcommand{visual("vbox")} } -\unexpanded\def\ruledvtop{\syst_visualizers_vtop attr \visualattribute \ctxcommand{visual("vtop")} } % special case +\unexpanded\def\ruledhbox{\syst_visualizers_hbox attr \visualattribute \ctxcommand{visual("simplehbox")} } +\unexpanded\def\ruledvbox{\syst_visualizers_vbox attr \visualattribute \ctxcommand{visual("simplevbox")} } +\unexpanded\def\ruledvtop{\syst_visualizers_vtop attr \visualattribute \ctxcommand{visual("simplevtop")} } % special case \unexpanded\def\showmakeup {\ctxcommand{setvisual("makeup")}% diff --git a/tex/context/base/typo-brk.lua b/tex/context/base/typo-brk.lua index 14f0b8b47..726518a85 100644 --- a/tex/context/base/typo-brk.lua +++ b/tex/context/base/typo-brk.lua @@ -29,7 +29,8 @@ local free_node = node.free local insert_node_before = node.insert_before local insert_node_after = node.insert_after local remove_node = nodes.remove -- ! nodes -local link_nodes = nodes.link + +local tonodes = nodes.tonodes local texattribute = tex.attribute local unsetvalue = attributes.unsetvalue @@ -139,10 +140,18 @@ methods[5] = function(head,start,settings) -- x => p q r head, start, tmp = remove_node(head,start) head, start = insert_node_before(head,start,new_disc()) local attr = tmp.attr + local font = tmp.font start.attr = copy_nodelist(attr) -- todo: critical only - start.pre = link_nodes(settings.right,tmp,attr) - start.post = link_nodes(settings.left,tmp,attr) - start.replace = link_nodes(settings.middle,tmp,attr) + local left, right, middle = settings.left, settings.right, settings.middle + if left then + start.pre = tonodes(tostring(left),font,attr) -- was right + end + if right then + start.post = tonodes(tostring(right),font,attr) -- was left + end + if middle then + start.replace = tonodes(tostring(middle),font,attr) + end free_node(tmp) insert_break(head,start,10000,10000) end diff --git a/tex/context/base/typo-mar.lua b/tex/context/base/typo-mar.lua index 8b9a083a5..65438de16 100644 --- a/tex/context/base/typo-mar.lua +++ b/tex/context/base/typo-mar.lua @@ -126,7 +126,7 @@ local free_node_list = node.flush_list local insert_node_after = node.insert_after local insert_node_before = node.insert_before -local link_nodes = nodes.link +local concat_nodes = nodes.concat local nodecodes = nodes.nodecodes local listcodes = nodes.listcodes @@ -450,7 +450,7 @@ local function realign(current,candidate) end end - current.list = hpack_nodes(link_nodes(anchornode,new_kern(-delta),current.list,new_kern(delta))) -- anchor == nil is ok in link_nodes + current.list = hpack_nodes(concat_nodes(anchornode,new_kern(-delta),current.list,new_kern(delta))) current.width = 0 end @@ -493,7 +493,7 @@ local function markovershoot(current) v_anchors = v_anchors + 1 cache[v_anchors] = stacked local anchor = new_latelua(format("typesetters.margins.ha(%s)",v_anchors)) -- todo: alleen als offset > line - current.list = hpack_nodes(link_nodes(anchor,current.list)) + current.list = hpack_nodes(concat_nodes(anchor,current.list)) end local function getovershoot(location) @@ -627,7 +627,7 @@ local function inject(parent,head,candidate) elseif head.id == whatsit_code and head.subtype == localpar_code then -- experimental if head.dir == "TRT" then - box.list = hpack_nodes(link_nodes(new_kern(candidate.hsize),box.list,new_kern(-candidate.hsize))) + box.list = hpack_nodes(concat_nodes(new_kern(candidate.hsize),box.list,new_kern(-candidate.hsize))) end insert_node_after(head,head,box) else diff --git a/tex/context/base/unic-ini.mkiv b/tex/context/base/unic-ini.mkiv index 55764dbdc..ece0da283 100644 --- a/tex/context/base/unic-ini.mkiv +++ b/tex/context/base/unic-ini.mkiv @@ -30,7 +30,7 @@ \def\unicodechar#1{\ctxcommand{unicodechar("#1")}} \unexpanded\def\unknownchar - {\dontleavehmode\hbox{\vrule\!!width.5em\!!height1ex\!!depth\zeropoint}} + {\dontleavehmode\hbox{\vrule\s!width.5\emwidth\s!height\exheight\s!depth\zeropoint}} \ifdefined\zwnbsp\else \let\zwnbsp\relax \fi % zerowidthnonbreakablespace diff --git a/tex/context/base/x-chemml.mkiv b/tex/context/base/x-chemml.mkiv index 34aba3011..80e8317d8 100644 --- a/tex/context/base/x-chemml.mkiv +++ b/tex/context/base/x-chemml.mkiv @@ -163,7 +163,7 @@ \stopxmlsetups \def\doCMLbond - {\hrule\!!width\hsize\!!height.1ex\relax} + {\hrule\s!width\hsize\s!height.1ex\relax} \def\dodoCMLbond#1#2#3% {\begingroup diff --git a/tex/context/base/x-mathml.mkiv b/tex/context/base/x-mathml.mkiv index 6db01c671..2866418e8 100644 --- a/tex/context/base/x-mathml.mkiv +++ b/tex/context/base/x-mathml.mkiv @@ -2240,10 +2240,10 @@ \!!deptha \xmlattdef{#1}{depth} \!!zeropoint \ifdim\!!heighta=\zeropoint \ifdim\!!deptha=\zeropoint\else - \hbox{\vrule\!!depth\!!deptha\!!height\zeropoint\!!width\zeropoint}% + \hbox{\vrule\s!depth\!!deptha\s!height\zeropoint\s!width\zeropoint}% \fi \else - \hbox{\vrule\!!depth\zeropoint\!!height\!!heighta\!!width\zeropoint}% + \hbox{\vrule\s!depth\zeropoint\s!height\!!heighta\s!width\zeropoint}% \fi \ifdim\!!widtha=\zeropoint\else \hskip\!!widtha @@ -2277,7 +2277,7 @@ % \setbox\scratchbox\hbox{\mathematics{\mathstyle{\mmllinetext}}}% not ok % \!!widtha\wd\scratchbox % \fi -% \hbox{\vrule\!!width\!!widtha\!!depth\!!deptha\!!height\!!heighta} +% \hbox{\vrule\s!width\!!widtha\s!depth\!!deptha\s!height\!!heighta} % \stopxmlsetups \startxmlsetups mml:mglyph % probably never ok (hbox is needed in order to switch to normal font) diff --git a/tex/context/sample/lorem.tex b/tex/context/sample/lorem.tex new file mode 100644 index 000000000..0132f659f --- /dev/null +++ b/tex/context/sample/lorem.tex @@ -0,0 +1,11 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur massa turpis, +semper quis fringilla ut, viverra nec risus. Pellentesque habitant morbi +tristique senectus et netus et malesuada fames ac turpis egestas. Donec nunc +lorem, sollicitudin vel sodales eget, vehicula nec mi. Proin ullamcorper rutrum +nibh, at porttitor nunc euismod et. Donec faucibus nisi faucibus ipsum porttitor +pharetra. Sed elementum, lectus nec congue imperdiet, ipsum leo viverra nisi, sit +amet commodo odio odio id nisl. Fusce sagittis lobortis nisi sed consectetur. Nam +egestas, sem ut fermentum convallis, ipsum tellus venenatis augue, eget +condimentum risus quam id erat. Sed metus dui, sollicitudin pharetra pellentesque +sed, placerat eget augue. Mauris sodales pretium tortor vitae rutrum. Proin quam +sem, lobortis tincidunt pretium vitae, feugiat eu lacus. diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index cb410ec09..7fe581243 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 : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 07/18/12 14:11:15 +-- merge date : 07/19/12 12:56:56 do -- begin closure to overcome local limits and interference |