29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

We can manipulate the heigth and depth of the lines to give different (and maybe better) results.<br />

\startuseMPgraphic{text vars}<br />

baselineskip := 8pt ;<br />

strutheight := 4pt ;<br />

strutdepth := 2pt ;<br />

offset := 4pt ;<br />

topskip := 3pt ;<br />

\stopuseMPgraphic<br />

This kind of graphic trickery in itself is not enough to get TEX into typesetting within the bounds<br />

of a closed curve. Since METAPOST can write information to a file, and TEX can read such a file, a<br />

natural way to handle this is to let METAPOST write a \parshape specification.<br />

\startuseMPgraphic{text macro}<br />

def provide_parshape (expr p, offset, baselineskip,<br />

strutheight, strutdepth, topskip) =<br />

\includeMPgraphic{text move}<br />

\includeMPgraphic{text split}<br />

\includeMPgraphic{text cutoff}<br />

\includeMPgraphic{text draw}<br />

\includeMPgraphic{text calc}<br />

\includeMPgraphic{text loop}<br />

\includeMPgraphic{text save}<br />

enddef ;<br />

\stopuseMPgraphic<br />

Talking to TEX Typesetting in METAPOST<br />

245

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!