Copyright (c) 1986 Xerox Corporation. All rights reserved. 2 27.17 Implementation of Image Streams 1 Interlisp does all image creation through a set of functions and data structures for device-independent graphics, known popularly as DIG. DIG is implemented through the use of a special type of stream, known as an image stream. An image stream, by convention, is any stream that has its IMAGEOPS field (described in detail below) set to a vector of meaningful graphical operations. Using image streams, you can write programs that draw and print on an output stream without regard to the underlying device, be it a window, a disk, or a printer. To define a new image stream type, it is necessary to put information on the variable IMAGESTREAMTYPES: IMAGESTREAMTYPES [Variable] 1 This variable describes how to create a stream for a given image stream type. The value of IMAGESTREAMTYPES is an association list, indexed by the image stream type (e.g., DISPLAY, INTERPRESS, etc.). The format of a single association list item is: (IMAGETYPE (OPENSTREAM OPENSTREAMFN) (FONTCREATE FONTCREATEFN) (FONTSAVAILABLE FONTSAVAILABLEFN)) OPENSTREAMFN, FONTCREATEFN, and FONTSAVAILABLEFN are "image stream methods," device-dependent functions used to implement generic image stream operations. For Interpress image streams, the association list entry is: (INTERPRESS (OPENSTREAM OPENIPSTREAM) (FONTCREATE \CREATEINTERPRESSFONT) (FONTSAVAILABLE \SEARCHINTERPRESSFONTS)) 1 (OPENSTREAMFN FILE OPTIONS) [Image Stream Method] 1 FILE is the file name as it was passed to OPENIMAGESTREAM, and OPTIONS is the OPTIONS property list passed to OPENIMAGESTREAM. The result must be a stream of the appropriate image type. 1 (FONTCREATEFN FAMILY SIZE FACE ROTATION DEVICE) [Image Stream Method] 1 FAMILY is the family name for the font, e.g., MODERN. SIZE is the body size of the font, in printer's points. FACE is a three-element list describing the weight, slope, and expansion of the face desired, e.g., (MEDIUM ITALIC EXPANDED). ROTATION is how much the font is to be rotated from the normal orientation, in minutes of arc. For example, to print a landscape page, fonts have the rotation 5400 (90 degrees). The function's result must be a FONTDESCRIPTOR with the fields filled in appropriately. 1 (FONTSAVAILABLEFN FAMILY SIZE FACE ROTATION DEVICE) [Image Stream Method] 1 This function returns a list of all fonts agreeing with the FAMILY, SIZE, FACE, and ROTATION arguments; any of them may be wild-carded (i.e., equal to *, which means any value is acceptable). Each element of the list should be a quintuple of the form (FAMILY SIZE FACE ROTATION DEVICE). Where the function looks is an implementation decision: the FONTSAVAILABLEFN for the display device looks at DISPLAYFONTDIRECTORIES, the Interpress code looks on INTERPRESSFONTDIRECTORIES, and implementors of new devices should feel free to introduce new search path variables. 1 As indicated above, image streams use a field that no other stream uses: IMAGEOPS. IMAGEOPS is an instance of the IMAGEOPS data type and contains a vector of the stream's graphical methods. The methods contained in the IMAGEOPS object can make arbitrary use of the stream's IMAGEDATA field, which is provided for their use, and may contain any data needed. The IMAGEOPS data type has the following fields: IMAGETYPE [IMAGEOPS Field] 1 Value is the name of an image type. Monochrome display streams have an IMAGETYPE of DISPLAY; color display streams are identified as (COLOR DISPLAY). The IMAGETYPE field is informational and can be set to anything you choose. 1 IMFONTCREATE [IMAGEOPS Field] 1 Value is the device name to pass to FONTCREATE when fonts are created for the stream. 1 The remaining fields are all image stream methods, whose value should be a device-dependent function that implements the generic operation. Most methods are called by a similarly-named function, e.g. the function DRAWLINE calls the IMDRAWLINE method. All coordinates that refer to points in a display device's space are measured in the device's units. (The IMSCALE method provides access to a device's scale.) For arguments that have defaults (such as the BRUSH argument of DRAWCURVE), the default is substituted for the NIL argument before it is passed to the image stream method. Therefore, image stream methods do not have to handle defaults. (IMCLOSEFN STREAM) [Image Stream Method] 1 Called before a stream is closed with CLOSEF. This method should flush buffers, write header or trailer information, etc. 1 (IMDRAWLINE STREAM X1 Y1 X2 Y2 WIDTH OPERATION COLOR DASHING) [Image Stream Method] 1 Draws a line of width WIDTH from (X1, Y1) to (X2, Y2). See DRAWLINE, ("DRAWLINE" . Function). 1 (IMDRAWCURVE STREAM KNOTS CLOSED BRUSH DASHING) [Image Stream Method] 1 Draws a curve through KNOTS. See DRAWCURVE, ("DRAWCURVE" . Function). 1 (IMDRAWCIRCLE STREAM CENTERX CENTERY RADIUS BRUSH DASHING) [Image Stream Method] 1 Draws a circle of radius RADIUS around (CENTERX, CENTERY). See DRAWCIRCLE, ("DRAWCIRCLE" . Function). 1 (IMDRAWELLIPSE STREAM CENTERX CENTERY SEMIMINORRADIUS SEMIMAJORRADIUS ORIENTATION BRUSH DASHING) [Image Stream Method] 1 Draws an ellipse around (CENTERX, CENTERY). See DRAWELLIPSE, ("DRAWELLIPSE" . Function). 1 (IMFILLPOLYGON STREAM POINTS TEXTURE) [Image Stream Method] 1 Fills in the polygon outlined by POINTS on the image stream STREAM, using the texture TEXTURE. See FILLPOLYGON, ("FILLPOLYGON" . Function). 1 (IMFILLCIRCLE STREAM CENTERX CENTERY RADIUS TEXTURE) [Image Stream Method] 1 Draws a circle filled with texture TEXTURE around (CENTERX, CENTERY). See FILLCIRCLE, ("FILLCIRCLE" . Function). 1 (IMBLTSHADE TEXTURE STREAM DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT OPERATION CLIPPINGREGION) [Image Stream Method] 1 The texture-source case of BITBLT (("BITBLT" . Function)). DESTINATIONLEFT, DESTINATIONBOTTOM, WIDTH, HEIGHT, and CLIPPINGREGION are measured in STREAM's units. This method is invoked by the functions BITBLT and BLTSHADE (("BLTSHADE" . Function)). 1 (IMBITBLT SOURCEBITMAP SOURCELEFT SOURCEBOTTOM STREAM DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION CLIPPEDSOURCELEFT CLIPPEDSOURCEBOTTOM SCALE) [Image Stream Method] 1 Contains the bit-map-source cases of BITBLT (("BITBLT" . Function)). SOURCELEFT, SOURCEBOTTOM, CLIPPEDSOURCELEFT, CLIPPEDSOURCEBOTTOM, WIDTH, and HEIGHT are measured in pixels; DESTINATIONLEFT, DESTINATIONBOTTOM, and CLIPPINGREGION are in the units of the destination stream. 1 (IMSCALEDBITBLT SOURCEBITMAP SOURCELEFT SOURCEBOTTOM STREAM DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION CLIPPEDSOURCELEFT CLIPPEDSOURCEBOTTOM SCALE) [Image Stream Method] 1 A scaled version of IMBITBLT. Each pixel in SOURCEBITMAP is replicated SCALE times in the X and Y directions; currently, SCALE must be an integer. 1 (IMMOVETO STREAM X Y) [Image Stream Method] 1 Moves to (X,Y). This method is invoked by the function MOVETO (("MOVETO" . Function)). If IMMOVETO is not supplied, a default method composed of calls to the IMXPOSITION and IMYPOSITION methods is used. 1 (IMSTRINGWIDTH STREAM STR RDTBL) [Image Stream Method] 1 Returns the width of string STR in STREAM's units, using STREAM's current font. This is envoked when STRINGWIDTH (("STRINGWIDTH" . Function)) is passed a stream as its FONT argument. If IMSTRINGWIDTH is not supplied, it defaults to calling STRINGWIDTH on the default font of STREAM. 1 (IMCHARWIDTH STREAM CHARCODE) [Image Stream Method] 1 Returns the width of character CHARCODE in STREAM's units, using STREAM's current font. This is invoked when CHARWIDTH (("CHARWIDTH" . Function)) is passed a stream as its FONT argument. If IMCHARWIDTH is not supplied, it defaults to calling CHARWIDTH on the default font of STREAM. 1 (IMCHARWIDTHY STREAM CHARCODE) [Image Stream Method] 1 Returns the Y componant of the width of character CHARCODE in STREAM's units, using STREAM's current font. This is envoked when CHARWIDTHY (("CHARWIDTHY" . Function)) is passed a stream as its FONT argument. If IMCHARWIDTHY is not supplied, it defaults to calling CHARWIDTHY on the default font of STREAM. 1 (IMBITMAPSIZE STREAM BITMAP DIMENSION) [Image Stream Method] 1 Returns the size that BITMAP will be when BITBLTed to STREAM, in STREAM's units. DIMENSION can be one of WIDTH, HEIGHT, or NIL, in which case the dotted pair (WIDTH . HEIGHT) will be returned. This is envoked by BITMAPIMAGESIZE (("BITMAPIMAGESIZE" . Function)). If IMBITMAPSIZE is not supplied, it defaults to a method that multiplies the bitmap height and width by the scale of STREAM. 1 (IMNEWPAGE STREAM) [Image Stream Method] 1 Causes a new page to be started. The X position is set to the left margin, and the Y position is set to the top margin plus the linefeed. If not supplied, defaults to (\OUTCHAR STREAM (CHARCODE ^L)). Envoked by DSPNEWPAGE (("DSPNEWPAGE" . Function)). 1 (IMTERPRI STREAM) [Image Stream Method] 1 Causes a new line to be started. The X position is set to the left margin, and the Y position is set to the current Y position plus the linefeed. If not supplied, defaults to (\OUTCHAR STREAM (CHARCODE EOL)). Envoked by TERPRI (("TERPRI" . Function)). 1 (IMRESET STREAM) [Image Stream Method] 1 Resets the X and Y position of STREAM. The X coordinate is set to its left margin; the Y coordinate is set to the top of the clipping region minus the font ascent. Envoked by DSPRESET, ("DSPRESET" . Function). 1 The following methods all have corresponding DSPxx functions (e.g., IMYPOSITION corresponds to DSPYPOSITION) that invoke them. They also have the property of returning their previous value; when called with NIL they return the old value without changing it. (IMCLIPPINGREGION STREAM REGION) [Image Stream Method] 1 Sets a new clipping region on STREAM. 1 (IMXPOSITION STREAM XPOSITION) [Image Stream Method] 1 Sets the X-position on STREAM. 1 (IMYPOSITION STREAM YPOSITION) [Image Stream Method] 1 Sets a new Y-position on STREAM. 1 (IMFONT STREAM FONT) [Image Stream Method] 1 Sets STREAM's font to be FONT. 1 (IMLEFTMARGIN STREAM LEFTMARGIN) [Image Stream Method] 1 Sets STREAM's left margin to be LEFTMARGIN. The left margin is defined as the X-position set after the new line. 1 (IMRIGHTMARGIN STREAM RIGHTMARGIN) [Image Stream Method] 1 Sets STREAM's right margin to be RIGHTMARGIN. The right margin is defined as the maximum X-position at which characters are printed; printing beyond it causes a new line. 1 (IMTOPMARGIN STREAM YPOSITION) [Image Stream Method] 1 Sets STREAM's top margin (the Y-position of the tops of characters that is set after a new page) to be YPOSITION. 1 (IMBOTTOMMARGIN STREAM YPOSITION) [Image Stream Method] 1 Sets STREAM's bottom margin (the Y-position beyond which any printing causes a new page) to be YPOSITION. 1 (IMLINEFEED STREAM DELTA) [Image Stream Method] 1 Sets STREAM's line feed distance (distance to move vertically after a new line) to be DELTA. 1 (IMSCALE STREAM SCALE) [Image Stream Method] 1 Returns the number of device points per screen point (a screen point being ~1/72 inch). SCALE is ignored. 1 (IMSPACEFACTOR STREAM FACTOR) [Image Stream Method] 1 Sets the amount by which to multiply the natural width of all following space characters on STREAM; this can be used for the justification of text. The default value is 1. For example, if the natural width of a space in STREAM's current font is 12 units, and the space factor is set to two, spaces appear 24 units wide. The values returned by STRINGWIDTH and CHARWIDTH are also affected. 1 (IMOPERATION STREAM OPERATION) [Image Stream Method] 1 Sets the default BITBLT OPERATION argument (see ("OPERATION" . BITBLTargument)). 1 (IMBACKCOLOR STREAM COLOR) [Image Stream Method] 1 Sets the background color of STREAM. 1 (IMCOLOR STREAM COLOR) [Image Stream Method] 1 Sets the default color of STREAM. 1 In addition to the IMAGEOPS methods described above, there are two other important methods, which are contained in the stream itself. These fields can be installed using a form like (replace (STREAM OUTCHARFN) of STREAM with (FUNCTION MYOUTCHARFN)). Note: You need to have loaded the Interlisp-D system declarations to manipulate the fields of STREAMs. The declarations can be loaded by loading the Lisp Library package SYSEDIT. (STRMBOUTFN STREAM CHARCODE) [Stream Method] 1 The function called by BOUT. 1 (OUTCHARFN STREAM CHARCODE) [Stream Method] 1 The function that is called to output a single byte. This is like STRMBOUTFN, except for being one level higher: it is intended for text output. Hence, this function should convert (CHARCODE EOL) into the stream's actual end-of-line sequence and should adjust the stream's CHARPOSITION appropriately before invoking the stream's STRMBOUTFN (by calling BOUT) to actually put the character. Defaults to \FILEOUTCHARFN, which is probably incorrect for an image stream. 1  ((()KKT/KT((.((7((MODERN MODERN MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))    HRULE.GETFNMODERN ( HRULE.GETFNMODERN ;V HRULE.GETFNMODERN  \A ;      &,  HRULE.GETFNMODERN   HRULE.GETFNMODERN  &>  HRULE.GETFNMODERN   HRULE.GETFNMODERN  (5`*  HRULE.GETFNMODERN   HRULE.GETFNMODERN  <;d<![  HRULE.GETFNMODERN Ib/ J%  HRULE.GETFNMODERN  H * ?  HRULE.GETFNMODERN   HRULE.GETFNMODERN  $ (  HRULE.GETFNMODERN   u]  &{  HRULE.GETFNMODERN  &O  HRULE.GETFNMODERN   HRULE.GETFNMODERN   IRM.GET.CREF  HRULE.GETFNMODERN  ! HRULE.GETFNMODERN    IRM.GET.CREF  HRULE.GETFNMODERN + HRULE.GETFNMODERN    IRM.GET.CREF  HRULE.GETFNMODERN P HRULE.GETFNMODERN    IRM.GET.CREF  HRULE.GETFNMODERN  HRULE.GETFNMODERN  !  IRM.GET.CREF  HRULE.GETFNMODERN % HRULE.GETFNMODERN  #  IRM.GET.CREF  HRULE.GETFNMODERN  V HRULE.GETFNMODERN   IRM.GET.CREF3 IRM.GET.CREF  HRULE.GETFNMODERN   HRULE.GETFNMODERN  % IRM.GET.CREF  -  HRULE.GETFNMODERN  HRULE.GETFNMODERN   -  HRULE.GETFNMODERN    HRULE.GETFNMODERN  * IRM.GET.CREF<    HRULE.GETFNMODERN  HRULE.GETFNMODERN  '  IRM.GET.CREF )   HRULE.GETFNMODERN   HRULE.GETFNMODERN  '  IRM.GET.CREF )   HRULE.GETFNMODERN  HRULE.GETFNMODERN  2'  IRM.GET.CREF )   HRULE.GETFNMODERN  HRULE.GETFNMODERN      IRM.GET.CREF f  HRULE.GETFNMODERN   HRULE.GETFNMODERN     IRM.GET.CREF  HRULE.GETFNMODERN   HRULE.GETFNMODERN    IRM.GET.CREF  HRULE.GETFNMODERN   HRULE.GETFNMODERN   IRM.GET.CREF  HRULE.GETFNMODERN -  e0  HRULE.GETFNMODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN  HRULE.GETFNMODERN   H  HRULE.GETFNMODERN  HRULE.GETFNMODERN     HRULE.GETFNMODERN   HRULE.GETFNMODERN  \   HRULE.GETFNMODERN  HRULE.GETFNMODERN  T   HRULE.GETFNMODERN    HRULE.GETFNMODERN  K  HRULE.GETFNMODERN    HRULE.GETFNMODERN  Y   HRULE.GETFNMODERN   HRULE.GETFNMODERN  \|v    HRULE.GETFNMODERN   HRULE.GETFNMODERN    IRM.GET.CREF  HRULE.GETFNMODERN    HRULE.GETFNMODERN    HRULE.GETFNMODERN    HRULE.GETFNMODERN    HRULE.GETFNMODERN BbG  HRULE.GETFNMODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN  C jN ,  .3  HRULE.GETFNMODERN 3Sz 27.16.4 Copying Image Objects Between Windows 1 Copying between windows is implemented as follows: If a button event occurs in a window when a copy key is down, the window's COPYBUTTONEVENTFN window property is called. If this window supports copy-selection, it should track the mouse, indicating the item to be copied. When the button is released, the COPYBUTTONEVENTFN should create an image object out of the selected information, and call COPYINSERT to insert it in the current TTY window. COPYINSERT calls the COPYINSERTFN window property of the TTY window to insert this image object. Therefore, both the source and destination windows can determine how they handle copying image objects. If the COPYBUTTONEVENTFN of a window is NIL, the BUTTONEVENTFN is called instead when a button event occurs in the window when a copy key is down, and copying from that window is not supported. If the COPYINSERTFN of the TTY window is NIL, COPYINSERT will turn the image object into a string (by calling the PREPRINTFN method of the image object, see ("PREPRINTFN" . ImagefnsMethod)) and insert it by calling BKSYSBUF (("BKSYSBUF" . Function)). COPYBUTTONEVENTFN [Window Property] 1 The COPYBUTTONEVENTFN of a window is called (if it exists) when a button event occurs in the window and a copy key is down. If no COPYBUTTONEVENTFN exists, the BUTTONEVENTFN is called. 1 COPYINSERTFN [Window Property] 1 The COPYINSERTFN of the "destination" window is called by COPYINSERT to insert something into the destination window. It is called with two arguments: the object to be inserted and the destination window. The object to be inserted can be a character string, an IMAGEOBJ, or a list of IMAGEOBJs and character strings. As a convention, the COPYINSERTFN should call BKSYSBUF (("BKSYSBUF" . Function)) if the object to be inserted insert is a character string. 1 (COPYINSERT IMAGEOBJ) [Function] 1 COPYINSERT inserts IMAGEOBJ into the window that currently has the TTY. If the current TTY window has a COPYINSERTFN, it is called, passing it IMAGEOBJ and the window as arguments. If no COPYINSERTFN exists and if IMAGEOBJ is an image object, BKSYSBUF is called on the result of calling its PREPRINTFN on it. If IMAGEOBJ is not an image object, it is simply passed to BKSYSBUF (("BKSYSBUF" . Function)). In this case, BKSYSBUF will call PRIN2 with a read table taken from the process associated with the TTY window. A window that wishes to use PRIN1 or a different read table must provide its own COPYINSERTFN to do this. 1 )KKT/KT((. (((MODERN MODERN MODERN MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8)) 0 HRULE.GETFNMODERN I *      : ! IRM.GET.CREF IRM.GET.CREF HRULE.GETFNMODERN n    HRULE.GETFNMODERN   HRULE.GETFNMODERN  * /   IRM.GET.CREF= HRULE.GETFNMODERN   HRULE.GETFNMODERN   N  (  0 IRM.GET.CREF g0   HRULE.GETFNMODERN m>z 27.16.3 Reading and Writing Image Objects on Files 1 Image Objects can be written out to files using HPRINT and read back using HREAD. The following functions can also be used: (WRITEIMAGEOBJ IMAGEOBJ STREAM) [Function] 1 Prints (using PRIN2) a call to READIMAGEOBJ, then calls the PUTFN for IMAGEOBJ to write it onto STREAM. During input, then, the call to READIMAGEOBJ is read and evaluated; it in turn reads back the object's description, using the appropriate GETFN. 1 (READIMAGEOBJ STREAM GETFN NOERROR) [Function] 1 Reads an IMAGEOBJ from STREAM, starting at the current file position. Uses the function GETFN after validating it (and loading support code, if necessary). If the GETFN can't be validated or isn't defined, READIMAGEOBJ returns an "encapsulated image object", an IMAGEOBJ that safely encapsulates all of the information in the image object. An encapsulated image object displays as a rectangle that says, "Unknown IMAGEOBJ Type" and lists the GETFN's name. Selecting an encapsulated image object with the mouse causes another attempt to read the object from the file; this is so you can load any necessary support code and then get to the object. Warning: You cannot save an encapsulated image object on a file because there isn't enough information to allow copying the description to the new file from the old one. If NOERROR is non-NIL, READIMAGEOBJ returns NIL if it can't successfully read the object. 1 ()KKT/KT(. (((MODERN MODERN MODERN MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8)) j HRULE.GETFNMODERN 2- HRULE.GETFNMODERN   # ^ HRULE.GETFNMODERN  HRULE.GETFNMODERN  <?& ,  + HRULE.GETFNMODERN z[Sz 27.16.2 Registering Image Objects 1 Each legitimate GETFN needs to be known to the system, to prevent various Trojan-horse problems and to allow the automatic loading of the supporting code for infrequently used IMAGEOBJs. To this end, there is a global list, IMAGEOBJGETFNS, that contains an entry for each GETFN. The existence of the entry marks the GETFN as legitimate; the entry itself is a property list, which can hold information about the GETFN. No action needs to be taken for GETFNs that are currently in use: the function IMAGEFNSCREATE automatically adds its GETFN argument to the list. However, packages that support obsolete versions of objects may need to explicitly add the obsolete GETFNs. For example, TEdit supports bit-map IMAGEOBJs. Recently, a change was made in the format in which objects are stored; to retain compatibility with the old object format, there are now two GETFNs. The current GETFN is automatically on the list, courtesy of IMAGEFNSCREATE. However, the code file that supports the old bit-map objects contains the clause: (ADDVARS (IMAGEOBJGETFNS (OLDGETFNNAME))), which adds the old GETFN to IMAGEOBJGETFNS. For a given GETFN, the entry on IMAGEOBJGETFNS may be a property list of information. Currently the only recognized property is FILE. FILE is the name of the file that can be loaded if the GETFN isn't defined. This file should define the GETFN, along with all the other functions needed to support that kind of IMAGEOBJ. For example, the bit-map IMAGEOBJ implemented by TEdit use the GETFN BMOBJ.GETFN2. Its entry on IMAGEOBJGETFNS is (BMOBJ.GETFN2 FILE IMAGEOBJ), indicating that the support code for bit-map image objects resides on the file IMAGEOBJ, and that the GETFN for them is BMOBJ.GETFN2. This makes it possible to have entries for GETFNs whose supporting code isn't loaded%you might, for instance, have your init file add entries to IMAGEOBJGETFNS for the kinds of image objects you commonly use. The system's default reading method will automatically load the code when necessary. ((. (((MODERN MODERN MODERN MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8)) $ HRULE.GETFNMODERN )"(Z *|(+W  T3-D Q  V Zz 27.16.1 IMAGEFNS Methods 1 Note: Many of the IMAGEFNS methods below are passed "host stream" arguments. The TEdit text editor passes the "text stream" (an object contain all of the information in the document being edited) as the "host stream" argument. Other editing programs that want to use image objects may want to pass the data structure being edited to the IMAGEFNS methods as the "host stream" argument. (DISPLAYFN IMAGEOBJ IMAGESTREAM IMAGESTREAMTYPE HOSTSTREAM) [IMAGEFNS Method] 1 The DISPLAYFN method is called to display the object IMAGEOBJ at the current position on IMAGESTREAM. The type of IMAGESTREAM indicates whether the device is the display or some other image stream. Note: When the DISPLAYFN method is called, the offset and clipping regions for the stream are set so the object's image is at (0,0), and only that image area can be modified. 1 (IMAGEBOXFN IMAGEOBJ IMAGESTREAM CURRENTX RIGHTMARGIN) [IMAGEFNS Method] 1 The IMAGEBOXFN method should return the size of the object as an IMAGEBOX, which is a data structure that describes the image laid down when an IMAGEOBJ is displayed in terms of width, height, and descender height. An IMAGEBOX has four fields: XSIZE, YSIZE, YDESC, and XKERN. XSIZE and YSIZE are the width and height of the object image. YDESC and XKERN give the position of the baseline and the left edge of the image relative to where you want to position it. For characters, the YDESC is the descent (height of the descender) and the XKERN is the amount of left kerning (note: TEdit doesn't support left kerning). The IMAGEBOXFN looks at the type of the stream to determine the output device if the object's size changes from device to device. (For example, a bit-map object may specify a scale factor that is ignored when the bit map is displayed on the screen.) CURRENTX and RIGHTMARGIN allow an object to take account of its environment when deciding how big it is. If these fields are not available, they are NIL. Note: TEdit calls the IMAGEBOXFN only during line formatting, then caches the IMAGEBOX as the BOUNDBOX property of the IMAGEOBJ. This avoids the need to call the IMAGEBOXFN when incomplete position and margin information is available. 1 (PUTFN IMAGEOBJ FILESTREAM) [IMAGEFNS Method] 1 The PUTFN method is called to save the object on a file. It prints a description on FILESTREAM that, when read by the corresponding GETFN method (see below), regenerates the image object. (TEdit and HPRINT take care of writing out the name of the GETFN.) 1 (GETFN FILESTREAM) [IMAGEFNS Method] 1 The GETFN method is called when the object is encountered on the file during input. It reads the description that was written by the PUTFN method and returns an IMAGEOBJ. 1 (COPYFN IMAGEOBJ SOURCEHOSTSTREAM TARGETHOSTSTREAM) [IMAGEFNS Method] 1 The COPYFN method is called during a copy-select operation. It should return a copy of IMAGEOBJ. If it returns the litatom DON'T, copying is suppressed. 1 (BUTTONEVENTINFN IMAGEOBJ WINDOWSTREAM SELECTION RELX RELY WINDOW HOSTSTREAM BUTTON) [IMAGEFNS Method] 1 The BUTTONEVENTINFN method is called when you press a mouse button inside the object. The BUTTONEVENTINFN decides whether or not to handle the button, to track the cursor in parallel with mouse movement, and to invoke selections or edits supported by the object (but see the COPYBUTTONEVENTINFN method below). If the BUTTONEVENTINFN returns NIL, TEdit treats the button press as a selection at its level. Note that when this function is first called, a button is down. The BUTTONEVENTINFN should also support the button-down protocol to descend inside of any composite objects with in it. In most cases, the BUTTONEVENTINFN relinquishes control (i.e., returns) when the cursor leaves its object's region. Note: When the BUTTONEVENTINFN is called, the window's clipping region and offsets have been changed so that the lower-left corner of the object's image is at (0,0), and only the object's image can be changed. The selection is available for changing to fit your needs; the mouse button went down at (RELX,RELY) within the object's image. You can affect how TEdit treats the selection by returning one of several values. If you return NIL, TEdit forgets that you selected an object; if you return the atom DON'T, TEdit doesn't permit the selection; if you return the atom CHANGED, TEdit updates the screen. Use CHANGED to signal TEdit that the object has changed size or will have side effects on other parts of the screen image. 1 (COPYBUTTONEVENTINFN IMAGEOBJ WINDOWSTREAM) [IMAGEFNS Method] 1 The COPYBUTTONEVENTINFN method is called when you button inside an object while holding down a copy key. Many of the comments about BUTTONEVENTINFN apply here too. Also, see the discussion below about copying image objects between windows (("copying image objects between windows" . TERM)). 1 (WHENMOVEDFN IMAGEOBJ TARGETWINDOWSTREAM SOURCEHOSTSTREAM TARGETHOSTSTREAM) [IMAGEFNS Method] 1 The WHENMOVEDFN method provides hooks by which the object is notified when TEdit performs an operation (MOVEing) on the whole object. It allows objects to have side effects. 1 (WHENINSERTEDFN IMAGEOBJ TARGETWINDOWSTREAM SOURCEHOSTSTREAM TARGETHOSTSTREAM) [IMAGEFNS Method] 1 The WHENINSERTEDFN method provides hooks by which the object is notified when TEdit performs an operation (INSERTing) on the whole object. It allows objects to have side effects. 1 (WHENDELETEDFN IMAGEOBJ TARGETWINDOWSTREAM) [IMAGEFNS Method] 1 The WHENDELETEDFN method provides hooks by which the object is notified when TEdit performs an operation (DELETEing) on the whole object. It allows objects to have side effects. 1 (WHENCOPIEDFN IMAGEOBJ TARGETWINDOWSTREAM SOURCEHOSTSTREAM TARGETHOSTSTREAM) [IMAGEFNS Method] 1 The WHENCOPIEDFN method provides hooks by which the object is notified when TEdit performs an operation (COPYing) on the whole object. The WHENCOPIEDFN method is called in addition to (and after) the COPYFN method above. It allows objects to have side effects. 1 (WHENOPERATEDONFN IMAGEOBJ WINDOWSTREAM HOWOPERATEDON SELECTION HOSTSTREAM) [IMAGEFNS Method] 1 The WHENOPERATEDONFN method provides a hook for edit operations. HOWOPERATEDON should be one of SELECTED, DESELECTED, HIGHLIGHTED, and UNHILIGHTED. The WHENOPERATEDONFN differs from the BUTTONEVENTINFN because it is called when you extend a selection through the object. That is, the object is treated in toto as a TEdit character. HIGHLIGHTED refers to the selection being highlighted on the screen, and UNHIGHLIGHTED means that the highlighting is being turned off. 1 (PREPRINTFN IMAGEOBJ) [IMAGEFNS Method] 1 The PREPRINTFN method is called to convert the object into something that can be printed for inclusion in documents. It returns an object that the receiving window can print (using either PRIN1 or PRIN2,its choice) to obtain a character representation of the object. If the PREPRINTFN method is NIL, the OBJECTDATUM field of IMAGEOBJ itself is used. TEdit uses this function when you indicate that you want to print the characters from an object rather than the object itself (presumably using PRIN1 case). 1 )KKT/KT((. (((MODERN MODERN MODERN MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN 9( / HRULE.GETFNMODERN  (  I f, HRULE.GETFNMODERN  ) HRULE.GETFNMODERN  3GC02K  ~ .$ ? HRULE.GETFNMODERN  HRULE.GETFNMODERN L &?* HRULE.GETFNMODERN   HRULE.GETFNMODERN } HRULE.GETFNMODERN * HRULE.GETFNMODERN N HRULE.GETFNMODERN B HRULE.GETFNMODERN H yR~D=!p HRULE.GETFNMODERN  HRULE.GETFNMODERN n^0 IRM.GET.CREF HRULE.GETFNMODERN  = HRULE.GETFNMODERN   HRULE.GETFNMODERN = HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN = HRULE.GETFNMODERN  | 18 HRULE.GETFNMODERN 8 HRULE.GETFNMODERN .     > 4 HRULE.GETFNMODERN   HRULE.GETFNMODERN  I     HRULE.GETFNMODERN dz 2 27.16 Image Objects 1 An Image Object is an object that includes information about an image, such as how to display it, how to print it, and how to manipulate it when it is included in a collection of images (such as a document). More generally, it enables you to include one kind of image, with its own semantics, layout rules, and editing paradigms, inside another kind of image. Image Objects provide a general-purpose interface between image users who want to manipulate arbitrary images, and image producers, who create images for use, say, in documents. Images are encapsulated inside a uniform barrier%the IMAGEOBJ data type. From the outside, you communicate to the image by calling a standard set of functions. For example, calling one function tells you how big the image is; calling another causes the image object to be displayed where you tell it, and so on. Anyone who wants to create images for general use can implement his own brand of IMAGEOBJ. IMAGEOBJs have been implemented (in library packages) for bitmaps, menus, annotations, graphs, and sketches. Image Objects were originally implemented to support inserting images into TEdit text files, but the facility is available for use by any tools that manipulate images. The Image Object interface allows objects to exist in TEdit documents and be edited with their own editor. It also provides a facility in which objects can be shift-selected (or "copy-selected") between TEdit and non-TEdit windows. For example, the Image Objects interface allows you to copy-select graphs from a Grapher window into a TEdit window. The source window (where the object comes from) does not have to know what sort of window the destination window (where the object is inserted) is, and the destination does not have to know where the insertion comes from. A new data type, IMAGEOBJ, contains the data and the procedures necessary to manipulate an object that is to be manipulated in this way. IMAGEOBJs are created with the function IMAGEOBJCREATE (below). Another new data type, IMAGEFNS, is a vector of the procedures necessary to define the behavior of a type of IMAGEOBJ. Grouping the operations in a separate data type allows multiple instances of the same type of image object to share procedure vectors. The data and procedure fields of an IMAGEOBJ have a uniform interface through the function IMAGEOBJPROP. IMAGEFNS are created with the function IMAGEFNSCREATE: (IMAGEFNSCREATE DISPLAYFN IMAGEBOXFN PUTFN GETFN COPYFN BUTTONEVENTINFN COPYBUTTONEVENTINFN WHENMOVEDFN WHENINSERTEDFN WHENDELETEDFN WHENCOPIEDFN WHENOPERATEDONFN PREPRINTFN %) [Function] 1 Returns an IMAGEFNS object that contains the functions necessary to define the behavior of an IMAGEOBJ. The arguments DISPLAYFN through PREPRINTFN should all be function names to be stored as the "methods" of the IMAGEFNS. The purpose of each IMAGEFNS method is described below. Note: Image objects must be "registered" before they can be read by TEdit or HREAD (see ("Registering image objects" . TERM)). IMAGEFNSCREATE implicitly registers its GETFN argument. 1 (IMAGEOBJCREATE OBJECTDATUM IMAGEFNS) [Function] 1 Returns an IMAGEOBJ that contains the object datum OBJECTDATUM and the operations vector IMAGEFNS. OBJECTDATUM can be arbitrary data. 1 (IMAGEOBJPROP IMAGEOBJECT PROPERTY NEWVALUE) [NoSpread Function] 1 Accesses and sets the properties of an IMAGEOBJ. Returns the current value of the PROPERTY property of the image object IMAGEOBJECT. If NEWVALUE is given, the property is set to it. IMAGEOBJPROP can be used on the system properties OBJECTDATUM, DISPLAYFN, IMAGEBOXFN, PUTFN, GETFN, COPYFN, BUTTONEVENTINFN, COPYBUTTONEVENTINFN, WHENOPERATEDONFN, and PREPRINTFN. Additionally, it can be used to save arbitrary properties on an IMAGEOBJ. 1 (IMAGEFNSP X) [Function] 1 Returns X if X is an IMAGEFNS object, NIL otherwise. 1 (IMAGEOBJP X) [Function] 1 Returns X if X is an IMAGEOBJ object, NIL otherwise. 1 )KKT/KT((.((7((MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN  HRULE.GETFNMODERN jfq  N/ 8 HRULE.GETFNMODERN  K   CN$ IRM.GET.CREF  HRULE.GETFNMODERN  HRULE.GETFNMODERN      HRULE.GETFNMODERN  HRULE.GETFNMODERN '$ & &    C HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN nz("PRETTYPRINT" . Function)2 27.15 Font Profiles 1 PRETTYPRINT contains a facility for printing different elements (user functions, system functions, clisp words, comments, etc.) in different fonts to emphasize (or deemphasize) their importance, and in general to provide for a more pleasing appearance. Of course, in order to be useful, this facility requires that the user is printing on a device (such as a bitmapped display or a laser printer) which supports multiple fonts. PRETTYPRINT signals font changes by inserting into the file a user-defined escape sequence (the value of the variable FONTESCAPECHAR) followed by the character code which specifies, by number, which font to use, i.e. ^A for font number 1, etc. Thus, if FONTESCAPECHAR were the character ^F, ^F^C would be output to change to font 3, ^F^A to change to font 1, etc. If FONTESCAPECHAR consists of characters which are separator charactors in FILERDTBL, then a file with font changes in it can also be loaded back in. Currently, PRETTYPRINT uses the following font classes. The user can specify separate fonts for each of these classes, or use the same font for several different classes. LAMBDAFONT The font for printing the name of the function being prettyprinted, before the actual definition (usually a large font). CLISPFONT If CLISPFLG is on, the font for printing any clisp words, i.e. atoms with property CLISPWORD. COMMENTFONT The font used for comments. USERFONT The font for the name of any function in the file, or any member of the list FONTFNS. SYSTEMFONT The font for any other (defined) function. CHANGEFONT The font for an expression marked by the editor as having been changed. PRETTYCOMFONT The font for the operand of a file package command. DEFAULTFONT The font for everything else. Note that not all combinations of fonts will be aesthetically pleasing (or even readable!) and the user may have to experiment to find a compatible set. Although in some implementations LAMBDAFONT et al. may be defined as variables, one should not set them directly, but should indicate what font is to be used for each class by calling the function FONTPROFILE: (FONTPROFILE PROFILE) [Function] 1 Sets up the font classes as determined by PROFILE, a list of elements which defines the correspondence between font classes and specific fonts. Each element of PROFILE is a list of the form: (FONTCLASS FONT# DISPLAYFONT PRESSFONT INTERPRESSFONT) FONTCLASS is the font class name and FONT# is the font number for that class. For each font class name, the escape sequence will consist of FONTESCAPECHAR followed by the character code for the font number, e.g. ^A for font number 1, etc. If FONT# is NIL for any font class, the font class named DEFAULTFONT (which must always be specified) is used. Alternatively, if FONT# is the name of a previously defined font class, this font class will be equivalenced to the previously defined one. DISPLAYFONT, PRESSFONT, and INTERPRESSFONT are font specifications (of the form accepted by FONTCREATE) for the fonts to use when printing to the display and to Press and Interpress printers respectively. 1 FONTPROFILE [Variable] 1 This is the variable used to store the current font profile, in the form accepted by the function FONTPROFILE. Note that simply editing this value will not change the fonts used for the various font classes; it is necessary to execute (FONTPROFILE FONTPROFILE) to install the value of this variable. 1 The process of printing with multiple fonts is affected by a large number of variables: FONTPROFILE, FILELINELENGTH, PRETTYLCOM, etc. To facilitate switching back and forth between various sets of values for the font variables, Interlisp supports the idea of named "font configurations" encapsulating the values of all relevant variables. To create a new font configuration, set all "relevant" variables to the values you want, and then call FONTNAME to save them (on the variable FONTDEFS) under a given name. To install a particular font configuration, call FONTSET giving it your name. To change the values in a saved font configuration, edit the value of the variable FONTDEFS. Note: The list of variables saved by FONTNAME is stored in the variable FONTDEFSVARS. This can be changed by the user. (FONTNAME NAME) [Function] 1 Collects the names and values of the variables on FONTDEFSVARS, and saves them on FONTDEFS. 1 (FONTSET NAME) [Function] 1 Installs font configuration for NAME. Also evaluates (FONTPROFILE FONTPROFILE) to install the font classes as specified in the new value of the variable FONTPROFILE. Generates an error if NAME not previously defined. 1 FONTDEFSVARS [Variable] 1 The list of variables to be packaged by a FONTNAME. Initially FONTCHANGEFLG, FILELINELENGTH, COMMENTLINELENGTH, FIRSTCOL, PRETTYLCOM, LISTFILESTR, and FONTPROFILE. 1 FONTDEFS [Variable] 1 An association list of font configurations. FONTDEFS is a list of elements of form (NAME . PARAMETER-PAIRS). To save a configuration on a file after performing a FONTNAME to define it, the user could either save the entire value of FONTDEFS, or use the ALISTS file package command (("ALISTS" . FilePackageCommand)) to dump out just the one configuration. 1 FONTESCAPECHAR [Variable] 1 The character or string used to signal the start of a font escape sequence. 1 FONTCHANGEFLG [Variable] 1 If T, enables fonts when prettyprinting. If NIL, disables fonts. 1 LISTFILESTR [Variable] 1 In Interlisp-10, passed to the operating system by LISTFILES (("LISTFILES" . Function)). Can be used to specify subcommands to the LIST command, e.g. to establish correspondance between font number and font name. 1 COMMENTLINELENGTH [Variable] 1 Since comments are usually printed in a smaller font, COMMENTLINELENGTH is provided to offset the fact that Interlisp does not know about font widths. When FONTCHANGEFLG=T, CAR of COMMENTLINELENGTH is the linelength used to print short comments, i.e. those printed in the right margin, and CDR is the linelength used when printing full width comments. 1 (CHANGEFONT FONT STREAM) [Function] 1 Executes the operations on STREAM to change to the font FONT. For use in PRETTYPRINTMACROS. 1  ((()KKT/KT1((.((7(MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))   IRM.GET.CREFMODERN  HRULE.GETFN  HRULE.GETFNMODERN   k5"&: B   z H  N , I 5 !    HRULE.GETFNMODERN *p    c* >u  2 g HRULE.GETFNMODERN   HRULE.GETFNMODERN  E ) HRULE.GETFNMODERN X  gHj& $  HRULE.GETFNMODERN 2  HRULE.GETFNMODERN   HRULE.GETFNMODERN  K  HRULE.GETFNMODERN   HRULE.GETFNMODERN *      HRULE.GETFNMODERN  HRULE.GETFNMODERN -8>  IRM.GET.CREF* HRULE.GETFNMODERN  HRULE.GETFNMODERN L HRULE.GETFNMODERN   HRULE.GETFNMODERN ) HRULE.GETFNMODERN   HRULE.GETFNMODERN 3  IRM.GET.CREF.N HRULE.GETFNMODERN  HRULE.GETFNMODERN 6V ]; HRULE.GETFNMODERN    HRULE.GETFNMODERN  HRULE.GETFNMODERN jz ("PRETTYPRINT" . Function)((MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  IRM.GET.CREFz 2 27.13 Font Files and Font Directories 1 If FONTCREATE is called to create a font that has not been loaded into Interlisp, FONTCREATE has to read the font information from a font file that contains the information for that font. For printer devices, the font files have to contain width information for each character in the font. For display fonts, the font files have to contain, in addition, bitmap images for each character in the fonts. The font file names, formats, and searching algorithms are different for each device. There are a set of variables for each device, that determine the directories that are searched for font files. All of these variables must be set before Interlisp can auto-load font files. These variables should be initialized in the site-specific INIT file. DISPLAYFONTDIRECTORIES [Variable] 1 Value is a list of directories searched to find font bitmap files for display fonts. 1 DISPLAYFONTEXTENSIONS [Variable] 1 Value is a list of file extensions used when searching DISPLAYFONTDIRECTORIES for display fonts. Initially set to (DISPLAYFONT), but when using older font files it may be necessary to add STRIKE and AC to this list. 1 INTERPRESSFONTDIRECTORIES [Variable] 1 Value is a list of directories searched to find font widths files for Interpress fonts. 1 PRESSFONTWIDTHSFILES [Variable] 1 Value is a list of files (not directories) searched to find font widths files for Press fonts. Press font widths are packed into large files (usually named FONTS.WIDTHS). 1 )KKT/KT((.((7((MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN ( HRULE.GETFNMODERN  E  HRULE.GETFNMODERN U HRULE.GETFNMODERN  HRULE.GETFNMODERN 7& = HRULE.GETFNMODERN  HRULE.GETFNMODERN X HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN Gz 2 27.12 Fonts 1 A font is the collection of images that are printed or displayed when characters are output to a graphic output device. Some simple displays and printers can only print characters using one font. Bitmap displays and graphic printers can print characters using a large number of fonts. Fonts are identified by a distinctive style or family (such as Modern or Classic), a size (such as 10 points), and a face (such as bold or italic). Fonts also have a rotation that indicates the orientation of characters on the screen or page. A normal horizontal font (also called a portrait font) has a rotation of 0; the rotation of a vertical (landscape) font is 90 degrees. While any combination can be specified, in practice the user will find that only certain combinations of families, sizes, faces, and rotations are available for any graphic output device. To specify a font to the functions described below, a FAMILY is represented by a literal atom, a SIZE by a positive integer, and a FACE by a three-element list of the form (WEIGHT SLOPE EXPANSION). WEIGHT, which indicates the thickness of the characters, can be BOLD, MEDIUM, or LIGHT; SLOPE can be ITALIC or REGULAR; and EXPANSION can be REGULAR, COMPRESSED, or EXPANDED, indicating how spread out the characters are. For convenience, faces may also be specified by three-character atoms, where each character is the first letter of the corresponding field. Thus, MRR is a synonym for (MEDIUM REGULAR REGULAR). In addition, certain common face combinations may be indicated by special literal atoms: STANDARD = (MEDIUM REGULAR REGULAR) = MRR ITALIC = (MEDIUM ITALIC REGULAR) = MIR BOLD = (BOLD REGULAR REGULAR) = BRR BOLDITALIC = (BOLD ITALIC REGULAR) = BIR Interlisp represents all the information related to a font in an object called a font descriptor. Font descriptors contain the family, size, etc. properties used to represent the font. In addition, for each character in the font, the font descriptor contains width information for the character and (for display fonts) a bitmap containing the picture of the character. The font functions can take fonts specified in a variety of different ways. DSPFONT, FONTCREATE, FONTCOPY, etc. can be applied to font descriptors, "font lists" such as '(MODERN 10), image streams (coerced to its current font), or windows (coerced to the current font of its display stream). The printout command ".FONT" ((".FONT" . PrintoutCommand)) will also accept fonts specified in any of these forms. (FONTCREATE FAMILY SIZE FACE ROTATION DEVICE NOERRORFLG CHARSET) [Function] 1 Returns a font descriptor for the specified font. FAMILY is a litatom specifying the font family. SIZE is an integer indicating the size of the font in points. FACE specifies the face characteristics in one of the formats listed above; if FACE is NIL, STANDARD is used. ROTATION, which specifies the orientation of the font, is 0 (or NIL) for a portrait font and 90 for a landscape font. DEVICE indicates the output device for the font, and can be any image stream type (("Image stream types" . TERM)), such as DISPLAY, INTERPRESS, etc. DEVICE may also be an image stream, in which case the type of the stream determines the font device. DEVICE defaults to DISPLAY. The FAMILY argument to FONTCREATE may also be a list, in which case it is interpreted as a font-specification quintuple, a list of the form (FAMILY SIZE FACE ROTATION DEVICE). Thus, (FONTCREATE '(GACHA 10 BOLD)) is equivalent to (FONTCREATE 'GACHA 10 'BOLD). FAMILY may also be a font descriptor, in which case that descriptor is simply returned. If a font descriptor has already been created for the specified font, FONTCREATE simply returns it. If it has not been created, FONTCREATE has to read the font information from a font file that contains the information for that font. The name of an appropriate font file, and the algorithm for searching depends on the device that the font is for, and is described in more detail below. If an appropriate font file is found, it is read into a font descriptor. If no file is found, for DISPLAY fonts FONTCREATE looks for fonts with less face information and fakes the remaining faces (such as by doubling the bit pattern of each character or slanting it). For hardcopy printer fonts, there is no acceptable faking algorithm. If no acceptable font is found, the action of FONTCREATE is determined by NOERRORFLG. If NOERRORFLG is NIL, it generates a FONT NOT FOUND error with the offending font specification; otherwise, FONTCREATE returns NIL. CHARSET is the character set which will be read to create the font. Defaults to 0. For more information on character sets, see NS Characters, ("NS Characters" . TERM). 1 (FONTP X) [Function] 1 Returns X if X is a font descriptor; NIL otherwise. 1 (FONTPROP FONT PROP) [Function] 1 Returns the value of the PROP property of font FONT. The following font properties are recognized: FAMILY The style of the font, represented as a literal atom, such as CLASSIC or MODERN. SIZE A positive integer giving the size of the font, in printer's points (1/72 of an inch). WEIGHT The thickness of the characters; one of BOLD, MEDIUM, or LIGHT. SLOPE The "slope" of the characters in the font; one of ITALIC or REGULAR. EXPANSION The extent to which the characters in the font are spread out; one of REGULAR, COMPRESSED, or EXPANDED. Most available fonts have EXPANSION=REGULAR. FACE A three-element list of the form (WEIGHT SLOPE EXPANSION), giving all of the typeface parameters. ROTATION An integer that gives the orientation of the font characters on the screen or page, in degrees. A normal horizontal font (also called a portrait font) has a rotation of 0; the rotation of a vertical (landscape) font is 90. DEVICE The device that the font can be printed on; one of DISPLAY, INTERPRESS, etc. ASCENT An integer giving the maximum height of any character in the font from its base line (the printing position). The top line will be at BASELINE+ASCENT-1. DESCENT An integer giving the maximum extent of any character below the base line, such as the lower part of a "p". The bottom line of a character will be at BASELINE-DESCENT. HEIGHT Equal to ASCENT + DESCENT. SPEC The (FAMILY SIZE FACE ROTATION DEVICE) quintuple by which the font is known to Lisp. DEVICESPEC The (FAMILY SIZE FACE ROTATION DEVICE) quintuple that identifies what will be used to represent the font on the display or printer. It will differ from the SPEC property only if an implicit coercion is done to approximate the specified font with one that actually exists on the device. SCALE The units per printer's point (1/72 of an inch) in which the font is measured. For example, this is 35.27778 (the number of micas per printer's point) for Interpress fonts, which are measured in terms of micas. 1 (FONTCOPY OLDFONT PROP1 VAL1 PROP2 VAL2 ...) [NoSpread Function] 1 Returns a font descriptor that is a copy of the font OLDFONT, but which differs from OLDFONT in that OLDFONT's properties are replaced by the specified properties and values. Thus, (FONTCOPY FONT 'WEIGHT 'BOLD 'DEVICE 'INTERPRESS) will return a bold Interpress font with all other properties the same as those of FONT. FONTCOPY accepts the properties FAMILY, SIZE, WEIGHT, SLOPE, EXPANSION, FACE, ROTATION, and DEVICE. If the first property is a list, it is taken to be the PROP1 VAL1 PROP2 VAL2 ... sequence. Thus, (FONTCOPY FONT '(WEIGHT BOLD DEVICE INTERPRESS)) is equivalent to the example above. If the property NOERROR is specified with value non-NIL, FONTCOPY will return NIL rather than causing an error if the specified font cannot be created. 1 (FONTSAVAILABLE FAMILY SIZE FACE ROTATION DEVICE CHECKFILESTOO?) [Function] 1 Returns a list of available fonts that match the given specification. FAMILY, SIZE, FACE, ROTATION, and DEVICE are the same as for FONTCREATE. Additionally, any of them can be the atom *, in which case all values of that field are matched. If CHECKFILESTOO? is NIL, only fonts already loaded into virtual memory will be considered. If CHECKFILESTOO? is non-NIL, the font directories for the specified device will be searched. When checking font files, the ROTATION is ignored. Note: The search is conditional on the status of the server which holds the font. Thus a file server crash may prevent FONTCREATE from finding a file that an earlier FONTSAVAILABLE returned. Each element of the list returned will be of the form (FAMILY SIZE FACE ROTATION DEVICE). Examples: (FONTSAVAILABLE 'MODERN 10 'MRR 0 'DISPLAY) will return ((MODERN 10 (MEDIUM REGULAR REGULAR) 0 DISPLAY)) if the regular Modern 10 font for the display is in virtual memory; NIL otherwise. (FONTSAVAILABLE '* 14 '* '* 'INTERPRESS T) will return a list of all the size 14 Interpress fonts, whether they are in virtual memory or in font files. Warning: One must be careful when using the function FONTSAVAILABLE to determine what Press font files are available. For Press font families/faces, the font widths for different sizes are consistently scaled versions of the smallest font in the family/face. Therefore, instead of storing data about all of the sizes in the FONTS.WIDTHS file, only the widths for the font of SIZE=1 are stored, and the other widths are calculated by scaling these widths up. This is signified in the FONTS.WIDTHS file by a font with SIZE=0. Therefore, if FONTSAVAILABLE is called with CHECKFILESTOO?=T, and it finds such a "relative" font, it returns a font spec list with size of 0. For example, _(FONTSAVAILABLE 'GACHA '* '* 0 'PRESS T) ((GACHA 0 (BOLD ITALIC REGULAR) 0 PRESS) (GACHA 0 (BOLD REGULAR REGULAR) 0 PRESS) (GACHA 0 (MEDIUM ITALIC REGULAR) 0 PRESS) (GACHA 0 (MEDIUM REGULAR REGULAR) 0 PRESS)) This indicates that Press files can be created with GACHA files of any size with faces BIR, BRR, MIR, and MRR. Of course, this doesn't guarantee that these fonts are available in all sizes on your printer. 1 (SETFONTDESCRIPTOR FAMILY SIZE FACE ROTATION DEVICE FONT) [Function] 1 Indicates to the system that FONT is the font that should be associated with the FAMILY SIZE FACE ROTATION DEVICE characteristics. If FONT is NIL, the font associated with these characteristics is cleared and will be recreated the next time it is needed. As with FONTPROP and FONTCOPY, FONT is coerced to a font descriptor if it is not one already. This functions is useful when it is desirable to simulate an unavailable font or to use a font with characteristics different from the interpretations provided by the system. 1 (DEFAULTFONT DEVICE FONT %) [Function] 1 Returns the font that would be used as the default (if NIL were specified as a font argument) for image stream type DEVICE. If FONT is a font descriptor, it is set to be the default font for DEVICE. 1 (CHARWIDTH CHARCODE FONT) [Function] 1 CHARCODE is an integer that represents a valid character (as returned by CHCON1). Returns the amount by which an image stream's X-position will be incremented when the character is printed. 1 (CHARWIDTHY CHARCODE FONT) [Function] 1 Like CHARWIDTH, but returns the Y component of the character's width, the amount by which an image stream's Y-position will be incremented when the character is printed. This will be zero for most characters in normal portrait fonts, but may be non-zero for landscape fonts or for vector-drawing fonts. 1 (STRINGWIDTH STR FONT FLG RDTBL) [Function] 1 Returns the amount by which a stream's X-position will be incremented if the printname for the Interlisp-D object STR is printed in font FONT. If FONT is an image stream, its font is used. If FLG is non-NIL, the PRIN2-pname of STR with respect to the readtable RDTBL is used. 1 (STRINGREGION STR STREAM PRIN2FLG RDTBL) [Function] 1 Returns the region occupied by STR if it were printed at the current location in the image stream STREAM. This is useful, for example, for determining where text is in a window to allow the user to select it. The arguments PRIN2FLG and RDTBL are passed to STRINGWIDTH. Note: STRINGREGION does not take into account any carriage returns in the string, or carriage returns that may be automatically printed if STR is printed to STREAM. Therefore, the value returned is meaningless for multi-line strings. 1 The following functions allow the user to access and change the bitmaps for individual characters in a display font. Note: Character code 256 can be used to access the "dummy" character, used for characters in the font with no bitmap defined. (GETCHARBITMAP CHARCODE FONT) [Function] 1 Returns a bitmap containing a copy of the image of the character CHARCODE in the font FONT. 1 (PUTCHARBITMAP CHARCODE FONT NEWCHARBITMAP NEWCHARDESCENT) [Function] 1 Changes the bitmap image of the character CHARCODE in the font FONT to the bitmap NEWCHARBITMAP. If NEWCHARDESCENT is non-NIL, the descent of the character is changed to the value of NEWCHARDESCENT. 1 (EDITCHAR CHARCODE FONT) [Function] 1 Calls the bitmap editor (EDITBM, ("EDITBM" . Function)) on the bitmap image of the character CHARCODE in the font FONT. CHARCODE can be a character code (as returned by CHCON1) or an atom or string, in which case the first character of CHARCODE is used. 1  (((1)KKT/KT((.((7((MODERN MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))    HRULE.GETFNMODERN   HRULE.GETFNMODERN 96%%:  \ sM @  IRM.GET.CREF: 3 HRULE.GETFNMODERN  3+;K 84M IRM.GET.CREF  `   k RF 1 ^ .   9   IRM.GET.CREF  HRULE.GETFNMODERN  HRULE.GETFNMODERN     HRULE.GETFNMODERN    HRULE.GETFNMODERN  1?X)3 G  " )4  / w~  HRULE.GETFNMODERN    HRULE.GETFNMODERN  5 J #S : "% G  HRULE.GETFNMODERN / HRULE.GETFNMODERN  G -6H` x % 6 , 0E +n6 'i b*)*+-4b  HRULE.GETFNMODERN % HRULE.GETFNMODERN  0w;  HRULE.GETFNMODERN  HRULE.GETFNMODERN  9:<  HRULE.GETFNMODERN    HRULE.GETFNMODERN  Ap  HRULE.GETFNMODERN    HRULE.GETFNMODERN   "  HRULE.GETFNMODERN   HRULE.GETFNMODERN  r+    HRULE.GETFNMODERN  HRULE.GETFNMODERN  @y  yH  HRULE.GETFNMODERN   HRULE.GETFNMODERN  A   HRULE.GETFNMODERN * HRULE.GETFNMODERN  *  :  HRULE.GETFNMODERN    HRULE.GETFNMODERN   IRM.GET.CREF' )=   HRULE.GETFNMODERN Byz ((MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8)) cz 2 27.10 Display Streams 1 Display streams (image streams of type DISPLAY) are used to control graphic output operations to a bitmap, known as the "destination" bitmap of the display stream. For each window on the screen, there is an associated display stream which controls graphics operations to a specific part of the screen bitmap. Any of the functions that take a display stream will also take a window, and use the associated display stream. Display streams can also have a destination bitmap that is not connected to any window or display device. (DSPCREATE DESTINATION) [Function] 1 Creates and returns a display stream. If DESTINATION is specified, it is used as the destination bitmap, otherwise the screen bitmap is used. 1 (DSPDESTINATION DESTINATION DISPLAYSTREAM) [Function] 1 Returns the current destination bitmap for DISPLAYSTREAM, setting it to DESTINATION if non-NIL. DESTINATION can be either the screen bitmap, or an auxilliary bitmap in order to construct figures, possibly save them, and then display them in a single operation. Warning: The window system maintains the destination of a window's display stream. Users should be very careful about changing this field. 1 (DSPXOFFSET XOFFSET DISPLAYSTREAM) [Function] 1 (DSPYOFFSET YOFFSET DISPLAYSTREAM) [Function] 1 Each display stream has its own coordinate system, separate from the coordinate system of its destination bitmap. Having the coordinate system local to the display stream allows objects to be displayed at different places by translating the display stream's coordinate system relative to its destination bitmap. This local coordinate system is defined by the X offset and Y offset. DSPXOFFSET returns the current X offset for DISPLAYSTREAM, the X origin of the display stream's coordinate system in the destination bitmap's coordinate system. It is set to XOFFSET if non-NIL. DSPYOFFSET returns the current Y offset for DISPLAYSTREAM, the Y origin of the display stream's coordinate system in the destination bitmap's coordinate system. It is set to YOFFSET if non-NIL. The X offset and Y offset for a display stream are both initially 0 (no X or Y-coordinate translation). Warning: The window system maintains the X and Y offset of a window's display stream. Users should be very careful about changing these fields. 1 (DSPTEXTURE TEXTURE DISPLAYSTREAM) [Function] 1 Returns the current texture used as the background pattern for DISPLAYSTREAM. It is set to TEXTURE if non-NIL. Initially the value of WHITESHADE. 1 (DSPSOURCETYPE SOURCETYPE DISPLAYSTREAM) [Function] 1 Returns the current BITBLT sourcetype used when printing characters to the display stream (see ("SOURCETYPE" . BITBLTargument)). It is set to SOURCETYPE, if non-NIL. Must be either INPUT or INVERT. Initially INPUT. 1 (DSPSCROLL SWITCHSETTING DISPLAYSTREAM) [Function] 1 Returns the current value of the "scroll flag," a flag that determines the scrolling behavior of the display stream; either ON or OFF. If ON, the bits in the display streams's destination bitmap are moved after any linefeed that moves the current position out of the destination bitmap. Any bits moved out of the current clipping region are lost. Does not adjust the X offset, Y offset, or clipping region of the display stream. Initially OFF. Sets the scroll flag to SWITCHSETTING, if non-NIL. Note: The word "scrolling" also describes the use of "scroll bars" on the left and bottom of a window to move an object displayed in a window. This feature is described on ("Scrolling" . TERM). 1 Each window has an associated display stream. To get the window of a particular display stream, use WFROMDS: (WFROMDS DISPLAYSTREAM DONTCREATE) [Function] 1 Returns the window associated with DISPLAYSTREAM, creating a window if one does not exist (and DONTCREATE is NIL). Returns NIL if the destination of DISPLAYSTREAM is not a screen bitmap that supports a window system. If DONTCREATE is non-NIL, WFROMDS will never create a window, and returns NIL if DISPLAYSTREAM does not have an associated window. TTYDISPLAYSTREAM calls WFROMDS with DONTCREATE = T, so it will not create a window unnecessarily. Also, if WFROMDS does create a window, it calls CREATEW with NOOPENFLG = T. 1 (DSPBACKUP WIDTH DISPLAYSTREAM) [Function] 1 Backs up DISPLAYSTREAM over a character which is WIDTH screen points wide. DSPBACKUP fills the backed over area with the display stream's background texture and decreases the X position by WIDTH. If this would put the X position less than DISPLAYSTREAM's left margin, its operation is stopped at the left margin. It returns T if any bits were written, NIL otherwise. 1  ()KKT/KT((.((7((MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN  HRULE.GETFNMODERN '   HRULE.GETFNMODERN * Z HRULE.GETFNMODERN  HRULE.GETFNMODERN +    HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN  " v " vi HRULE.GETFNMODERN   HRULE.GETFNMODERN ?   HRULE.GETFNMODERN  HRULE.GETFNMODERN E IRM.GET.CREF    HRULE.GETFNMODERN   HRULE.GETFNMODERN |.   IRM.GET.CREF HRULE.GETFNMODERN e  HRULE.GETFNMODERN # /   7 ) % :   HRULE.GETFNMODERN   HRULE.GETFNMODERN    i. I  HRULE.GETFNMODERN vz 2 27.9 Drawing and Shading Grids 1 A grid is a partitioning of an arbitrary coordinate system (hereafter referred to as the "source system") into rectangles. This section describes functions that operate on grids. It includes functions to draw the outline of a grid, to translate between positions in a source system and grid coordinates (the coordinates of the rectangle which contains a given position), and to shade grid rectangles. A grid is defined by its "unit grid," a region (called a grid specification) which is the origin rectangle of the grid in terms of the source system. Its LEFT field is interpreted as the X-coordinate of the left edge of the origin rectangle, its BOTTOM field is the Y-coordinate of the bottom edge of the origin rectangle, its WIDTH is the width of the grid rectangles, and its HEIGHT is the height of the grid rectangles. (GRID GRIDSPEC WIDTH HEIGHT BORDER STREAM GRIDSHADE) [Function] 1 Outlines the grid defined by GRIDSPEC which is WIDTH rectangles wide and HEIGHT rectangles high on STREAM. Each box in the grid has a border within it that is BORDER points on each side; so the resulting lines in the grid are 2*BORDER thick. If BORDER is the atom POINT, instead of a border the lower left point of each grid rectangle will be turned on. If GRIDSHADE is non-NIL, it should be a texture and the border lines will be drawn using that texture. 1 (SHADEGRIDBOX X Y SHADE OPERATION GRIDSPEC GRIDBORDER STREAM) [Function] 1 Shades the grid rectangle (X,Y) of GRIDSPEC with texture SHADE using OPERATION on STREAM. GRIDBORDER is interpreted the same as for GRID. 1 The following two functions map from the X,Y coordinates of the source system into the grid X,Y coordinates: (GRIDXCOORD XCOORD GRIDSPEC) [Function] 1 Returns the grid X-coordinate (in the grid specified by GRIDSPEC) that contains the source system X-coordinate XCOORD. 1 (GRIDYCOORD YCOORD GRIDSPEC) [Function] 1 Returns the grid Y-coordinate (in the grid specified by GRIDSPEC) that contains the source system Y-coordinate YCOORD. 1 The following two functions map from the grid X,Y coordinates into the X,Y coordinates of the source system: (LEFTOFGRIDCOORD GRIDX GRIDSPEC) [Function] 1 Returns the source system X-coordinate of the left edge of a grid rectangle at grid X-coordinate GRIDX (in the grid specified by GRIDSPEC). 1 (BOTTOMOFGRIDCOORD GRIDY GRIDSPEC) [Function] 1 Returns the source system Y-coordinate of the bottom edge of a grid rectangle at grid Y-coordinate GRIDY (in the grid specified by GRIDSPEC). 1  ()KKT/KT((.((7((MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN ! HRULE.GETFNMODERN /XK.'- HRULE.GETFNMODERN  7?  Y P HRULE.GETFNMODERN . HRULE.GETFNMODERN     HRULE.GETFNMODERN m  HRULE.GETFNMODERN 8/ HRULE.GETFNMODERN   HRULE.GETFNMODERN 8/ HRULE.GETFNMODERN m HRULE.GETFNMODERN a HRULE.GETFNMODERN  HRULE.GETFNMODERN c HRULE.GETFNMODERN $z 2 27.8 Miscellaneous Drawing and Printing Operations 1 (DSPFILL REGION TEXTURE OPERATION STREAM) [Function] 1 Fills REGION of the image stream STREAM (within the clipping region) with the texture TEXTURE. If REGION is NIL, the whole clipping region of STREAM is used. If TEXTURE or OPERATION is NIL, the values for STREAM are used. 1 (FILLPOLYGON POINTS TEXTURE STREAM) [Function] 1 Fills in the polygon outlined by POINTS on the image stream STREAM, using the texture TEXTURE. POINTS is a list of positions (("Positions" . TERM)) determining the vertices of a closed polygon. FILLPOLYGON fills in this polygon with the texture TEXTURE. POINTS can also be a list whose elements are lists of positions, in which case each sublist describes a separate polygon to be filled. Note: When filling a polygon, there is more than one way of dealing with the situation where two polygon sides intersect, or one polygon is fully inside the other. Currently, FILLPOLYGON to a display stream uses the "odd" fill rule, which means that intersecting polygon sides define areas that are filled or not filled somewhat like a checkerboard. For example, (FILLPOLYGON '((125 . 125)(150 . 200)(175 . 125)(125 . 175)(175 . 175)) GRAYSHADE WINDOW) would produce a display something like this: /E@@@ PP**PUT**UTUT*UTUTTUP * *P@P @((*PUT** UPTUPT*UTUUUPU  U@UUU@TU@P@ @PP**PP  @ This fill convention also takes into account all polygons in POINTS, if it specifies multiple polygons. This can be used to put "holes" in filled polygons. For example, (FILLPOLYGON '( ((110 . 110)(150 . 200)(190 . 110)) ((135 . 125)(160 . 125)(160 . 150)(135 . 150)) ) GRAYSHADE WINDOW) will put a square hole in a triangular region: OX@@ PP**UTUTUTUUUUUU@ UU@UU@ UUPUUP**UUUTUUUTUUUUUUUUUUUU@UUUU@ UUUUPUUUUP***UTUT**UTUU**UUUU@* *UU@UU@ * *UUPUUP****UUUTUUUT**UUUUUUUUUUUUUUUUUUUU@UUUUUUUU@ UUUUUUUUPUUUUUUUUP**UUUUUUUUUTUUUUUUUUUT Currently, FILLPOLYGON uses the "Replace" BITBLT operation (see ("OPERATION" . BITBLTargument)) to fill areas with the texture. However, any areas that are not filled are not changed. If there are "holes" in the filled polygon, this can be used to produce a "window" effect. For example, the following is the display produced by filling the star polygon (above) over a window full of text: `P @ 'D!B"(@E!>@! @!B@*(HE !D0* @ '*D!B*(@E!U@!U@!B@HE !0U@U@U@ U@@ '!B@E!UT>UP!UD UP!B"*E FU@UU@U* P P 'D!B"(E!>@! @!B@"(E !D@@P@  U@ UU@ '!BE!U]UP!UUUP!BJE !UUTUUT ** WT TT 'F!B*"(E!U>U!U U!B"(jE !D*P@P@C @@ #D !B"(@E!>@! @!B@"(HE !D0 1 (FILLCIRCLE CENTERX CENTERY RADIUS TEXTURE STREAM) [Function] 1 Fills in a circular area of radius RADIUS about the point (CENTERX,CENTERY) in STREAM with TEXTURE. STREAM's position is left at (CENTERX,CENTERY). 1 (DSPRESET STREAM) [Function] 1 Sets the X coordinate of STREAM to its left margin, sets its Y coordinate to the top of the clipping region minus the font ascent. For a display stream, this also fills its destination bitmap with its background texture. 1 (DSPNEWPAGE STREAM) [Function] 1 Starts a new page. The X coordinate is set to the left margin, and the Y coordinate is set to the top margin plus the linefeed. 1 (CENTERPRINTINREGION EXP REGION STREAM) [Function] 1 Prints EXP so that is it centered within REGION of the STREAM. If REGION is NIL, EXP will be centered in the clipping region of STREAM. 1  ((()KKT/KT(.((7((MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))   HRULE.GETFNMODERN 5 HRULE.GETFNMODERN   HRULE.GETFNMODERN  /    HRULE.GETFNMODERN   HRULE.GETFNMODERN  ! IRM.GET.CREF1 ( R. BMOBJ.GETFN3MODERN =h )6 /| BMOBJ.GETFN3MODERN    IRM.GET.CREF+ BMOBJ.GETFN3MODERN   HRULE.GETFNMODERN  % HRULE.GETFNMODERN  #  HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN  HRULE.GETFNMODERN  ,  HRULE.GETFNMODERN vz 2 27.7 Drawing Curves 1 A curve is drawn by placing a brush pattern centered at each point along the curve's trajectory. A brush pattern is defined by its shape, size, and color. The predefined brush shapes are ROUND, SQUARE, HORIZONTAL, VERTICAL, and DIAGONAL; new brush shapes can be created using the INSTALLBRUSH function, described below. A brush size is an integer specifying the width of the brush in the units of the device. The color is a color specification, which is only used if the curve is drawn to an image stream that supports colors. A brush is specified to the various drawing functions as a list of the form (SHAPE WIDTH COLOR), for example (SQUARE 2) or (VERTICAL 4 RED). A brush can also be specified as a positive integer, which is interpreted as a ROUND brush of that width. If a brush is a litatom, it is assumed to be a function which is called at each point of the curve's trajectory (with three arguments: the X-coordinate of the point, the Y-coordinate, and the image stream), and should do whatever image stream operations are necessary to draw each point. Finally, if a brush is specified as NIL, a (ROUND 1) brush is used as default. The appearance of a curve is also determined by its dashing characteristics. Dashing is specified by a list of positive integers. If a curve is dashed, the brush is placed along the trajectory for the number of units indicated by the first element of the dashing list. The brush is off, not placed in the bitmap, for a number of units indicated by the second element. The third element indicates how long it will be on again, and so forth. The dashing sequence is repeated from the beginning when the list is exhausted. The units used to measure dashing are the units of the brush. For example, specifying the dashing as (1 1) with a brush of (ROUND 16) would put the brush on the trajectory, skip 16 points, and put down another brush. A curve is not dashed if the dashing argument to the drawing function is NIL. The curve functions use the image stream's clipping region and operation. Most types of image streams only support the PAINT operation when drawing curves. When drawing to a display stream, the curve-drawing functions accept the operation INVERT if the brush argument is 1. For brushes larger than 1, these functions will use the ERASE operation instead of INVERT. For display streams, the curve-drawing functions treat the REPLACE operation the same as PAINT. (DRAWCURVE KNOTS CLOSED BRUSH DASHING STREAM) [Function] 1 Draws a "parametric cubic spline curve" on the image stream STREAM. KNOTS is a list of positions to which the curve will be fitted. If CLOSED is non-NIL, the curve will be closed; otherwise it ends at the first and last positions in KNOTS. BRUSH and DASHING are interpreted as described above. For example, (DRAWCURVE '((10 . 10)(50 . 50)(100 . 10)(150 . 50)) NIL '(ROUND 5) '(1 1 1 2) XX) would draw a curve like the following on the display stream XX: ;  > > >                 p p p p       > > > q  p   1 (DRAWCIRCLE CENTERX CENTERY RADIUS BRUSH DASHING STREAM) [Function] 1 Draws a circle of radius RADIUS about the point (CENTERX,CENTERY) onto the image stream STREAM. STREAM's position is left at (CENTERX,CENTERY). The other arguments are interpreted as described above. 1 (DRAWELLIPSE CENTERX CENTERY SEMIMINORRADIUS SEMIMAJORRADIUS ORIENTATION BRUSH DASHING STREAM) [Function] 1 Draws an ellipse with a minor radius of SEMIMINORRADIUS and a major radius of SEMIMAJORRADIUS about the point (CENTERX,CENTERY) onto the image stream STREAM. ORIENTATION is the angle of the major axis in degrees, positive in the counterclockwise direction. STREAM's position is left at (CENTERX,CENTERY). The other arguments are interpreted as described above. 1 New brush shapes can be defined using the following function: (INSTALLBRUSH BRUSHNAME BRUSHFN BRUSHARRAY) [Function] 1 Installs a new brush called BRUSHNAME with creation-function BRUSHFN and optional array BRUSHARRAY. BRUSHFN should be a function of one argument (a width), which returns a bitmap of the brush for that width. BRUSHFN will be called to create new instances of BRUSHNAME-type brushes; the sixteen smallest instances will be pre-computed and cached. "Hand-crafted" brushes can be supplied as the BRUSHARRAY argument. Changing an existing brush can be done by calling INSTALLBRUSH with new BRUSHFN and/or BRUSHARRAY. 1 (DRAWPOINT X Y BRUSH STREAM OPERATION) [Function] 1 Draws BRUSH centered around point (X, Y) on STREAM, using the operation OPERATION. BRUSH may be a bitmap or a brush. 1  ((()KKT/KT((.((7((MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))    HRULE.GETFNMODERN  HRULE.GETFNMODERN  , L R\ T xtV> ! HRULE.GETFNMODERN  <?Q% 5!< BMOBJ.GETFN3MODERN   HRULE.GETFNMODERN  + HRULE.GETFNMODERN  ;  HRULE.GETFNMODERN  P HRULE.GETFNMODERN  ( Y;  HRULE.GETFNMODERN > HRULE.GETFNMODERN    f+ ~ >     HRULE.GETFNMODERN   HRULE.GETFNMODERN     HRULE.GETFNMODERN 8z 2 27.6 Drawing Lines 1 Interlisp-D provides several functions for drawing lines and curves on image streams. The line drawing functions are intended for interactive applications where efficiency is important. They do not allow the use of "brush" patterns, like the curve drawing functions, but (for display streams) they support drawing a line in INVERT mode, so redrawing the line will erase it. DRAWCURVE (("DRAWCURVE" . Function)) can be used to draw lines using a brush. (DRAWLINE X1 Y1 X2 Y2 WIDTH OPERATION STREAM COLOR DASHING) [Function] 1 Draws a straight line from the point (X1,Y1) to the point (X2,Y2) on the image stream STREAM. The position of STREAM is set to (X2,Y2). If X1 equals X2 and Y1 equals Y2, a point is drawn at (X1,Y1). WIDTH is the width of the line, in the units of the device. If WIDTH is NIL, the default is 1. OPERATION is the BITBLT operation (see ("OPERATION" . BITBLTargument)) used to draw the line. If OPERATION is NIL, the value of DSPOPERATION for the image stream is used. COLOR is a color specification that determines the color used to draw the line for image streams that support color. If COLOR is NIL, the DSPCOLOR of STREAM is used. DASHING is a list of positive integers that determines the dashing characteristics of the line. The line is drawn for the number of points indicated by the first element of the dashing list, is not drawn for the number of points indicated by the second element. The third element indicates how long it will be on again, and so forth. The dashing sequence is repeated from the beginning when the list is exhausted. If DASHING is NIL, the line is not dashed. 1 (DRAWBETWEEN POSITION1 POSITION2 WIDTH OPERATION STREAM COLOR DASHING) [Function] 1 Draws a line from the point POSITION1 to the point POSITION2 onto the destination bitmap of STREAM. The position of STREAM is set to POSITION2. 1 (DRAWTO X Y WIDTH OPERATION STREAM COLOR DASHING) [Function] 1 Draws a line from the current position to the point (X,Y) onto the destination bitmap of STREAM. The position of STREAM is set to (X,Y). 1 (RELDRAWTO DX DY WIDTH OPERATION STREAM COLOR DASHING) [Function] 1 Draws a line from the current position to the point (DX,DY) coordinates away onto the destination bitmap of STREAM. The position of STREAM is set to the end of the line. If DX and DY are both 0, nothing is drawn. 1 )KKT/KT((.((7((MODERN MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN  HRULE.GETFNMODERN F-  IRM.GET.CREF+ % HRULE.GETFNMODERN % ;  IRM.GET.CREF  t  HRULE.GETFNMODERN   % HRULE.GETFNMODERN    HRULE.GETFNMODERN ( HRULE.GETFNMODERN 4   HRULE.GETFNMODERN  * HRULE.GETFNMODERN 41$ HRULE.GETFNMODERN z 2 27.5 Moving Bits Between Bitmaps With BITBLT 1 BITBLT is the primitive function for moving bits from one bitmap to another, or from a bitmap to an image stream. (BITBLT SOURCE SOURCELEFT SOURCEBOTTOM DESTINATION DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION) [Function] 1 Transfers a rectangular array of bits from SOURCE to DESTINATION. SOURCE can be a bitmap, or a display stream or window, in which case its associated bitmap is used. DESTINATION can be a bitmap or an arbitrary image stream. WIDTH and HEIGHT define a pair of rectangles, one in each of the SOURCE and DESTINATION whose left, bottom corners are at, respectively, (SOURCELEFT, SOURCEBOTTOM) and (DESTINATIONLEFT, DESTINATIONBOTTOM). If these rectangles overlap the boundaries of either source or destination they are both reduced in size (without translation) so that they fit within their respective boundaries. If CLIPPINGREGION is non-NIL it should be a REGION and is interpreted as a clipping region within DESTINATION; clipping to this region may further reduce the defining rectangles. These (possibly reduced) rectangles define the source and destination rectangles for BITBLT. The mode of transferring bits is defined by SOURCETYPE and OPERATION. SOURCETYPE and OPERATION specify whether the source bits should come from SOURCE or TEXTURE, and how these bits are combined with those of DESTINATION. SOURCETYPE and OPERATION are described further below. TEXTURE is a texture, as described on ("Textures" . TAG). BITBLT aligns the texture so that the upper-left pixel of the texture coincides with the upper-left pixel of the destination bitmap. SOURCELEFT, SOURCEBOTTOM, DESTINATIONLEFT, and DESTINATIONBOTTOM default to 0. WIDTH and HEIGHT default to the width and height of the SOURCE. TEXTURE defaults to white. SOURCETYPE defaults to INPUT. OPERATION defaults to REPLACE. If CLIPPINGREGION is not provided, no additional clipping is done. BITBLT returns T if any bits were moved; NIL otherwise. Note: If SOURCE or DESTINATION is a window or image stream, the remaining arguments are interpreted as values in the coordinate system of the window or image stream and the operation of BITBLT is translated and clipped accordingly. Also, if a window or image stream is used as the destination to BITBLT, its clipping region further limits the region involved. 1 SOURCETYPE specifies whether the source bits should come from the bitmap SOURCE, or from the texture TEXTURE. SOURCETYPE is interpreted as follows: INPUT The source bits come from SOURCE. TEXTURE is ignored. INVERT The source bits are the inverse of the bits from SOURCE. TEXTURE is ignored. TEXTURE The source bits come from TEXTURE. SOURCE, SOURCELEFT, and SOURCEBOTTOM are ignored. OPERATION specifies how the source bits (as specified by SOURCETYPE) are combined with the bits in DESTINATION and stored back into DESTINATION. DESTINATION is one of the following: REPLACE All source bits (on or off) replace destination bits. PAINT Any source bits that are on replace the corresponding destination bits. Source bits that are off have no effect. Does a logical OR between the source bits and the destination bits. INVERT Any source bits that are on invert the corresponding destination bits. Does a logical XOR between the source bits and the destination bits. ERASE Any source bits that are on erase the corresponding destination bits. Does a logical AND operation between the inverse of the source bits and the destination bits. Different combinations of SOURCETYPE and OPERATION can be specified to achieve many different effects. Given the following bitmaps as the values of SOURCE, TEXTURE, and DESTINATION: <F??~~??<Ǿal0ql09>l0 l0' ;FDDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" DDDDDDD@fffffff`""""""" 3 f3f3f3f3 f3< PZxbgl6gllfÃ7glnf7mlnf6lmlc6lmx6xg BITBLT would produce the results given below for the difference combinations of SOURCETYPE and OPERATION (assuming CLIPPINGREGION, SOURCELEFT, etc. are set correctly, of course): Pf???~~~~~~?~~?~~?~~??????????????????????????????7`6ٌ8ٌflٌg|wc`v3<6 y mq9mqmyهmmmm9e Pf~~~?~?~?~??????????????????????????????7`6ٌ8ٌflٌg|wc`v3<6 xCflf09lv0mmv0myn0mcn09cf0 Pf~~~?~?~?~???????????????????????????????7`6ٌ8ٌflٌg|wc`v3<6 ll9n0mn>mm0mm09l> Pf?7`6ٌ8ٌflٌg|wc`v3<6 }a09a0m}>maðma9}> Pf??mm0mm09l> Pf???~~~~~~maðma9}> PfDDDDDDDffffffd"""""" DDDDDDDffffffd"""""" DDDDDDDffffffd"""""" DDDDDDDffffffd"""""" DDDDDDDffffffd"""""" DDDDDDDffffffd"""""" DDDDDDDffffffd"""""" DDDDDDDffffffd"""""""#DDDDDDG&ffffffg"""""""#DDDDDDG&ffffffg"""""""#DDDDDDG&ffffffg"""""""#DDDDDDG&ffffffg"""""""#DDDDDDG&ffffffg"""""""#DDDDDDG&ffffffg"""""""#DDDDDDG&ffffffg"""""""#}|`a`8``fl|`|g|``c`a`3<}Ǚ|y mq9mqmyهmmmm9e PfDDDDfffd""" DDDDfffd""" DDDDfffd""" DDDDfffd""" DDDDfffd""" DDDDfffd""" DDDDfffd""" DDDDfffd""""DDD&fff""""DDD&fff""""DDD&fff""""DDD&fff""""DDD&fff""""DDD&fff""""DDD&fff""""}|`a`8``fl|`|g|``c`a`3<}Ǚ|xCflf09lv0mmv0myn0mcn09cf0 PfDDDDٙfffd""" DDDDٙfffd""" DDDDٙfffd""" DDDDٙfffd""" DDDDٙfffd""" DDDDٙfffd""" DDDDٙfffd""" DDDDٙfffd""""DDD&fff""""DDD&fff""""DDD&fff""""DDD&fff""""DDD&fff""""DDD&fff""""DDD&fff""""}|`a`8``fl|`|g|``c`a`3<}Ǚ|ll9n0mn>mm0mm09l> Pfٙٙٙٙٙٙٙٙ}|`a`8``fl|`|g|``c`a`3<}Ǚ|}a09a0m}>maðma9}> (BLTSHADE TEXTURE DESTINATION DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT OPERATION CLIPPINGREGION) [Function] 1 BLTSHADE is the SOURCETYPE = TEXTURE case of BITBLT. It fills the specified region of the destination bitmap DESTINATION with the texture TEXTURE. DESTINATION can be a bitmap or image stream. 1 (BITMAPIMAGESIZE BITMAP DIMENSION STREAM) [Function] 1 Returns the size that BITMAP will be when BITBLTed to STREAM, in STREAM's units. DIMENSION can be one of WIDTH, HEIGHT, or NIL, in which case the dotted pair (WIDTH . HEIGHT) will be returned. 1  ((1()KKT/KT((.((7((MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))    HRULE.GETFNMODERN  / HRULE.GETFNMODERN l HRULE.GETFNMODERN  + ^ /1 3  0 ,    20    IRM.GET.CREF  (    3    i:  HRULE.GETFNMODERN  ?  2    0     7  c < BMOBJ.GETFN3MODERN < BMOBJ.GETFN3 BMOBJ.GETFN3J    & BMOBJ.GETFN3MODERN  BMOBJ.GETFN3 BMOBJ.GETFN3 BMOBJ.GETFN3 BMOBJ.GETFN3MODERN  BMOBJ.GETFN3 BMOBJ.GETFN3 BMOBJ.GETFN3 BMOBJ.GETFN3MODERN  BMOBJ.GETFN3 BMOBJ.GETFN3 BMOBJ.GETFN3 [ HRULE.GETFNMODERN    ;  "  HRULE.GETFNMODERN  HRULE.GETFNMODERN       HRULE.GETFNMODERN 8:z 2 27.4 Current Position of an Image Stream 1 Each image stream has a "current position," which is a position (in the image stream's coordinate system) where the next printing operation will start from. The functions which print characters or draw on an image stream update these values appropriately. The following functions are used to explicitly access the current position of an image stream: (DSPXPOSITION XPOSITION STREAM) [Function] 1 Returns the X coordinate of the current position of STREAM. If XPOSITION is non-NIL, the X coordinate is set to it (without changing the Y coordinate). 1 (DSPYPOSITION YPOSITION STREAM) [Function] 1 Returns the Y coordinate of the current position of STREAM. If YPOSITION is non-NIL, the Y coordinate is set to it (without changing the X coordinate). 1 (MOVETO X Y STREAM) [Function] 1 Changes the current position of STREAM to the point (X,Y). 1 (RELMOVETO DX DY STREAM) [Function] 1 Changes the current position to the point (DX,DY) coordinates away from current position of STREAM. 1 (MOVETOUPPERLEFT STREAM REGION) [Function] 1 Moves the current position to the beginning position of the top line of text. If REGION is non-NIL, it must be a REGION and the X position is changed to the left edge of REGION and the Y position changed to the top of REGION less the font ascent of STREAM. If REGION is NIL, the X coordinate is changed to the left margin of STREAM and the Y coordinate is changed to the top of the clipping region of STREAM less the font ascent of STREAM. 1 )KKT/KT((.((7((MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN + HRULE.GETFNMODERN a HRULE.GETFNMODERN 4 E HRULE.GETFNMODERN  HRULE.GETFNMODERN 4 E HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN *+ HRULE.GETFNMODERN   HRULE.GETFNMODERN R3*4F HRULE.GETFNMODERN Mz 2 27.3 Accessing Image Stream Fields 1 The following functions manipulate the fields of an image stream. These functions return the old value (the one being replaced). A value of NIL for the new value will return the current setting without changing it. These functions do not change any of the bits drawn on the image stream; they just affect future operations done on the image stream. (DSPCLIPPINGREGION REGION STREAM) [Function] 1 The clipping region is a region that limits the extent of characters printed and lines drawn (in the image stream's coordinate system). Initially set so that no clipping occurs. Warning: For display streams, the window system maintains the clipping region during window operations. Users should be very careful about changing this field. 1 (DSPFONT FONT STREAM) [Function] 1 The font field specifies the font (see ("Fonts" . TERM)) used when printing characters to the image stream. Note: DSPFONT determines its new font descriptor from FONT by the same coercion rules that FONTPROP and FONTCREATE use (("FONTCREATE" . Function)), with one additional possibility: If FONT is a list of the form (PROP1 VAL1 PROP2 VAL2 ...) where PROP1 is acceptable as a font-property to FONTCOPY (("FONTCOPY" . Function)), then the new font is obtained by (FONTCOPY (DSPFONT NIL STREAM) PROP1 VAL1 PROP2 VAL2 ...). For example, (DSPFONT '(SIZE 12) STREAM) would change the font to the 12 point version of the current font, leaving all other font properties the same. 1 (DSPTOPMARGIN YPOSITION STREAM) [Function] 1 The top margin is an integer that is the Y position after a new page (in the image stream's coordinate system). This function has no effect on windows. 1 (DSPBOTTOMMARGIN YPOSITION STREAM) [Function] 1 The bottom margin is an integer that is the minimum Y position that characters will be printed by PRIN1 (in the image stream's coordinate system). This function has no effect on windows. 1 (DSPLEFTMARGIN XPOSITION STREAM) [Function] 1 The left margin is an integer that is the X position after an end-of-line (in the image stream's coordinate system). Initially the left edge of the clipping region. 1 (DSPRIGHTMARGIN XPOSITION STREAM) [Function] 1 The right margin is an integer that is the maximum X position that characters will be printed by PRIN1 (in the image stream's coordinate system). This is initially the position of the right edge of the window or page. 1 The line length of a window or image stream (as returned by LINELENGTH, ("LINELENGTH" . Function)) is computed by dividing the distance between the left and right margins by the width of an uppercase "A" in the current font. The line length is changed whenever the font, left margin, or right margin are changed or whenever the window is reshaped. (DSPOPERATION OPERATION STREAM) [Function] 1 The operation is the default BITBLT operation (see ("OPERATION" . BITBLTargument)) used when printing or drawing on the image stream. One of REPLACE, PAINT, INVERT, or ERASE. Initially REPLACE. This is a meaningless operation for most printers which support the model that once dots are deposited on a page they cannot be removed. 1 (DSPLINEFEED DELTAY STREAM) [Function] 1 The linefeed is an integer that specifies the Y increment for each linefeed, normally negative. Initially minus the height of the initial font. 1 (DSPSCALE SCALE STREAM) [Function] 1 Returns the scale of the image stream STREAM, a number indicating how many units in the streams coordinate system correspond to one printer's point (1/72 of an inch). For example, DSPSCALE returns 1 for display streams, and 35.27778 for Interpress and Press streams (the number of micas per printer's point). In order to be device-independent, user graphics programs must either not specify position values absolutely, or must multiply absolute point quantities by the DSPSCALE of the destination stream. For example, to set the left margin of the Interpress stream XX to one inch, do (DSPLEFTMARGIN (TIMES 72 (DSPSCALE NIL XX)) XX) The SCALE argument to DSPSCALE is currently ignored. In a future release it will enable the scale of the stream to be changed under user control, so that the necessary multiplication will be done internal to the image stream interface. In this case, it would be possible to set the left margin of the Interpress stream XX to one inch by doing (DSPSCALE 1 XX) (DSPLEFTMARGIN 72 XX) 1 (DSPSPACEFACTOR FACTOR STREAM) [Function] 1 The space factor is the amount by which to multiply the natural width of all following space characters on STREAM; this can be used for the justification of text. The default value is 1. For example, if the natural width of a space in STREAM's current font is 12 units, and the space factor is set to two, spaces appear 24 units wide. The values returned by STRINGWIDTH and CHARWIDTH are also affected. 1 The following two functions only have meaning for image streams that can display color: (DSPCOLOR COLOR STREAM) [Function] 1 Sets the default foreground color of STREAM. Returns the previous foreground color. If COLOR is NIL, it returns the current foreground color without changing anything. The default color is white 1 (DSPBACKCOLOR COLOR STREAM) [Function] 1 Sets the background color of STREAM. Returns the previous background color. If COLOR is NIL, it returns the current background color without changing anything. The default background color is black. 1  ((()KKT/KT((.((7((MODERN MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))    HRULE.GETFNMODERN % HRULE.GETFNMODERN   HRULE.GETFNMODERN    HRULE.GETFNMODERN    HRULE.GETFNMODERN  ' IRM.GET.CREF5)!  IRM.GET.CREF'% IRM.GET.CREF$p  HRULE.GETFNMODERN  HRULE.GETFNMODERN    HRULE.GETFNMODERN  HRULE.GETFNMODERN  bU  HRULE.GETFNMODERN  HRULE.GETFNMODERN    HRULE.GETFNMODERN  HRULE.GETFNMODERN  au  HRULE.GETFNMODERN <  IRM.GET.CREF HRULE.GETFNMODERN   IRM.GET.CREF=   HRULE.GETFNMODERN    HRULE.GETFNMODERN    HRULE.GETFNMODERN    HRULE.GETFNMODERN  &Z0 #  HRULE.GETFNMODERN   HRULE.GETFNMODERN  k|v    HRULE.GETFNMODERN X   HRULE.GETFNMODERN  %.a  HRULE.GETFNMODERN   HRULE.GETFNMODERN  .m  HRULE.GETFNMODERN j*z 2 27.2 Opening Image Streams 1 An image stream is an output stream which "knows" how to process graphic commands to a graphics output device. Besides accepting the normal character-output functions (PRINT, etc.), an image stream can also be passed as an argument to functions to draw curves, to print characters in multiple fonts, and other graphics operations. Each image stream has an "image stream type," a litatom that specifies the type of graphic output device that the image stream is processing graphics commands for. Currently, the built-in image stream types are DISPLAY (for the display screen), INTERPRESS (for Interpress format printers), and PRESS (for Press format printers). There are also library packages available that define image stream types for the IRIS display, 4045 printer, FX-80 printer, C150 printer, etc. Image streams to the display (display streams) interpret graphics commands by immediately executing the appropriate operations to cause the desired image to appear on the display screen. Image streams for hardcopy devices such as Interpress printers interpret the graphic commands by saving information in a file, which can later be sent to the printer. Note: Not all graphics operations can be properly executed for all image stream types. For example, BITBLT may not be supported to all printers. This functionality is still being developed, but even in the long run some operations may be beyond the physical or logical capabilities of some devices or image file formats. In these cases, the stream will approximate the specified image as best it can. (OPENIMAGESTREAM FILE IMAGETYPE OPTIONS) [Function] 1 Opens and returns an image stream of type IMAGETYPE on a destination specified by FILE. If FILE is a file name on a normal file storage device, the image stream will store graphics commands on the specified file, which can be transmitted to a printer by explicit calls to LISTFILES and SEND.FILE.TO.PRINTER. If IMAGETYPE is DISPLAY, then the user is prompted for a window to open. FILE in this case will be used as the title of the window. If FILE is a file name on the LPT device, this indicates that the graphics commands should be stored in a temporary file, and automatically sent to the printer when the image stream is closed by CLOSEF. FILE = NIL is equivalent to FILE = {LPT}. File names on the LPT device are of the form {LPT}PRINTERNAME.TYPE, where PRINTERNAME, TYPE, or both may be omitted. PRINTERNAME is the name of the particular printer to which the file will be transmitted on closing; it defaults to the first printer on DEFAULTPRINTINGHOST that can print IMAGETYPE files. The TYPE extension supplies the value of IMAGETYPE when it is defaulted (see below). OPENIMAGESTREAM will generate an error if the specified printer does not accept the kind of file specified by IMAGETYPE. If IMAGETYPE is NIL, the image type is inferred from the extension field of FILE and the EXTENSIONS properties in the list PRINTFILETYPES (see ("PRINTFILETYPES" . Variable)). Thus, the extensions IP, IPR, and INTERPRESS indicate Interpress format, and the extension PRESS indicates Press format. If FILE is a printer file with no extension (of the form {LPT}PRINTERNAME), then IMAGETYPE will be the type that the indicated printer can print. If FILE has no extension but is not on the printer device {LPT}, then IMAGETYPE will default to the type accepted by the first printer on DEFAULTPRINTINGHOST. OPTIONS is a list in property list format, (PROP1 VAL1 PROP2 VAL2 %), used to specify certain attributes of the image stream; not all attributes are meaningful or interpreted by all types of image streams. Acceptable properties are: REGION Value is the region on the page (in stream scale units, 0,0 being the lower-left corner of the page) that text will fill up. It establishes the initial values for DSPLEFTMARGIN, DSPRIGHTMARGIN, DSPBOTTOMMARGIN (the point at which carriage returns cause page advancement) and DSPTOPMARGIN (where the stream is positioned at the beginning of a new page). If this property is not given, the value of the variable DEFAULTPAGEREGION, is used. FONTS Value is a list of fonts that are expected to be used in the image stream. Some image streams (e.g. Interpress) are more efficient if the expected fonts are specified in advance, but this is not necessary. The first font in this list will be the initial font of the stream, otherwise the default font for that image stream type will be used. HEADING Value is the heading to be placed automatically on each page. NIL means no heading. 1 Examples: Suppose that Tremor: is an Interpress printer, Quake is a Press printer, and DEFAULTPRINTINGHOST is (Tremor: Quake): (OPENIMAGESTREAM) returns an Interpress image stream on printer Tremor:. (OPENIMAGESTREAM NIL 'PRESS) returns a Press stream on Quake. (OPENIMAGESTREAM '{LPT}.INTERPRESS) returns an Interpress stream on Tremor:. (OPENIMAGESTREAM '{CORE}FOO.PRESS) returns a Press stream on the file {CORE}FOO.PRESS. (IMAGESTREAMP X IMAGETYPE) [NoSpread Function] 1 Returns X (possibly coerced to a stream) if it is an output image stream of type IMAGETYPE (or of any type if IMAGETYPE=NIL), otherwise NIL. 1 (IMAGESTREAMTYPE STREAM) [Function] 1 Returns the image stream type of STREAM. 1 (IMAGESTREAMTYPEP STREAM TYPE) [Function] 1 Returns T if STREAM is an image stream of type TYPE. 1  (1()KKT/KT(.((7((MODERN MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))   HRULE.GETFNMODERN  HRULE.GETFNMODERN    ' c f) HRULE.GETFNMODERN *   37    }  ! $_   9   IRM.GET.CREF ) :d xf v& H  R B B 9 Y@ HRULE.GETFNMODERN  /  #! "$  HRULE.GETFNMODERN H    HRULE.GETFNMODERN  HRULE.GETFNMODERN ! HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN z 27.1.4 Textures 1 A Texture denotes a pattern of gray which can be used to (conceptually) tessellate the plane to form an infinite sheet of gray. It is currently either a 4 by 4 pattern or a 16 by N (N <= 16) pattern. Textures are created from bitmaps using the following function: (CREATETEXTUREFROMBITMAP BITMAP) [Function] 1 Returns a texture object that will produce the texture of BITMAP. If BITMAP is too large, its lower left portion is used. If BITMAP is too small, it is repeated to fill out the texture. 1 (TEXTUREP OBJECT) [Function] 1 Returns OBJECT if it is a texture; NIL otherwise. 1 The functions which accept textures (TEXTUREP, BITBLT, DSPTEXTURE, etc.) also accept bitmaps up to 16 bits wide by 16 bits high as textures. When a region is being filled with a bitmap texture, the texture is treated as if it were 16 bits wide (if less, the rest is filled with white space). The common textures white and black are available as system constants WHITESHADE and BLACKSHADE. The global variable GRAYSHADE is used by many system facilities as a background gray shade and can be set by the user. (EDITSHADE SHADE) [Function] 1 Opens a window that allows the user to edit textures. Textures can be either small (4 by 4) patterns or large (16 by 16). In the edit area, the left button adds bits to the shade and the middle button erases bits from the shade. The top part of the window is painted with the current texture whenever all mouse keys are released. Thus it is possible to directly compare two textures that differ by more than one pixel by holding a mouse key down until all changes are made. When the "quit" button is selected, the texture being edited is returned. If SHADE is a texture object, EDITSHADE starts with it. If SHADE is T, it starts with a large (16 by 16) white texture. Otherwise, it starts with WHITESHADE. 1 The following is a picture of the texture editor, editing a large (16 by 16) pattern: ,,000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000``0``0``0`>`0`H`0`H`0`H`0`H`0`H`0`H`0``0``0``0``0``0``000000 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00UUUuU]UWUUUuU]UW00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW0ꪺꪺ0 TUU@UTUU@W00 TUU@UTUU@W00 TUU@UTUU@W00 TUU@UTUU@W00UUU`WUUU`W00 TUUUUPUTUUUUPW00 TUUUUPUTUUUUPW00 TUUUUPUTUUUUPW00 TUUUUPUTUUUUPW0ꪪꪪ0 TUPUTUPW0**0 TUPUTUPW0**0 TUPUTUPW0**0 TUPUTUPW0**0U@5UXWU@5UXW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW0ꪪꪪ0 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00UUUuUXWUUUuUXW0 0 0 0 0 0 0 0 0@ @ 0 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00UUUuUXWUUUuUPW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW00 UUUUUUPUUUUUUUPW0ꪪꪪ0 TUPUTUPW0**0 TUPUTUPW0**0 TUPUTUPW0**0 TUPUTUPW0**0U@5UPWU@5UXW00 TUUUUPUTUUUUPW00 TUUUUPUTUUUUPW00 TUUUUPUTUUUUPW00 TUUUUPUTUUUUPW0ꪪꪪ0 TUU@UTUU@W00 TUU@UTUU@W00 TUU@UTUU@W00 TUU@UTUU@W00TUU`WTUU`W00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW0ꪺꪺ0 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00 TUUUUUUUTUUUUUUW00UUUuU]UWTUUuU]UW0 0 0 0 0 0 0 0 0@ @ 000000  (()KKT/KT((. (1(MODERN MODERN MODERN MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN R HRULE.GETFNMODERN :37 HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN % F   Z  HRULE.GETFNMODERN ) N  HRULE.GETFNMODERN V, BMOBJ.GETFN3MODERN `z 27.1.3 Bitmaps 1 The display primitives manipulate graphical images in the form of bitmaps. A bitmap is a rectangular array of "pixels," each of which is an integer representing the color of one point in the bitmap image. A bitmap is created with a specific number of bits allocated for each pixel. Most bitmaps used for the display screen use one bit per pixel, so that at most two colors can be represented. If a pixel is 0, the corresponding location on the image is white. If a pixel is 1, its location is black. This interpretation can be changed for the display screen with the function VIDEOCOLOR (("VIDEOCOLOR" . Function)). Bitmaps with more than one bit per pixel are used to represent color or grey scale images. Bitmaps use a positive integer coordinate system with the lower left corner pixel at coordinate (0,0). Bitmaps are represented as instances of the datatype BITMAP. Bitmaps can be saved on files with the VARS file package command (("VARS" . FilePackageCommand)). (BITMAPCREATE WIDTH HEIGHT BITSPERPIXEL) [Function] 1 Creates and returns a new bitmap which is WIDTH pixels wide by HEIGHT pixels high, with BITSPERPIXEL bits per pixel. If BITSPERPIXEL is NIL, it defaults to 1. 1 (BITMAPP X) [Function] 1 Returns X if X is a bitmap, NIL otherwise. 1 (BITMAPWIDTH BITMAP) [Function] 1 Returns the width of BITMAP in pixels. 1 (BITMAPHEIGHT BITMAP) [Function] 1 Returns the height of BITMAP in pixels. 1 (BITSPERPIXEL BITMAP) [Function] 1 Returns the number of bits per pixel of BITMAP. 1 (BITMAPBIT BITMAP X Y NEWVALUE) [Function] 1 If NEWVALUE is between 0 and the maximum value for a pixel in BITMAP, the pixel (X,Y) is changed to NEWVALUE and the old value is returned. If NEWVALUE is NIL, BITMAP is not changed but the value of the pixel is returned. If NEWVALUE is anything else, an error is generated. If (X,Y) is outside the limits of BITMAP, 0 is returned and no pixels are changed. BITMAP can also be a window or display stream. Note: non-window image streams are "write-only"; the NEWVALUE argument must be non-NIL. 1 (BITMAPCOPY BITMAP) [Function] 1 Returns a new bitmap which is a copy of BITMAP (same dimensions, bits per pixel, and contents). 1 (EXPANDBITMAP BITMAP WIDTHFACTOR HEIGHTFACTOR) [Function] 1 Returns a new bitmap that is WIDTHFACTOR times as wide as BITMAP and HEIGHTFACTOR times as high. Each pixel of BITMAP is copied into a WIDTHFACTOR times HEIGHTFACTOR block of pixels. If NIL, WIDTHFACTOR defaults to 4, HEIGHTFACTOR to 1. 1 (SHRINKBITMAP BITMAP WIDTHFACTOR HEIGHTFACTOR DESTINATIONBITMAP) [Function] 1 Returns a copy of BITMAP that has been shrunken by WIDTHFACTOR and HEIGHTFACTOR in the width and height, respectively. If NIL, WIDTHFACTOR defaults to 4, HEIGHTFACTOR to 1. If DESTINATIONBITMAP is not provided, a bitmap that is 1/WIDTHFACTOR by 1/HEIGHTFACTOR the size of BITMAP is created and returned. WIDTHFACTOR and HEIGHTFACTOR must be positive integers. 1 (PRINTBITMAP BITMAP FILE) [Function] 1 Prints the bitmap BITMAP on the file FILE in a format that can be read back in by READBITMAP. 1 (READBITMAP FILE) [Function] 1 Creates a bitmap by reading an expression (written by PRINTBITMAP) from the file FILE. 1 (EDITBM BMSPEC) [Function] 1 EDITBM provides an easy-to-use interactive editing facility for various types of bitmaps. If BMSPEC is a bitmap, it is edited. If BMSPEC is an atom whose value is a bitmap, its value is edited. If BMSPEC is NIL, EDITBM asks for dimensions and creates a bitmap. If BMSPEC is a region, that portion of the screen bitmap is used. If BMSPEC is a window, it is brought to the top and its contents edited. 1 EDITBM sets up the bitmap being edited in an editing window. The editing window has two major areas: a gridded edit area in the lower part of the window and a display area in the upper left part. In the edit area, the left button will add points, the middle button will erase points. The right button provides access to the normal window commands to reposition and reshape the window. The actual size bitmap is shown in the display area. For example, the following is a picture of the bitmap editing window editing a eight-high by eighteen-wide bitmap: *~RsFuvmmqmmmv[bfwUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUTxDUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUTDxUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUTHDUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUTDUUUUUPUUUUUUUPUPUPªUUUUUPUUUUUUUPUPUPªUUUUUPUUUUUUUPUPUPªUUUUUPUUUUUUUPUPUPªUUUUUPUUUUUUUPUPUPªUUUUUPUUUUUUUPUPUPªUUUUUPUUUUUUUPUPUPªUUUUUPUUUUUUUPUPUPƪUPUPUPUUUPUUUPUPUPUPUUUPUUUPUPUPUPUUUPUUUPUPUPUPUUUPUUUPUPUPUPUUUPUUUPUPUPUPUUUPUUUPUPUPUPUUUPUUUPUPUPUPUUUPUUUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUUUUUUUPUPUPUPUPUUUUUUUPUPUPUPUPUUUUUUUPUPUPUPUPUUUUUUUPUPUPUPUPUUUUUUUPUPUPUPUPUUUUUUUPUPUPUPUPUUUUUUUPUPUPUPUPUUUUUUUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUPUUUUUPUPUPUPUPªUUUUUPUPUPUPUPªUUUUUPUPUPUPUPªUUUUUPUPUPUPUPªUUUUUPUPUPUPUPªUUUUUPUPUPUPUPªUUUUUPUPUPUPUPªUUUUUPUPUPUPUPƪ If the bitmap is too large to fit in the edit area, only a portion will be editable. This portion can be changed by scrolling both up and down in the left margin and left and right in the bottom margin. Pressing the middle button while in the display area will bring up a menu that allows global placement of the portion of the bitmap being edited. To allow more of the bitmap to be editing at once, the window can be reshaped to make it larger or the GridSize_ command described below can be used to reduce the size of a bit in the edit area. The bitmap editing window can be reshaped to provide more or less room for editing. When this happens, the space allocated to the editing area will be changed to fit in the new region. Whenever the left or middle button is down and the cursor is not in the edit area, the section of the display of the bitmap that is currently in the edit area is complemented. Pressing the left button while not in the edit region will put the lower left 16 x 16 section of the bitmap into the cursor for as long as the left button is held down. Pressing the middle button while not in either the edit area or the display area (i.e. while in the grey area in the upper right or in the title) will bring up a command menu. There are commands to stop editing, to restore the bitmap to its initial state and to clear the bitmap. Holding the middle button down over a command will result in an explanatory message being printed in the prompt window. The commands are described below: Paint Puts the current bitmap into a window and call the window PAINT command on it. The PAINT command implements drawing with various brush sizes and shapes but only on an actual sized bitmap. The PAINT mode is left by pressing the RIGHT button and selecting the QUIT command from the menu. At this point, you will be given a choice of whether or not the changes you made while in PAINT mode should be made to the current bitmap. ShowAsTile Tesselates the current bitmap in the upper part of the window. This is useful for determining how a bitmap will look if it were made the display background (using the function CHANGEBACKGROUND). Note: The tiled display will not automatically change as the bitmap changes; to update it, use the ShowAsTile command again. Grid,On/Off Turns the editing grid display on or off. GridSize_ Allows specification of the size of the editing grid. Another menu will appear giving a choice of several sizes. If one is selected, the editing portion of the bitmap editor will be redrawn using the selected grid size, allowing more or less of the bitmap to be edited without scrolling. The original size is chosen hueristically and is typically about 8. It is particularly useful when editing large bitmaps to set the edit grid size smaller than the original. Reset Sets all or part of the bitmap to the contents it had when EDITBM was called. Another menu will appear giving a choice between resetting the entire bitmap or just the portion that is in the edit area. The second menu also acts as a confirmation, since not selecting one of the choices on this menu results in no action being taken. Clear Sets all or part of the bitmap to 0. As with the Reset command, another menu gives a choice between clearing the entire bitmap or just the portion that is in the edit area. Cursor_ Sets the cursor to the lower left part of the bitmap. This prompts the user to specify the cursor "hot spot" (see ("HotSpot" . TERM)) by clicking in the lower left corner of the grid. OK Copies the changed image into the original bitmap, stops the bitmap editor and closes the edit windows. The changes the bitmap editor makes during the interaction occur on a copy of the original bitmap. Unless the bitmap editor is exited via OK, no changes are made in the original. Stop Stops the bitmap editor without making any changes to the original bitmap.  1()KKT/KT((. (((MODERN MODERN MODERN MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN F  IRM.GET.CREF* IRM.GET.CREF HRULE.GETFNMODERN *   HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN ( HRULE.GETFNMODERN   HRULE.GETFNMODERN 3 $</,_ HRULE.GETFNMODERN   HRULE.GETFNMODERN (2 HRULE.GETFNMODERN  HRULE.GETFNMODERN        HRULE.GETFNMODERN 1 HRULE.GETFNMODERN   ,   %      HRULE.GETFNMODERN    HRULE.GETFNMODERN  )  HRULE.GETFNMODERN   HRULE.GETFNMODERN 6  HRULE.GETFNMODERN  HRULE.GETFNMODERN X >/=@ HRULE.GETFNMODERN ( BMOBJ.GETFN3MODERN  SZ;is, g  + < 3wt IRM.GET.CREF4'Lqz 27.1.2 Regions 1 A Region denotes a rectangular area in a coordinate system. Regions are characterized by the coordinates of their bottom left corner and their width and height. A REGION is a record with fields LEFT, BOTTOM, WIDTH, and HEIGHT. It can be manipulated with the standard record package facilities. There are access functions for the REGION record that return the TOP and RIGHT of the region. The following functions are provided for manipulating regions: (CREATEREGION LEFT BOTTOM WIDTH HEIGHT) [Function] 1 Returns an instance of the REGION record which has LEFT, BOTTOM, WIDTH and HEIGHT as respectively its LEFT, BOTTOM, WIDTH, and HEIGHT fields. Example: (CREATEREGION 10 -20 100 200) will create a region that denotes a rectangle whose width is 100, whose height is 200, and whose lower left corner is at the position (10,-20). 1 (REGIONP X) [Function] 1 Returns X if X is a region, NIL otherwise. 1 (INTERSECTREGIONS REGION1 REGION2 ... REGIONn) [NoSpread Function] 1 Returns a region which is the intersection of a number of regions. Returns NIL if the intersection is empty. 1 (UNIONREGIONS REGION1 REGION2 ... REGIONn) [NoSpread Function] 1 Returns a region which is the union of a number of regions, i.e. the smallest region that contains all of them. Returns NIL if there are no regions given. 1 (REGIONSINTERSECTP REGION1 REGION2) [Function] 1 Returns T if REGION1 intersects REGION2. Returns NIL if they do not intersect. 1 (SUBREGIONP LARGEREGION SMALLREGION) [Function] 1 Returns T if SMALLREGION is a subregion (is equal to or entirely contained in) LARGEREGION; otherwise returns NIL. 1 (EXTENDREGION REGION INCLUDEREGION) [Function] 1 Changes (destructively modifies) the region REGION so that it includes the region INCLUDEREGION. It returns REGION. 1 (MAKEWITHINREGION REGION LIMITREGION) [Function] 1 Changes (destructively modifies) the left and bottom of the region REGION so that it is within the region LIMITREGION, if possible. If the dimension of REGION are larger than LIMITREGION, REGION is moved to the lower left of LIMITREGION. If LIMITREGION is NIL, the value of the variable WHOLEDISPLAY (the screen region) is used. MAKEWITHINREGION returns the modified REGION. 1 (INSIDEP REGION POSORX Y) [Function] 1 If POSORX and Y are numbers, it returns T if the point (POSORX,Y) is inside of REGION. If POSORX is a POSITION, it returns T if POSORX is inside of REGION. If REGION is a WINDOW, the window's interior region in window coordinates is used. Otherwise, it returns NIL. 1 )KKT/KT((. (((MODERN MODERN MODERN MODERN MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN j? HRULE.GETFNMODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN L HRULE.GETFNMODERN   HRULE.GETFNMODERN y  HRULE.GETFNMODERN  HRULE.GETFNMODERN    HRULE.GETFNMODERN   HRULE.GETFNMODERN  7  HRULE.GETFNMODERN  HRULE.GETFNMODERN ,   HRULE.GETFNMODERN  HRULE.GETFNMODERN C! $     HRULE.GETFNMODERN   HRULE.GETFNMODERN  U HRULE.GETFNMODERN ,z 27.1.1 Positions 1 A position denotes a point in an X,Y coordinate system. A POSITION is an instance of a record with fields XCOORD and YCOORD and is manipulated with the standard record package facilities. For example, (create POSITION XCOORD _ 10 YCOORD _ 20) creates a position representing the point (10,20). (POSITIONP X) [Function] 1 Returns X if X is a position; NIL otherwise. 1 ()KKT/KT(. (((MODERN MODERN MODERN MODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN ;(O)4  HRULE.GETFNMODERN   HRULE.GETFNMODERN ;%z 2 27.1 Primitive Graphics Concepts 1 The Interlisp-D graphics system is based on manipulating bitmaps (rectangular arrays of pixels), positions, regions, and textures. These objects are used by all of the graphics functions. (.((7((MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNMODERN # HRULE.GETFNMODERN ? z 27. GRAPHICS OUTPUT OPERATIONS 6 Streams are used as the basis for all I/O operations. Files are implemented as streams that can support character printing and reading operations, and file pointer manipulation. An image stream is a type of stream that also provides an interface for graphical operations. All of the operations that can applied to streams can be applied to image streams. For example, an image stream can be passed as the argument to PRINT, to print something on an image stream. In addition, special functions are provided to draw lines and curves and perform other graphical operations. Calling these functions on a stream that is not an image stream will generate an error. ((](.? PAGEHEADING DRAFTMESSAGE(MODERN MODERNMODERN ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))  HRULE.GETFNDz