[NTG-context] %%BoundingBox: (atend)

Taco Hoekwater ntg-context@ntg.nl
Wed Jun 2 14:46:47 CEST 2004


Hi,

A one-line patch to texutil.pl is enough to handle most cases of (atend).
The method is far from waterproof,  but neither is a Korn Shell script,
and the added complexity to texutil.pl is neglible.

Greetings, Taco

--- texutil.pl.org      2004-06-02 15:36:03.610266871 +0200
+++ texutil.pl  2004-06-02 15:38:17.454329753 +0200
@@ -2129,7 +2129,7 @@
                if (($BBoxFound) && ((substr $SomeLine,0,1) ne "%"))
                  { last }
                if ($BBoxFound<2)
-                 { if ($SomeLine =~ /^%%BoundingBox:/io)
+                 { if ($SomeLine =~ /^%%BoundingBox:(?!\s+\(atend\))/io)
                      { $EpsBBox = $SomeLine ; $BBoxFound = 1 ; next }
                    elsif ($SomeLine =~ /^%%HiResBoundingBox:/io)
                      { $EpsBBox = $SomeLine ; $BBoxFound = 2 ; next }


On Wed, 02 Jun 2004 10:13:33 -0300, George wrote:
> On Tue, 1 Jun 2004, Hans Hagen wrote:
> 
> > At 14:24 30/05/2004, you wrote:
> >> Hello,
> >> ConTeXt does not find the EPS-BoundingBox in EPS files generated by 
> >> xmgrace.
> >> Such a file begins like this:
> >> 
> >> %!PS-Adobe-3.0 EPSF-3.0
> >> %%BoundingBox: (atend)
> > [...]
> >> If not, I'm going to write a script, that converts the file.
> >
> > if you have a small demo file i can add that feature to texutil
> 
> I'd suggest adopting some of the conventions used by the
> LaTeX2e graphics bundle, in particular, to look for the 
> BoundingBox in filename.(e)ps.bb.
> 
> Rather than making texutil more complex a separate tool (findbb, attached)
> that reliably writes the bbox by trying several methods, even using the 
> ghostscript bbox device to generate one (e.g., in the case of files 
> created with dvips -E that get incorrect BoundingBox entries because the 
> dvips calculation ignores things drawn by \specials).
> 
> Try "findbb xmgracefile.ps > xmgracefile.ps.bb"
> 
> --
> George N. White III  <aa056@chebucto.ns.ca>
>    Head of St. Margarets Bay, Nova Scotia, Canada


-- 
groeten,

Taco



More information about the ntg-context mailing list