Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!rsalz From: rsalz@uunet.UU.NET (Rich Salz) Newsgroups: comp.sources.unix Subject: v12i054: A PostScript interpreter, Part05/18 Message-ID: <2753@uunet.UU.NET> Date: Tue, 3-Nov-87 02:15:37 EST Article-I.D.: uunet.2753 Posted: Tue Nov 3 02:15:37 1987 Date-Received: Fri, 6-Nov-87 03:52:50 EST Organization: UUNET Communications Services, Arlington, VA Lines: 5258 Approved: rs@uunet.UU.NET Submitted-by: Crispin Goswell Posting-number: Volume 12, Issue 54 Archive-name: postscript/part05 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'doc/hard-interface' <<'END_OF_FILE' X#include "main.h" X#include "graphics.h" X Xstruct hardware X { X }; X X/* X * This file describes the interface that PostScript requires to the X * graphics system at Version 1.4. X * X * ''Hardware'' in this context refers to a pointer to windows and/or X * bitmaps and is the lowest level X * of access that PostScript is interested in. Any Hardware parameter X * may be expected to be NULL. X */ X X/************************* CREATION OF WINDOWS AND BITMAPS *******************/ X Xstruct hardware *InitHardware () {} X/* X * InitHardware () returns a default device which PostScript may use X * immediately (or NULL if not appropriate). X * Its size and shape are not defined. Most typically the user will want X * to start up another device X * before it is used anyway. No attempt will be made by PostScript to X * Destroy the resulting X * device. X */ X Xstruct hardware *NewBitmapHardware (width, height) int width, height; {} X Xstruct hardware *NewWindowHardware (width, height) int width, height; {} X/* X * NewBitmapHardware () is expected to create a new bitmap. Only one plane will be needed. X * X * NewWindowHardware () is expected to create a window on the screen. X * On a colour system this will X * be expected to support full colour. X */ X Xint IsWindowHardware (h) struct hardware *h; {} X/* X * IsWindowHardware () should return TRUE if the hardware is a window, X * FALSE otherwise. X * NULL is a window. X */ X Xvoid DestroyHardware (h) struct hardware *h; {} X/* X * DestroyHardware () should release the resources required by the X * hardware, bitmap or window. X * This should cause a window device to vanish. X * NULL is not an error (does nothing). X */ X X XMatrix DeviceMatrix (width, height) int width, height; {} X XDevicePoint HardwareExtent (h) struct hardware *h; {} X/* X * X * DeviceMatrix () should return a matrix appropriate to a device of the X * given height and width. X * For a typical display with a graphics origin at the top left of a X * window, X * an appropriate definition would be: X * X * Matrix DeviceMatrix (width, height) int width, height; X * { X * return NewMatrix (PIXELS_PER_INCH / 72.0, 0.0, 0.0, X * -PIXELS_PER_INCH / 72.0, 0.0, (float) height); X * } X * X * HardwareExtent () returns a DevicePoint describing the width and X * height of the argument. X * NULL has extent NewDevicePoint (0, 0). X */ X X/*********************** OUTPUT PRIMITIVES ******************************/ X Xvoid BitBlt (from, to, fromPoint, toPoint, extent, rop) X struct hardware *from, *to; X DevicePoint toPoint, fromPoint, extent; X int rop; X {} X Xvoid Paint (from, to, fromPoint, toPoint, extent, colour) X struct hardware *from, *to; X DevicePoint toPoint, fromPoint, extent; X Colour colour; X {} X X/* X * BitBlt () is a full function RasterOp will the ability to mask the X * source with a colour. The 'rop' argument X * will have values as described in the header file hard.h. X * If the from argument is NULL it is taken to be X * a bitmap full of ones the shape of the fromPoint and extent. X * If the to argument is NULL, this is a no-op. X * X * Paint () is an addition to BitBlt. Bits that are set in the source X * are Painted into the destination X * in the given colour with a copying rasterop so that they replace X * pixels previously there. If the X * machine does not support colour windows, half-toning should be X * performed. X * Colour values have hue, saturation and brightness components. X * on a black and white or greyscale X * system the brightness value will be a FP value between 0.0 (black) X * and 1.1 (white), which can be X * used as a grey level. X */ X Xvoid BitBltTrapezoid (to, lefttop, leftbottom, righttop, rightbottom, top, X bottom, rop) X struct hardware *to; X DevicePoint lefttop, leftbottom, righttop, rightbottom; X int top, bottom, rop; X {} X Xvoid PaintTrapezoid (to, lefttop, leftbottom, righttop, rightbottom, top, X bottom, colour) X struct hardware *to; X DevicePoint lefttop, leftbottom, righttop, rightbottom; X int top, bottom; X Colour colour; X {} X X/* X * BitBltTrapezoid () and PaintTrapezoid () render a complete X * trapezoidal shape. X * The corners of the trapezoid may lie far outside the range of X * interesting scan-lines, but the slope X * of the line should be clipped by the top and bottom. The coordinates X * are half-open. X */ X Xvoid Line (h, fromPoint, toPoint, rop) X struct hardware *h; X DevicePoint fromPoint, toPoint; X int rop; X {} X Xvoid PaintLine (h, fromPoint, toPoint, colour) X struct hardware *h; X DevicePoint fromPoint, toPoint; X Colour colour; X {} X X/* X * Line () is expected to draw a line between the given points (the last pixel is expected to be drawn) X * with the given RasterOp and colour masking. The line should be one pixel wide and half-open. [Thicker lines are X * done with BitBlt.] X * X * PaintLine () is expected to Paint a line by analogy with Paint and BitBlt. X */ X Xint TransferSize () {} X Xvoid SetTransfer (vec) float *vec; {} X/* X * TransferSize () and SetTransfer () control the mapping function X * between user brightnesses X * and device brightnesses. The interface is expected to perform this X * mapping of brightnesses X * to a sufficient resolution. SetTransfer takes a table of floating X * point numbers between X * 0 and 1. User brightnesses are scaled to the size of this table and X * mapped through it. X * The argument table given to SetTransfer () will be deleted after use. X * TransferSize () simply X * enquires the required size of the table. X * X * It may be appropriate to half-tone on a grayscale or colour device to X * improve rendering if it is not too X * expensive. TransferSize () returns the size of the pattern table. X */ X Xchar *StringFromHardware (h) struct hardware *h; {} X Xstruct hardware *HardwareFromString (s, width, height) Xchar *s; int width, height; {} X/* X * StringFromHardware () produces a string from its argument which X * describes the bitmap. X * The bitmap is returned in row-major order with the leftmost bit of X * each byte in the most significant X * position. Rows are padded to byte boundaries. Only single plane X * bitmaps are used. X * X * HardwareFromString () performs the inverse mapping, generating a X * bitmap from a set of bits, given X * a width and height. Only single plane bitmaps are used. X */ X Xint ScreenSize (freq, rotation) float freq, rotation; {} X Xvoid BuildScreen (freq, rotation, x, y) float freq, rotation, *x, *y; {} X Xvoid SetScreen (freq, rotation, thresh) float freq, rotation, *thresh; {} X/* X * ScreenSize () allows PostScript to determine how large an array of X * sample points to expect. X * It should return the length of the side of the sample square. X * X * BuildScreen () returns a set of sampling coordinates to PostScript to X * hand to the users spot-function X * X * SetScreen () allows PostScript to set the thresholds for each sample X * point so that half-tone bitmaps X * can be made. X */ X Xvoid SetClipHardware (h, clip) struct hardware *h, *clip; {} X/* X * SetClipHardware sets hardware which is a clip mask for BitBlt. X * This mask should be ANDed with any output X * operation. If clip is NULL, masking will not be needed. X */ X Xvoid HardUpdate () {} X/* X * HardUpdate is a hook to allow devices which do output buffering to X * flush that buffering when appropriate. X * This allows an interactive user to see completed graphics between X * prompts (it is called as a side-effect X * of the PostScript flush operator). Typically is is a no-op. X */ X Xvoid UpdateControl () X {} X/* X * This call can be used to enable batching of output operations. X * UpdateControl (FALSE) means ``start of X * batching'' UpdateControl (TRUE) means ``end of batching''. X * It is used to improve performance on machines X * where screen updates have a high locking overhead. It may be a no-op. X */ END_OF_FILE if test 7674 -ne `wc -c <'doc/hard-interface'`; then echo shar: \"'doc/hard-interface'\" unpacked with wrong size! fi # end of 'doc/hard-interface' fi if test -f 'postscript/demos/fishes' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'postscript/demos/fishes'\" else echo shar: Extracting \"'postscript/demos/fishes'\" \(7514 characters\) sed "s/^X//" >'postscript/demos/fishes' <<'END_OF_FILE' X%! X% The following are all the functions required to produce the famous X% "Square Limit" drawing by M. C. Escher. These functions were derived by X% Peter Henderson. See his paper in 1982 Conf. on LISP and Func. Prog. X% (C) Miranda coding by Michael Parsons, September 1985 X% Translation to PostScript by Peter Bumbulis, July 1986 X% X X30 0 translate X X% quartet combines 4 images, one image in each quadrant, to produce one image. X/quartet { X 4 -1 roll 1 2 div 0 1 zoom X 4 -1 roll 1 2 div 1 1 zoom X 4 -1 roll 1 2 div 0 0 zoom X 4 -1 roll 1 2 div 1 0 zoom X 4 {exec} /repeat cvx X 7 array astore cvx X} def X X% nonet arranges 9 images in equal sized squares to form 1 image. X/nonet { X 9 -1 roll 1 3 div 0 1 zoom X 9 -1 roll 1 3 div 0.5 1 zoom X 9 -1 roll 1 3 div 1 1 zoom X 9 -1 roll 1 3 div 0 0.5 zoom X 9 -1 roll 1 3 div 0.5 0.5 zoom X 9 -1 roll 1 3 div 1 0.5 zoom X 9 -1 roll 1 3 div 0 0 zoom X 9 -1 roll 1 3 div 0.5 0 zoom X 9 -1 roll 1 3 div 1 0 zoom X 9 {exec} /repeat cvx X 12 array astore cvx X} def X X% cycle combines 4 smaller copies of an image, each rotated by a different X% multiple of 90 degrees. X/cycle {dup 270 rot dup 180 rot dup 90 rot quartet} def X X% t is one of the basic fish rearrangements. X/t {{p} {q} {r} {s} quartet} def X X% u is another of the basic fish rearrangements. X/u {{q} 90 rot cycle} def X X% side defines one side of the picture at level n. X/side { X dup 0 le X { pop {} dup t 90 rot t quartet} X {1 sub side dup t 90 rot t quartet} X ifelse X} def X X% corner defines one corner of the picture at level n. X/corner { X dup 0 le X { pop {} {} {} u quartet} X {1 sub dup corner exch side dup 90 rot u quartet} X ifelse X} def X X% quadcorner forms one quarter of the image at level n; X/quadcorner { X dup corner exch side dup dup 90 rot dup u exch t 90 rot dup 3 1 roll X {q} 90 rot nonet X} def X X% squarelimit produces the fish drawing. X/squarelimit {quadcorner cycle} def X X% fish gives a border to produce the final drawing. X/fish { X squarelimit exec X newpath X 0 0 moveto X 0 1 lineto X 1 1 lineto X 1 0 lineto X closepath X stroke X} def X X/flip {0.5 0.5 translate 1 -1 scale -0.5 -0.5 translate} def X X% All the data needed to draw the fish. X/p { X gsave flip X newpath X 0 0.8125 moveto 0 0.5 lineto X 0 0.8125 moveto 0.1875 0.75 lineto X 0.75 0 moveto 0.8125 6.25e-2 lineto X 0.1875 0.75 moveto 0 0.5 lineto X 0.375 1 moveto 0.25 0.75 lineto X 0.25 0.6875 moveto 0.4375 0.625 lineto X 0.25 0.6875 moveto 0.25 0.375 lineto X 0.4375 0.625 moveto 0.25 0.375 lineto X 0.6875 1 moveto 0.625 0.75 lineto X 0.6875 1 moveto 0.875 0.875 lineto X 0.875 0.875 moveto 1 0.875 lineto X 0.625 0.75 moveto 0.8125 0.6875 lineto X 0.8125 0.6875 moveto 1 0.75 lineto X 0.625 0.75 moveto 0.5 0.5 lineto X 0.5625 0.625 moveto 0.75 0.5625 lineto X 0.75 0.5625 moveto 1 0.625 lineto X 0.5 0.5 moveto 0.75 0.4375 lineto X 0.75 0.4375 moveto 1 0.5 lineto X 0.5 0.5 moveto 0.25 0.1875 lineto X 0.25 0.1875 moveto 0 0 lineto X 0.5 0.25 moveto 1 0.375 lineto X 1 0.25 moveto 0.75 0.25 lineto X 0.75 0.25 moveto 0.5 0 lineto X 0.5 0 moveto 0.375 6.25e-2 lineto X 0.375 6.25e-2 moveto 0 0 lineto X 0.625 0 moveto 0.75 0.125 lineto X 0.75 0.125 moveto 1 0.1875 lineto X 1 0.125 moveto 0.8125 6.25e-2 lineto X 1 6.25e-2 moveto 0.875 0 lineto X stroke X grestore X} def X X/q { X gsave flip X newpath X 0 0 moveto 0 0.25 lineto X 0 0.5 moveto 0 1 lineto X 0 1 moveto 0.5 1 lineto X 0.75 1 moveto 1 1 lineto X 0.125 1 moveto 0.25 0.6875 lineto X 0.25 1 moveto 0.375 0.6875 lineto X 0.375 1 moveto 0.5 0.6875 lineto X 0.5 1 moveto 0.625 0.625 lineto X 0.25 0.6875 moveto 0.25 0.5625 lineto X 0.375 0.6875 moveto 0.375 0.5625 lineto X 0.5 0.6875 moveto 0.5 0.5 lineto X 0.625 0.625 moveto 0.625 0.4375 lineto X 0.625 1 moveto 0.875 0.3125 lineto X 0.75 1 moveto 0.8125 0.75 lineto X 0.8125 1 moveto 1 0.625 lineto X 0.875 1 moveto 1 0.75 lineto X 0.9375 1 moveto 1 0.875 lineto X 0 0.25 moveto 0.1875 0.1875 lineto X 0 0.375 moveto 0.4375 0.3125 lineto X 0 0.5 moveto 0.25 0.5625 lineto X 0.125 0 moveto 0.1875 0.1875 lineto X 0.1875 0.1875 moveto 0.3125 0.125 lineto X 0.3125 0.125 moveto 0.25 0 lineto X 0.3125 0.125 moveto 0.4375 6.25e-2 lineto X 0.4375 6.25e-2 moveto 0.5 0 lineto X 0.5 6.25e-2 moveto 0.6875 6.25e-2 lineto X 0.6875 6.25e-2 moveto 0.5625 0.1875 lineto X 0.5625 0.1875 moveto 0.5 6.25e-2 lineto X 0.5625 0.25 moveto 0.75 0.25 lineto X 0.75 0.25 moveto 0.625 0.375 lineto X 0.625 0.375 moveto 0.5625 0.25 lineto X 1 0 moveto 0.75 0.375 lineto X 0.375 0 moveto 0.4375 6.25e-2 lineto X 0.75 0.375 moveto 0.375 0.5625 lineto X 0.375 0.5625 moveto 0.25 0.5625 lineto X 1 0 moveto 0.9375 0.375 lineto X 0.9375 0.375 moveto 1 0.5 lineto X 1 0.5 moveto 0.8125 0.75 lineto X stroke X grestore X} def X X/r { X gsave flip X newpath X 0.5 0.5 moveto 0.125 0.25 lineto X 0.125 0.25 moveto 0 0 lineto X 0 0.5 moveto 0.125 0.25 lineto X 0 0.25 moveto 6.25e-2 0.125 lineto X 0 1 moveto 0.5 0.5 lineto X 0 0.75 moveto 0.3125 0.375 lineto X 6.25e-2 0.9375 moveto 0.25 1 lineto X 0.125 0.875 moveto 0.5 1 lineto X 0.1875 0.8125 moveto 0.5 0.875 lineto X 0.3125 0.6875 moveto 0.75 0.8125 lineto X 0.5 0.875 moveto 0.75 1 lineto X 0.75 0.8125 moveto 1 1 lineto X 0.5 0.5 moveto 0.875 0.625 lineto X 1 0.625 moveto 0.6875 0.375 lineto X 0.6875 0.375 moveto 0.375 0 lineto X 1 0.5 moveto 0.75 0.25 lineto X 1 0.75 moveto 0.875 0.625 lineto X 0.75 0.25 moveto 0.6875 0 lineto X 0.75 0.25 moveto 1 0 lineto X 1 0.375 moveto 0.8125 0.1875 lineto X 1 0.25 moveto 0.875 0.125 lineto X 1 0.125 moveto 0.9375 6.25e-2 lineto X stroke X grestore X} def X X/s { X gsave flip X newpath X 0 1 moveto 0.25 0.875 lineto X 0.125 0.9375 moveto 0 0.75 lineto X 0.25 0.875 moveto 0.5 0.875 lineto X 0.5 0.875 moveto 1 1 lineto X 1 1 moveto 0.625 0.75 lineto X 0.625 0.75 moveto 0.5 0.625 lineto X 0 0.625 moveto 0.4375 0.75 lineto X 0 0.5 moveto 0.5 0.625 lineto X 0 0.375 moveto 0.4375 0.5 lineto X 0 0.25 moveto 0.4375 0.375 lineto X 0 0.125 moveto 0.4375 0.1875 lineto X 0.5 0.625 moveto 0.4375 0.5 lineto X 0.4375 0.5 moveto 0.4375 0.1875 lineto X 0.4375 0.1875 moveto 0.5 0 lineto X 0.625 0 moveto 0.6875 0.375 lineto X 0.75 0 moveto 0.8125 0.1875 lineto X 0.8125 0.1875 moveto 0.9375 0.4375 lineto X 0.9375 0.4375 moveto 1 0.5 lineto X 1 0.125 moveto 0.8125 0.1875 lineto X 1 0.25 moveto 0.875 0.3125 lineto X 1 0.375 moveto 0.9375 0.4375 lineto X 0.75 0.5625 moveto 0.75 0.75 lineto X 0.75 0.75 moveto 0.625 0.625 lineto X 0.625 0.625 moveto 0.75 0.5625 lineto X 0.8125 0.5625 moveto 0.9375 0.5 lineto X 0.9375 0.5 moveto 0.9375 0.6875 lineto X 0.9375 0.6875 moveto 0.8125 0.5625 lineto X stroke X grestore X} def X X% rot rotates an image by th radians anti-clockwise, about the image centre. X/rotcode {gsave 0.5 0.5 translate rotate -0.5 -0.5 translate exec grestore} def X X/rot { /rotcode cvx 3 array astore cvx } def X X% zoom scales an image up or down with one fixed point. X/zoomcode { X gsave 2 copy neg exch neg exch 5 2 roll translate dup scale translate exec grestore X} def X/zoom { /zoomcode cvx 5 array astore cvx} def X X/setup {0 144 translate 72 7 mul dup scale .25 7 div dup translate .001 setlinewidth} def X X% display a level 2 fish X Xsetup X2 fish Xcopypage Xcopypage Xshowpage END_OF_FILE if test 7514 -ne `wc -c <'postscript/demos/fishes'`; then echo shar: \"'postscript/demos/fishes'\" unpacked with wrong size! fi # end of 'postscript/demos/fishes' fi if test -f 'postscript/fonts/Times/italic.a' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'postscript/fonts/Times/italic.a'\" else echo shar: Extracting \"'postscript/fonts/Times/italic.a'\" \(7989 characters\) sed "s/^X//" >'postscript/fonts/Times/italic.a' <<'END_OF_FILE' XCharStrings X/parenleft X Xput XMetrics X/parenleft X[9 X14] Xput XCharStrings X/parenright X Xput XMetrics X/parenright X[9 X14] Xput XCharStrings X/bracketleft X Xput XMetrics X/bracketleft X[9 X14] Xput XCharStrings X/bracketright X Xput XMetrics X/bracketright X[9 X14] Xput XCharStrings X/braceleft X Xput XMetrics X/braceleft X[9 X14] Xput XCharStrings X/braceright X Xput XMetrics X/braceright X[9 X14] Xput XCharStrings X/zero X Xput XMetrics X/zero X[2 X20] Xput XCharStrings X/one X Xput XMetrics X/one X[2 X20] Xput XCharStrings X/two X Xput XMetrics X/two X[2 X20] Xput XCharStrings X/three X Xput XMetrics X/three X[2 X20] Xput XCharStrings X/four X Xput XMetrics X/four X[2 X20] Xput XCharStrings X/five X Xput XMetrics X/five X[2 X20] Xput XCharStrings X/six X Xput XMetrics X/six X[2 X20] Xput XCharStrings X/seven X Xput XMetrics X/seven X[2 X20] Xput XCharStrings X/eight X Xput XMetrics X/eight X[2 X20] Xput XCharStrings X/nine X Xput XMetrics X/nine X[2 X20] Xput XCharStrings X/period X Xput XMetrics X/period X[-4 X10] Xput XCharStrings X/comma X Xput XMetrics X/comma X[-4 X10] Xput XCharStrings X/colon X Xput XMetrics X/colon X[0 X10] Xput XCharStrings X/semicolon X Xput XMetrics X/semicolon X[0 X10] Xput XCharStrings X/exclam X Xput XMetrics X/exclam X[7 X10] Xput XCharStrings X/question X Xput XMetrics X/question X[3 X18] Xput XCharStrings X/quoteright X Xput XMetrics X/quoteright X[8 X8] Xput XCharStrings X/quotedbl X Xput XMetrics X/quotedbl X[4 X16] Xput XCharStrings X/ring X Xput XMetrics X/ring X[5 X14] Xput XCharStrings X/asterisk X Xput XMetrics X/asterisk X[4 X16] Xput XCharStrings X/slash X Xput XMetrics X/slash X[5 X22] Xput XCharStrings X/parenleft X Xput XMetrics X/parenleft X[9 X14] Xput XCharStrings X/parenright X Xput XMetrics X/parenright X[9 X14] Xput XCharStrings X/bracketleft X Xput XMetrics X/bracketleft X[9 X14] Xput XCharStrings X/bracketright X Xput XMetrics X/bracketright X[9 X14] Xput XCharStrings X/braceleft X Xput XMetrics X/braceleft X[9 X14] Xput XCharStrings X/braceright X Xput XMetrics X/braceright X[9 X14] Xput XCharStrings X/angleleft X Xput XMetrics X/angleleft X[9 X14] Xput XCharStrings X/angleright X Xput XMetrics X/angleright X[9 X14] Xput XCharStrings X/bar X Xput XMetrics X/bar X[12 X8] Xput XCharStrings X/minus X Xput XMetrics X/minus X[-4 X26] Xput XCharStrings X/plus X Xput XMetrics X/plus X[-4 X26] Xput XCharStrings X/equal X Xput XMetrics X/equal X[-4 X26] Xput XCharStrings X/less X Xput XMetrics X/less X[-3 X24] Xput XCharStrings X/greater X Xput XMetrics X/greater X[-3 X24] Xput XCharStrings X/asciicircum X Xput XMetrics X/asciicircum X[-3 X22] Xput XCharStrings X/quoteleft X Xput XMetrics X/quoteleft X[7 X10] Xput XCharStrings X/quoteright X Xput XMetrics X/quoteright X[7 X10] Xput XCharStrings X/percent X Xput XMetrics X/percent X[0 X24] Xput XCharStrings X/ampersand X Xput XMetrics X/ampersand X[0 X25] Xput XCharStrings X/at X Xput XMetrics X/at X[-1 X27] Xput XCharStrings X/dollar X Xput XMetrics X/dollar X[6 X20] Xput XCharStrings X/numbersign X Xput XMetrics X/numbersign X[2 X21] Xput XCharStrings X/space X() Xput XMetrics X/space X[0 X20] Xput XCharStrings X/.notdef X Xput XMetrics X/.notdef X[3 X18] Xput XCharStrings X/hyphen X Xput XMetrics X/hyphen X[-3 X14] Xput XCharStrings X/underscore X Xput XMetrics X/underscore X[0 X16] Xput XCharStrings X/backslash X Xput XMetrics X/backslash X[-4 X26] Xput XCharStrings X/asciitilde X Xput XMetrics X/asciitilde X[-3 X24] Xput END_OF_FILE if test 7989 -ne `wc -c <'postscript/fonts/Times/italic.a'`; then echo shar: \"'postscript/fonts/Times/italic.a'\" unpacked with wrong size! fi # end of 'postscript/fonts/Times/italic.a' fi if test -f 'postscript/fonts/Times/roman.a' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'postscript/fonts/Times/roman.a'\" else echo shar: Extracting \"'postscript/fonts/Times/roman.a'\" \(7887 characters\) sed "s/^X//" >'postscript/fonts/Times/roman.a' <<'END_OF_FILE' XCharStrings X/parenleft X Xput XMetrics X/parenleft X[9 X14] Xput XCharStrings X/parenright X Xput XMetrics X/parenright X[9 X14] Xput XCharStrings X/bracketleft X Xput XMetrics X/bracketleft X[9 X14] Xput XCharStrings X/bracketright X Xput XMetrics X/bracketright X[9 X14] Xput XCharStrings X/braceleft X Xput XMetrics X/braceleft X[9 X14] Xput XCharStrings X/braceright X Xput XMetrics X/braceright X[9 X14] Xput XCharStrings X/zero X Xput XMetrics X/zero X[2 X20] Xput XCharStrings X/one X Xput XMetrics X/one X[2 X20] Xput XCharStrings X/two X Xput XMetrics X/two X[2 X20] Xput XCharStrings X/three X Xput XMetrics X/three X[2 X20] Xput XCharStrings X/four X Xput XMetrics X/four X[2 X20] Xput XCharStrings X/five X Xput XMetrics X/five X[2 X20] Xput XCharStrings X/six X Xput XMetrics X/six X[2 X20] Xput XCharStrings X/seven X Xput XMetrics X/seven X[2 X20] Xput XCharStrings X/eight X Xput XMetrics X/eight X[2 X20] Xput XCharStrings X/nine X Xput XMetrics X/nine X[2 X20] Xput XCharStrings X/period X Xput XMetrics X/period X[-4 X10] Xput XCharStrings X/comma X Xput XMetrics X/comma X[-4 X10] Xput XCharStrings X/colon X Xput XMetrics X/colon X[0 X10] Xput XCharStrings X/semicolon X Xput XMetrics X/semicolon X[0 X10] Xput XCharStrings X/exclam X Xput XMetrics X/exclam X[7 X10] Xput XCharStrings X/question X Xput XMetrics X/question X[3 X18] Xput XCharStrings X/quoteright X Xput XMetrics X/quoteright X[8 X8] Xput XCharStrings X/quotedbl X Xput XMetrics X/quotedbl X[4 X16] Xput XCharStrings X/ring X Xput XMetrics X/ring X[5 X14] Xput XCharStrings X/asterisk X Xput XMetrics X/asterisk X[4 X16] Xput XCharStrings X/slash X Xput XMetrics X/slash X[5 X22] Xput XCharStrings X/parenleft X Xput XMetrics X/parenleft X[9 X14] Xput XCharStrings X/parenright X Xput XMetrics X/parenright X[9 X14] Xput XCharStrings X/bracketleft X Xput XMetrics X/bracketleft X[9 X14] Xput XCharStrings X/bracketright X Xput XMetrics X/bracketright X[9 X14] Xput XCharStrings X/braceleft X Xput XMetrics X/braceleft X[9 X14] Xput XCharStrings X/braceright X Xput XMetrics X/braceright X[9 X14] Xput XCharStrings X/angleleft X Xput XMetrics X/angleleft X[9 X14] Xput XCharStrings X/angleright X Xput XMetrics X/angleright X[9 X14] Xput XCharStrings X/bar X Xput XMetrics X/bar X[12 X8] Xput XCharStrings X/minus X Xput XMetrics X/minus X[-4 X26] Xput XCharStrings X/plus X Xput XMetrics X/plus X[-4 X26] Xput XCharStrings X/equal X Xput XMetrics X/equal X[-4 X26] Xput XCharStrings X/less X Xput XMetrics X/less X[-3 X24] Xput XCharStrings X/greater X Xput XMetrics X/greater X[-3 X24] Xput XCharStrings X/asciicircum X Xput XMetrics X/asciicircum X[-3 X22] Xput XCharStrings X/quoteright X Xput XMetrics X/quoteleft X[7 X10] Xput XCharStrings X/quoteleft X Xput XMetrics X/quoteright X[7 X10] Xput XCharStrings X/percent X Xput XMetrics X/percent X[0 X24] Xput XCharStrings X/ampersand X Xput XMetrics X/ampersand X[0 X25] Xput XCharStrings X/at X Xput XMetrics X/at X[-1 X27] Xput XCharStrings X/dollar X Xput XMetrics X/dollar X[6 X20] Xput XCharStrings X/space X() Xput XMetrics X/space X[0 X20] Xput XCharStrings X/.notdef X Xput XMetrics X/.notdef X[3 X18] Xput XCharStrings X/hyphen X Xput XMetrics X/hyphen X[-3 X14] Xput XCharStrings X/underscore X Xput XMetrics X/underscore X[0 X16] Xput XCharStrings X/backslash X Xput XMetrics X/backslash X[-4 X26] Xput XCharStrings X/asciitilde X Xput XMetrics X/asciitilde X[-3 X24] Xput END_OF_FILE if test 7887 -ne `wc -c <'postscript/fonts/Times/roman.a'`; then echo shar: \"'postscript/fonts/Times/roman.a'\" unpacked with wrong size! fi # end of 'postscript/fonts/Times/roman.a' fi if test -f 'postscript/fonts/times/greek.r' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'postscript/fonts/times/greek.r'\" else echo shar: Extracting \"'postscript/fonts/times/greek.r'\" \(7459 characters\) sed "s/^X//" >'postscript/fonts/times/greek.r' <<'END_OF_FILE' XCharStrings X/1127 X Xput XMetrics X/1127 X[-2 X16] Xput XCharStrings X/1128 X Xput XMetrics X/1128 X[0 X13] Xput XCharStrings X/1129 X Xput XMetrics X/1129 X[-1 X14] Xput XCharStrings X/1130 X Xput XMetrics X/1130 X[1 X14] Xput XCharStrings X/1131 X Xput XMetrics X/1131 X[-2 X12] Xput XCharStrings X/1132 X Xput XMetrics X/1132 X[1 X11] Xput XCharStrings X/1133 X Xput XMetrics X/1133 X[-1 X16] Xput XCharStrings X/1134 X Xput XMetrics X/1134 X[-1 X16] Xput XCharStrings X/1135 X Xput XMetrics X/1135 X[-1 X9] Xput XCharStrings X/1136 X Xput XMetrics X/1136 X[-1 X14] Xput XCharStrings X/1137 X Xput XMetrics X/1137 X[1 X12] Xput XCharStrings X/1138 X Xput XMetrics X/1138 X[0 X15] Xput XCharStrings X/1139 X Xput XMetrics X/1139 X[-2 X15] Xput XCharStrings X/1140 X Xput XMetrics X/1140 X[2 X11] Xput XCharStrings X/1141 X Xput XMetrics X/1141 X[-2 X13] Xput XCharStrings X/1142 X Xput XMetrics X/1142 X[-2 X17] Xput XCharStrings X/1143 X Xput XMetrics X/1143 X[0 X14] Xput XCharStrings X/1144 X Xput XMetrics X/1144 X[-2 X16] Xput XCharStrings X/1145 X Xput XMetrics X/1145 X[-2 X15] Xput XCharStrings X/1146 X Xput XMetrics X/1146 X[-1 X14] Xput XCharStrings X/1147 X Xput XMetrics X/1147 X[-2 X15] Xput XCharStrings X/1148 X Xput XMetrics X/1148 X[-1 X13] Xput XCharStrings X/1149 X Xput XMetrics X/1149 X[-1 X18] Xput XCharStrings X/1150 X Xput XMetrics X/1150 X[-2 X16] Xput XCharStrings X/1027 X Xput XMetrics X/1027 X[0 X14] Xput XCharStrings X/1028 X Xput XMetrics X/1028 X[-1 X16] Xput XCharStrings X/1029 X Xput XMetrics X/1029 X[0 X13] Xput XCharStrings X/1030 X Xput XMetrics X/1030 X[0 X14] Xput XCharStrings X/1031 X Xput XMetrics X/1031 X[-1 X15] Xput XCharStrings X/1032 X Xput XMetrics X/1032 X[1 X13] Xput XCharStrings X/1033 X Xput XMetrics X/1033 X[-1 X17] Xput XCharStrings X/1034 X Xput XMetrics X/1034 X[0 X15] Xput XCharStrings X/1035 X Xput XMetrics X/1035 X[3 X9] Xput XCharStrings X/1036 X Xput XMetrics X/1036 X[-1 X16] Xput XCharStrings X/1037 X Xput XMetrics X/1037 X[0 X14] Xput XCharStrings X/1038 X Xput XMetrics X/1038 X[-2 X19] Xput XCharStrings X/1039 X Xput XMetrics X/1039 X[-1 X16] Xput XCharStrings X/1040 X Xput XMetrics X/1040 X[0 X16] Xput XCharStrings X/1041 X Xput XMetrics X/1041 X[0 X15] Xput XCharStrings X/1042 X Xput XMetrics X/1042 X[-1 X17] Xput XCharStrings X/1043 X Xput XMetrics X/1043 X[-1 X15] Xput XCharStrings X/1044 X Xput XMetrics X/1044 X[0 X16] Xput XCharStrings X/1045 X Xput XMetrics X/1045 X[0 X15] Xput XCharStrings X/1046 X Xput XMetrics X/1046 X[0 X15] Xput XCharStrings X/1047 X Xput XMetrics X/1047 X[0 X15] Xput XCharStrings X/1048 X Xput XMetrics X/1048 X[0 X15] Xput XCharStrings X/1049 X Xput XMetrics X/1049 X[-1 X17] Xput XCharStrings X/1050 X Xput XMetrics X/1050 X[0 X15] Xput END_OF_FILE if test 7459 -ne `wc -c <'postscript/fonts/times/greek.r'`; then echo shar: \"'postscript/fonts/times/greek.r'\" unpacked with wrong size! fi # end of 'postscript/fonts/times/greek.r' fi if test -f 'source/device.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'source/device.c'\" else echo shar: Extracting \"'source/device.c'\" \(7801 characters\) sed "s/^X//" >'source/device.c' <<'END_OF_FILE' X/* X * Copyright (C) Rutherford Appleton Laboratory 1987 X * X * This source may be copied, distributed, altered or used, but not sold for profit X * or incorporated into a product except under licence from the author. X * It is not in the public domain. X * This notice should remain in the source unaltered, and any changes to the source X * made by persons other than the author should be marked as such. X * X * Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd X */ X#include "main.h" X#include "graphics.h" X Xstatic int NullDevice (); Xstatic int FrameDevice (); Xstatic int GrabBits (); X XColour Black = { 0.0, 0.0, 0.0 }, White = { 0.0, 0.0, 1.0 }; X Xstruct device *NewWindowDevice (), *NewBitmapDevice (), *NewCacheDevice (); X XInitDevices () X { X struct hardware *h; X DevicePoint extent; X X InstallOp ("framedevice", FrameDevice, 4, 0, 0, 0, Array, Integer, Integer, Array); X InstallOp ("nulldevice", NullDevice, 0, 0, 0, 0); X InstallOp ("grabbits", GrabBits, 4, 0, 0, 0, Float, Float, Float, Float); X X extent = HardwareExtent (h = InitHardware ()); X gstate->device = NULL; gstate->clipdevice = NULL; X SetDevice (LinkDevice (DeviceFrom (h, DeviceMatrix (extent.dx, extent.dy)))); X } X Xstatic int GrabBits (x, y, w, h) Object x, y, w, h; X { X HardPoint origin, corner, extent; X int width, height, size; X char *s; X struct hardware *dev; X X origin = ExtToInt (NewPoint (BodyReal (x), BodyReal (y))); X corner = ExtToInt (NewPoint (BodyReal (x) + BodyReal (w), BodyReal (y) + BodyReal (h))); X width = corner.hx - origin.hx; X height = corner.hy - origin.hy; X X fprintf (stderr, "width = %d, height = %d\n", width, height); X X extent = NewHardPoint ((float) width, (float) height); X X dev = NewBitmapHardware (width, height); X X BitBlt (gstate->device->dev, dev, X NewDevicePoint ((int) origin.hx, (int) origin.hy), X NewDevicePoint (0, 0), X NewDevicePoint ((int) extent.hx, (int) extent.hy), X ROP_SOURCE); X s = StringFromHardware (dev); X DestroyHardware (dev); X size = (width + 7) / 8 * height; X X Push (OpStack, MakeString (s, size)); X Free (s); X Push (OpStack, MakeInteger (width)); X Push (OpStack, MakeInteger (height)); X X return TRUE; X } X Xstatic int NullDevice () X { X SetDevice ( X NewDevice ( X NewClipPath (0.0, 0.0, 0.0, 0.0), X NewMatrix (1.0, 0.0, 0.0, 1.0, 0.0, 0.0), X (struct hardware *) NULL)); X return TRUE; X } X X/*ARGSUSED*/ Xstatic int FrameDevice (mat, width, height, proc) Object mat, width, height, proc; X { X Matrix m; X X if (lengthArray (mat) != 6 || !ExtractMatrix (&m, mat)) X return Error (PTypeCheck); X if (BodyInteger (width) < 0 || BodyInteger (height) < 0) X return Error (PRangeCheck); X SetDevice (NewWindowDevice (BodyInteger (width) * 8, BodyInteger (height), m)); X ErasePage (); X X return TRUE; X } X Xstruct device *DeviceFrom (h, m) struct hardware *h; Matrix m; X { X DevicePoint extent; X X extent = HardwareExtent (h); X return NewDevice ( X NewClipPath (0.0, (float) extent.dx, (float) extent.dy, 0.0), X m, X h); X } X Xstruct device *NewWindowDevice (width, height, m) int width, height; Matrix m; X { X return DeviceFrom (NewWindowHardware (width, height), m); X } X Xstruct device *NewBitmapDevice (width, height, m) int width, height; Matrix m; X { X return DeviceFrom (NewBitmapHardware (width, height), m); X } X Xstruct device *NewCacheDevice (m, width, height, swidth, sheight) Matrix m; int width, height, swidth, sheight; X { X return NewDevice ( X NewClipPath (0.0, (float) width, (float) height, 0.0), X NewMatrix (m.A, m.B, m.C, m.D, (float) swidth, (float) height - sheight), X NewBitmapHardware (width, height)); X } X XPath NewClipPath (left, right, top, bottom) float left, right, top, bottom; X { X Path p = NewPath (); X HardPoint cp; X int cp_def = gstate->cp_defined; X X cp = gstate->cp; X VOID MoveTo (p, NewHardPoint (left, bottom)); X VOID LineTo (p, NewHardPoint (right, bottom)); X VOID LineTo (p, NewHardPoint (right, top)); X VOID LineTo (p, NewHardPoint (left, top)); X ClosePath (p); X X gstate->cp = cp; gstate->cp_defined = cp_def; X X return p; X } X Xstruct device *NewDevice (clip, m, dev) Path clip; Matrix m; struct hardware *dev; X { X struct device *res = (struct device *) Malloc (sizeof (struct device)); X X res->link_count = 0; X res->default_clip = clip; X res->default_matrix = m; X res->dev = dev; X X return res; X } X XSetDevice (d) struct device *d; X { X UnlinkDevice (gstate->device); X gstate->device = LinkDevice (d); X gstate->CTM = d->default_matrix; X InitClip (); X } X Xint IsCache (d) struct device *d; X { X return !IsWindowHardware (d->dev); X } X Xstruct device *LinkDevice (d) struct device *d; X { X if (d) X ++d->link_count; X X return d; X } X XUnlinkDevice (d) struct device *d; X { X if (d == NULL) X return; X if (--d->link_count != 0) X return; X if (d->dev != NULL) X DestroyHardware (d->dev); X Free ((char *) d); X } X Xstruct device *UniqueDevice (d) struct device *d; X { X struct device *res; X DevicePoint ex; X X if (d && d->link_count == 1) X return d; X ex = HardwareExtent (gstate->device->dev); X res = LinkDevice (NewBitmapDevice (ex.dx, ex.dy, gstate->CTM)); X /*if (d) X { X BitBlt (d->dev, res->dev, NewDevicePoint (0, 0), NewDevicePoint (0, 0), ex, ROP_SOURCE); X UnlinkDevice (d); X } X else X */BitBlt (NULL, res->dev, NewDevicePoint (0, 0), NewDevicePoint (0, 0), ex, ROP_FALSE); X X return res; X } X XDevicePoint NewDevicePoint (x, y) int x, y; X { X DevicePoint res; X X res.dx = x; res.dy = y; X X return res; X } X XDevicePoint HardToDevice (p) HardPoint p; X { X return NewDevicePoint ((int) p.hx, (int) p.hy); X } X XDevicePaintLine (d, fromPoint, toPoint, colour) X struct device *d; X HardPoint fromPoint, toPoint; X Colour colour; X { X PaintLine (d->dev, HardToDevice (fromPoint), HardToDevice (toPoint), colour); X } X X/* Xvoid ColourLine (h, fromPoint, toPoint, rop, colour) X struct hardware *h; X DevicePoint fromPoint, toPoint; X int rop; X Colour colour; X { X int x1 = fromPoint.dx, y1 = fromPoint.dy, x2 = toPoint.dx, y2 = toPoint.dy; X int col = IsWindowHardware (h) ? HardColour (colour) : HardBlack; X X if (col == HardBlack) X { X ddbm = h->bm; X dd->d_line = rop_map [rop]; X line (x1, y1, LNMOVEABS); X line (x2, y2, LNDRAWABS); X } X else X { X box b; X X b = boxbuild (Min (x1, x2), Min (y1, y2), Max (x1, x2), Max (y1, y2)); X X NeedAux (h); X GraySync (h, col); X bmxcopy (h->bm, b, h->bm, b, WWXOR); X X ddbm = h->aux; X dd->d_line = WWOR; X line (x1, y1, LNMOVEABS); X line (x2, y2, LNDRAWABS); X X bmxcopy (h->aux, b, h->bm, b, WWAND | WWNOT); X bmxcopy (h->gray, b, h->aux, b, WWAND); X bmxcopy (h->aux, b, h->bm, b, rop_map [rop]); X X } X } X*/ X X/* Xvoid ColourBitBlt (from, to, fromPoint, toPoint, extent, rop, colour) X struct hardware *from, *to; X DevicePoint fromPoint, toPoint, extent; X int rop; X Colour colour; X { X box frombox, tobox; X int col = IsWindowHardware (to) ? HardColour (colour) : HardBlack; X int op = rop_map [rop]; X X X frombox = boxbuild (fromPoint.dx, fromPoint.dy, X fromPoint.dx + extent.dx - 1, fromPoint.dy + extent.dy - 1); X tobox = boxbuild (toPoint.dx, toPoint.dy, X toPoint.dx + extent.dx - 1, toPoint.dy + extent.dy - 1); X X if (to == NULL) X return; X X if (rop == ROP_FALSE) X bmxcopy (to->bm, tobox, to->bm, tobox, WWXOR); X else if (rop == ROP_TRUE) X if (col == HardBlack) X bmxcopy (to->bm, tobox, to->bm, tobox, WWXOR | WWNOT); X else X { X GraySync (to, col); X bmxcopy (to->gray, tobox, to->bm, tobox, WWCOPY); X } X else if (col == HardBlack) X bmxcopy (from->bm, frombox, to->bm, tobox, op); X else X { X GraySync (to, col); X NeedAux (to); X bmxcopy (to->gray, tobox, to->aux, tobox, WWCOPY); X bmxcopy (from->bm, frombox, to->aux, tobox, WWAND); X bmxcopy (to->aux, tobox, to->bm, tobox, op); X } X } X*/ END_OF_FILE if test 7801 -ne `wc -c <'source/device.c'`; then echo shar: \"'source/device.c'\" unpacked with wrong size! fi # end of 'source/device.c' fi echo shar: End of archive 5 \(of 18\). cp /dev/null ark5isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 18 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0