🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.apps
Article #10702

Pasting Graphics into MS-Word! : Toolbox Bug!

#10702
From: Don Gillies
Date: Fri, 07 Jun 1991 10:05
60 lines
3617 bytes
A while ago someone wrote in complaining that they couldn't get
ms-word to print graphic PICTures precisely; figures that align or
overlap in precise locations change when the graphic was taken from
MacDraw II to MS-Word.  I've been wrestling with this problem for 3
years.  I suggested that, in MacDraw II, you draw everything at 4x
resolution (approx 300dpi resolution), and align it at this
resolution, and then print on a postscript device to get aligned
results.  I also suggested using a grid that divides 300 (like 50
divisions / inch).

This works fine if all you do is print on a postscript laser printer.
But now I own a deskwriter, and have access to three different postscript
devices.  I need my documents to print well on all devices.  After 4
hours of experimenting this evening, and reading INSIDE MACINTOSH, I
think I've found the source of the problem, and a sure workaround.

In short, "Avoid the rectangle tools in both MacDraw II and in
Canvas!".  It seems (from inside macintosh) that in the Quickdraw
replay language, Rectanges might be stored in PICTures using relative
coordinates (i.e.  a base plus an offset).  Inside Mac volume 1
implies that they are probably *scaled* using relative coordinates.
This is bad bad news, since a rectangle x-coordinate represented as
(x1,delta) whose right edge must overlap the left edge of a rectangle
that is (x2, mu) where x2 = x1 + delta, will not scale correctly in
integer arithmetic; you will get (for the right edge) int(x1*scale) +
int(delta*scale) <= int(x2*scale) in general; the (x,delta) rectangle
will fall to the left of the (y,mu) rectange.  The fix is simple:

NEVER USE RECTANGLES IN THESE DRAW PROGRAMS.  DRAW RECTANGLES WITH THE
POLYGON TOOL TO GET DEVICE INDEPENDENCE.  NUKE THE RECTANGLE TOOL!

Inside macintosh volume 1 says that the scaling methods for polygons
are better than for rectangles.  I just spent 4 hours drawing a figure
with many rectangles (some filled, some cleared, all with hairline
borders) with both rectangles polygons in MacDraw II, Canvas.  I
printed the results on the HP Deskwriter Driver, and with the Freedom
of the Press Postscript driver.

In all cases, rectangles can NEVER be aligned correctly with the
Deskwriter driver; this is because Quickdraw is probably doing stupid
scaling to 300dpi (some sort of relative coordinate scaling for
rectangles).

Not only that, but if you use hairlines (like .5 pt or .25 pt lines),
rectangles put fill material OUTSIDE the hairlines on postscript
devices -- but POLYGONS FILL CORRECTLY with hairlines in postscript.
So by using polygons, you fix TWO problems.  And MS-Word prints
perfect results!  I'm never going to use a rectangle again!

	REMEMBER: RECTANGLES ARE DEVICE-INDEPENDENCE DEATH.

I haven't checked to see what happens with ovals and circles, since I
never align these objects.  Someone should get Apple to patch
quickdraw to solve this problem.  When I get some time, I'll try to
find out exactly where the problem is in the toolbox.

Don Gillies	     |  University of Illinois at Urbana-Champaign
gillies@cs.uiuc.edu  |  Digital Computer Lab, 1304 W. Springfield, Urbana IL

-- 
Technical Details
Message-ID: <1991Jun7.100530.24764@m.cs.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!m.cs.uiuc.edu!gillies

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!m.cs.uiuc.edu!gillies
From: gillies@m.cs.uiuc.edu (Don Gillies)
Newsgroups: comp.sys.mac.apps
Subject: Pasting Graphics into MS-Word! : Toolbox Bug!
Message-ID: <1991Jun7.100530.24764@m.cs.uiuc.edu>
Date: 7 Jun 91 10:05:30 GMT
Distribution: comp
Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL
Lines: 60