[metapost] Filling complex paths
Daniel H. Luecking
luecking at uark.edu
Fri Oct 17 17:40:32 CEST 2014
I think you have to wrap the drawing in withprescript/withpostscript code that
redefines the PS operators fill and newpath.
Years ago, before these operators existed, B. Jackovski emailed me some
code that allowed eofill and eoclip operators. In those days one used a trick
using a dummy font whose name was redefined to be a command that
provided these redefinitions (I think). It should be a little easier now.
Daniel H. Luecking
Department of Mathematical Sciences
1 University of Arkansas
Fayetteville, AR, USA 72701-1201
From: metapost [metapost-bounces at tug.org] on behalf of Tobias Columbus [tobias.columbus at gmail.com]
Sent: Thursday, October 16, 2014 4:44 PM
To: metapost at tug.org
Subject: [metapost] Filling complex paths
I am currently writing a piece of software that should spit out some MetaPost
code. My input are the closed curves of a glyph and I want to produce MetaPost
code that fills them according to Postscript rules. However, as MetaPost cannot
handle non-contiguous closed paths, this task seems difficult at least.
Note that the glyphs come from non-Postscript fonts, so that the MetaPost
"glyph" primitive does not work for me. I also tried "graphictext" as described
in the Metafun manual but that turned out to be too inaccurate. I traced the
inaccuracy back to "pstoedit", which is called for "graphictext".
My attempt was to fiddle around with specials and
withprescript/withpostscript. This attempt turned out to be nonsense as
addto always writes "stroke" or "fill" and my specials were ignored. I
could, of course, write the whole glyph with specials, but I would
prefer a cleaner solution.
Has anybody some experience with this kind of problem? How difficult
would it be to add filling of non-contiguous paths to MetaPost?
Thank you in advance,
More information about the metapost