summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/grph-rul.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-02-25 14:15:08 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-02-25 14:15:08 +0100
commit2956fe45a7fd41b8f84ccec8edcba66a3445e6e9 (patch)
tree9b8bb67ac817b66a7395ae7b2a8c7b5586079f32 /tex/context/base/mkiv/grph-rul.lua
parent33e29b1ba0661b0f58605749528362a0e12eae52 (diff)
downloadcontext-2956fe45a7fd41b8f84ccec8edcba66a3445e6e9.tar.gz
2016-02-25 14:02:00
Diffstat (limited to 'tex/context/base/mkiv/grph-rul.lua')
-rw-r--r--tex/context/base/mkiv/grph-rul.lua38
1 files changed, 18 insertions, 20 deletions
diff --git a/tex/context/base/mkiv/grph-rul.lua b/tex/context/base/mkiv/grph-rul.lua
index 4ca36b677..5d3cb8ad5 100644
--- a/tex/context/base/mkiv/grph-rul.lua
+++ b/tex/context/base/mkiv/grph-rul.lua
@@ -55,33 +55,31 @@ do
return v
end)
- local makecode = utilities.templates.replacer [[
- beginfig(1);
- RuleWidth := %width% ;
- RuleHeight := %height% ;
- RuleDepth := %depth% ;
- RuleThickness := %line% ;
- RuleFactor := %factor% ;
- RuleOffset := %offset% ;
- def RuleColor = %color% enddef ;
- %data%;
- endfig ;
- ]]
+ local replacer = utilities.templates.replacer
local predefined = {
- ["fake:word"] = [[
-fill unitsquare xscaled RuleWidth yscaled RuleHeight withcolor RuleColor ;
-draw (0,RuleDepth+RuleThickness/2) -- (RuleWidth,RuleDepth+RuleThickness/2) withpen pencircle scaled RuleThickness withcolor white ;
+ ["fake:word"] = replacer [[
+FakeWord(%width%,%height%,%depth%,%line%,%color%);
]],
- ["fake:rule"] = [[
-fill unitsquare xscaled RuleWidth yscaled RuleHeight withcolor RuleColor ;
+ ["fake:rule"] = replacer[[
+FakeRule(%width%,%height%,%depth%,%line%,%color%);
]],
+ ["fake:rest"] = replacer [[
+RuleWidth := %width% ;
+RuleHeight := %height% ;
+RuleDepth := %depth% ;
+RuleThickness := %line% ;
+RuleFactor := %factor% ;
+RuleOffset := %offset% ;
+def RuleColor = %color% enddef ;
+%data%;
+ ]]
}
ruleactions.mp = function(p,h,v,i,n)
- local name = p.name
- local code = makecode {
- data = name and predefined[name] or p.data or "",
+ local name = p.name or "fake:rest"
+ local code = (predefined[name] or predefined["fake:rest"]) {
+ data = p.data or "",
width = p.width * bpfactor,
height = p.height * bpfactor,
depth = p.depth * bpfactor,