🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.postscript
1 messages
1 total messages Started by Eric W. Sink Fri, 13 Nov 1992 18:56
Newbie PS questions
#4091
Author: Eric W. Sink
Date: Fri, 13 Nov 1992 18:56
57 lines
2915 bytes
I'm just getting into PostScript (and enjoying it BTW).  I'm just
starting to think I understand BoundingBoxes, translate and scale,
and coordinate systems.  Here are a few questions and comments.
Please let me know if I'm way off base.

1.  Suppose my app reads in an EPS object, with the intent of
	integrating that object into a document.  On faith, I
	believe that I can place that EPS object anywhere in
	my user coordinate space, at any size.
	My best guess for how to do this:

	gsave
	TX TY translate
	SX SY scale
	% insert actual EPS code here
	grestore

	In other words, by tacking a few lines just before and after
	the EPS code which I imported, I can size and place the graphic
	by just sticking it somewhere in the rest of the PS generated
	for my document.

	Is this right ?  If so, how would I calculate TX and TY, SZ and SY ?
	I assume TX and TY are the location in coordinate space of
	the corner of the rectangle where I want to place the object.
	SX should be the width of the destination rectangle divided
	by the width of the bounding box as it appears in the EPS
	comment.  SY is similar.  Is this right ?

2.  To better understand the translate and scale operators, I ask:
	Suppose you were writing a tiny subset PostScript interpreter,
	which supported only moveto, lineto, stroke, translate, and
	scale.  How would you implement translate and scale?

	Each invocation of lineto and moveto adds to the current path.
	The coordinates which are added to that path are first modified
	by the CTM (HOW?).  So, all I need to do in response to the
	translate and scale operators is to modify the CTM.  Then,
	as moveto and lineto are used, they will modified through
	the CTM appropriately.

3.  Is the following statement correct ?
	The %%BoundingBox comment in an EPS object has nothing to
	do with defining a coordinate system.  It merely states the
	ranges of coordinates which will be used in the path construction
	operators within that object.  The intent is that *applications*
	can read that comment and use it for its own calculations.  The
	PS interpreter itself treats it like the comment it really is,
	and ignores it.

Thanks in advance,

-- 
Eric W. Sink, Spyglass        | "You are the Pan."
1800 Woodfield Drive          |     - Rufio
Savoy, IL  61826              |
---- e-sink@uiuc.edu ---------|---------- 217-355-6000 -----------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads