[metapost] Trying to use MT1 to make outline fonts... (again)

mskala at ansuz.sooke.bc.ca mskala at ansuz.sooke.bc.ca
Tue Jun 19 14:47:49 CEST 2012


On Tue, 19 Jun 2012, Shriramana Sharma wrote:
> 1) Has this "regular pen stroking algorithm" since the article been
> added to MT1?

No.  And although I am not an MT1 developer, I think it's unlikely to be
added in the future.  It's a really hard computational geometry problem,
and there are difficulties enough with boundary cases in the current code
already.  Classic METAFONT works on bitmaps; it's not clear how to do
something equivalent to the bitmap-based stroke operation using vectors
exclusively.

> 2) Are rotated elliptical pens usable?
> 3) Even if not, are non-rotated elliptical pens usable?
> 4) Even if not, at least are circular pens usable?

I use all three - circular, non-circular elliptical, with rotation, and
without rotation.  The "simplified" stroking algorithm generally works
pretty well in practice.  When I have trouble with it, I can often work
around the issues by adding extra points along my path using the MT1
insert_nodes() macro.  The lack of a true pen stroke calculation is
noticed, but is not prohibitive.

> 5) The MFBook tells me to do pickup pencircle xscaled yscaled rotated
> and do "penstroke". It is not very clear to me whether I can do
> penstrokes in MT1 or I have to do outlines only and fill them. (Means
> the computer doesn't take care of converting the strokes to paths.)
> Can anyone please clarify?

You cannot "do penstroke" in MT1 at all, because you can't do it in
Metapost either, and MT1 is just a layer of macros and processing on top
of Metapost.  The equivalent operation in MT1 is to use the pen_stroke()
macro, which takes a path and computes another path representing the shape
of the resulting stroke, which you can then fill.

The sample code that comes with MT1 is worth reading; it shows how
pen-stroking is done with paths, and as soon as you experiment with it
yourself you'll get some idea of the possibilities and limitations of the
simplified stroking algorithm.  Unfortunately, the best documentation is
in Polish, which I can't read and you probably can't either.

-- 
Matthew Skala
mskala at ansuz.sooke.bc.ca                 People before principles.
http://ansuz.sooke.bc.ca/


More information about the metapost mailing list