[comp.lang.postscript] FontBBox in Font Dictionaries

phillips@cs.ubc.ca (George Phillips) (08/09/90)

I'm confused about the FontBBox entry that is supposed to be in every
font dictionary.  According to my copy of the red book, FontBBox is
a 4 element array.  But on both a NeXT machine and a laserwriter it
appears to be 4 numbers.  That is, if you do something like:

/Helvetica findfont begin FontBBox end

you'll have 
	-166 -244 1000 966
on the stack instead of the array
	[ -166 -244 1000 966 ]

So why does it push 4 numbers instead of the array?


George Phillips phillips@cs.ubc.ca {alberta,uw-beaver,uunet}!ubc-cs!phillips

glenn@heaven.woodside.ca.us (Glenn Reid) (08/09/90)

In article <9078@ubc-cs.UUCP> phillips@cs.ubc.ca (George Phillips) writes:
:I'm confused about the FontBBox entry that is supposed to be in every
:font dictionary.  According to my copy of the red book, FontBBox is
:a 4 element array.  But on both a NeXT machine and a laserwriter it
:appears to be 4 numbers.  That is, if you do something like:
:
:/Helvetica findfont begin FontBBox end
:
:you'll have 
:	-166 -244 1000 966
:on the stack instead of the array
:	[ -166 -244 1000 966 ]
:
:So why does it push 4 numbers instead of the array?

It's an executable array (otherwise known as a procedure).  You can
get it to land on the stack by using

/Helvetica findfont begin /FontBBox load end

and you can use the "cvlit" operator if you want it to be a literal
array for some reason.

/Glenn

-- 
 Glenn Reid				PostScript/NeXT consultant
 glenn@heaven.woodside.ca.us		Independent Software Developer
 ..{adobe,next}!heaven!glenn		415-851-1785

aas@boeygen.nr.no (Gisle Aas) (08/10/90)

In article <239@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us (Glenn Reid) writes:

>   It's an executable array (otherwise known as a procedure).  You can
>   get it to land on the stack by using
>
>   /Helvetica findfont begin /FontBBox load end
>
>   and you can use the "cvlit" operator if you want it to be a literal
>   array for some reason.

I can not see that the definition of FontBBox in the Red book says
that it should be an executable array.  IMHO it ought to be a literal
array.

The Blue book example of creating a new (analytic) font (page 219)
also defines FontBBox as a normal array of 4 numbers:
    /FontBBox [50 0 760 700] def

Perhaps the PS-books should be fixed to match the implementation, or
vica versa.



--
Gisle Aas               |  snail: Boks 114 Blindern, N-0314 Oslo, Norway
Norsk Regnesentral      |  X.400: G=Gisle;S=Aas;O=nr;P=uninett;C=no
voice: +47-2-453561     |  inet:  Gisle.Aas@nr.no

glenn@heaven.woodside.ca.us (Glenn Reid) (08/11/90)

In article <AAS.90Aug10102803@boeygen.nr.no> aas@boeygen.nr.no (Gisle Aas) writes:
>I can not see that the definition of FontBBox in the Red book says
>that it should be an executable array.  IMHO it ought to be a literal
>array.

I have to agree with you there.

>Perhaps the PS-books should be fixed to match the implementation, or
>vica versa.

Since the installed base of fonts is a lot larger than the installed
base of either Red Books or people who care about executable arrays,
I would guess that the book ought to make this a little clearer.

/Glenn

-- 
 Glenn Reid				PostScript/NeXT consultant
 glenn@heaven.woodside.ca.us		Independent Software Developer
 ..{adobe,next}!heaven!glenn		415-851-1785