29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

130<br />

4.4 Foregrounds<br />

The overlay system is actually a system of layers. Sometimes we are confronted with a situation<br />

in which we want the text behind another layer. This can be achieved by explicitly placing the<br />

foreground layer, as in figure 4.3.<br />

The graphic layer is defined as follows:<br />

one, two, three, . . . one, two, three, . . .<br />

frame on top layer frame on<br />

bottom layer<br />

Figure 4.3 Foreground<br />

material moved backwards.<br />

\startuniqueMPgraphic{backfore}<br />

draw fullcircle<br />

xscaled \overlaywidth yscaled \overlayheight<br />

withpen pencircle scaled 2pt<br />

withcolor .625yellow ;<br />

\stopuniqueMPgraphic<br />

\defineoverlay[backfore][\uniqueMPgraphic{backfore}]<br />

The two framed texts have a slightly different definition. The leftmost graphic is defined as:<br />

\framed<br />

[background=backfore,backgroundoffset=4pt]<br />

{one, two, three, \unknown}<br />

The rightmost graphic is specified as:<br />

\framed<br />

[background={foreground,backfore},backgroundoffset=4pt]<br />

{one, two, three, \unknown}<br />

The current values of the frame color and frame width are passed to the overlay. It often makes<br />

more sense to use colors defined at the document level, if only to force consistency.<br />

\startuniqueMPgraphic{super ellipse}<br />

path p ; p := unitsquare<br />

xscaled \overlaywidth yscaled \overlayheight<br />

superellipsed .85 ;<br />

pickup pencircle scaled \overlaylinewidth ;<br />

fill p withcolor \MPcolor{\overlaycolor} ;<br />

draw p withcolor \MPcolor{\overlaylinecolor} ;<br />

\stopuniqueMPgraphic<br />

\defineoverlay[super ellipse][\uniqueMPgraphic{super ellipse}]<br />

Enhancing the layout Foregrounds

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

Saved successfully!

Ooh no, something went wrong!