rsm@amethyst.ma.arizona.edu (Robert Maier) (02/15/88)
The following is a simple PostScript program that prepares an application form for Single Booklovers. Single Booklovers is (I quote from their add) "a national organization started in 1970 to help cultured singles get acquainted through a monthly national newsletter". They have several thousand members. As of last report, the yearly membership fee was $44. That entitles the member to a copy of the registry of the members of the opposite sex, which summarizes what they say about themselves in their applications. Copies of the actual profile sheets of MOTOS are available for a nominal fee (less than a dollar each). SB seems to be quite short on `techie' women, and is having difficulties attracting enough literate males (literate programming doesn't count :-)). Help them out by sending them an application, or write them for more information. Their address is: Single Booklovers P.O. Box 117 Gradyville, PA 19039 (215)358-5049 Disclaimer: I have no pecuniary interest in Single Booklovers (beyond being a member); this program was written as a way of teaching myself PostScript. Since this article is going to soc.singles and rec.arts.books as well as comp.lang.postscript, I should explain that the application form must be printed out on a printer that understands that language. The Apple Laserwriter is one such. To print it, cut it at the dotted line and put it in a file. Then send it to the printer with `lpr' or a similar command. The first characters of the file should be the "%!". The form is filled out at the bottom. It should be self-explanatory. --Robert. ====================================================================== Robert S. Maier | Internet: rsm@amethyst.ma.arizona.edu Dept. of Math. | UUCP: ..{allegra,cmcl2,hao!noao}!arizona!amethyst!rsm Univ. of Arizona | Bitnet: maier@arizrvax Tucson, AZ 85721 | Phone: +1 602 621 6893 / +1 602 621 2617 -------------------------CUT ME HERE--------------------------------- %! % Simple PostScript program to prepare an application form for Single % Booklovers. Placed in the public domain. Instructions are at the % bottom. % % written 2.2.88 by Robert Maier (rsm@amethyst.ma.arizona.edu) % % /inch { 72 mul } def /hoffset { 0.075 inch } def % for buggy printers /voffset { 0.0 inch } def hoffset voffset translate /width { 8.5 inch } def % size of paper /height { 11 inch } def /centerline { width 2 div } def /hindent { 1 inch 3 div } def % overall hindent for page 0.35 setlinewidth /linespacing { 1 inch 3 div } def % interline spacing /lineoffset { 0.05 inch } def % x, -y offset fr keys to underlines /valoffset { 0.12 inch 0.06 inch } def % x, y offsets from lines to values /titlefontset { /Helvetica-Bold findfont 14 scalefont setfont } def /keyfontset { /Times-Roman findfont 12 scalefont setfont } def /valuefontset { /Helvetica findfont 12 scalefont setfont } def /left 0 def /center 1 def /right 2 def /ladjust 3 def % newline and extra-large (150%) newline /nl { hindent currentpoint exch pop linespacing sub moveto } def /nljump { hindent currentpoint exch pop linespacing 1.5 mul sub moveto } def % create a new array, copy old one into it /defarray { % newarrayname oldarrayname defarray load dup length exch dup xcheck 3 1 roll exch array copy exch { cvx } if def } def /centertext { % x y (text) centertext /txt exch def /ycenter exch def /xcenter exch def txt stringwidth pop 2 div neg xcenter add ycenter moveto txt show } def % underline draws an underline of given length, to be filled in with a % string by the user. The tag is used to position the point when the % form is filled in (see below). % finalunderline draws an underline to the right-hand side of the page. % rightjust draws an underline, leaving room for some specified % right-justified text. /underline { % tag length underline dup 3 1 roll lineoffset dup neg rmoveto valoffset tagloc 0 rlineto lineoffset dup rmoveto } def /finalunderline { % tag finalunderline width currentpoint pop sub hindent sub lineoffset 2 mul sub underline } def /rightjust { % tag text rightjust; leaves text on stack dup 3 1 roll stringwidth pop width currentpoint pop sub hindent sub lineoffset 2 mul sub exch sub underline } def % used as a template by tagloc (see below). If you don't think the % three options left/center/ladjust suffice, add your own. /strndisplay { % [hoffset] string left/center/ladjust strndisplay 0 0 0 moveto % x, y, len will all be poked in by tagloc exch dup dup left eq { pop pop pop show } { center eq { pop 2 div currentpoint 3 1 roll add exch 3 -1 roll centertext } { ladjust eq { pop exch 0 rmoveto show } if } ifelse } ifelse } def % tagloc (called by underline) tags the current loc of point, by % making a copy of `strndisplay' with name chosen to be the specified % tag. Current x, y coors of point, and the parameter (line length) % passed from underline are poked into the newly created copy. % Provision is made for an offset rel to currentpoint. /tagloc { % tag xwidth xoffset yoffset tagloc /yoffset exch def % offsets from currentpoint to start /xoffset exch def % of region /xwidth exch def % xwidth of region to tag dup /strndisplay defarray load dup dup 0 xwidth xoffset 2 mul sub put 1 currentpoint pop xoffset add put 2 currentpoint exch pop yoffset add put } def % Form is designed here. Format should be self-explanatory; just % print out a copy and compare the below with what you get! 0 height moveto nljump titlefontset centerline currentpoint exch pop (PERSONAL PROFILE FOR SINGLE BOOKLOVERS) centertext nljump keyfontset (Name) show /name 3.5 inch underline (Sex) show /sex 0.4 inch underline (Age) show /age 0.4 inch underline (Marital Status) show /status finalunderline nl (Address) show /address 5.3 inch underline (Religion) show /religion finalunderline nl (Height) show /height 0.7 inch underline (Weight) show /weight 0.7 inch underline (Number and ages of children) show /children finalunderline nl (Years of education) show /education 0.9 inch underline (Interest in marriage (great, moderate, slight, none)) show /interest finalunderline nl (Five favorite books) show /books1 finalunderline nl /books2 finalunderline nl /books3 finalunderline nl (Interest and taste in plays) show /plays finalunderline nl (Favorite outdoor sports) show /sports finalunderline nl (Favorite magazines) show /magazines finalunderline nl (Interest and taste in movies) show /movies finalunderline nl (Occupation) show /occupation 2.53 inch underline (Interest and taste in music) show /music1 finalunderline nl /music2 (What two things disturb you) rightjust show nl (most about today's society?) show /badsoc1 finalunderline nl /badsoc2 finalunderline nl (What two changes in society in recent years please you most?) show /goodsoc1 finalunderline nl /goodsoc2 finalunderline nl (Interest in religion) show /religion-interest (If interested in marriage, what characteristics) rightjust show nl (do you consider important in a prospective mate?) show /characteristics1 finalunderline nl /characteristics2 finalunderline nl /characteristics3 finalunderline nl /characteristics4 finalunderline nl (Would you like a Single Booklover who has read your Personal Profile and thinks you are someone he or she would) show nl (like to know better to write or call you?) show /answer (Give your telephone number if you desire) rightjust show nl /phone 1.7 inch underline nl (Is there anything about yourself you would want a fellow Single Booklover and prospective date to know that is not) show nl (given above?) show /other1 finalunderline nl /other2 finalunderline nl /other3 finalunderline nl /other4 finalunderline nl valuefontset % Form is filled in here. All lines below you will need to % change are of the form % % (information_supplied_by_applicant) position label % `information_supplied_by_applicant' is a string. `position' is % "left" (for left justification), "center" (for centered text), or % "ladjust". If it is "ladjust", the string should be preceded by a % distance, interpreted as a horizontal displacement relative to the % point where a left-justified string would begin. (name goes here) center name (M/F) center sex (XX) center age (fill in) center status (address goes here) center address (fill in) center religion (XX) center height (XX) center weight (child info here) center children (XX) center education (fill in) center interest (books start here) left books1 (books continue here) left books2 (books end here) left books3 (play info here) left plays (sports info here) left sports (magazine info here) left magazines (movie info here) left movies (occupation here) center occupation (music starts here) left music1 (music ends here) left music2 (pessimism starts here) left badsoc1 (pessimism ends here) left badsoc2 (optimism starts here) left goodsoc1 (optimism ends here) left goodsoc2 (religion info here) center religion-interest (characteristics start here) left characteristics1 (characteristics continue) left characteristics2 (characteristics continue) left characteristics3 (characteristics end here) left characteristics4 (answer here) center answer (optional phone no.) center phone (private details start here) left other1 (private details continue here) left other2 (private details continue here) left other3 (private details end here) left other4 stroke showpage -- Robert S. Maier | Internet: rsm@amethyst.ma.arizona.edu Dept. of Math. | UUCP: ..{allegra,cmcl2,hao!noao}!arizona!amethyst!rsm Univ. of Arizona | Bitnet: maier@arizrvax Tucson, AZ 85721 | Phone: +1 602 621 6893 / +1 602 621 2617