MetaFun - Pragma ADE

MetaFun - Pragma ADE MetaFun - Pragma ADE

pragma.ade.com
from pragma.ade.com More from this publisher
29.11.2012 Views

206 By default the shapes are filled after they are drawn. This has the advantage that in characters built out of pieces, disturbing lines fragments are covered. The drawback is that you get only half the linewidth. You can reverse the drawing order by adding the reversefill directive. The previous graphic then comes out as: graphictext "\bf Fun" scaled 4 zscaled (1,1.5) reversefill withdrawcolor blue withfillcolor .5white withpen pencircle scaled 5pt The reversefill directive can be countered by outlinefill. The next example is taken from the MAKEMPY manual. It demonstrates that you can combine TEX's powerful line breaking with METAPOST's graphic capabilities. \startuseMPgraphic{quotation} picture one ; one := image ( graphictext \MPstring{text} scaled 1.5 withdrawcolor .625blue withfillcolor .625white withpen pencircle scaled 1pt ; ) ; picture two ; two := image ( graphictext \MPstring{author} scaled 2 withdrawcolor .625red withfillcolor .625white withpen pencircle scaled 2pt ; ) ; currentpicture := one ; addto currentpicture also two shifted lrcorner one shifted - 1.125 lrcorner two shifted (0, - 1.250 * ypart urcorner two) ; setbounds currentpicture to boundingbox currentpicture enlarged 3pt ; \stopuseMPgraphic Special effects Outline fonts

In this graphic, we have two text fragments, the first one is a text, the second one the name of the author. We combine the quotation and author into this graphic using the following definitions: \setMPtext{text} {\vbox{\hsize 8.5cm \input zapf }} \setMPtext{author}{\hbox{\sl Hermann Zapf}} These definitions assume that the file zapf.tex is present on the system (which is the case when you have installed CONTEXT). The graphic can now be typeset using the following call: \placefigure {A text does not need to be an outline in order to be typeset in an outline font.} {\useMPgraphic{quotation}} Figure 8.9 A text does not need to be an outline in order to be typeset in an outline font. The quality of the output depends on how the glyphs are constructed. For instance, in TEX, math symbols are sometimes composed of glyph fragments and rules. graphictext "$$\sqrt{1+x}$$" scaled 8 Outline fonts Special effects 207

In this graphic, we have two text fragments, the first one is a text, the second one the name of the<br />

author. We combine the quotation and author into this graphic using the following definitions:<br />

\setMPtext{text} {\vbox{\hsize 8.5cm \input zapf }}<br />

\setMPtext{author}{\hbox{\sl Hermann Zapf}}<br />

These definitions assume that the file zapf.tex is present on the system (which is the case when<br />

you have installed CONTEXT). The graphic can now be typeset using the following call:<br />

\placefigure<br />

{A text does not need to be an outline in order to be<br />

typeset in an outline font.}<br />

{\useMPgraphic{quotation}}<br />

Figure 8.9 A text does not need to be an<br />

outline in order to be typeset in an outline font.<br />

The quality of the output depends on how the glyphs are constructed. For instance, in TEX, math<br />

symbols are sometimes composed of glyph fragments and rules.<br />

graphictext<br />

"$$\sqrt{1+x}$$"<br />

scaled 8<br />

Outline fonts Special effects<br />

207

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

Saved successfully!

Ooh no, something went wrong!