From - Wed Jun 11 17:21:34 2003
Return-Path: <ftpmaint@joshua.smcvt.edu>
Received: from joshua.smcvt.edu (joshua.smcvt.edu [192.80.64.209])
          by nef.ens.fr (8.12.9/1.01.28121999) with ESMTP id h5BFLW3i084552
          for <metafont@ens.fr>; Wed, 11 Jun 2003 17:21:32 +0200 (CEST)
Received: from ftpmaint by joshua.smcvt.edu with local (Exim 3.35 #1 (Debian))
	id 19Q7nY-0008RZ-00
	for <metafont@ens.fr>; Wed, 11 Jun 2003 11:46:04 -0400
From: Jim Hefferon <ftpmaint@joshua.smcvt.edu>
To: metafont@ens.fr
Subject: Converting MetaPost graphics into .png or .jpg
Message-Id: <E19Q7nY-0008RZ-00@joshua.smcvt.edu>
Date: Wed, 11 Jun 2003 11:46:04 -0400

Hello,

I have graphics that I wrote in MetaPost.  They compile fine and show up
fine using mproof and ghostview.

I want to use them in a web document so I need .png or some similar
format.  I ran the graphics through dvips -E (using the mps2eps shell script;
in case most people don't know of it I included the core part at the bottom
of this email but basically it runs dvips -E to make an .eps).  I can view
the result in ghostview.

But when I run the standard utility (standard on Linux, anyway) 
  convert graphic.1.eps graphic.png
then I get an all-white box and the graphic and the text in the graphic
is gone.  My graphic viewer shows nothing, and neither does my web browser
when I include the graphic in a web page.  Converting to a .gif or a .jpg
also produce all-white boxes with (what looks like) the correct dimensions.

Anyone on this list have any ideas?  I've put the relevant files in
ftp://joshua.smcvt.edu/pub/hefferon/mpsgraphic in case that would help.

Thanks,
Jim Hefferon

BTW, I had some trouble finding an archive of this group.  The link on
J Hobby's page seems dead and I didn't have any luck with Google.  Is 
there an archive that I should have found?


========= the relevant part of mps2eps ============================

MPSFILE=$1
BASENAME=`basename $MPSFILE .mps`
TEXBASE=$BASENAME$$
TEXFILE=$TEXBASE.tex
EPSFILE=$BASENAME.eps

cat > $TEXFILE <<EOF
\nopagenumbers
\input epsf
\centerline{\epsfbox{$MPSFILE}}
\end
EOF

tex $TEXFILE > /dev/null
dvips -E -j -o $EPSFILE $TEXBASE 2> /dev/null
rm -f $TEXBASE.*

From - Wed Jun 11 17:41:07 2003
Return-Path: <ftpmaint@joshua.smcvt.edu>
Received: from joshua.smcvt.edu (joshua.smcvt.edu [192.80.64.209])
          by nef.ens.fr (8.12.9/1.01.28121999) with ESMTP id h5BFf43i088083
          for <metafont@ens.fr>; Wed, 11 Jun 2003 17:41:04 +0200 (CEST)
Received: from ftpmaint by joshua.smcvt.edu with local (Exim 3.35 #1 (Debian))
	id 19Q86Q-000052-00; Wed, 11 Jun 2003 12:05:34 -0400
From: Jim Hefferon <ftpmaint@joshua.smcvt.edu>
To: Peter.Vanroose@esat.kuleuven.ac.be
CC: metafont@ens.fr
In-reply-to: 
	<Pine.LNX.4.55dh.0306111733030.31322@inchmurrin.esat.kuleuven.ac.be>
	(message from Peter Vanroose on Wed, 11 Jun 2003 17:37:14 +0200
	(CEST))
Subject: Re: [metafont] Converting MetaPost graphics into .png or .jpg
References: <E19Q7nY-0008RZ-00@joshua.smcvt.edu> <Pine.LNX.4.55dh.0306111733030.31322@inchmurrin.esat.kuleuven.ac.be>
Message-Id: <E19Q86Q-000052-00@joshua.smcvt.edu>
Date: Wed, 11 Jun 2003 12:05:34 -0400


   Which version of convert are you using?  Mine (5.5.7) converts correctly.

It is the version that came with Debian.  I see that it is 5.4.4.  I'll
update it.  Thanks for helping me out.

Jim 


From - Fri Jun 13 06:44:42 2003
Return-Path: <laurent@math.toronto.edu>
Received: from coxeter.math.toronto.edu (coxeter.math.toronto.edu [128.100.68.3])
          by nef.ens.fr (8.12.9/1.01.28121999) with ESMTP id h5D4idpx036062
          for <metafont@ens.fr>; Fri, 13 Jun 2003 06:44:40 +0200 (CEST)
Received: (from laurent@localhost)
	by coxeter.math.toronto.edu (8.11.6p2/8.11.0/UTMath 1.0) id h5D4ibG193882;
	Fri, 13 Jun 2003 00:44:37 -0400
Date: Fri, 13 Jun 2003 00:44:37 -0400
From: Larry Siebenmann <laurent@math.toronto.edu>
Message-Id: <200306130444.h5D4ibG193882@coxeter.math.toronto.edu>
To: hobby@research.bell-labs.com, laurent@math.toronto.edu, metafont@ens.fr
Subject: re: Converting MetaPost graphics into .png or .jpg



Jim Hefferon wrote:

 > BTW, I had some trouble finding an archive of this group.  The link on
 > J Hobby's page seems dead and I didn't have any luck with Google.  Is 
 > there an archive that I should have found?

Yes, that's unfortunate.  The archiving site has been

       http://www.gutenberg.eu.org/pub/gut/publications/

for several years.

Cheers,

Laurent S.


PS The archive is up to March 2003.  I am sending Jim the few posts 
since then.

But I cannot answer his quiery since I have a Mac environment.


From - Mon Jun 30 08:45:03 2003
Return-Path: <laurent@math.toronto.edu>
Received: from coxeter.math.toronto.edu (coxeter.math.toronto.edu [128.100.68.3])
          by nef.ens.fr (8.12.9/1.01.28121999) with ESMTP id h5U6j0Kk036410
          for <metafont@ens.fr>; Mon, 30 Jun 2003 08:45:01 +0200 (CEST)
Received: (from laurent@localhost)
	by coxeter.math.toronto.edu (8.11.6p2/8.11.0/UTMath 1.0) id h5U6iu3174566;
	Mon, 30 Jun 2003 02:44:56 -0400
Date: Mon, 30 Jun 2003 02:44:56 -0400
From: Larry Siebenmann <laurent@math.toronto.edu>
Message-Id: <200306300644.h5U6iu3174566@coxeter.math.toronto.edu>
To: hobby@plan9.bell-labs.com, laurent@math.toronto.edu, metafont@ens.fr
Subject: elementary puzzle



Hi Metapost users,

Since the list is quiet, here is an 
beginner's puzzler.

Consider the following three mini-samples
and imagine what the result should be.
Then look at the result and give a 
rational explanation that will help beginners
like me avoid this and all related traps.

prologues:=2; %% Generate standard eps

beginfig(0)
  draw (100,0)--(70,70)--(0,0); 
  draw (0,0)--(100,0)--(100,100)--(0,100)--cycle;
endfig;

beginfig(1)
  draw (100,0)--(70,70)--(0,0) withcolor blue; 
  draw (0,0)--(100,0)--(100,100)--(0,100)--cycle;
endfig;

beginfig(2)
  draw (100,0)--(70,70)--(0,0) withcolor blue; 
  draw (0,0)--(100,0)--(100,100)--(0,100)--cycle withcolor blue;
endfig;

end

Cheers

Laurent S.



From - Mon Jun 30 09:44:58 2003
Return-Path: <Martin_Buchmann@gmx.net>
Received: from mail.gmx.net (pop.gmx.net [213.165.64.20])
          by nef.ens.fr (8.12.9/1.01.28121999) with SMTP id h5U7ivKk049855
          for <metafont@ens.fr>; Mon, 30 Jun 2003 09:44:57 +0200 (CEST)
Received: (qmail 4417 invoked by uid 65534); 30 Jun 2003 07:44:56 -0000
Received: from pm032.pm.mw.tu-darmstadt.de (EHLO [130.83.205.232]) (130.83.205.232)
  by mail.gmx.net (mp012) with SMTP; 30 Jun 2003 09:44:56 +0200
Mime-Version: 1.0
X-Sender: 1474225@imap.gmx.net
Message-Id: <p05200f00bb2598cb3b41@[130.83.205.232]>
In-Reply-To: <200306300644.h5U6iu3174566@coxeter.math.toronto.edu>
References: <200306300644.h5U6iu3174566@coxeter.math.toronto.edu>
Date: Mon, 30 Jun 2003 09:44:55 +0200
To: Larry Siebenmann <laurent@math.toronto.edu>
From: Martin Buchmann <Martin_Buchmann@gmx.net>
Subject: Re: [metafont] elementary puzzle
Cc: metafont@ens.fr
Content-Type: text/plain; charset="iso-8859-1" ; format="flowed"
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by nef.ens.fr id h5U7ivKk049855

Larry,

could you please explain what is wrong with the examples in your 
opinion. I just had a quick look and maybe i have not reached my 
complete visual capacity on this monday morning but i can't see 
anything surprising. Maybe it's my fault but i can't see it, honestly.

Best regards
   Martin

P.S.: There exists also a MetaPost list: 
http://www.ntg.nl/mailman/listinfo/metapost


-- 
Das Wort "WINDOWS" stammt aus einem alten Sioux-Dialekt und bedeutet:
"Weißer Mann starrt durch Glasscheibe auf Sanduhr."
			(gefunden in d.c.t.t)


From - Mon Jun 30 22:06:18 2003
Return-Path: <luecking@uark.edu>
Received: from mailhost.uark.edu (mail.uark.edu [130.184.5.66])
          by nef.ens.fr (8.12.9/1.01.28121999) with ESMTP id h5UK6Hko006594
          for <metafont@ens.fr>; Mon, 30 Jun 2003 22:06:17 +0200 (CEST)
Received: from mathfolk.uark.edu ([130.184.197.23])
 by mailhost.uark.edu (iPlanet Messaging Server 5.2 HotFix 1.04 (built Oct 21
 2002)) with ESMTPSA id <0HHB00GZ68UEPZ@mailhost.uark.edu> for metafont@ens.fr;
 Mon, 30 Jun 2003 14:59:02 -0500 (CDT)
Date: Mon, 30 Jun 2003 14:59:07 -0500
From: Dan Luecking <luecking@uark.edu>
Subject: Re: [metafont] elementary puzzle
In-reply-to: <200306300644.h5U6iu3174566@coxeter.math.toronto.edu>
X-Sender: luecking@mail.uark.edu
To: metafont@ens.fr
Message-id: <5.1.1.6.0.20030630145200.00b60278@mail.uark.edu>
MIME-version: 1.0
X-Mailer: QUALCOMM Windows Eudora Version 5.1.1
Content-type: text/plain; charset=us-ascii; format=flowed
Content-transfer-encoding: 7BIT

At 02:44 AM 6/30/2003 -0400, you wrote:

[snipped]
>  ...look at the result and give a
>rational explanation that will help beginners
>like me avoid this and all related traps.

The only slight problem I see is in the second figure (beginfig(1))
the base of the rectangle (black) covers up the base of the previously
drawn triangle (blue). The only suggestion I can give is to be aware
that this happens and adjust the code if it the output is not what you
intended.

>beginfig(1)
>   draw (100,0)--(70,70)--(0,0) withcolor blue;
>   draw (0,0)--(100,0)--(100,100)--(0,100)--cycle;
>endfig;

Regards,
Dan


Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas


