home *** CD-ROM | disk | FTP | other *** search
- /*
-
- FlippyFloppyWraps.psw
-
- Wraps for this funky thing.
-
- Copyright (c) 1992 by Scott Byer
-
- Permission is given to freely distribute and modify this code
- provided the copyright notice is left unchanged.
- No warranties, explicit or implied, apply to this code.
- */
-
- /* Zero out the cache limit for this context, return the old value. */
- defineps FFWzerocachelimit( | int *cacheLimit)
- cachestatus cacheLimit clear
- 0 setcachelimit
- endps
-
- defineps FFWsetcachelimit(int cacheLimit)
- cacheLimit setcachelimit
- endps
-
- /* Get the path bounding box for a line of text. */
- defineps FFWTextBBox( char *someText | double *llx, *lly, *urx, *ury )
- newpath
- 0 0 moveto (someText) false charpath
- flattenpath pathbbox
- ury urx lly llx
- endps
-
- /* Transform the coordinate system */
- defineps FFWTransform(double tx, ty, sx, sy, r)
- tx ty translate sx sy scale r rotate
- endps
-
- /* Reverse transform things, if given the right inputs. */
- defineps FFWDeTransform(double tx, ty, sx, sy, r)
- r rotate sx sy scale tx ty translate
- endps
-
- /* Draw a single black rectangle. */
- defineps FFWBlackBox(double llx, lly, width, height)
- 0 setgray
- llx lly width height rectfill
- endps
-
- /* Draw text at a given location; the font must already be set. */
- defineps FFWText(double x, y; char *text)
- x y moveto (text) show
- endps