[metapost] Bug: wrong bounding box with mptopdf?

Peter Rolf indiego at gmx.net
Wed Aug 13 17:59:22 CEST 2008


Oliver Buerschaper schrieb:
> Dear MetaPost wizards,
> 
> there seems to be a bug with the bounding box handling in mptopdf … see 
> this test case:
> 
> ---
> beginfig(1);
>     draw fullsquare scaled 3cm;
> endfig;
> 
> end
> ---
> 
> 
> Log output:
> 
> ---
> MPtoPDF 1.3.2 : running 'texexec --mptex '
> TeXExec | processing graphic 'boundingbox.mp'
> This is MetaPost, Version 0.993 (Web2C 7.5.6)
> (/usr/local/texlive/2007/texmf/web2c/natural.tcx)
> (boundingbox.mp [1]
> metafun 2007-12-1 11:43
>  )
> 1 output file written: boundingbox.1
> Transcript written on boundingbox.log.
> TeXExec | runtime: 0.061077
> This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
>  %&-line parsing enabled.
> [MP to PDF] (./boundingbox.1) [1]
> Output written on boundingbox.pdf (1 page, 1330 bytes).
> Transcript written on boundingbox.log.
> 
> MPtoPDF 1.3.2 : boundingbox is converted to boundingbox-1.pdf
> ---
> 
> 
> PDF output:
> 
> 
> 
> 
> 
> Note how the top bit is chipped off … compare this problem with the one 
> described in 
> http://www.tug.org/pipermail/metapost/2007-June/000964.html where TeX 
> labels are cut off.
>
Hi Oliver,

mh, looks ok to me (maybe a viewer problem?). If you look deeper into 
your pdf, you see

/BBox [0 0 85.5394 85.5394]

Lets calculate the BBox by hand:

30mm/25.4mm*72 = 85.0394bp
(72bp per inch)

Add the linewidth (the half on both opposing sides) and you finally get 
the size of the bounding box. Is the default pen size 0.5bp? If so the 
bounding box calculation is ok (or I made the same error). :)


Best wishes, Peter


> Best wishes,
> Oliver
> 
> 
> ------------------------------------------------------------------------
> 
> --
> http://tug.org/metapost/



More information about the metapost mailing list