diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-02-24 12:15:08 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-02-24 12:15:08 +0100 |
commit | 33e29b1ba0661b0f58605749528362a0e12eae52 (patch) | |
tree | d9c1ceebec1f4869ffa0bdeafbeef390cb916525 /tex/context/base/mkiv/mlib-pdf.lua | |
parent | a3170089e0016cfc0489c433d9113d94b9ce3d67 (diff) | |
download | context-33e29b1ba0661b0f58605749528362a0e12eae52.tar.gz |
2016-02-24 11:22:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-pdf.lua')
-rw-r--r-- | tex/context/base/mkiv/mlib-pdf.lua | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/tex/context/base/mkiv/mlib-pdf.lua b/tex/context/base/mkiv/mlib-pdf.lua index 10327c01d..a2d4638a9 100644 --- a/tex/context/base/mkiv/mlib-pdf.lua +++ b/tex/context/base/mkiv/mlib-pdf.lua @@ -468,8 +468,21 @@ function metapost.flush(result,flusher,askedfig) }) -- first we analyze local before, after = processplugins(object) - local evenodd = not object.istext and object.postscript == "evenodd" - local collect = not object.istext and object.postscript == "collect" + local evenodd, collect, both = false, false, false + local postscript = object.postscript + if not object.istext then + if postscript == "evenodd" then + evenodd = true + elseif postscript == "collect" then + collect = true + elseif postscript == "both" then + both = true + elseif postscript == "eoboth" then + evenodd = true + both = true + end + end + -- if collect then if not savedpath then savedpath = { object.path or false } @@ -498,16 +511,23 @@ function metapost.flush(result,flusher,askedfig) linecap = lc result[#result+1] = f_J(lc) end - local dl = object.dash - if dl then - local d = f_d(concat(dl.dashes or {}," "),dl.offset) - if d ~= dashed then - dashed = d - result[#result+1] = d + if both then + if dashed ~= false then -- was just dashed test + result[#result+1] = "[] 0 d" + dashed = false + end + else + local dl = object.dash + if dl then + local d = f_d(concat(dl.dashes or {}," "),dl.offset) + if d ~= dashed then + dashed = d + result[#result+1] = d + end + elseif dashed ~= false then -- was just dashed test + result[#result+1] = "[] 0 d" + dashed = false end - elseif dashed ~= false then -- was just dashed test - result[#result+1] = "[] 0 d" - dashed = false end local path = object.path -- newpath local transformed, penwidth = false, 1 @@ -547,7 +567,11 @@ function metapost.flush(result,flusher,askedfig) if objecttype == "fill" then result[#result+1] = evenodd and "h f*" or "h f" -- f* = eo elseif objecttype == "outline" then - result[#result+1] = open and "S" or "h S" + if both then + result[#result+1] = evenodd and "h B*" or "h B" -- f* = eo + else + result[#result+1] = open and "S" or "h S" + end elseif objecttype == "both" then result[#result+1] = evenodd and "h B*" or "h B"-- B* = eo -- b includes closepath end |