[metapost] Filling complex paths
tobias.columbus at gmail.com
Fri Oct 17 17:29:53 CEST 2014
Thanks for your answer! ... and sorry for being too stupid to reply to the list.
I did not try this yet, but this would work. I think that I will stick with your
solution as a workaround. However, I initially wanted to avoid filling whole
regions with the background color as I do not know about the background of the
pictures the contours will be used in.
On Thu, Oct 16, 2014 at 05:08:00PM -0600, Dan T. Abell wrote:
> Hi Tobias,
> Have you tried using 'fill' for the outermost closed
> curve, followed by 'unfill' on the closed curves inside?
> On 16 Oct 2014, at 15:44, Tobias Columbus <tobias.columbus at gmail.com> wrote:
> > Hi all,
> > 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,
> > Tobias
> > --
> > http://tug.org/metapost/
> Dan T. Abell :: dabell69 at earthlink dot net
> 169 76th St, Boulder CO 80303 :: 303.748.6894
More information about the metapost