Zdeněk Hurák | 2 Oct 13:27 2008
Picon
Picon

Troubles to display text in a Metapost figure

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

(Continue reading)

Troy Henderson | 2 Oct 13:34 2008
Picon

Re: Troubles to display text in a Metapost figure

Place a

prologues:=3;

at the beginning of your file, and that will embed all fonts into your
output EPS.  Conversion to PDF should then work.  Note that the
prologues:=3 option will only work for MetaPost version 0.970 or
greater.

Troy
--
http://tug.org/metapost/

Karel Horák | 2 Oct 13:55 2008
Picon

Re: Troubles to display text in a Metapost figure

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
(Continue reading)

Mojca Miklavec | 8 Oct 19:34 2008
Picon

"Math drawings for dummies"

Hello,

for those who are afraid of Metapost (or simply think that it takes
too much time to program a simple figure with not too fancy features),
there's a magnificent point-and-click tool for creating mathematical
drawings with "perfect precision" and TeX labels matching the style of
your document.
(If you want to find itersection of curves, or curves going through
several points, you don't need to "pretend that you have hit the
intersection" as you would do in Corel Draw.)

The prerelease version has TikZ export (with plain/LaTeX/ConTeXt
support included).
    http://www.geogebra.org -> future

Mojca
--
http://tug.org/metapost/

xpdf | 15 Oct 21:11 2008
Picon

Error: /undefined in cmr10

I get this in my "gv"
What add this font to gv or metapost change to normal fonts
--
http://tug.org/metapost/

Troy Henderson | 15 Oct 21:35 2008
Picon

Re: Error: /undefined in cmr10

Place

prologues:=3;

in your source file and your fonts should be embedded into your output EPS.

Troy
--
http://tug.org/metapost/

xpdf | 15 Oct 23:07 2008
Picon

intersectiontimes

What get four points intersections 2 path

path fa;
path fb;

fa=( (0,0)..(10,11).....
fb=.....

a intersectiontimes b

4 points A,B,C, D
look this
http://images37.fotosik.pl/20/c49a9eb1afea743b.jpg

--
http://tug.org/metapost/

Troy Henderson | 15 Oct 23:45 2008
Picon

Re: intersectiontimes

Try this:

--- begin cut code ---

path p,q,r;
p:=fullcircle xscaled 72 yscaled 36;
q:=fullcircle xscaled 36 yscaled 72;
r:=p;
draw p withcolor green;
draw q withcolor red;
for n=1 upto 4:
   (t[n],whatever) = r intersectiontimes q;
   z[n] = point t[n] of r;
   r:= subpath (t[n]+epsilon,length r) of r;
   fill fullcircle scaled 2 shifted z[n] withcolor blue;
endfor;

--- end cut code ---

In this case, p and q are the two paths and r is simply a copy of p
that is going to be trimmed along the way.  Basically, you continually
trim r so that the "first" point for which r intersects q is
*strictly* further (hence the need for epsilon) along than the
previous intersection point.  Repeating this process 4 times gets them
all.  I hope this is not too difficult to understand.  Also, anyone
with a better solution please let me know as I would love to hear it.

Troy
--
http://tug.org/metapost/
(Continue reading)

Reinhard Kotucha | 15 Oct 23:53 2008
Picon

Error: /undefined in cmr10


xpdf writes:
 > ...

Dear xpdf,
I'm just wondering about your name.  Are you the author of xpdf or do
just want to kid us?

Regards,
  Reinhard

--

-- 
----------------------------------------------------------------------------
Reinhard Kotucha			              Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha <at> web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------
--
http://tug.org/metapost/

Dan Luecking | 16 Oct 21:45 2008
Picon

Re: intersectiontimes

At 04:45 PM 10/15/2008, Troy Henderson wrote:
>Try this:
>
>--- begin cut code ---
>
>path p,q,r;
>p:=fullcircle xscaled 72 yscaled 36;
>q:=fullcircle xscaled 36 yscaled 72;
>r:=p;
>draw p withcolor green;
>draw q withcolor red;
>for n=1 upto 4:
>    (t[n],whatever) = r intersectiontimes q;

  % in a general purpose macro one might want:
     exitif t[n]<0;

>    z[n] = point t[n] of r;
>    r:= subpath (t[n]+epsilon,length r) of r;
>    fill fullcircle scaled 2 shifted z[n] withcolor blue;
>endfor;

Dan

Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
"Dubito ergo cogito, cogito ergo sum" --Descartes

--
(Continue reading)


Gmane