From b8a38bef2eaacea0dd17897dc99f1ef09b46a7e3 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 28 Nov 2016 14:23:17 +0100 Subject: 2016-11-28 13:36:00 --- tex/context/base/mkiv/mlib-pdf.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tex/context/base/mkiv/mlib-pdf.lua') diff --git a/tex/context/base/mkiv/mlib-pdf.lua b/tex/context/base/mkiv/mlib-pdf.lua index 5989b5b55..4d1756c43 100644 --- a/tex/context/base/mkiv/mlib-pdf.lua +++ b/tex/context/base/mkiv/mlib-pdf.lua @@ -31,6 +31,7 @@ local pen_info = mplib.pen_info local object_fields = mplib.fields local save_table = false +local force_stroke = false metapost = metapost or { } local metapost = metapost @@ -68,6 +69,10 @@ directives.register("metapost.savetable",function(v) end end) +trackers.register("metapost.forcestroke",function(v) + force_stroke = v +end) + local pdfliteral = function(pdfcode) local literal = copy_node(mpsliteral) literal.data = pdfcode @@ -560,7 +565,9 @@ function metapost.flush(result,flusher,askedfig) else flushnormalpath(path,result,open) end - if objecttype == "fill" then + if force_stroke then + result[#result+1] = open and "S" or "h S" + elseif objecttype == "fill" then result[#result+1] = evenodd and "h f*" or "h f" -- f* = eo elseif objecttype == "outline" then if both then @@ -597,7 +604,9 @@ function metapost.flush(result,flusher,askedfig) else flushnormalpath(path,result,open) end - if objecttype == "fill" then + if force_stroke then + result[#result+1] = open and "S" or "h S" + elseif 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" -- cgit v1.2.3