Font problems

From Metapost

(Difference between revisions)
(PDF)
(Viewing non-standalone MPS-files)
 
(10 intermediate revisions not shown)
Line 1: Line 1:
-
Sometimes, text in the diagrams produced by MetaPost might look ugly.  The most common reason, lack of sufficient font information in Metapost output, is dealt with on this page.  You might also want to read more about different [Text|methods of typesetting text] in Metapost.
+
Sometimes, text in the diagrams produced by MetaPost might look ugly.  The most common reason, lack of sufficient font information in Metapost output, is dealt with on this page.  You might also want to read more about different [[Text|methods of typesetting text]] in Metapost.
-
By default, files produced by Metapost are  Postcript fragments, which are not self-contained.  This is fine, as long as you don't plan to view them directly but embed in other files or/and do some post-processing (see the first two sections).  If you want to be able to view your Metapost output directly, see the last section.
+
By default, files produced by Metapost are  PostScript fragments, which are not self-contained.  This is fine, as long as you don't plan to view them directly but embed in other files or/and do some post-processing (see the first two sections).  If you want to be able to view your Metapost output directly, see the last section.
-
For more information, see [ftp://cam.ctan.org/tex-archive/info/metafp.pdf|ftp://cam.ctan.org/tex-archive/info/metafp.pdf]
+
For more information, see [ftp://cam.ctan.org/tex-archive/info/metafp.pdf]
== Standalone output ==
== Standalone output ==
Line 37: Line 37:
=== PDF ===  
=== PDF ===  
-
PDFLatex can handle [[Glossary#MPS|MPS]] files directly. See the [Latex] page for examples and more information.   
+
PDFLatex can handle [[Glossary#MPS|MPS]] files directly. See the [[Latex]] page for examples and more information.   
   mpost mydiagrams.mp
   mpost mydiagrams.mp
   pdflatex mydocument.tex
   pdflatex mydocument.tex
-
== Viewing non-standalone MPS-files ==
+
Hello!
 +
Excellent site, but most of messages here are not related to its contents...
-
First of all you need to ensure that MetaPost's output is a valid PS file by putting the statement
+
[http://www.url4.net/ABA121 mature lesbians] |
-
 
+
[http://www.url4.net/514E15 gay boys] |
-
  prologues := 2
+
[http://www.url4.net/CC4DC4 lesbian movie] |
-
 
+
[http://www.url4.net/BD5231 adult home videos]
-
at the beginning of your MP file, or calling mpost as
+
-
 
+
-
  mpost "prologues:=2; input mydiagrams.mp"
+
-
 
+
-
=== Ghostscript and ghostview ===
+
-
 
+
-
==== Check your psfonts.map  ====
+
-
 
+
-
Check whether your psfonts.map file includes the fonts you want to use.  For Computer Modern fonts look for lines like
+
-
 
+
-
  cmr10 CMR10 <cmr10.pfb
+
-
 
+
-
==== Create your Fontmap file ====
+
-
 
+
-
Make sure your Fontmap file includes lines like
+
-
 
+
-
  /CMR10                          (cmr10.pfb)                    ;
+
-
 
+
-
If not, use this <a href=/f/Fontmap>Fontmap</a> file or generate your own using the following script:
+
-
 
+
-
  #!/bin/bash
+
-
  cat $(kpsewhich psfonts.map) |
+
-
  awk '!/^%.*/ && NF>2 {
+
-
    printf "/%-32s%-32s;\
+
-
", $1, sprintf("(%s)", substr($NF,2)); 
+
-
    printf "/%-32s%-32s;\
+
-
", $2, sprintf("(%s)", substr($NF,2)); 
+
-
  }'
+
-
 
+
-
 
+
-
==== Set up font directories ====
+
-
 
+
-
To display fonts propertly, you must tell ghostscript where your fonts are (note the colon at the end)
+
-
 
+
-
  export GS_LIB=/your/fontmap/file/dir/:$(dirname $(kpsewhich cmr10.pfb)):$(dirname $(kpsewhich lasy10.pfb)):
+
-
 
+
-
Typically, this will expand to something like
+
-
 
+
-
  export  GS_LIB=/home/yourname/local/share/fonts/:/usr/share/texmf-tetex/fonts/type1/bluesky/cm:/usr/share/texmf-tetex/fonts/type1/bluesky/latex:
+
-
 
+
-
which tell ghostscript where to find Computer Modern fonts. If you use other non-standard fonts, you will have to include the path to them in the above definition.
+
-
 
+
-
<!-- todo: where to find fonts, naming issues, updmap -->
+
-
 
+
-
==== Debugging font problems ====
+
-
 
+
-
To debug font problems, type
+
-
 
+
-
  gs yourfile.ps
+
-
 
+
-
and look for error messages.
+
-
 
+
-
=== DVI ===
+
-
 
+
-
DVI previewers (such as xdvi) usually use Ghostscript for rendering embedded Postscript.  Make sure to enable this feature; it might not be turned on by default.  Once your Ghostscript is set up properly (see above), you shouldn't have problems.
+

Current revision as of 02:19, 23 June 2007

Sometimes, text in the diagrams produced by MetaPost might look ugly. The most common reason, lack of sufficient font information in Metapost output, is dealt with on this page. You might also want to read more about different methods of typesetting text in Metapost.

By default, files produced by Metapost are PostScript fragments, which are not self-contained. This is fine, as long as you don't plan to view them directly but embed in other files or/and do some post-processing (see the first two sections). If you want to be able to view your Metapost output directly, see the last section.

For more information, see [1]

Contents

[edit] Standalone output

[edit] PS

mps2eps converts a given MPS to a self-contained EPS file with the necessary fonts included.

 mpost mydiagrams.mp
 mps2eps mydiagrams.1 > mydiagrams-1.eps

[edit] PDF

The following will produce mydiagrams-1.pdf:

 mpost mydiagrams.mp
 mptopdf mydiagrams.1   

[edit] Standalone output with latex

Prepare a Latex file mydocument.tex that embeds your diagrams. If you just want to see your diagrams, use the standard mproof.tex:

 tex mproof mydiagrams.1 mydiagrams.2 ...

[edit] PS

Use the "-j0" option of dvips:

 mpost mydiagrams.mp
 latex mydocument.tex
 dvips -j0 mydocument.dvi > mydocument.ps

[edit] PDF

PDFLatex can handle MPS files directly. See the Latex page for examples and more information.

 mpost mydiagrams.mp
 pdflatex mydocument.tex

Hello! Excellent site, but most of messages here are not related to its contents...

mature lesbians | gay boys | lesbian movie | adult home videos

Personal tools