summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv39
1 files changed, 38 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv b/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
index 643e93c428d..19f398eb900 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
@@ -71,7 +71,7 @@
%definesystemattribute[ruled]
%definesystemattribute[shifted]
-\registerctxluafile{node-rul}{}
+\registerctxluafile{node-rul}{optimize}
\installcorenamespace{bar}
\installcorenamespace{barindex}
@@ -146,6 +146,8 @@
{\node_rules_set{#1}\barparameter\c!left}%
{\relax\barparameter\c!right}}
+% store in properties
+
\unexpanded\def\node_rules_set#1% maybe reverse the 1000 (also maybe use more attributes instead of settings)
{\edef\currentbar{#1}%
\usebarstyleandcolor\c!foregroundstyle\c!foregroundcolor
@@ -571,4 +573,39 @@
\c!distance=.25\emwidth,
\c!rulethickness=.25\exheight]
+%D Bonus:
+%D
+%D \starttyping
+%D \startuseMPgraphic{foo}
+%D fill unitsquare
+%D xyscaled (RuleWidth,RuleHeight+RuleDepth) enlarged (ExHeight/4,ExHeight/8)
+%D shifted (-ExHeight/8,ExHeight/16)
+%D withcolor RuleColor ;
+%D \stopuseMPgraphic
+%D
+%D \definelinefiller[foo][mp=foo,color=darkred]
+%D
+%D \linefillerhbox[foo]{OEPS}
+%D \stoptyping
+
+\unexpanded\def\node_backgrounds_filler_box#1#2[#3]%
+ {\bgroup
+ \clf_enablebackgroundboxes
+ \dowithnextbox{%
+ \node_linefiller_set{#3}% already sets the attribute
+ #1%
+ attr \backgroundattribute \plusone
+ % attr \linefillerattribute \the\attribute\linefillerattribute
+ {\box\nextbox}%
+ \egroup}%
+ #2}
+
+\unexpanded\def\linefillerhbox{\node_backgrounds_filler_box\hpack\hbox}
+\unexpanded\def\linefillervbox{\node_backgrounds_filler_box\vpack\vbox}
+\unexpanded\def\linefillervtop{\node_backgrounds_filler_box\tpack\vtop}
+
+%D Bonus:
+
+\unexpanded\def\autorule{\clf_autorule}
+
\protect \endinput