[metapost] `withprescript' writing order

Lander lander at we.lc.ehu.es
Wed Dec 26 13:58:23 CET 2007


Dear List,

When several `withprescript' drawing options are specified
for a given object, the order in which the strings are
written to the output file is the opposite of the order in
which they appear in the input file.  This does not happen
with `withpostscript'.  Example:
        
        beginfig(1)
          fill fullcircle scaled 2cm withcolor blue
            withprescript "gsave"
            withprescript ".3 .setopacityalpha"
            withpostscript "grestore";
          fill fullcircle scaled 2cm shifted (1cm, 0)
            withcolor blue;
        endfig;

The `.setopacityalpha' operator comes before `gsave' in the
output file, but my intention is the other way round (just
to alter the graphics state for the first circle).  I wonder
whether this is a deliberate behaviour as intended by the
developers: because it is a "prescript", it may make sense
that LIFO writing order.  I find it a bit awkward, though;
perhaps it is worth adding a line to the manual, as a
clarification.

Sincerely,
Lander.


More information about the metapost mailing list