[metapost] Troubles to display text in a Metapost figure

Zdeněk Hurák hurak at fel.cvut.cz
Thu Oct 2 13:27:39 CEST 2008


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

%!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.

-- 
Zdenek Hurak



More information about the metapost mailing list