From b7acaab4eb5fb8d6e3a6aa86a86c2b0576bde6ea Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 24 Sep 2018 15:05:48 +0200 Subject: 2018-09-24 14:19:00 --- metapost/context/base/mpiv/mp-mlib.mpiv | 33 +++++++++++++++++++++++++++++++++ metapost/context/base/mpiv/mp-tool.mpiv | 5 ++--- 2 files changed, 35 insertions(+), 3 deletions(-) (limited to 'metapost') diff --git a/metapost/context/base/mpiv/mp-mlib.mpiv b/metapost/context/base/mpiv/mp-mlib.mpiv index 48fcbd8c9..807b91dbd 100644 --- a/metapost/context/base/mpiv/mp-mlib.mpiv +++ b/metapost/context/base/mpiv/mp-mlib.mpiv @@ -1246,6 +1246,39 @@ def mfun_do_outline_options_d = enddef ; def mfun_do_outline_options_f = enddef ; def mfun_do_outline_options_r = enddef ; +def outlinetexttopath(text o, p, n) = + scantokens("numeric " & str n & ";") ; + scantokens("path " & str p & "[];") ; + n := 0 ; + for i within o : p[incr(n)] := pathpart i ; endfor ; +enddef ; + +def filloutlinetext(expr o) = + draw image ( + save n, m ; numeric n, m ; n := m := 0 ; + for i within o : + n := n + 1 ; + endfor ; + for i within o : + m := m + 1 ; + if n = m : + eofill + else : + nofill + fi pathpart i ; + endfor ; + ) +enddef ; + +def drawoutlinetext(expr o) = + draw image ( + % nicer for properties + for i within o : + draw pathpart i ; + endfor ; + ) +enddef ; + if mfun_use_one_pass : vardef outlinetext@# (expr t) text rest = diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv index 8a11d8fda..4c7303f44 100644 --- a/metapost/context/base/mpiv/mp-tool.mpiv +++ b/metapost/context/base/mpiv/mp-tool.mpiv @@ -325,7 +325,7 @@ let pop_boundingbox = popboundingbox ; % downward compatible vardef boundingbox primary p = if (path p) or (picture p) : - llcorner p -- lrcorner p -- urcorner p -- ulcorner p + llcorner p -- lrcorner p -- urcorner p -- ulcorner p else : origin fi -- cycle @@ -3409,8 +3409,7 @@ primarydef p crossingunder q = a := hold[hold] ; hold := hold - 1 ; fi if i = crossingnumbermax : - message("crossingunder reached maximum " & decimal i & - " intersections."); + message("crossingunder reached maximum " & decimal i & " intersections."); fi endfor -- cgit v1.2.3