From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/4810 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: mptopdf or mpost problem with bounding boxes? Date: Sat, 09 Jun 2001 20:18:42 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <3.0.6.32.20010609201842.009ed520@server-1> References: <200106081447.PAA22615@skye.ra.phy.cam.ac.uk> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1035395449 28933 80.91.224.250 (23 Oct 2002 17:50:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:50:49 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: Sanjoy Mahajan In-Reply-To: <200106081447.PAA22615@skye.ra.phy.cam.ac.uk> Xref: main.gmane.org gmane.comp.tex.context:4810 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:4810 At 03:47 PM 6/8/01 +0200, Sanjoy Mahajan wrote: >Dear Hans, > >Here's another problem I noticed, and I'm not sure if it's due to >pdftex, mptopdf, or mpost. The tilted ellipse in transfer.pdf (in the >attached gzipped tar file) is clipped at its top edge (magnify a lot >in acroread to see the problem). transfer.pdf comes from transfer.mp >via "pdftex '&mptopdf' '\relax' transfer.1" > >When `transfer.pdf' is included in a pdftex file -- see `test.tex' and >`test.pdf' in the tar file -- the clipping means that the ellipse is >broken open at the top edge. > >For comparison I also included `transfer2.pdf' made by `epstopdf', and >it has a similar problem. If I change transfer.mp not to spit out >high-resolution bounding boxes (right now it has prologues:=-1), then >the problem goes away. But maybe the underlying bug is still there, >and the slippage of half a pixel or so is enough to hide it? > >Do you see the same problem in your setup? Perhaps your pdftex is >newer? The versions I use (from tetex-1.0.6 in linux 2.0): > >- MetaPost 0.641 (Web2C 7.3.1) >- pdfTeX, Version 3.14159-13d (Web2C 7.3.1) >- epstopdf 1999/05/06, v2.5 > >I've simplified the MP file roughly as far as possible yet still >preserve the bug. > >I don't think it's an MP problem, because `test2.tex' (which uses >regular tex and `epsf.tex' to include the EPS file `transfer.1') looks >fine when turned into postscript (no clipping). But maybe the >bounding box is not okay yet epsf.tex doesn't notice? Well, i spent many days on this problem already. It's not so much a bug as well as a combination of (1) pdf viewers clipping in an inaccurate way. I already use more digits precission now, but still, viewers can spoil things especially when xforms are used. In ConTeXt additional measures are taken. (2) the boundingbox of a graphic is calculated using the points that make up curves, so the extreme lrtb points of a circle are clipped to half the linewidth. If you have a recent version of context, there is also a file mp-tool in there. If you load this file, you got a bunch of additional mp macros. This file also sets the high res boundingbox. One way to deal with the problem is to say: input mp-tool ; beginfig (1) ; .... setbounds currentpicture to boundingbox currentpicture enlarged 1pt ; % or whatever endfig ; end In ConTeXt, when mp graphics are embedded, this is normally not needed. When using ConTeXt to make independent graphics [see metafun manual at our site which also covers most of mpost in detail] you can use \startMPpage cum suis and enlarge the boundigbox of each graphic with \setupMPpage [offset=1pt] etc etc Personally i think that it should be an option for metapost to calculate the real boundingbox. (3) concerning normal versus high res boundingbox: your observation has to do with rounding and in most cases you're better of with the high res (better loose .05pt than .5pt). (4) In pdf(tex) a mediabox is quite restrictive and forms clip, while in ps or inline graphics in pdf there is no clipping. So, when you encounter unwanted clipping, in ConTeXt one can disable form (object) usage, or enlarge the extra offsets, or ... Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com -------------------------------------------------------------------------