InterViews Reference Manual idraw(1) NNAAMMEE idraw - drawing editor SSYYNNOOPPSSIISS iiddrraaww [_o_p_t_i_o_n_s] [_f_i_l_e] DDEESSCCRRIIPPTTIIOONN You can use _i_d_r_a_w to create and edit drawings containing graphics like text, lines, splines, rectangles, polygons, and ellipses. Drawings are stored in files that can be printed on a PostScript printer. You can can open an exist- ing drawing when starting up _i_d_r_a_w by typing a filename on the command line. The editor displays a portrait or land- scape view of an 8.5 by 11 inch page with a set of tools on the left side of the view and a set of pulldown menus along the top of the view. The panner, a box in _i_d_r_a_w's lower left corner containing four arrows, two buttons, and a slider, allows you to pan and zoom the view of the drawing. AARRGGUUMMEENNTTSS In addition to the standard InterViews library options, _i_d_r_a_w also accepts the options listed below: --ss Create a small view showing about one half of the 8.5x11 drawing area (the default). --ll Create a large view showing the entire 8.5x11 drawing area. XX DDEEFFAAUULLTTSS You can customize the number of undoable changes and the font, brush, pattern, or color menus by setting resources in your X defaults database. Each string of the form ``idraw.resource:definition'' sets a resource. If you want to customize any of the paint menus, you set a resource given by the concatenation of the menu's name and the entry's number, such as ``idraw.pattern8'', for each entry that you want to override. All menus use the number 1 for the first entry. You have to set resources only for the entries that you want to override, not all of them. If you want to add entries to the menus, you simply set resources for them, but don't skip any numbers after the end of the menu because the menu will stop growing at the first unde- fined resource it finds. If you want to shorten a menu instead of extending it, defining a blank string as the resource for an entry will truncate the menu before that entry. _I_d_r_a_w understands the following resources: hhiissttoorryy InterViews Last change: 29 November 1989 1 InterViews Reference Manual idraw(1) Set the maximum number of undoable changes (20 by default). iinniittiiaallffoonntt Set which font will be the initial font when _i_d_r_a_w starts up. Give a number which identifies the font by its position in the Font menu starting from 1 for the first entry. ffoonntt_i Define a custom font to use for the _ith entry in the Font menu. Give three strings separated by whitespace. The first string defines the font's name, the second string the corresponding print font, and the third string the print size. For example, ``idraw.font3:8x13bold Courier-Bold 13'' defines the third font entry. iinniittiiaallbbrruusshh Set which brush will be the initial brush when _i_d_r_a_w starts up. Give a number which identifies the brush by its position in the Brush menu starting from 1 for the first entry. bbrruusshh_i Define a custom brush to use for the _ith entry in the Brush menu. You usually give two numbers and two booleans: a 16-bit hexadecimal number to define the brush's line style (each 1 bit draws a dash and each 0 bit a gap), a decimal integer to define the brush's width in pixels, either 0 or 1 to determine whether lines start from an arrowhead, and either 0 or 1 to determine whether lines end in an arrowhead. If you give only the string ``none'', it defines the nonexis- tent brush. For example, ``idraw.brush2:ffff 1 0 0'' defines a single pixel wide solid line without any arrowheads. iinniittiiaallppaatttteerrnn Set which pattern will be the initial pattern when _i_d_r_a_w starts up. Give a number which identifies the pattern by its position in the Pattern menu starting from 1 for the first entry. ppaatttteerrnn_i Define a custom pattern to use for the _ith entry in the Pattern menu. You can specify the pattern from a 16x16 bitmap, a 8x8 bitmap, a 4x4 bitmap, a grayscale number, or the string ``none''. You specify the 16x16 bitmap with sixteen 16-bit hexadecimal numbers, the 8x8 bitmap with eight 8-bit hexadecimal numbers, the 4x4 bitmap with a single 16-bit hexadecimal number, and the InterViews Last change: 29 November 1989 2 InterViews Reference Manual idraw(1) grayscale number with a single floating point number. The floating point number must contain a period to dis- tinguish itself from the single hexadecimal number and lie between 0.0 and 1.0, where 0.0 corresponds to a solid pattern and 1.0 to a clear pattern. On the printer, the bitmap patterns appear as bitmaps, the grayscale patterns appear as halftoned shades, and the ``none'' patterns never obscure any underlying graph- ics. For example, ``idraw.pattern8:8421'' defines a diagonally hatched pattern. iinniittiiaallffggccoolloorr Set which foreground color will be selected when _i_d_r_a_w starts up. Give a number which identifies the color by its position in the FgColor menu starting from 1 for the first entry. ffggccoolloorr_i Define a custom color to use for the _ith entry in the FgColor menu. Give a string defining the name of the color and optionally three decimal numbers between 0 and 65535 following the name to define the red, green, and blue components of the color's intensity. The intensities override the name; that is, idraw will look the name up in a window system database of common col- ors only if you omit the intensities. You can define shades of gray by using equal proportions of each pri- mary color. For example, ``idraw.fgcolor8:Indigo 48896 0 65280'' defines a color which is a mixture of red and blue. iinniittiiaallbbggccoolloorr Set which background color will be selected when _i_d_r_a_w starts up. Give a number which identifies the color by its position in the BgColor menu starting from 1 for the first entry. bbggccoolloorr_i Define a custom color to use for the _ith entry in the BgColor menu. The same rules apply to background col- ors as to foreground colors. Other users can edit drawings that you make with custom fonts, brushes, patterns, or colors because _i_d_r_a_w stores their definitions with the drawing and recreates them when it reads the drawing back in. However, not all definitions work across all machines. Thick or dashed brushes that work on one machine, for example, may become invisible on another machine. They will always work in the printout, however. DDRRAAWWIINNGG TTOOOOLLSS The drawing tools lie vertically along _i_d_r_a_w's left side. InterViews Last change: 29 November 1989 3 InterViews Reference Manual idraw(1) SSeelleecctt, MMoovvee, SSccaallee, SSttrreettcchh, RRoottaattee, and RReesshhaappee manipulate existing graphics. MMaaggnniiffyy makes a part of the view expand to fill the entire view. TTeexxtt, LLiinnee, MMuullttii LLiinnee, OOppeenn SSpplliinnee, EElllliippssee, RReeccttaannggllee, PPoollyyggoonn, and CClloosseedd SSpplliinnee cre- ate new graphics. The shift key will constrain the last group of drawing tools if you press it at the _s_a_m_e time you click the mouse to begin drawing. You can set the current drawing tool by clicking on it or typing its associated character. The current drawing tool highlights itself with inverted colors. Clicking the left mouse button in the drawing area invokes the current drawing tool. _I_d_r_a_w pro- vides the following drawing tools: SSeelleecctt Select a graphic whether or not it's already selected and discard all other selections. If you hold down the shift key, SSeelleecctt retains the previous selections while including an unselected graphic or excluding a selected graphic. If you press the button outside any graphic, you can clear all of the selections or drag a rubber- band rectangle around a group of graphics to select all of them together. _S_h_o_r_t_c_u_t_: the right mouse button invokes SSeelleecctt while the mouse is in the drawing area. MMoovvee Move graphics from one spot to another. _S_h_o_r_t_c_u_t_: the middle mouse button invokes MMoovvee while the mouse is in the drawing area. SSccaallee Scale graphics about their centers. SSttrreettcchh Stretch graphics vertically or horizontally while tying down the opposite edge. RRoottaattee Rotate graphics about their centers according to the angle between two radii: the one defined by the origi- nal clicking point and the one defined by the current dragging point. RReesshhaappee Move one of a graphic's points and reshape the graphic accordingly. Nothing happens when you try to reshape an ellipse or circle because they don't have any points suitable for dragging. When you try to reshape some text, you will enter a text editing mode where you can change the text with emacs-like keystrokes. You will terminate the mode when you use the mouse to do any- thing like pulling down a menu or reshaping another graphic. InterViews Last change: 29 November 1989 4 InterViews Reference Manual idraw(1) MMaaggnniiffyy Magnify the part of the drawing specified by dragging a rectangle to fill the entire view. IIddrraaww limits magni- fications to powers of two between predefined minimum and maximum magnifications. TTeexxtt Create some text. You click where you want to put the first line's upper left corner and then type as much text as you want. You may use emacs-style keystrokes to edit the text as well as enter it. You will termi- nate the mode and create the text when you use the mouse to do anything. LLiinnee Create a line. The shift key constrains the line to lie on either the vertical or the horizontal axis. MMuullttii LLiinnee Create a set of connected lines. The shift key con- strains each segment to lie on either the vertical or the horizontal axis. Any button except the left mouse button terminates the line. OOppeenn SSpplliinnee Create an open B-spline. The shift key constrains each control point to lie on either the vertical or the hor- izontal axis with the preceding point. Any button except the left mouse button terminates the spline. EElllliippssee Create an ellipse. The shift key constrains the ellipse to the shape of a circle. RReeccttaannggllee Create a rectangle. The shift key constrains the rect- angle to the shape of a square. PPoollyyggoonn Create a polygon. The shift key constrains each side to lie on either the vertical or the horizontal axis. Any button except the left mouse button terminates the polygon. CClloosseedd SSpplliinnee Create a closed B-spline. The shift key constrains each control point to lie on either the vertical or the horizontal axis with the preceding point. Any button except the left mouse button terminates the spline. PPUULLLLDDOOWWNN MMEENNUUSS The pulldown menus FFiillee, EEddiitt, SSttrruuccttuurree, FFoonntt, BBrruusshh, PPaatt-- tteerrnn, FFggCCoolloorr, BBggCCoolloorr, AAlliiggnn, and OOppttiioonn lie across _i_d_r_a_w's top. They contain commands which you execute by pulling InterViews Last change: 29 November 1989 5 InterViews Reference Manual idraw(1) down the menu and releasing the mouse button on the command or by typing the character associated with the command. The FFiillee menu contains the following commands to operate on files: NNeeww Destroy the current drawing and replace it with an unnamed blank drawing. RReevveerrtt Reread the current drawing, destroying any unsaved changes. OOppeenn...... Pop up a FileChooser(3I) which you can use to browse the file system looking for an existing drawing to open. SSaavvee AAss...... Save the current drawing in a file whose name you type. SSaavvee Save the current drawing in the file it came from. PPrriinntt...... Print the current drawing by sending it through a pipe to a command which you type, such as ``lpr.'' The bold rectangular outline (called the _p_a_g_e _b_o_u_n_d_a_r_y) appear- ing in the drawing area indicates the portion of the drawing that will appear on the printed page. The EEddiitt menu contains the following commands to edit graph- ics: UUnnddoo Undo the last done change to the drawing. Successive UUnnddoo commands undo earlier and earlier changes back to the last stored change and then do nothing. RReeddoo Redo the last undone change to the drawing. Successive RReeddoo commands redo later and later changes up to the first change undone by UUnnddoo and then do nothing. Any new changes cause all undone changes to be forgotten. CCuutt Remove the selected graphics from the drawing and place them in a file called ..cclliippbbooaarrdd in your home directory for later retrieval. CCooppyy Copy the selected graphics into the clipboard. PPaassttee Paste copies of the graphics in the clipboard into the drawing. Together, CCuutt, CCooppyy, and PPaassttee allow you to transfer graphics between multiple instantiations of InterViews Last change: 29 November 1989 6 InterViews Reference Manual idraw(1) _i_d_r_a_w simply by cutting graphics out of one view and pasting them into another. DDuupplliiccaattee Duplicate the selected graphics and add the copies to the drawing. DDeelleettee Destroy the selected graphics. SSeelleecctt AAllll Select every graphic within the drawing. FFlliipp HHoorriizzoonnttaall, FFlliipp VVeerrttiiccaall Flip the selected graphics into their mirror images along the horizontal or vertical axes. 9900 CClloocckkwwiissee, 9900 CCoouunntteerrCCWW Rotate the selected graphics 90 degrees clockwise or counterclockwise. PPrreecciissee MMoovvee......, PPrreecciissee SSccaallee......, PPrreecciissee RRoottaattee...... Move, scale, or rotate graphics by exact amounts which you type in a dialog box. You type movements in units of screen pixels, scalings in terms of magnifications along the axes, and rotations in degrees. The SSttrruuccttuurree menu contains the following commands to modify the structure of the drawing, that is, the order in which graphics are drawn: GGrroouupp Nest the selected graphics in a newly created picture. A picture is just a graphic which contains other graph- ics. GGrroouupp allows you to build hierarchies of graph- ics. UUnnggrroouupp Dissolve the selected pictures. UUnnggrroouupp reverses a GGrroouupp operation. BBrriinngg TToo FFrroonntt Bring the selected graphics to the front of the drawing so that they are drawn on top of (after) the other graphics in the drawing. SSeenndd TToo BBaacckk Send the selected graphics to the back of the drawing so that they are drawn behind (before) the other graph- ics in the drawing. NNuummbbeerr ooff GGrraapphhiiccss InterViews Last change: 29 November 1989 7 InterViews Reference Manual idraw(1) Count and display in a popup window the number of selected graphics, recursively adding the number of graphics nested inside pictures among the selected graphics. SSeelleecctt AAllll followed by NNuummbbeerr ooff GGrraapphhiiccss counts the total number of graphics in the drawing. The FFoonntt menu contains a set of fonts with which to print text. When you set the current font from the menu, you will also set all the selected graphics' fonts to that font. A font indicator in the upper right corner displays the cur- rent font. The BBrruusshh menu contains a set of brushes with which to draw lines. When you set the current brush from the menu, you will also set all the selected graphics' brushes to that brush. The nonexistent brush draws invisible lines and nonoutlined graphics. The arrowhead brushes add arrowheads to lines', multi lines', and open splines' starting point, ending point, or both. You can freely stretch or scale these graphics without affecting the arrowheads' size. A brush indicator in the upper left corner displays the cur- rent brush. The PPaatttteerrnn menu contains a set of patterns with which to fill graphics but not text. Text always appears solid but you can use a different color than black to get a halftoned shade. When you set the current pattern from the menu, you will also set all the selected graphics' patterns to that pattern. The nonexistent pattern draws unfilled graphics while the other patterns draw graphics filled with a bitmap or a halftoned shade. The FFggCCoolloorr and BBggCCoolloorr menus contains a set of colors with which to draw graphics and text. When you set the current foreground or background color from the FgColor or BgColor menu, you will also set all the selected graphics' fore- ground or background colors. The ``on'' bits in the bitmaps for dashed lines and fill patterns appear in the foreground color while the ``off'' bits appear in the background color. A black and white printer will print a halftoned shade of gray for any color other than black or white. The brush, pattern, and font indicators all reflect the current colors. The AAlliiggnn menu contains commands to align graphics with other graphics. The first graphic selected stays fixed while the other graphics move in the order they were selected according to the type of alignment chosen. The last Align command, Align To Grid, aligns each selected graphic's lower left corner with the nearest point in a grid of points spaced every 8 printer's points (one ninth of an inch). InterViews Last change: 29 November 1989 8 InterViews Reference Manual idraw(1) The OOppttiioonn menu contains the following commands: RReedduuccee Reduce the magnification by a factor of two so the drawing's size decreases by half. EEnnllaarrggee Enlarge the magnification by a factor of two so the drawing's size doubles. NNoorrmmaall SSiizzee Set the magnification to unity so the drawing appears at actual size. RReedduuccee ttoo FFiitt Reduce the magnification until the drawing fits entirely within the view. CCeenntteerr PPaaggee Center the view over the center of the 8.5 by 11 inch page. GGrriiddddiinngg oonn//ooffff Toggle the grid's constraining effect on or off. When gridding is on, new graphics will use only grid points as their points, existing graphics will move or scale only in grid-sized units, and so forth. GGrriidd vviissiibbllee//iinnvviissiibbllee Toggle the grid's visibility on or off. When visibil- ity is on, _i_d_r_a_w draws a grid of equally spaced points behind the drawing. GGrriidd ssppaacciinngg...... Change the grid spacing to a value (in units of print- ers' points of which there are 72.07 to an inch) that you type in a dialog box. OOrriieennttaattiioonn Toggle the drawing's orientation. If the editor was formerly showing a portrait view of the drawing, it will now show a landscape view of the drawing and vice versa. FFIILLEESS ~/.clipboard clipboard file for copy, cut, and paste SSEEEE AALLSSOO FileChooser(3I), Panner(3I), World(3I) BBUUGGSS _I_d_r_a_w allows you to enter the grid spacing only in units of InterViews Last change: 29 November 1989 9 InterViews Reference Manual idraw(1) printers' points. It should allow you to enter the grid spacing in units of pixels if you want the grid points to coincidence with pixels, avoiding the problems with an unevenly spaced grid. InterViews Last change: 29 November 1989 10