[metapost] Questions re ps_out

Taco Hoekwater taco at elvenkind.com
Thu Aug 9 10:05:34 CEST 2012


Hi,

On 08/08/2012 09:07 AM, Shriramana Sharma wrote:
>
> 1) If I want the PostScript code for all the figures at a time, I have
> to manually do a for loop to run this on each edge_object and
> individually save the output somewhere else? (I am thinking like a
> QList<QString>...) Can't this be made automatic (perhaps by request --
> ship_out_all or something)?

Preferably not, writing a small loop is easy enough on the user side.

> 2) Re the mp_stream struct that the ps_out is: char*data; char*cur;,
> do I understand that char*data will give the actual PS code? What is
> cur? The current position in the stream?

Yes, and yes.

> 3) The syntax of the mp_ps_ship_out function is  int
> mp_ps_ship_out(mp_edge_object*hh,int prologues,int procset).
>
> a. Do I understand correctly I have to point hh to the desired edge
> object (figure) for which I want PS code and that by prologues I
> assume you mean the one for which we set value using prologues:= in
> the MP code? (Which is perhaps not accessible per figure being a
> global variable...)

Yes.

> b. What is procset and what value should I pass it? I don't find this
> word anywhere else in the API doc or the manual.

The 'procset' variable is 'mpprocset'. This is a switch between yes/no
creation of a private postscript dictionary containing shortcuts for
the used postscript operators.

Best wishes,
Taco



More information about the metapost mailing list