Changes

Jump to navigation Jump to search
890 bytes added ,  21:18, 29 August 2013
Add “Text in MetaPost” section
* [http://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html Lots of examples]
* [[Color in MetaPost]] describes how to get color mixtures, TeX colors, and transparent effects in MetaPost graphics.
* [http://wiki.contextgarden.net/MetaPost_in_ConTeXt MetaPost in ConTeXt]
== Using MetaPost in ConTeXt ==
* that should create a pdf file test.pdf
* open test.pdf with a pdf viewer like Adobe Acrobat, Okular... You should see a circle.
 
== Text in MetaPost ==
 
Text that is typeset using `textext` or `btex … etex` adapts to the body font. However, when `label("Foo", pair)` or `"Foo" infont defaultfont` is used, which is not the recommended way, the text is typeset using the font `MetafunDefault`, which can be changed if desired. Example:
 
<context mode="mkiv" source="yes" text="Gives:">
\starttext
\startMPcode
label("Foo", origin);
draw textext("Bar") yshifted -LineHeight;
\stopMPcode
 
\definefontsynonym
[MetafunDefault]
[Bold*default]
 
\switchtobodyfont [pagella, 18pt]
 
\startMPcode
label("Foo", origin);
draw textext("Foo") yshifted -LineHeight;
\stopMPcode
\stoptext
</context>
 
The recommended way to typeset text is to use the `textext` macro and change the font using {{cmd |setupMPinstance}}.
== Other Links ==
69

edits

Navigation menu