[metapost] Troubles to display text in a Metapost figure

Karel Horák akk64 at quick.cz
Thu Oct 2 13:55:56 CEST 2008


Zdene(k Hurák napsal(a):
> Hello,
> 
> as a beginner with Metapost, I am having troubles to use text labels in a
> Metapost figure. The code is simple
> 
> beginfig(1);
> label.lft("A",(1cm,1cm));
> endfig;
> end;
> 
> The trouble is that the postscript generated using mpost gives no visible
> text when viewed with gsview or kghostview. The source code for the
> postscript is

In that case you must configure gs to know about /cmr10 (thru fontmap 
file, see also the corresponding file fontmap.cm in your /gs/lib 
directory; the path to cmr10.pfb must of course correspond to your real 
path). But if you will use the same code with
prologues:=3;
you will obtain eps file with cmr10.pfb included which will than work 
correctly in any further processing.

Happy mp-ing,


> 
> %!PS
> %%BoundingBox: 17 24 26 32 
> %%HiResBoundingBox: 17.87445 24.94255 25.34645 31.75035 
> %%Creator: MetaPost 1.001
> %%CreationDate: 2008.10.01:2100
> %%Pages: 1
> %*Font: cmr10 9.96265 9.96265 41:8
> %%BeginProlog
> %%EndProlog
> %%Page: 1 1
>  0 0 0 setrgbcolor
> 17.87445 24.94255 moveto
> (A) cmr10 9.96265 fshow
> showpage
> %%EOF
> 
> 
> Apparently something is wrong because when I am trying to convert this to
> PDF using epstopdf, I get an error message starting with
>  
> Error: /undefined in cmr10
> 
> I estimate that this must be related to missing or unlinked fonts. I have
> the same problem on a Linux platform (Gentoo + Texlive) and Windows
> platform (XP + Miktex) and therefore I would appreciate a systematic
> solution, if possible.
> 
> Thanks for a hint.
> 




More information about the metapost mailing list