[metapost] Trying to figure out MPLib

Shriramana Sharma samjnaa at gmail.com
Fri Aug 3 14:39:59 CEST 2012

On Fri, Aug 3, 2012 at 5:39 PM, Hans Hagen <pragma at wxs.nl> wrote:
>> needs TeX or kpathsea) to be done by it. The important reason I am
>> using MetaPost/MPLib is to calculating the control points needed for
>> smooth strokes.
> So, just take the library and package it indepently. Of course one might
> wonder what benefits metapost provides in that case.

As I said above, basically I need the smooth curves Hobby algorithm.
MPost is one of the better known implementations out there. But if it
is difficult to integrate it outside a TeX environment (in which case
I'm not sure what the point of creating a library was -- only to save
multiple executable calls from within ConTeXT/LuaTeX?) then I guess it
might not be very suitable for my purpose.

I'm also looking into the Asymptote code right now as it is in C++
(which I understand better than CWEB). (I am aware Asymptote is
related to TeX also...)

Until then (I'm still looking at MPLib so) I wonder why mp_execute
requires me to input the length of the string myself. Basically I'm
doing mp_execute ( mp, command, strlen ( command ) ) -- so can't the
library calculate the length itself using strlen? Why put the burden
on the API user?

Shriramana Sharma

More information about the metapost mailing list