[comp.org.usenix] Postscript for facesaver bitmaps?

arnold@mathcs.emory.edu (Arnold D. Robbins {EUCC}) (06/21/89)

Can the postscript program(s) used in the facesaver booth be made
available from the faceserver@uunet.uu.net? The current face2postscript
(or whatever it's called) that the faceserver sends out relies on two
separate bitmap manipulation packages which have been posted to the net
but which I don't have and don't have the time to find and build.

The main reason is that I am running out of facesaver stickers from the
SF Usenix.  Since I know my image is on UUNET, I would like to be able
to print out more stickers using the bitmap.  (They don't give us
personallized business cards here, so I just put the sticker on the
back of the generic one...)

Also, once I have it in postscript, it can be played around with...

As a separate idea, it'd be nice if they had the old database on-line at
the facesaver booth, so we could get stickers without having to get our
picture reshot.  I think that'd be a great time saver!

Thanks!
-- 
Arnold Robbins -- Emory University Computing Center | Unix is a Registered
DOMAIN: arnold@unix.cc.emory.edu		    | Bell of AT&T Trademark
UUCP: gatech!emoryu1!arnold  PHONE: +1 404 727-7636 | Laboratories.
BITNET: arnold@emoryu1	     FAX:   +1 404 727-2599 |         -- Donn Seeley

aoki@faerie.Berkeley.EDU (Paul M. Aoki) (06/21/89)

In article <4162@emory.mathcs.emory.edu> arnold@mathcs.emory.edu (Arnold D. Robbins {EUCC}) writes:
>Can the postscript program(s) used in the facesaver booth be made
>available from the faceserver@uunet.uu.net? The current face2postscript
>(or whatever it's called) that the faceserver sends out relies on two
>separate bitmap manipulation packages which have been posted to the net
>but which I don't have and don't have the time to find and build.

The file you get by requesting "send format" contains a standalone 
C program that converts the uunet faces to PostScript.

[ BTW, I'd like to see a copy of the stuff you have .. ]

--
Paul M. Aoki		aoki@postgres.Berkeley.EDU	     uunet!ucbvax!aoki
	    "Oh, the usual.  Publishing, perishing.  How about you?"

crtb@nih-csl.UUCP (chuck bacon) (06/21/89)

Here's some PS I put together for fun, which prints out the bitmaps
of as many pictures as will fit, on as many sheets as it takes.
If you
  cat /dev/tty faces.ps joe.face pete.face | lpr
  %!needed to fool lpr
  /Size 138.24 def
  ^D
you override the default picture size.  The Size variable
describes the width of the picture in points (easy to remember).
Size defaults to 184.32 points, or pictures 2.56" wide.  Since
most pictures are 96 pixels wide and it would be desirable to use an
integral number of printer dots per pixel (for smoothness of the
halftone pattern), I suggest multiples of 23.04 points (0.32 inches),
although I can't see any degradation when using other Sizes.

The `faces' files contain two sets of picture information, namely
PicData 96 128 8 (usually, sometimes 108 128 8) and Image 96 128 8
(always, as far as I've seen).  I discovered that PicData appears
to correspond exactly to the number of hex pairs which are supplied.
Image doesn't do anything obvious, but I've assumed it's supposed to
suggest the `apparent' number of pixels.  Therefore I force either
size of PicData (96 or 108 wide) into the same width (unit, magnified
by Size).

Warning: The override Size above, 138.24 pts.(1.92") gets you NINE
faces on a page.  On my NTX with 5 meg., I can go out for a beer,
and (depending on whom I run into) get back in time to hear the
printer whine...

-------- faces.ps --------
%! faces.ps -- 6/17/89 -- for displaying uunet.uu.net:faces/ data
% Chuck Bacon - crtb@alw.nih.gov
% You get a header which looks like this:
%	FirstName: Randall		<< ends with a trailing blank! >>
%	LastName: Smith
%	E-mail: randy@ncifcrf.gov
%	PicData: 108 128 8
%	Image: 96 128 8

currentdict /Size known not
  { /Size 120 def } if		% 184.32 is for 2 x 2 pictures on a sheet
/Ourfont /Helvetica-Bold findfont def
/Namefont Ourfont Size 12 div scalefont def
/NF { Namefont setfont } bind def
/Mailfont Ourfont Size 15 div scalefont def
/MF { Mailfont setfont } bind def
/XL 90 def			% Left margin, 1.25"
/YT 720 Size 1.28 mul sub def	% Lower edge of topmost picture
/DX Size 1.35 mul def		% Horizontal distance between pictures
/DY Size 1.80 mul def		% Vertical distance between pictures
/XR 612 Size 1.1 mul sub def	% Rightmost picture placement
/YB 72 def			% Lower limit of picture placement
/YN Size -7.5 div def		% Where First/Last Names are printed
/YI Size -4.3 div def		% Where Email address gets printed

/Workstr 256 string def		% Header text may be any length
/FindRoom {
  X XR gt { /X XL def /Y Y DY sub def Y YB lt { showpage /Y YT def } if } if
 } def

%		ReadHeader: reads currentfile, usually six lines

%	Returns with stack = true if end of file, false if end of header.

/ReadHeader
 {
  /FirstName () def
  /LastName () def
  /E-mail () def
  /PicData (96 128 8) def	% 1st 3 args. to `image'
  /Image (96 128 8) def
   {	% loop
    currentfile Workstr readline not { showpage true exit } if
    (: ) search
     {	% ifelse			% true exit: end of entire file
      exch pop			% ditch the ": "
      dup length 0 gt		% A line beginning with `: ' would kill us!
       { cvn exch dup length string copy def }
       { pop pop } ifelse
     } { pop false exit } ifelse	% false exit: end of header
   } loop
 } def

%		PrintPicture: reads currentfile, does `showpage exit' if EOF

/PrintPicture
 {
  gsave X Y translate
  0 YN moveto NF FirstName show LastName show
  0 YI moveto MF E-mail show
  Size dup scale		% 120 pts. should be 5 pixels per sample
  /Picstr PicData cvx exec pop pop string def
  PicData cvx exec		% 1st 3 args. to `image'
  [ PicData cvx exec pop 0 exch 0 exch Image cvx exec pop div mul 0 0 ]
% [ Image cvx exec pop 0 exch 0 exch 0 0]
% [100 0 0 100 0 0]		% (see PostScript Ref. Man. p. 75)
  { currentfile Picstr readhexstring not { showpage exit } if }
  image				% (Ref. Man. p. 170)
  currentfile read { pop } if	% Get the `/n' after the last hex
  grestore
 } def

/PrintAll	% Print as many pictures as you encounter
 {
  /Y YT def
  /X XL def
   {
    ReadHeader { exit } if	% Quit if EOF
    FindRoom
    PrintPicture		% Picture bottom is at Y=0
    /X X DX add def
   } loop
 } def

PrintAll
---------- Absolutely must cut off here! -----------
-- 
Charles Bacon, crtb@alw.nih.gov, crb@nihcudec.Bitnet, (301)496-4823
"Good is better than evil 'cause it's nicer".  --Li'l Abner