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.

Meta is a female lion!<br />

Figure 10.2 An example of clipping.<br />

The font and scale are determined by two variables, defaultfont and defaultscale, the former<br />

expecting the name of a font in the form of a string, the latter expecting a numeric to be used in<br />

the scaling of the font. Should you choose not to set these yourself, they default to "cmr10" and<br />

1.0, respectively. However, you can change the defaults as follows:<br />

defaultfont := "tir" ;<br />

defaultscale := 1.2 ;<br />

These settings select Adobe Times at about 12pt. You can also set these variables to CONTEXT related<br />

values. For CONTEXT graphics they are set to:<br />

defaultfont := "\truefontname{Regular}" ;<br />

defaultscale := \the\bodyfontsize/10 ;<br />

This means that they will adapt themselves to the current body font (in this document file:texgyrepagella-regular)<br />

and the current size of the bodyfont (here 10.0pt/10).<br />

10.4 TEX text<br />

In the next example we will use a special mechanism for building graphics step by step. The<br />

advantage of this method is that we can do intermediate calculations in TEX. Our objective is to write<br />

a macro that draws text along a circular path. While doing so we want to achieve the following:<br />

• the text should be properly kerned, i.e. the spacing between characters should be optimal,<br />

• the position on the circle should vary, and<br />

• the radius of the circle should vary.<br />

This implementation is not the most straightforward one, but by doing it step by step, at least we<br />

see what is involved. Later, we will see a better method. If you run these examples yourself, you<br />

must make sure that the TEX environment of your document matches the one used by METAPOST.<br />

TEX text Typesetting in METAPOST<br />

227

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

Saved successfully!

Ooh no, something went wrong!