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.

140<br />

OverlayHeight \overlayheight current height<br />

OverlayDepth \overlayheight current depth (often zero)<br />

OverlayColor \MPcolor{\overlaycolor} background color<br />

OverlayLineWidth \overlaylinewidth width of the frame<br />

OverlayLineColor \MPcolor{} color of the frame<br />

BaseLineSkip \the\baselineskip main line distance<br />

LineHeight \the\baselineskip idem<br />

BodyFontSize \the\bodyfontsize font size of the running text<br />

StrutHeight \strutheight space above the baseline<br />

StrutDepth \strutdepth space below the baseline<br />

ExHeight 1ex height of an x<br />

EmWidth 1em width of an m-dash<br />

\startuseMPgraphic{FunnyFrame}<br />

picture p ; numeric o ; path a, b ; pair c ;<br />

p := textext.rt(\MPstring{FunnyFrame}) ;<br />

o := BodyFontSize ;<br />

a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ;<br />

p := p shifted (2o,OverlayHeight-ypart center p) ;<br />

pickup pencircle scaled OverlayLineWidth ;<br />

b := a superellipsed .95 ;<br />

fill b withcolor OverlayColor ;<br />

draw b withcolor OverlayLineColor ;<br />

b := (boundingbox p) superellipsed .95 ;<br />

fill b withcolor OverlayColor ;<br />

draw b withcolor OverlayLineColor ;<br />

draw p withcolor black ;<br />

setbounds currentpicture to a ;<br />

\stopuseMPgraphic<br />

Zapf (3)<br />

Many people are just fascinated by their PC's tricks, and think that a widely--praised program,<br />

called up on the screen, will make everything automatic from now on.<br />

We used the following command to pass the settings:<br />

\setupframedtexts<br />

[FunnyText]<br />

[backgroundcolor=lightgray,<br />

framecolor=darkred,<br />

rulethickness=2pt,<br />

offset=\bodyfontsize,<br />

before={\blank[big,medium]},<br />

after={\blank[big]},<br />

width=\textwidth]<br />

In a real implementation, we should also take care of some additional spacing before the text,<br />

which is why we have added more space before than after the framed text.<br />

Enhancing the layout Graphics and macros

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

Saved successfully!

Ooh no, something went wrong!