Here is a simple test.
Run the following Python script
import pyx
pyx.unit.set(defaultunit='pt')
c = pyx.canvas.canvas()
c.insert(pyx.epsfile.epsfile(0, 0, "eg.eps"))
c.writeEPSfile('pyxout.eps')
where eg.eps is below. Should get a bounding box
of 0 0 100 100. Right now (revision 3000) it is
off by 1 in every direction.
One comment: this is actually a big deal, for
graphics headed for publication. Good behavior
should be the default, imo. I did not fully understand
the linewidth argument: when I give you a bounding
box, that's it! Everything outside is clipped.
I cannot have a 1 point "halo" around the figure.
My usage is generally to import and EPS file and then
do things **inside** the bounding box. (E.g., add
text or perhaps a JPEG in some cases.) In this case, I
guess it would be nice to be able to just say
explicitly, "set the bounding box based on the bounding box
from that EPS file, unless I explicitly change it".
This might be generally useful?
Alan Isaac
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 100 100
%%HiResBoundingBox: 0 0 100 100
%%Title: eg.eps
%%CreationDate: Mon Sep 08 22:10:39 2008
%%Pages: 1
%%EndComments
%%Page: 1 1
%%BeginDocument: eg.eps
/bmargin 0 def
/lmargin 0 def
/width 100 def
/height 100 def
%draw a border completely inside bounding box
/lwh 4 def %half line width
/lwf lwh 2 mul def %full line width
lwf setlinewidth
lmargin lwh add bmargin lwh add width lwf sub height lwf sub rectstroke
%%EndDocument
%%Trailer
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
PyX-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-devel