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.

38<br />

You can define such a pen yourself:<br />

path p ; p := fullcircle xscaled 2cm yscaled 3cm ;<br />

pen doublepen ; doublepen := makepen ((0,0)--(.3cm,.3cm)) ;<br />

pickup doublepen ; draw p ;<br />

Here we define a new pen using the pen command. Then we define a path, and make a pen out of<br />

it using the makepen macro. The path should be a relatively simple one, otherwise METAPOST will<br />

complain.<br />

You can use makepen with the previously introduced withpen:<br />

draw p withpen makepen ((0,0)--(.3cm,.3cm)) ;<br />

and pickup:<br />

pickup makepen ((0,0)--(.3cm,.3cm)) ; draw p ;<br />

You can use makepen and makepath to convert paths into pens and vice versa.<br />

Pens are very important when defining fonts, and METAFONT is meant to be a font creation tool.<br />

Since METAPOST has a slightly different audience, it lacks some features in this area, but offers a<br />

few others instead. Nevertheless, one can try to design a font using METAPOST. Of course, pens are<br />

among the designers best kept secrets. But even then, not every O is a nice looking one.<br />

1.12 Joining lines<br />

The way lines are joined or end is closely related to the way POSTSCRIPT handles this. By setting the<br />

variables linejoin and linecap, you can influence the drawing process. Figure 1.1 demonstrates<br />

the alternatives. The gray curves are drawn with both variables set to rounded.<br />

Welcome to MetaPost Joining lines

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

Saved successfully!

Ooh no, something went wrong!