idraw(1) InterViews Reference Manual idraw(1) NAME idraw - drawing editor SYNOPSIS idraw [_o_p_t_i_o_n_s] [_f_i_l_e] DESCRIPTION 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 landscape 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. ARGUMENTS In addition to the standard InterViews library options, _i_d_r_a_w also accepts the options listed below: -s Create a small view showing about one half of the 8.5x11 drawing area (the default). -l Create a large view showing the entire 8.5x11 drawing area. X DEFAULTS 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: history Set the maximum number of undoable changes InterViews Last change: 29 November 1989 1 idraw(1) InterViews Reference Manual idraw(1) (20 by default). initialfont Set which font will be the initial font when _i_d_r_a_w starts up. Give a number which identi- fies the font by its position in the Font menu starting from 1 for the first entry. font_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. initialbrush 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. brush_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 hexa- decimal 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 arrow- head, and either 0 or 1 to determine whether lines end in an arrowhead. If you give only the string ``none'', it defines the nonex- istent brush. For example, ``idraw.brush2:ffff 1 0 0'' defines a single pixel wide solid line without any arrowheads. initialpattern 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. pattern_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 bit- map, a 4x4 bitmap, a grayscale number, or the string ``none''. You specify the 16x16 bit- map 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 grayscale number InterViews Last change: 29 November 1989 2 idraw(1) InterViews Reference Manual idraw(1) with a single floating point number. The floating point number must contain a period to distinguish itself from the single hexade- cimal 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 grays- cale patterns appear as halftoned shades, and the ``none'' patterns never obscure any underlying graphics. For example, ``idraw.pattern8:8421'' defines a diagonally hatched pattern. initialfgcolor 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. fgcolor_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 sys- tem database of common colors only if you omit the intensities. You can define shades of gray by using equal proportions of each primary color. For example, ``idraw.fgcolor8:Indigo 48896 0 65280'' defines a color which is a mixture of red and blue. initialbgcolor 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. bgcolor_i Define a custom color to use for the _ith entry in the BgColor menu. The same rules apply to background colors 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 InterViews Last change: 29 November 1989 3 idraw(1) InterViews Reference Manual idraw(1) machine. They will always work in the printout, however. DRAWING TOOLS The drawing tools lie vertically along _i_d_r_a_w's left side. Select, Move, Scale, Stretch, Rotate, and Reshape manipulate existing graphics. Magnify makes a part of the view expand to fill the entire view. Text, Line, Multi Line, Open Spline, Ellipse, Rectangle, Polygon, and Closed Spline create 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: Select Select a graphic whether or not it's already selected and discard all other selections. If you hold down the shift key, Select retains the previous selections while includ- ing 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 rubberband 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 Select while the mouse is in the drawing area. Move Move graphics from one spot to another. _S_h_o_r_t_c_u_t: the middle mouse button invokes Move while the mouse is in the drawing area. Scale Scale graphics about their centers. Stretch Stretch graphics vertically or horizontally while tying down the opposite edge. Rotate Rotate graphics about their centers according to the angle between two radii: the one defined by the original clicking point and the one defined by the current dragging point. Reshape 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 InterViews Last change: 29 November 1989 4 idraw(1) InterViews Reference Manual idraw(1) keystrokes. You will terminate the mode when you use the mouse to do anything like pulling down a menu or reshaping another graphic. Magnify Magnify the part of the drawing specified by dragging a rectangle to fill the entire view. Idraw limits magnifications to powers of two between predefined minimum and maximum mag- nifications. Text 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 terminate the mode and create the text when you use the mouse to do anything. Line Create a line. The shift key constrains the line to lie on either the vertical or the horizontal axis. Multi Line Create a set of connected lines. The shift key constrains each segment to lie on either the vertical or the horizontal axis. Any button except the left mouse button ter- minates the line. Open Spline Create an open B-spline. The shift key con- strains 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. Ellipse Create an ellipse. The shift key constrains the ellipse to the shape of a circle. Rectangle Create a rectangle. The shift key constrains the rectangle to the shape of a square. Polygon 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. Closed Spline Create a closed B-spline. The shift key con- strains 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. InterViews Last change: 29 November 1989 5 idraw(1) InterViews Reference Manual idraw(1) PULLDOWN MENUS The pulldown menus File, Edit, Structure, Font, Brush, Pat- tern, FgColor, BgColor, Align, and Option lie across _i_d_r_a_w's top. They contain commands which you execute by pulling down the menu and releasing the mouse button on the command or by typing the character associated with the command. The File menu contains the following commands to operate on files: New Destroy the current drawing and replace it with an unnamed blank drawing. Revert Reread the current drawing, destroying any unsaved changes. Open... Pop up a FileChooser(3I) which you can use to browse the file system looking for an exist- ing drawing to open. Save As... Save the current drawing in a file whose name you type. Save Save the current drawing in the file it came from. Print... 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) appearing in the drawing area indicates the portion of the drawing that will appear on the printed page. The Edit menu contains the following commands to edit graph- ics: Undo Undo the last done change to the drawing. Successive Undo commands undo earlier and earlier changes back to the last stored change and then do nothing. Redo Redo the last undone change to the drawing. Successive Redo commands redo later and later changes up to the first change undone by Undo and then do nothing. Any new changes cause all undone changes to be forgotten. Cut Remove the selected graphics from the drawing and place them in a file called .clipboard in your home directory for later retrieval. Copy Copy the selected graphics into the InterViews Last change: 29 November 1989 6 idraw(1) InterViews Reference Manual idraw(1) clipboard. Paste Paste copies of the graphics in the clipboard into the drawing. Together, Cut, Copy, and Paste allow you to transfer graphics between multiple instantiations of _i_d_r_a_w simply by cutting graphics out of one view and pasting them into another. Duplicate Duplicate the selected graphics and add the copies to the drawing. Delete Destroy the selected graphics. Select All Select every graphic within the drawing. Flip Horizontal, Flip Vertical Flip the selected graphics into their mirror images along the horizontal or vertical axes. 90 Clockwise, 90 CounterCW Rotate the selected graphics 90 degrees clockwise or counterclockwise. Precise Move..., Precise Scale..., Precise Rotate... 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 Structure menu contains the following commands to modify the structure of the drawing, that is, the order in which graphics are drawn: Group Nest the selected graphics in a newly created picture. A picture is just a graphic which contains other graphics. Group allows you to build hierarchies of graphics. Ungroup Dissolve the selected pictures. Ungroup rev- erses a Group operation. Bring To Front 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. Send To Back Send the selected graphics to the back of the drawing so that they are drawn behind (before) the other graphics in the drawing. Number of Graphics InterViews Last change: 29 November 1989 7 idraw(1) 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. Select All followed by Number of Graphics counts the total number of graphics in the drawing. The Font 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 current font. The Brush 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 current brush. The Pattern 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 FgColor and BgColor 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 Align 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 idraw(1) InterViews Reference Manual idraw(1) The Option menu contains the following commands: Reduce Reduce the magnification by a factor of two so the drawing's size decreases by half. Enlarge Enlarge the magnification by a factor of two so the drawing's size doubles. Normal Size Set the magnification to unity so the drawing appears at actual size. Reduce to Fit Reduce the magnification until the drawing fits entirely within the view. Center Page Center the view over the center of the 8.5 by 11 inch page. Gridding on/off Toggle the grid's constraining effect on or off. When gridding is on, new graphics will use only grid points as their points, exist- ing graphics will move or scale only in grid-sized units, and so forth. Grid visible/invisible Toggle the grid's visibility on or off. When visibility is on, _i_d_r_a_w draws a grid of equally spaced points behind the drawing. Grid spacing... Change the grid spacing to a value (in units of printers' points of which there are 72.07 to an inch) that you type in a dialog box. Orientation 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. FILES ~/.clipboard clipboard file for copy, cut, and paste SEE ALSO FileChooser(3I), Panner(3I), World(3I) BUGS _I_d_r_a_w allows you to enter the grid spacing only in units of 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 9