[comp.lang.postscript] Question from Ignorant

toweri@clinet.FI (Jukka Lindgren) (09/14/88)

	In my job, we are searching for a new image processing system.
Today, when discussing about possible choices, we noticed one system,
that has compatibility with postcript-language. A salesman from this
company had described the postcript with an example:

	"If you take for example a letter 'A' (ASCII=65), in postcript
it is represented by a series of lines that actually are a drawing of
the letter 'A'."

like this:
                        /\
         line 1  ----> /  \ <--- line 2
                      /----\
                     /  ^   \
                        ^
			^- line 3

But I am not so sure...  Until now I have thought that the postscript
doesn't "draw" individual letters, but merely "tells" the type-setter
that
 "there is the beginning of text column (x1,y1) and it ends at (x2,y2)
  and it contains the following text with following type- and size setting.

Am I right or am I right ?

Thank you in advance...

av@utacs.UTA.FI (Arto Viitanen) (09/14/88)

In article <692@clinet.FI> toweri@clinet.UUCP (Jukka Lindgren) writes:
>
 A salesman ...
>
>	"If you take for example a letter 'A' (ASCII=65), in postcript
>it is represented by a series of lines that actually are a drawing of
>the letter 'A'."
>But I:
> "there is the beginning of text column (x1,y1) and it ends at (x2,y2)
>  and it contains the following text with following type- and size setting.
>

There are two things called postscript:

1) The programming language.

2) The interpreter.

To a program, letter A is indeed a text. To the interpreter, when
program says to output letter A, the interpreter checks, what font has
been told (by the program) to be the default one, looks for a
procedure associated with ASCII-code 65 in the font (/AA usually),
then looks for fontsize, current output position, direction and so on,
and finally executes the procedure. In the procedure, letter A is
indeed defined as lines (or actually as curves).

Hope this makes you more confused !!

roy@phri.UUCP (Roy Smith) (09/16/88)

toweri@clinet.UUCP (Jukka Lindgren) writes:
> Until now I have thought that the postscript doesn't "draw" individual
> letters, but merely "tells" the type-setter that "there is the beginning
> of text column (x1,y1) and it ends at (x2,y2) and it contains the
> following text with following type- and size setting.
> 
> Am I right or am I right ?

Not really.  Yes, at one level you are right.  I can do:

	/Helvetica findfont 12 scalefont setfont
	72 72 moveto (Print me) show

which tells the PostScript interpreter to print a given string at a given
place on the page using a given size of a given font.  But, if you look at
the font machinery closer, you see that each letter in the font has been
described at some earlier time with some combination of the usual graphics
operators (lineto, curveto, stroke, fill, etc).  There is a complicated
font cache mechanism which lets you do this just once and then use the
cached letterform bitmaps again and again to save time, but fundamentally
the letters are drawn using the graphic primitives.

	The PostScript font generation machinery is general enough that you
can create and use filled, stroked, or even bitmap fonts if you want to.
-- 
Roy Smith, System Administrator
Public Health Research Institute
{allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy@uunet.uu.net
"The connector is the network"

mwp@munnari.oz (Michael Paddon) (09/19/88)

From article <692@clinet.FI>, by toweri@clinet.FI (Jukka Lindgren):
> 
> But I am not so sure...  Until now I have thought that the postscript
> doesn't "draw" individual letters, but merely "tells" the type-setter
> that
>  "there is the beginning of text column (x1,y1) and it ends at (x2,y2)
>   and it contains the following text with following type- and size setting.
> 
> Am I right or am I right ?

Wrong. Sets of postscript characters (fonts) may be described as arbitrary
graphical shapes. As such, they are subject to all forms of manipulation
that other general shapes are subject to (transformations etc). In general,
a character's definition is
	"a procedure body that executes...to produce the character's shape"
				(Red book, page 86)

Of course, this level of generalisation could be very inefficient in
practice, so some optimizations have been made. The abstract definition,
however, is probably good enough for people not actually building fonts
of their own.

Because fonts are very widely used in page descriptions, Adobe specified
some higher level operations to simplify their use in everyday situations.
The "show" operator is one such example (there are many others). These
specialised operators do not alter the fact that characters are merely
arbitrary shapes.

Some PostScript systems I have used also allow characters to be defined
as bit maps and the corresponding bit masks. This system is not as
flexible as the more general font model, but is occasionally useful
as many fonts already exist as bitmap descriptions.

========================================================
| Michael Paddon (mwp@munnari.oz.au)                   |
| Department of Computer Science, Melbourne University |
========================================================