From 2956fe45a7fd41b8f84ccec8edcba66a3445e6e9 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Thu, 25 Feb 2016 14:15:08 +0100 Subject: 2016-02-25 14:02:00 --- metapost/context/base/mpiv/mp-mlib.mpiv | 10 +++++----- metapost/context/base/mpiv/mp-page.mpiv | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) (limited to 'metapost') diff --git a/metapost/context/base/mpiv/mp-mlib.mpiv b/metapost/context/base/mpiv/mp-mlib.mpiv index 17ec983a1..326342b70 100644 --- a/metapost/context/base/mpiv/mp-mlib.mpiv +++ b/metapost/context/base/mpiv/mp-mlib.mpiv @@ -1451,11 +1451,11 @@ vardef formatted(expr f, x) = textext(varfmt(f, x)) enddef ; % new -def both text t = draw t withpostscript "both" enddef ; % we use draw because we need the proper boundingbox -def eoboth text t = draw t withpostscript "eoboth" enddef ; % we use draw because we need the proper boundingbox -def eofill text t = fill t withpostscript "evenodd" enddef ; -def nofill text t = fill t withpostscript "collect" enddef ; -%%% eoclip text t = clip t withpostscript "evenodd" enddef ; % no postscripts yet +def fillup text t = draw t withpostscript "both" enddef ; % we use draw because we need the proper boundingbox +def eofillup text t = draw t withpostscript "eoboth" enddef ; % we use draw because we need the proper boundingbox +def eofill text t = fill t withpostscript "evenodd" enddef ; +def nofill text t = fill t withpostscript "collect" enddef ; +%%% eoclip text t = clip t withpostscript "evenodd" enddef ; % no postscripts yet % def withrule expr r = % if (t = "even-odd") or (t = "evenodd") : withpostscript "evenodd" fi diff --git a/metapost/context/base/mpiv/mp-page.mpiv b/metapost/context/base/mpiv/mp-page.mpiv index a6fa3fba3..4ccf4448e 100644 --- a/metapost/context/base/mpiv/mp-page.mpiv +++ b/metapost/context/base/mpiv/mp-page.mpiv @@ -662,3 +662,32 @@ def Enlarged (expr p, d) = urEnlarged (p,d) -- ulEnlarged (p,d) -- cycle) enddef ; + +% for the moment we put these here: + +numeric RuleWidth ; RuleWidth := 0 ; +numeric RuleHeight ; RuleHeight := 0 ; +numeric RuleDepth ; RuleDepth := 0 ; +numeric RuleThickness ; RuleThickness := 0 ; +numeric RuleFactor ; RuleFactor := 0 ; +numeric RuleOffset ; RuleOffset := 0 ; + def RuleColor = (.5white) enddef ; + +def FakeWord(expr RuleWidth, RuleHeight, RuleDepth, RuleThickness) (text RuleColor) = + fill unitsquare + xscaled RuleWidth + yscaled (RuleDepth-RuleThickness/2) + withcolor RuleColor ; + fill unitsquare + xscaled RuleWidth + yscaled (RuleHeight-RuleDepth-RuleThickness/2) + shifted (0,RuleDepth+RuleThickness) + withcolor RuleColor ; +enddef ; + +def FakeRule(expr RuleWidth, RuleHeight, RuleDepth, RuleThickness) (text RuleColor) = + fill unitsquare + xscaled RuleWidth + yscaled RuleHeight + withcolor RuleColor ; +enddef ; -- cgit v1.2.3