Real printing plugin?

Marcel Weiher marcel at metaobject.com
Mon Mar 25 09:19:16 UTC 2002


On Thursday, March 14, 2002, at 12:33 AM, Richard A. O'Keefe wrote:

> I mean "larger".  Bigger.  Dramatically bigger.
> Take a specific case.  A BookMorph with one page, containing text in
> New York 12, the area holding the text being approximately 2 inches
> on a side.

I don't think 'screen inches' are a very useful measurement.  Can you 
produce a sample?  It's kind of difficult to comment on rough 
descriptions.

>  Save PS in file, drop file onto MacGS.  The result is
> nearly 4 inches on a side.

So you're seeing a factor of 2?

>  Also the text is some sans-serif font (on looking in the PS file, I 
> see it is Helvetica).

The font-mapping is done in PostscriptCanvas>>postscriptFontInfoForFont: 
with helpf from a mapping table initialized in 
PostscriptCanvas>>initializeFontMap.  If you can find better mappings 
using commonly available Postscript fonts, that would be a very good 
contribution.

>   When I print it, the
> text area is about 5 inches on a side.
>
> 	The Morphic Postscript routines assume 1
> 	pixel = 1 point ( 1/72 inch ).
>
> Well, it shouldn't assume that, because 1 pixel = 1/96 inch on my 
> screen.

You are free to include a scale factor to adapt it to your screen size.  
The problem is that the Squeak graphic routines are not device 
independent, meaning the mapping to device independent coordinates is 
always just a guess.

> But that ratio, 96/72, is only 4/3, which is rather less than the nearly
> two-fold linear expansion I see.


> 	Since the output is device independent,
>
> No it isn't.  It starts

Yes it is.

> 	%!PS-Adobe-2.0
> 	%%Pages: (atend)
> 	% initialScale: 2.179
> 	%%BoundingBox: 221 223 170 347
> 	39.216 39.216 translate
> 	%%EndComments
> which looks like absolute co-ordinates to me.

Which has nothing to do with device independence.   With a multi-page 
format, it has to place the graphics on a page.  This is not 
device-dependence.

> 	you can scale it to your needs, though I don't know if there is any
> 	Squeak front-end for doing this.
> 	
> EPS files are easy to scale, but PS files?  How?

'<x-factor>  <y-factor> scale' before the parts you want scaled.  You 
would probably want to do this in the page-setup code.

> 	>  What general rule applies to size here?  If I have a
> 	> W-by-H morph with P-"point" text in it, what area and font size
> 	> should I expect in the PS file that results?
> 	
> 	Typically W x H, with P-point font.  The substituted fonts may appear
> 	different, though.
> 	
> I've now made several experiments, and I _never_ get W x H, or P-point.

What *do* you get?  Are you sure Ghostscript isn't doing some scaling of 
its own?

> And I would have hoped that a serif font would get a serif font as 
> substitute

As I said above, you are free to put better mappings in place.

Marcel

--
Marcel Weiher				Metaobject Software Technologies
marcel at metaobject.com		www.metaobject.com
Metaprogramming for the Graphic Arts.   HOM, IDEAs, MetaAd etc.




More information about the Squeak-dev mailing list