home *** CD-ROM | disk | FTP | other *** search
Wrap
/* File CrosswordSquarePS.psw This file contains the code to draw a crossword puzzle square. The letter is centered within the square. The number is put in the upper left hand corner at 1/4 the size of the letter. */ /* ———————————————————————————————————————————————————————————————————————————— */ defineps PSWdrawSquare (int letter, number; float x, y, size, capheight) x y translate % % The font should already be set. Center the letter horizontally on a % baseline half the capheight from the center of the square. Do not center it % vertically in case it descends. % letter -1 ne { 1 string dup dup 0 letter put % make the string stringwidth pop neg size add 2 div % x size capheight add 2 div % y moveto show } if number -1 ne { currentfont 0.5 scalefont setfont % scale down the font 1 capheight 0.5 mul 1 add moveto % x & y number 3 string cvs show } if endps