Home » Archimedes archive » Acorn User » AU 1997-10 A.adf » Extras » Apple][e/PD/BOB/ARMBOB/doc/Draw
Apple][e/PD/BOB/ARMBOB/doc/Draw
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn User » AU 1997-10 A.adf » Extras |
Filename: | Apple][e/PD/BOB/ARMBOB/doc/Draw |
Read OK: | ✔ |
File size: | 1C6A bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
Manual for the Armbob 2.1 draw library -------------------------------------- GCW 29/12/94 Joe Taylor's DrawBasic package (Liber Abaci 1994) is a procedure library for BBC Basic to facilitate the construction of DrawFiles under program control. The Armbob draw library is intended for the same purpose, but cannot claim to offer the same range of facilities. This has been developed as an experiment in using Armbob's object-oriented features. It provides a basic platform for others to develop further. Of necessity it strongly resembles DrawBasic, except with an Armbob syntax rather than a Basic syntax. Armbob does not have Basic's LIBRARY command. Instead one uses BobProj or BobPTask files to list the library files and the main program file to be compiled and run together. See the BobProj file Bob:DrawEx which contains the lines bob:h.draw.object bob:h.draw.file bob:h.draw.figure bob:main.drawex The first three lines are just a standard "header" for using the draw library. The file named in the last line is the one to look at to see an example of how the draw library is used. The file bob:h.draw.object defines the low level class of "objects" and their methods. None of the definitions in this file should be used in your programs explictly. An object is essentially an array of bytes structured in some way. The file bob:h.draw.file defines the class of "drawfiles", using the low level notion of "object". Only some of the definitions in this file should be used in your programs explicitly. This note documents them. The file bob:h.draw.figure uses only definitions in bob:h.draw.file. It is intended for definitions of geometrical subpath objects (see below), represented as drawfile methods. As a starter, it contains only the drawfile methods drawfile::circle(x,y,r) Draw a circle, centre (x,y), radius r. drawfile::ellipse(x,y,a,b) Draw an ellipse, centre (x,y), with horizontal semi-axis of length a, and vertical semi-axis of length b. All units are in points - (1/72)". Glossary -------- To create a new drawfile, called MyDrawFile, say, use the command MyDrawFile = new drawfile; Drawfiles contain 1) a header, and 2) a list of "draw objects". These must be created in order. The command MyDrawFile->begin(); creates the header. At present the only draw objects permitted in Armbob are: 1) text objects 2) path objects 3) group objects Text ---- A text object is created and named by a command of the form MyTextObject = MyDrawFile->text(string,x,y); Here 'string' is a string expression, and (x,y) is the position where the bottom left of the string will placed. Text objects have various attributes that can be altered from their default values. colour ------ The default colour for text is black. The command colour(MyTextObject,c); will set the text colour of MyTextObject to c. Colours can have values in the range 0-15 (click on the palette icon to see which they are), and the following synonyms are predefined: white = 0; black = 7; blue = 8; yellow = 9; green = 10; red = 11; cream = 12; olive = 13; orange = 14; azure = 15; font ---- The default font is the system font. Other fonts may be used using the command font(MyTextObject,f); where f can take values 0-12. The following synonyms are predefined: System = 0; Trinity_Medium = 1; Trinity_Medium_Italic = 2; Trinity_Bold = 3; Trinity_Bold_Italic = 4; Corpus_Medium = 5; Corpus_Medium_Oblique = 6; Corpus_Bold = 7; Corpus_Bold_Oblique = 8; Homerton_Medium = 9; Homerton_Medium_Oblique = 10; Homerton_Bold = 11; Homerton_Bold_Oblique = 12; font size --------- The default font size is 10 point. The font size can be modified horizontally and vertically independently with commands: MyDrawFile->font_x(MyTextObject,pts_x); MyDrawFile->font_y(MyTextObject,pts_y); where pts_x and pts_y are the horizontal and vertical font sizes in points. Note that modifying the font size uses a drawfile method, rather than a straightforward function. This is because altering the font size might alter the bounding box for the whole drawfile. Paths ----- A path consists of 1) a header and 2) a sequence of subpaths. These must be created in order. To create the header of a path called MyPath use the command MyPath = MyDrawFile->path(); This must be followed by at least one subpath. Each subpath begins with a command MyDrawFile->move(x,y); and is followed by a sequence of commands either of the same form or of the form MyDrawFile->draw(x,y); or MyDrawFile->bezier(x1,y1,x2,y2,x3,y3); and optionally terminated by a command MyDrawFile->close_with_line(); Of course, a sequence of such commands may be bundled up into a function or a drawfile method (see the file bob:h.draw.figure). The path is terminated by the command MyDrawFile->endpath(MyPath); Path objects have various attributes that can be altered from their default values. Fill colour ----------- The default fill colour is none. This can be altered with fill(MyPath,c); where c is a colour (see above). The value c = none = -1 gives a transparent fill colour. Outline colour -------------- The default colour is black. This can be altered with outline(MyPath,c); where c is a colour (see above). The value c = none = -1 gives a transparent fill colour. Linewidth --------- The default is one point. This can be altered with linewidth(MyPath,n); where n is the number of points. Join style ---------- The default is mitred joins. This can be altered with join_style(MyPath,x); where x can be Mitred, Round or Bevelled. Cap style ------------ The default is butt caps. Endcaps can be altered with endcap_style(MyPath,x); and startcaps can be altered with startcap_style(MyPath,x); where x can be Butt, Round or Square. Winding Rule ------------ The default winding rule is Non_Zero. This can be altered with winding_rule(MyPath,rule); where rule is Non_Zero or Even_Odd. Groups ------ A group consists of a header followed by a sequence of drawfile objects, i.e. text, path or group objects. The header is created by a command of the form MyGroup = MyDrawFile->group(); and the sequence of drawfile objects that comprise the group must be terminated by the command MyDrawFile->endgroup(MyGroup); Finally, a drawfile is saved to a file and displayed with the command MyDrawFile->end(file); It is quite permissible to define many drawfiles at once in the same program, with the commands for creating them interleaved however one wishes. Only the relative ordering of the commands for a given drawfile are important. The MyDrawFile-> prefix sorts out which commands apply to MyDrawFile.
00000000 20 20 20 20 20 20 20 20 20 4d 61 6e 75 61 6c 20 | Manual | 00000010 66 6f 72 20 74 68 65 20 41 72 6d 62 6f 62 20 32 |for the Armbob 2| 00000020 2e 31 20 64 72 61 77 20 6c 69 62 72 61 72 79 0a |.1 draw library.| 00000030 20 20 20 20 20 20 20 20 20 2d 2d 2d 2d 2d 2d 2d | -------| 00000040 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00000050 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |---------------.| 00000060 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00000070 20 20 20 20 20 20 20 20 20 20 47 43 57 20 32 39 | GCW 29| 00000080 2f 31 32 2f 39 34 0a 0a 4a 6f 65 20 54 61 79 6c |/12/94..Joe Tayl| 00000090 6f 72 27 73 20 44 72 61 77 42 61 73 69 63 20 70 |or's DrawBasic p| 000000a0 61 63 6b 61 67 65 20 28 4c 69 62 65 72 20 41 62 |ackage (Liber Ab| 000000b0 61 63 69 20 31 39 39 34 29 20 69 73 20 61 20 70 |aci 1994) is a p| 000000c0 72 6f 63 65 64 75 72 65 0a 6c 69 62 72 61 72 79 |rocedure.library| 000000d0 20 66 6f 72 20 42 42 43 20 42 61 73 69 63 20 74 | for BBC Basic t| 000000e0 6f 20 66 61 63 69 6c 69 74 61 74 65 20 74 68 65 |o facilitate the| 000000f0 20 63 6f 6e 73 74 72 75 63 74 69 6f 6e 20 6f 66 | construction of| 00000100 20 44 72 61 77 46 69 6c 65 73 0a 75 6e 64 65 72 | DrawFiles.under| 00000110 20 70 72 6f 67 72 61 6d 20 63 6f 6e 74 72 6f 6c | program control| 00000120 2e 20 54 68 65 20 41 72 6d 62 6f 62 20 64 72 61 |. The Armbob dra| 00000130 77 20 6c 69 62 72 61 72 79 20 69 73 20 69 6e 74 |w library is int| 00000140 65 6e 64 65 64 20 66 6f 72 20 74 68 65 0a 73 61 |ended for the.sa| 00000150 6d 65 20 70 75 72 70 6f 73 65 2c 20 62 75 74 20 |me purpose, but | 00000160 63 61 6e 6e 6f 74 20 63 6c 61 69 6d 20 74 6f 20 |cannot claim to | 00000170 6f 66 66 65 72 20 74 68 65 20 73 61 6d 65 20 72 |offer the same r| 00000180 61 6e 67 65 20 6f 66 20 66 61 63 69 6c 69 74 69 |ange of faciliti| 00000190 65 73 2e 0a 54 68 69 73 20 68 61 73 20 62 65 65 |es..This has bee| 000001a0 6e 20 64 65 76 65 6c 6f 70 65 64 20 61 73 20 61 |n developed as a| 000001b0 6e 20 65 78 70 65 72 69 6d 65 6e 74 20 69 6e 20 |n experiment in | 000001c0 75 73 69 6e 67 20 41 72 6d 62 6f 62 27 73 20 6f |using Armbob's o| 000001d0 62 6a 65 63 74 2d 6f 72 69 65 6e 74 65 64 0a 66 |bject-oriented.f| 000001e0 65 61 74 75 72 65 73 2e 20 49 74 20 70 72 6f 76 |eatures. It prov| 000001f0 69 64 65 73 20 61 20 62 61 73 69 63 20 70 6c 61 |ides a basic pla| 00000200 74 66 6f 72 6d 20 66 6f 72 20 6f 74 68 65 72 73 |tform for others| 00000210 20 74 6f 20 64 65 76 65 6c 6f 70 20 66 75 72 74 | to develop furt| 00000220 68 65 72 2e 20 0a 4f 66 20 6e 65 63 65 73 73 69 |her. .Of necessi| 00000230 74 79 20 69 74 20 73 74 72 6f 6e 67 6c 79 20 72 |ty it strongly r| 00000240 65 73 65 6d 62 6c 65 73 20 44 72 61 77 42 61 73 |esembles DrawBas| 00000250 69 63 2c 20 65 78 63 65 70 74 20 77 69 74 68 20 |ic, except with | 00000260 61 6e 20 41 72 6d 62 6f 62 20 0a 73 79 6e 74 61 |an Armbob .synta| 00000270 78 20 72 61 74 68 65 72 20 74 68 61 6e 20 61 20 |x rather than a | 00000280 42 61 73 69 63 20 73 79 6e 74 61 78 2e 0a 0a 41 |Basic syntax...A| 00000290 72 6d 62 6f 62 20 64 6f 65 73 20 6e 6f 74 20 68 |rmbob does not h| 000002a0 61 76 65 20 42 61 73 69 63 27 73 20 4c 49 42 52 |ave Basic's LIBR| 000002b0 41 52 59 20 63 6f 6d 6d 61 6e 64 2e 20 49 6e 73 |ARY command. Ins| 000002c0 74 65 61 64 20 6f 6e 65 20 75 73 65 73 20 42 6f |tead one uses Bo| 000002d0 62 50 72 6f 6a 0a 6f 72 20 42 6f 62 50 54 61 73 |bProj.or BobPTas| 000002e0 6b 20 66 69 6c 65 73 20 74 6f 20 6c 69 73 74 20 |k files to list | 000002f0 74 68 65 20 6c 69 62 72 61 72 79 20 66 69 6c 65 |the library file| 00000300 73 20 61 6e 64 20 74 68 65 20 6d 61 69 6e 20 70 |s and the main p| 00000310 72 6f 67 72 61 6d 20 66 69 6c 65 0a 74 6f 20 62 |rogram file.to b| 00000320 65 20 63 6f 6d 70 69 6c 65 64 20 61 6e 64 20 72 |e compiled and r| 00000330 75 6e 20 74 6f 67 65 74 68 65 72 2e 20 53 65 65 |un together. See| 00000340 20 74 68 65 20 42 6f 62 50 72 6f 6a 20 66 69 6c | the BobProj fil| 00000350 65 20 42 6f 62 3a 44 72 61 77 45 78 20 77 68 69 |e Bob:DrawEx whi| 00000360 63 68 0a 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 |ch.contains the | 00000370 6c 69 6e 65 73 0a 0a 62 6f 62 3a 68 2e 64 72 61 |lines..bob:h.dra| 00000380 77 2e 6f 62 6a 65 63 74 0a 62 6f 62 3a 68 2e 64 |w.object.bob:h.d| 00000390 72 61 77 2e 66 69 6c 65 0a 62 6f 62 3a 68 2e 64 |raw.file.bob:h.d| 000003a0 72 61 77 2e 66 69 67 75 72 65 0a 62 6f 62 3a 6d |raw.figure.bob:m| 000003b0 61 69 6e 2e 64 72 61 77 65 78 0a 0a 54 68 65 20 |ain.drawex..The | 000003c0 66 69 72 73 74 20 74 68 72 65 65 20 6c 69 6e 65 |first three line| 000003d0 73 20 61 72 65 20 6a 75 73 74 20 61 20 73 74 61 |s are just a sta| 000003e0 6e 64 61 72 64 20 22 68 65 61 64 65 72 22 20 66 |ndard "header" f| 000003f0 6f 72 20 75 73 69 6e 67 20 74 68 65 20 64 72 61 |or using the dra| 00000400 77 0a 6c 69 62 72 61 72 79 2e 20 54 68 65 20 66 |w.library. The f| 00000410 69 6c 65 20 6e 61 6d 65 64 20 69 6e 20 74 68 65 |ile named in the| 00000420 20 6c 61 73 74 20 6c 69 6e 65 20 69 73 20 74 68 | last line is th| 00000430 65 20 6f 6e 65 20 74 6f 20 6c 6f 6f 6b 20 61 74 |e one to look at| 00000440 20 74 6f 20 73 65 65 0a 61 6e 20 65 78 61 6d 70 | to see.an examp| 00000450 6c 65 20 6f 66 20 68 6f 77 20 74 68 65 20 64 72 |le of how the dr| 00000460 61 77 20 6c 69 62 72 61 72 79 20 69 73 20 75 73 |aw library is us| 00000470 65 64 2e 0a 0a 54 68 65 20 66 69 6c 65 20 62 6f |ed...The file bo| 00000480 62 3a 68 2e 64 72 61 77 2e 6f 62 6a 65 63 74 20 |b:h.draw.object | 00000490 64 65 66 69 6e 65 73 20 74 68 65 20 6c 6f 77 20 |defines the low | 000004a0 6c 65 76 65 6c 20 63 6c 61 73 73 20 6f 66 20 22 |level class of "| 000004b0 6f 62 6a 65 63 74 73 22 20 61 6e 64 20 0a 74 68 |objects" and .th| 000004c0 65 69 72 20 6d 65 74 68 6f 64 73 2e 20 4e 6f 6e |eir methods. Non| 000004d0 65 20 6f 66 20 74 68 65 20 64 65 66 69 6e 69 74 |e of the definit| 000004e0 69 6f 6e 73 20 69 6e 20 74 68 69 73 20 66 69 6c |ions in this fil| 000004f0 65 20 73 68 6f 75 6c 64 20 62 65 20 75 73 65 64 |e should be used| 00000500 20 0a 69 6e 20 79 6f 75 72 20 70 72 6f 67 72 61 | .in your progra| 00000510 6d 73 20 65 78 70 6c 69 63 74 6c 79 2e 20 41 6e |ms explictly. An| 00000520 20 6f 62 6a 65 63 74 20 69 73 20 65 73 73 65 6e | object is essen| 00000530 74 69 61 6c 6c 79 20 61 6e 20 61 72 72 61 79 20 |tially an array | 00000540 6f 66 20 62 79 74 65 73 0a 73 74 72 75 63 74 75 |of bytes.structu| 00000550 72 65 64 20 69 6e 20 73 6f 6d 65 20 77 61 79 2e |red in some way.| 00000560 20 20 0a 0a 54 68 65 20 66 69 6c 65 20 62 6f 62 | ..The file bob| 00000570 3a 68 2e 64 72 61 77 2e 66 69 6c 65 20 64 65 66 |:h.draw.file def| 00000580 69 6e 65 73 20 74 68 65 20 63 6c 61 73 73 20 6f |ines the class o| 00000590 66 20 22 64 72 61 77 66 69 6c 65 73 22 2c 20 75 |f "drawfiles", u| 000005a0 73 69 6e 67 20 74 68 65 20 6c 6f 77 0a 6c 65 76 |sing the low.lev| 000005b0 65 6c 20 6e 6f 74 69 6f 6e 20 6f 66 20 22 6f 62 |el notion of "ob| 000005c0 6a 65 63 74 22 2e 20 4f 6e 6c 79 20 73 6f 6d 65 |ject". Only some| 000005d0 20 6f 66 20 74 68 65 20 64 65 66 69 6e 69 74 69 | of the definiti| 000005e0 6f 6e 73 20 69 6e 20 74 68 69 73 20 66 69 6c 65 |ons in this file| 000005f0 0a 73 68 6f 75 6c 64 20 62 65 20 75 73 65 64 20 |.should be used | 00000600 69 6e 20 79 6f 75 72 20 70 72 6f 67 72 61 6d 73 |in your programs| 00000610 20 65 78 70 6c 69 63 69 74 6c 79 2e 20 54 68 69 | explicitly. Thi| 00000620 73 20 6e 6f 74 65 20 64 6f 63 75 6d 65 6e 74 73 |s note documents| 00000630 20 74 68 65 6d 2e 0a 0a 54 68 65 20 66 69 6c 65 | them...The file| 00000640 20 62 6f 62 3a 68 2e 64 72 61 77 2e 66 69 67 75 | bob:h.draw.figu| 00000650 72 65 20 75 73 65 73 20 6f 6e 6c 79 20 64 65 66 |re uses only def| 00000660 69 6e 69 74 69 6f 6e 73 20 69 6e 20 62 6f 62 3a |initions in bob:| 00000670 68 2e 64 72 61 77 2e 66 69 6c 65 2e 0a 49 74 20 |h.draw.file..It | 00000680 69 73 20 69 6e 74 65 6e 64 65 64 20 66 6f 72 20 |is intended for | 00000690 64 65 66 69 6e 69 74 69 6f 6e 73 20 6f 66 20 67 |definitions of g| 000006a0 65 6f 6d 65 74 72 69 63 61 6c 20 73 75 62 70 61 |eometrical subpa| 000006b0 74 68 20 6f 62 6a 65 63 74 73 20 28 73 65 65 20 |th objects (see | 000006c0 62 65 6c 6f 77 29 2c 0a 72 65 70 72 65 73 65 6e |below),.represen| 000006d0 74 65 64 20 61 73 20 64 72 61 77 66 69 6c 65 20 |ted as drawfile | 000006e0 6d 65 74 68 6f 64 73 2e 20 41 73 20 61 20 73 74 |methods. As a st| 000006f0 61 72 74 65 72 2c 20 69 74 20 63 6f 6e 74 61 69 |arter, it contai| 00000700 6e 73 20 6f 6e 6c 79 20 74 68 65 20 0a 64 72 61 |ns only the .dra| 00000710 77 66 69 6c 65 20 6d 65 74 68 6f 64 73 0a 0a 64 |wfile methods..d| 00000720 72 61 77 66 69 6c 65 3a 3a 63 69 72 63 6c 65 28 |rawfile::circle(| 00000730 78 2c 79 2c 72 29 0a 0a 20 20 20 20 20 20 20 44 |x,y,r).. D| 00000740 72 61 77 20 61 20 63 69 72 63 6c 65 2c 20 63 65 |raw a circle, ce| 00000750 6e 74 72 65 20 28 78 2c 79 29 2c 20 72 61 64 69 |ntre (x,y), radi| 00000760 75 73 20 72 2e 0a 0a 64 72 61 77 66 69 6c 65 3a |us r...drawfile:| 00000770 3a 65 6c 6c 69 70 73 65 28 78 2c 79 2c 61 2c 62 |:ellipse(x,y,a,b| 00000780 29 0a 0a 20 20 20 20 20 20 20 44 72 61 77 20 61 |).. Draw a| 00000790 6e 20 65 6c 6c 69 70 73 65 2c 20 63 65 6e 74 72 |n ellipse, centr| 000007a0 65 20 28 78 2c 79 29 2c 20 77 69 74 68 20 68 6f |e (x,y), with ho| 000007b0 72 69 7a 6f 6e 74 61 6c 20 73 65 6d 69 2d 61 78 |rizontal semi-ax| 000007c0 69 73 20 6f 66 0a 20 20 20 20 20 20 20 6c 65 6e |is of. len| 000007d0 67 74 68 20 61 2c 20 61 6e 64 20 76 65 72 74 69 |gth a, and verti| 000007e0 63 61 6c 20 73 65 6d 69 2d 61 78 69 73 20 6f 66 |cal semi-axis of| 000007f0 20 6c 65 6e 67 74 68 20 62 2e 0a 0a 41 6c 6c 20 | length b...All | 00000800 75 6e 69 74 73 20 61 72 65 20 69 6e 20 70 6f 69 |units are in poi| 00000810 6e 74 73 20 2d 20 28 31 2f 37 32 29 22 2e 0a 0a |nts - (1/72)"...| 00000820 47 6c 6f 73 73 61 72 79 0a 2d 2d 2d 2d 2d 2d 2d |Glossary.-------| 00000830 2d 0a 0a 54 6f 20 63 72 65 61 74 65 20 61 20 6e |-..To create a n| 00000840 65 77 20 64 72 61 77 66 69 6c 65 2c 20 63 61 6c |ew drawfile, cal| 00000850 6c 65 64 20 4d 79 44 72 61 77 46 69 6c 65 2c 20 |led MyDrawFile, | 00000860 73 61 79 2c 20 75 73 65 20 74 68 65 20 63 6f 6d |say, use the com| 00000870 6d 61 6e 64 0a 0a 20 20 20 20 20 20 20 20 20 20 |mand.. | 00000880 20 20 20 4d 79 44 72 61 77 46 69 6c 65 20 3d 20 | MyDrawFile = | 00000890 6e 65 77 20 64 72 61 77 66 69 6c 65 3b 0a 0a 44 |new drawfile;..D| 000008a0 72 61 77 66 69 6c 65 73 20 63 6f 6e 74 61 69 6e |rawfiles contain| 000008b0 20 31 29 20 61 20 68 65 61 64 65 72 2c 20 61 6e | 1) a header, an| 000008c0 64 20 32 29 20 61 20 6c 69 73 74 20 6f 66 20 22 |d 2) a list of "| 000008d0 64 72 61 77 20 6f 62 6a 65 63 74 73 22 2e 20 54 |draw objects". T| 000008e0 68 65 73 65 0a 6d 75 73 74 20 62 65 20 63 72 65 |hese.must be cre| 000008f0 61 74 65 64 20 69 6e 20 6f 72 64 65 72 2e 20 54 |ated in order. T| 00000900 68 65 20 63 6f 6d 6d 61 6e 64 0a 0a 20 20 20 20 |he command.. | 00000910 20 20 20 20 20 20 20 20 20 4d 79 44 72 61 77 46 | MyDrawF| 00000920 69 6c 65 2d 3e 62 65 67 69 6e 28 29 3b 0a 0a 63 |ile->begin();..c| 00000930 72 65 61 74 65 73 20 74 68 65 20 68 65 61 64 65 |reates the heade| 00000940 72 2e 20 41 74 20 70 72 65 73 65 6e 74 20 74 68 |r. At present th| 00000950 65 20 6f 6e 6c 79 20 64 72 61 77 20 6f 62 6a 65 |e only draw obje| 00000960 63 74 73 20 70 65 72 6d 69 74 74 65 64 20 69 6e |cts permitted in| 00000970 0a 41 72 6d 62 6f 62 20 61 72 65 3a 0a 0a 20 20 |.Armbob are:.. | 00000980 20 20 20 31 29 20 74 65 78 74 20 6f 62 6a 65 63 | 1) text objec| 00000990 74 73 0a 20 20 20 20 20 32 29 20 70 61 74 68 20 |ts. 2) path | 000009a0 6f 62 6a 65 63 74 73 0a 20 20 20 20 20 33 29 20 |objects. 3) | 000009b0 67 72 6f 75 70 20 6f 62 6a 65 63 74 73 0a 0a 54 |group objects..T| 000009c0 65 78 74 0a 2d 2d 2d 2d 0a 41 20 74 65 78 74 20 |ext.----.A text | 000009d0 6f 62 6a 65 63 74 20 69 73 20 63 72 65 61 74 65 |object is create| 000009e0 64 20 61 6e 64 20 6e 61 6d 65 64 20 62 79 20 61 |d and named by a| 000009f0 20 63 6f 6d 6d 61 6e 64 20 6f 66 20 74 68 65 20 | command of the | 00000a00 66 6f 72 6d 0a 0a 20 20 20 20 20 20 20 20 20 20 |form.. | 00000a10 20 20 4d 79 54 65 78 74 4f 62 6a 65 63 74 20 3d | MyTextObject =| 00000a20 20 4d 79 44 72 61 77 46 69 6c 65 2d 3e 74 65 78 | MyDrawFile->tex| 00000a30 74 28 73 74 72 69 6e 67 2c 78 2c 79 29 3b 0a 0a |t(string,x,y);..| 00000a40 48 65 72 65 20 27 73 74 72 69 6e 67 27 20 69 73 |Here 'string' is| 00000a50 20 61 20 73 74 72 69 6e 67 20 65 78 70 72 65 73 | a string expres| 00000a60 73 69 6f 6e 2c 20 61 6e 64 20 28 78 2c 79 29 20 |sion, and (x,y) | 00000a70 69 73 20 74 68 65 20 70 6f 73 69 74 69 6f 6e 20 |is the position | 00000a80 77 68 65 72 65 0a 74 68 65 20 62 6f 74 74 6f 6d |where.the bottom| 00000a90 20 6c 65 66 74 20 6f 66 20 74 68 65 20 73 74 72 | left of the str| 00000aa0 69 6e 67 20 77 69 6c 6c 20 70 6c 61 63 65 64 2e |ing will placed.| 00000ab0 20 54 65 78 74 20 6f 62 6a 65 63 74 73 20 68 61 | Text objects ha| 00000ac0 76 65 20 76 61 72 69 6f 75 73 0a 61 74 74 72 69 |ve various.attri| 00000ad0 62 75 74 65 73 20 74 68 61 74 20 63 61 6e 20 62 |butes that can b| 00000ae0 65 20 61 6c 74 65 72 65 64 20 66 72 6f 6d 20 74 |e altered from t| 00000af0 68 65 69 72 20 64 65 66 61 75 6c 74 20 76 61 6c |heir default val| 00000b00 75 65 73 2e 0a 0a 20 63 6f 6c 6f 75 72 0a 20 2d |ues... colour. -| 00000b10 2d 2d 2d 2d 2d 0a 20 54 68 65 20 64 65 66 61 75 |-----. The defau| 00000b20 6c 74 20 63 6f 6c 6f 75 72 20 66 6f 72 20 74 65 |lt colour for te| 00000b30 78 74 20 69 73 20 62 6c 61 63 6b 2e 20 54 68 65 |xt is black. The| 00000b40 20 63 6f 6d 6d 61 6e 64 0a 0a 20 20 20 20 20 20 | command.. | 00000b50 20 20 20 20 20 20 63 6f 6c 6f 75 72 28 4d 79 54 | colour(MyT| 00000b60 65 78 74 4f 62 6a 65 63 74 2c 63 29 3b 0a 0a 20 |extObject,c);.. | 00000b70 77 69 6c 6c 20 73 65 74 20 74 68 65 20 74 65 78 |will set the tex| 00000b80 74 20 63 6f 6c 6f 75 72 20 6f 66 20 4d 79 54 65 |t colour of MyTe| 00000b90 78 74 4f 62 6a 65 63 74 20 74 6f 20 63 2e 20 43 |xtObject to c. C| 00000ba0 6f 6c 6f 75 72 73 20 63 61 6e 20 68 61 76 65 0a |olours can have.| 00000bb0 20 76 61 6c 75 65 73 20 69 6e 20 74 68 65 20 72 | values in the r| 00000bc0 61 6e 67 65 20 30 2d 31 35 20 28 63 6c 69 63 6b |ange 0-15 (click| 00000bd0 20 6f 6e 20 74 68 65 20 70 61 6c 65 74 74 65 20 | on the palette | 00000be0 69 63 6f 6e 20 74 6f 20 73 65 65 20 77 68 69 63 |icon to see whic| 00000bf0 68 0a 20 74 68 65 79 20 61 72 65 29 2c 20 61 6e |h. they are), an| 00000c00 64 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 |d the following | 00000c10 73 79 6e 6f 6e 79 6d 73 20 61 72 65 20 70 72 65 |synonyms are pre| 00000c20 64 65 66 69 6e 65 64 3a 0a 0a 20 20 77 68 69 74 |defined:.. whit| 00000c30 65 20 20 3d 20 20 30 3b 0a 20 20 62 6c 61 63 6b |e = 0;. black| 00000c40 20 20 3d 20 20 37 3b 0a 20 20 62 6c 75 65 20 20 | = 7;. blue | 00000c50 20 3d 20 20 38 3b 0a 20 20 79 65 6c 6c 6f 77 20 | = 8;. yellow | 00000c60 3d 20 20 39 3b 0a 20 20 67 72 65 65 6e 20 20 3d |= 9;. green =| 00000c70 20 31 30 3b 0a 20 20 72 65 64 20 20 20 20 3d 20 | 10;. red = | 00000c80 31 31 3b 0a 20 20 63 72 65 61 6d 20 20 3d 20 31 |11;. cream = 1| 00000c90 32 3b 0a 20 20 6f 6c 69 76 65 20 20 3d 20 31 33 |2;. olive = 13| 00000ca0 3b 0a 20 20 6f 72 61 6e 67 65 20 3d 20 31 34 3b |;. orange = 14;| 00000cb0 0a 20 20 61 7a 75 72 65 20 20 3d 20 31 35 3b 0a |. azure = 15;.| 00000cc0 20 20 20 20 20 20 20 20 20 20 20 20 0a 20 66 6f | . fo| 00000cd0 6e 74 0a 20 2d 2d 2d 2d 0a 20 54 68 65 20 64 65 |nt. ----. The de| 00000ce0 66 61 75 6c 74 20 66 6f 6e 74 20 69 73 20 74 68 |fault font is th| 00000cf0 65 20 73 79 73 74 65 6d 20 66 6f 6e 74 2e 20 4f |e system font. O| 00000d00 74 68 65 72 20 66 6f 6e 74 73 20 6d 61 79 20 62 |ther fonts may b| 00000d10 65 20 75 73 65 64 20 75 73 69 6e 67 0a 20 74 68 |e used using. th| 00000d20 65 20 63 6f 6d 6d 61 6e 64 0a 0a 20 20 20 20 20 |e command.. | 00000d30 20 20 20 20 20 20 20 20 66 6f 6e 74 28 4d 79 54 | font(MyT| 00000d40 65 78 74 4f 62 6a 65 63 74 2c 66 29 3b 0a 0a 20 |extObject,f);.. | 00000d50 77 68 65 72 65 20 66 20 63 61 6e 20 74 61 6b 65 |where f can take| 00000d60 20 76 61 6c 75 65 73 20 30 2d 31 32 2e 20 54 68 | values 0-12. Th| 00000d70 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 73 79 6e 6f |e following syno| 00000d80 6e 79 6d 73 20 61 72 65 20 70 72 65 64 65 66 69 |nyms are predefi| 00000d90 6e 65 64 3a 0a 0a 20 20 53 79 73 74 65 6d 20 20 |ned:.. System | 00000da0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000db0 3d 20 30 3b 0a 20 20 54 72 69 6e 69 74 79 5f 4d |= 0;. Trinity_M| 00000dc0 65 64 69 75 6d 20 20 20 20 20 20 20 20 20 20 3d |edium =| 00000dd0 20 31 3b 0a 20 20 54 72 69 6e 69 74 79 5f 4d 65 | 1;. Trinity_Me| 00000de0 64 69 75 6d 5f 49 74 61 6c 69 63 20 20 20 3d 20 |dium_Italic = | 00000df0 32 3b 0a 20 20 54 72 69 6e 69 74 79 5f 42 6f 6c |2;. Trinity_Bol| 00000e00 64 20 20 20 20 20 20 20 20 20 20 20 20 3d 20 33 |d = 3| 00000e10 3b 0a 20 20 54 72 69 6e 69 74 79 5f 42 6f 6c 64 |;. Trinity_Bold| 00000e20 5f 49 74 61 6c 69 63 20 20 20 20 20 3d 20 34 3b |_Italic = 4;| 00000e30 0a 20 20 43 6f 72 70 75 73 5f 4d 65 64 69 75 6d |. Corpus_Medium| 00000e40 20 20 20 20 20 20 20 20 20 20 20 3d 20 35 3b 0a | = 5;.| 00000e50 20 20 43 6f 72 70 75 73 5f 4d 65 64 69 75 6d 5f | Corpus_Medium_| 00000e60 4f 62 6c 69 71 75 65 20 20 20 3d 20 36 3b 0a 20 |Oblique = 6;. | 00000e70 20 43 6f 72 70 75 73 5f 42 6f 6c 64 20 20 20 20 | Corpus_Bold | 00000e80 20 20 20 20 20 20 20 20 20 3d 20 37 3b 0a 20 20 | = 7;. | 00000e90 43 6f 72 70 75 73 5f 42 6f 6c 64 5f 4f 62 6c 69 |Corpus_Bold_Obli| 00000ea0 71 75 65 20 20 20 20 20 3d 20 38 3b 0a 20 20 48 |que = 8;. H| 00000eb0 6f 6d 65 72 74 6f 6e 5f 4d 65 64 69 75 6d 20 20 |omerton_Medium | 00000ec0 20 20 20 20 20 20 20 3d 20 39 3b 0a 20 20 48 6f | = 9;. Ho| 00000ed0 6d 65 72 74 6f 6e 5f 4d 65 64 69 75 6d 5f 4f 62 |merton_Medium_Ob| 00000ee0 6c 69 71 75 65 20 3d 20 31 30 3b 0a 20 20 48 6f |lique = 10;. Ho| 00000ef0 6d 65 72 74 6f 6e 5f 42 6f 6c 64 20 20 20 20 20 |merton_Bold | 00000f00 20 20 20 20 20 20 3d 20 31 31 3b 0a 20 20 48 6f | = 11;. Ho| 00000f10 6d 65 72 74 6f 6e 5f 42 6f 6c 64 5f 4f 62 6c 69 |merton_Bold_Obli| 00000f20 71 75 65 20 20 20 3d 20 31 32 3b 0a 20 20 20 20 |que = 12;. | 00000f30 20 20 20 20 20 20 20 0a 20 66 6f 6e 74 20 73 69 | . font si| 00000f40 7a 65 0a 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 54 |ze. ---------. T| 00000f50 68 65 20 64 65 66 61 75 6c 74 20 66 6f 6e 74 20 |he default font | 00000f60 73 69 7a 65 20 69 73 20 31 30 20 70 6f 69 6e 74 |size is 10 point| 00000f70 2e 20 54 68 65 20 66 6f 6e 74 20 73 69 7a 65 20 |. The font size | 00000f80 63 61 6e 20 62 65 20 6d 6f 64 69 66 69 65 64 0a |can be modified.| 00000f90 20 68 6f 72 69 7a 6f 6e 74 61 6c 6c 79 20 61 6e | horizontally an| 00000fa0 64 20 76 65 72 74 69 63 61 6c 6c 79 20 69 6e 64 |d vertically ind| 00000fb0 65 70 65 6e 64 65 6e 74 6c 79 20 77 69 74 68 20 |ependently with | 00000fc0 63 6f 6d 6d 61 6e 64 73 3a 0a 0a 20 20 20 20 20 |commands:.. | 00000fd0 20 20 20 20 20 20 4d 79 44 72 61 77 46 69 6c 65 | MyDrawFile| 00000fe0 2d 3e 66 6f 6e 74 5f 78 28 4d 79 54 65 78 74 4f |->font_x(MyTextO| 00000ff0 62 6a 65 63 74 2c 70 74 73 5f 78 29 3b 0a 20 20 |bject,pts_x);. | 00001000 20 20 20 20 20 20 20 20 20 4d 79 44 72 61 77 46 | MyDrawF| 00001010 69 6c 65 2d 3e 66 6f 6e 74 5f 79 28 4d 79 54 65 |ile->font_y(MyTe| 00001020 78 74 4f 62 6a 65 63 74 2c 70 74 73 5f 79 29 3b |xtObject,pts_y);| 00001030 0a 0a 20 77 68 65 72 65 20 70 74 73 5f 78 20 61 |.. where pts_x a| 00001040 6e 64 20 70 74 73 5f 79 20 61 72 65 20 74 68 65 |nd pts_y are the| 00001050 20 68 6f 72 69 7a 6f 6e 74 61 6c 20 61 6e 64 20 | horizontal and | 00001060 76 65 72 74 69 63 61 6c 20 66 6f 6e 74 20 73 69 |vertical font si| 00001070 7a 65 73 20 69 6e 0a 20 70 6f 69 6e 74 73 2e 20 |zes in. points. | 00001080 4e 6f 74 65 20 74 68 61 74 20 6d 6f 64 69 66 79 |Note that modify| 00001090 69 6e 67 20 74 68 65 20 66 6f 6e 74 20 73 69 7a |ing the font siz| 000010a0 65 20 75 73 65 73 20 61 20 64 72 61 77 66 69 6c |e uses a drawfil| 000010b0 65 20 6d 65 74 68 6f 64 2c 0a 20 72 61 74 68 65 |e method,. rathe| 000010c0 72 20 74 68 61 6e 20 61 20 73 74 72 61 69 67 68 |r than a straigh| 000010d0 74 66 6f 72 77 61 72 64 20 66 75 6e 63 74 69 6f |tforward functio| 000010e0 6e 2e 20 54 68 69 73 20 69 73 20 62 65 63 61 75 |n. This is becau| 000010f0 73 65 20 61 6c 74 65 72 69 6e 67 20 74 68 65 0a |se altering the.| 00001100 20 66 6f 6e 74 20 73 69 7a 65 20 6d 69 67 68 74 | font size might| 00001110 20 61 6c 74 65 72 20 74 68 65 20 62 6f 75 6e 64 | alter the bound| 00001120 69 6e 67 20 62 6f 78 20 66 6f 72 20 74 68 65 20 |ing box for the | 00001130 77 68 6f 6c 65 20 64 72 61 77 66 69 6c 65 2e 0a |whole drawfile..| 00001140 0a 50 61 74 68 73 0a 2d 2d 2d 2d 2d 0a 41 20 70 |.Paths.-----.A p| 00001150 61 74 68 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 |ath consists of | 00001160 31 29 20 61 20 68 65 61 64 65 72 20 61 6e 64 20 |1) a header and | 00001170 32 29 20 61 20 73 65 71 75 65 6e 63 65 20 6f 66 |2) a sequence of| 00001180 20 73 75 62 70 61 74 68 73 2e 20 54 68 65 73 65 | subpaths. These| 00001190 0a 6d 75 73 74 20 62 65 20 63 72 65 61 74 65 64 |.must be created| 000011a0 20 69 6e 20 6f 72 64 65 72 2e 20 54 6f 20 63 72 | in order. To cr| 000011b0 65 61 74 65 20 74 68 65 20 68 65 61 64 65 72 20 |eate the header | 000011c0 6f 66 20 61 20 70 61 74 68 20 63 61 6c 6c 65 64 |of a path called| 000011d0 20 4d 79 50 61 74 68 0a 75 73 65 20 74 68 65 20 | MyPath.use the | 000011e0 63 6f 6d 6d 61 6e 64 0a 0a 20 20 20 20 20 20 20 |command.. | 000011f0 20 20 20 20 20 20 20 20 4d 79 50 61 74 68 20 3d | MyPath =| 00001200 20 4d 79 44 72 61 77 46 69 6c 65 2d 3e 70 61 74 | MyDrawFile->pat| 00001210 68 28 29 3b 0a 0a 54 68 69 73 20 6d 75 73 74 20 |h();..This must | 00001220 62 65 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 61 |be followed by a| 00001230 74 20 6c 65 61 73 74 20 6f 6e 65 20 73 75 62 70 |t least one subp| 00001240 61 74 68 2e 20 45 61 63 68 20 73 75 62 70 61 74 |ath. Each subpat| 00001250 68 20 62 65 67 69 6e 73 0a 77 69 74 68 20 61 20 |h begins.with a | 00001260 63 6f 6d 6d 61 6e 64 0a 0a 20 20 20 20 20 20 20 |command.. | 00001270 20 20 20 20 20 20 20 20 4d 79 44 72 61 77 46 69 | MyDrawFi| 00001280 6c 65 2d 3e 6d 6f 76 65 28 78 2c 79 29 3b 0a 0a |le->move(x,y);..| 00001290 61 6e 64 20 69 73 20 66 6f 6c 6c 6f 77 65 64 20 |and is followed | 000012a0 62 79 20 61 20 73 65 71 75 65 6e 63 65 20 6f 66 |by a sequence of| 000012b0 20 63 6f 6d 6d 61 6e 64 73 20 65 69 74 68 65 72 | commands either| 000012c0 20 6f 66 20 74 68 65 20 73 61 6d 65 20 66 6f 72 | of the same for| 000012d0 6d 20 6f 72 0a 6f 66 20 74 68 65 20 66 6f 72 6d |m or.of the form| 000012e0 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 000012f0 20 4d 79 44 72 61 77 46 69 6c 65 2d 3e 64 72 61 | MyDrawFile->dra| 00001300 77 28 78 2c 79 29 3b 0a 0a 6f 72 0a 0a 20 20 20 |w(x,y);..or.. | 00001310 20 20 20 20 20 20 20 20 20 20 20 20 4d 79 44 72 | MyDr| 00001320 61 77 46 69 6c 65 2d 3e 62 65 7a 69 65 72 28 78 |awFile->bezier(x| 00001330 31 2c 79 31 2c 78 32 2c 79 32 2c 78 33 2c 79 33 |1,y1,x2,y2,x3,y3| 00001340 29 3b 0a 0a 61 6e 64 20 6f 70 74 69 6f 6e 61 6c |);..and optional| 00001350 6c 79 20 74 65 72 6d 69 6e 61 74 65 64 20 62 79 |ly terminated by| 00001360 20 61 20 63 6f 6d 6d 61 6e 64 0a 0a 20 20 20 20 | a command.. | 00001370 20 20 20 20 20 20 20 20 20 20 20 4d 79 44 72 61 | MyDra| 00001380 77 46 69 6c 65 2d 3e 63 6c 6f 73 65 5f 77 69 74 |wFile->close_wit| 00001390 68 5f 6c 69 6e 65 28 29 3b 0a 0a 4f 66 20 63 6f |h_line();..Of co| 000013a0 75 72 73 65 2c 20 61 20 73 65 71 75 65 6e 63 65 |urse, a sequence| 000013b0 20 6f 66 20 73 75 63 68 20 63 6f 6d 6d 61 6e 64 | of such command| 000013c0 73 20 6d 61 79 20 62 65 20 62 75 6e 64 6c 65 64 |s may be bundled| 000013d0 20 75 70 20 69 6e 74 6f 20 61 20 66 75 6e 63 74 | up into a funct| 000013e0 69 6f 6e 0a 6f 72 20 61 20 64 72 61 77 66 69 6c |ion.or a drawfil| 000013f0 65 20 6d 65 74 68 6f 64 20 28 73 65 65 20 74 68 |e method (see th| 00001400 65 20 66 69 6c 65 20 62 6f 62 3a 68 2e 64 72 61 |e file bob:h.dra| 00001410 77 2e 66 69 67 75 72 65 29 2e 20 54 68 65 20 70 |w.figure). The p| 00001420 61 74 68 20 69 73 20 0a 74 65 72 6d 69 6e 61 74 |ath is .terminat| 00001430 65 64 20 62 79 20 74 68 65 20 63 6f 6d 6d 61 6e |ed by the comman| 00001440 64 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |d.. | 00001450 20 20 4d 79 44 72 61 77 46 69 6c 65 2d 3e 65 6e | MyDrawFile->en| 00001460 64 70 61 74 68 28 4d 79 50 61 74 68 29 3b 0a 0a |dpath(MyPath);..| 00001470 50 61 74 68 20 6f 62 6a 65 63 74 73 20 68 61 76 |Path objects hav| 00001480 65 20 76 61 72 69 6f 75 73 20 61 74 74 72 69 62 |e various attrib| 00001490 75 74 65 73 20 74 68 61 74 20 63 61 6e 20 62 65 |utes that can be| 000014a0 20 61 6c 74 65 72 65 64 20 66 72 6f 6d 20 74 68 | altered from th| 000014b0 65 69 72 20 0a 64 65 66 61 75 6c 74 20 76 61 6c |eir .default val| 000014c0 75 65 73 2e 0a 0a 20 46 69 6c 6c 20 63 6f 6c 6f |ues... Fill colo| 000014d0 75 72 0a 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |ur. -----------.| 000014e0 20 54 68 65 20 64 65 66 61 75 6c 74 20 66 69 6c | The default fil| 000014f0 6c 20 63 6f 6c 6f 75 72 20 69 73 20 6e 6f 6e 65 |l colour is none| 00001500 2e 20 54 68 69 73 20 63 61 6e 20 62 65 20 61 6c |. This can be al| 00001510 74 65 72 65 64 20 77 69 74 68 0a 0a 20 20 20 20 |tered with.. | 00001520 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001530 66 69 6c 6c 28 4d 79 50 61 74 68 2c 63 29 3b 0a |fill(MyPath,c);.| 00001540 0a 20 77 68 65 72 65 20 63 20 69 73 20 61 20 63 |. where c is a c| 00001550 6f 6c 6f 75 72 20 28 73 65 65 20 61 62 6f 76 65 |olour (see above| 00001560 29 2e 20 20 54 68 65 20 76 61 6c 75 65 20 63 20 |). The value c | 00001570 3d 20 6e 6f 6e 65 20 3d 20 2d 31 20 67 69 76 65 |= none = -1 give| 00001580 73 20 0a 20 61 20 74 72 61 6e 73 70 61 72 65 6e |s . a transparen| 00001590 74 20 66 69 6c 6c 20 63 6f 6c 6f 75 72 2e 0a 0a |t fill colour...| 000015a0 20 4f 75 74 6c 69 6e 65 20 63 6f 6c 6f 75 72 0a | Outline colour.| 000015b0 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a | --------------.| 000015c0 20 54 68 65 20 64 65 66 61 75 6c 74 20 63 6f 6c | The default col| 000015d0 6f 75 72 20 69 73 20 62 6c 61 63 6b 2e 20 54 68 |our is black. Th| 000015e0 69 73 20 63 61 6e 20 62 65 20 61 6c 74 65 72 65 |is can be altere| 000015f0 64 20 77 69 74 68 0a 0a 20 20 20 20 20 20 20 20 |d with.. | 00001600 20 20 20 20 20 20 20 20 20 20 20 20 6f 75 74 6c | outl| 00001610 69 6e 65 28 4d 79 50 61 74 68 2c 63 29 3b 0a 0a |ine(MyPath,c);..| 00001620 20 77 68 65 72 65 20 63 20 69 73 20 61 20 63 6f | where c is a co| 00001630 6c 6f 75 72 20 28 73 65 65 20 61 62 6f 76 65 29 |lour (see above)| 00001640 2e 20 20 54 68 65 20 76 61 6c 75 65 20 63 20 3d |. The value c =| 00001650 20 6e 6f 6e 65 20 3d 20 2d 31 20 67 69 76 65 73 | none = -1 gives| 00001660 20 0a 20 61 20 74 72 61 6e 73 70 61 72 65 6e 74 | . a transparent| 00001670 20 66 69 6c 6c 20 63 6f 6c 6f 75 72 2e 0a 0a 20 | fill colour... | 00001680 4c 69 6e 65 77 69 64 74 68 0a 20 2d 2d 2d 2d 2d |Linewidth. -----| 00001690 2d 2d 2d 2d 0a 20 54 68 65 20 64 65 66 61 75 6c |----. The defaul| 000016a0 74 20 69 73 20 6f 6e 65 20 70 6f 69 6e 74 2e 20 |t is one point. | 000016b0 54 68 69 73 20 63 61 6e 20 62 65 20 61 6c 74 65 |This can be alte| 000016c0 72 65 64 20 77 69 74 68 0a 0a 20 20 20 20 20 20 |red with.. | 000016d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 69 | li| 000016e0 6e 65 77 69 64 74 68 28 4d 79 50 61 74 68 2c 6e |newidth(MyPath,n| 000016f0 29 3b 0a 0a 20 77 68 65 72 65 20 6e 20 69 73 20 |);.. where n is | 00001700 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 70 6f |the number of po| 00001710 69 6e 74 73 2e 0a 0a 20 4a 6f 69 6e 20 73 74 79 |ints... Join sty| 00001720 6c 65 0a 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 |le. ----------. | 00001730 54 68 65 20 64 65 66 61 75 6c 74 20 69 73 20 6d |The default is m| 00001740 69 74 72 65 64 20 6a 6f 69 6e 73 2e 20 54 68 69 |itred joins. Thi| 00001750 73 20 63 61 6e 20 62 65 20 61 6c 74 65 72 65 64 |s can be altered| 00001760 20 77 69 74 68 0a 0a 20 20 20 20 20 20 20 20 20 | with.. | 00001770 20 20 20 20 20 20 20 20 20 20 20 6a 6f 69 6e 5f | join_| 00001780 73 74 79 6c 65 28 4d 79 50 61 74 68 2c 78 29 3b |style(MyPath,x);| 00001790 0a 0a 20 20 77 68 65 72 65 20 78 20 63 61 6e 20 |.. where x can | 000017a0 62 65 20 4d 69 74 72 65 64 2c 20 52 6f 75 6e 64 |be Mitred, Round| 000017b0 20 6f 72 20 42 65 76 65 6c 6c 65 64 2e 0a 0a 20 | or Bevelled... | 000017c0 43 61 70 20 73 74 79 6c 65 0a 20 2d 2d 2d 2d 2d |Cap style. -----| 000017d0 2d 2d 2d 2d 2d 2d 2d 0a 20 54 68 65 20 64 65 66 |-------. The def| 000017e0 61 75 6c 74 20 69 73 20 62 75 74 74 20 63 61 70 |ault is butt cap| 000017f0 73 2e 20 45 6e 64 63 61 70 73 20 63 61 6e 20 62 |s. Endcaps can b| 00001800 65 20 61 6c 74 65 72 65 64 20 77 69 74 68 0a 0a |e altered with..| 00001810 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001820 20 20 20 20 65 6e 64 63 61 70 5f 73 74 79 6c 65 | endcap_style| 00001830 28 4d 79 50 61 74 68 2c 78 29 3b 0a 0a 20 61 6e |(MyPath,x);.. an| 00001840 64 20 73 74 61 72 74 63 61 70 73 20 63 61 6e 20 |d startcaps can | 00001850 62 65 20 61 6c 74 65 72 65 64 20 77 69 74 68 0a |be altered with.| 00001860 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00001870 20 20 20 20 20 73 74 61 72 74 63 61 70 5f 73 74 | startcap_st| 00001880 79 6c 65 28 4d 79 50 61 74 68 2c 78 29 3b 0a 0a |yle(MyPath,x);..| 00001890 20 77 68 65 72 65 20 78 20 63 61 6e 20 62 65 20 | where x can be | 000018a0 42 75 74 74 2c 20 52 6f 75 6e 64 20 6f 72 20 53 |Butt, Round or S| 000018b0 71 75 61 72 65 2e 0a 0a 20 57 69 6e 64 69 6e 67 |quare... Winding| 000018c0 20 52 75 6c 65 0a 20 2d 2d 2d 2d 2d 2d 2d 2d 2d | Rule. ---------| 000018d0 2d 2d 2d 0a 20 54 68 65 20 64 65 66 61 75 6c 74 |---. The default| 000018e0 20 77 69 6e 64 69 6e 67 20 72 75 6c 65 20 69 73 | winding rule is| 000018f0 20 4e 6f 6e 5f 5a 65 72 6f 2e 20 54 68 69 73 20 | Non_Zero. This | 00001900 63 61 6e 20 62 65 20 61 6c 74 65 72 65 64 20 77 |can be altered w| 00001910 69 74 68 0a 0a 20 20 20 20 20 20 20 20 20 20 20 |ith.. | 00001920 20 20 20 20 20 20 20 77 69 6e 64 69 6e 67 5f 72 | winding_r| 00001930 75 6c 65 28 4d 79 50 61 74 68 2c 72 75 6c 65 29 |ule(MyPath,rule)| 00001940 3b 0a 0a 20 77 68 65 72 65 20 72 75 6c 65 20 69 |;.. where rule i| 00001950 73 20 4e 6f 6e 5f 5a 65 72 6f 20 6f 72 20 45 76 |s Non_Zero or Ev| 00001960 65 6e 5f 4f 64 64 2e 0a 0a 47 72 6f 75 70 73 0a |en_Odd...Groups.| 00001970 2d 2d 2d 2d 2d 2d 0a 41 20 67 72 6f 75 70 20 63 |------.A group c| 00001980 6f 6e 73 69 73 74 73 20 6f 66 20 61 20 68 65 61 |onsists of a hea| 00001990 64 65 72 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 |der followed by | 000019a0 61 20 73 65 71 75 65 6e 63 65 20 6f 66 20 64 72 |a sequence of dr| 000019b0 61 77 66 69 6c 65 0a 6f 62 6a 65 63 74 73 2c 20 |awfile.objects, | 000019c0 69 2e 65 2e 20 74 65 78 74 2c 20 70 61 74 68 20 |i.e. text, path | 000019d0 6f 72 20 67 72 6f 75 70 20 6f 62 6a 65 63 74 73 |or group objects| 000019e0 2e 20 54 68 65 20 68 65 61 64 65 72 20 69 73 20 |. The header is | 000019f0 63 72 65 61 74 65 64 0a 62 79 20 61 20 63 6f 6d |created.by a com| 00001a00 6d 61 6e 64 20 6f 66 20 74 68 65 20 66 6f 72 6d |mand of the form| 00001a10 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 00001a20 20 20 4d 79 47 72 6f 75 70 20 3d 20 4d 79 44 72 | MyGroup = MyDr| 00001a30 61 77 46 69 6c 65 2d 3e 67 72 6f 75 70 28 29 3b |awFile->group();| 00001a40 0a 0a 61 6e 64 20 74 68 65 20 73 65 71 75 65 6e |..and the sequen| 00001a50 63 65 20 6f 66 20 64 72 61 77 66 69 6c 65 20 6f |ce of drawfile o| 00001a60 62 6a 65 63 74 73 20 74 68 61 74 20 63 6f 6d 70 |bjects that comp| 00001a70 72 69 73 65 20 74 68 65 20 67 72 6f 75 70 20 6d |rise the group m| 00001a80 75 73 74 20 62 65 0a 74 65 72 6d 69 6e 61 74 65 |ust be.terminate| 00001a90 64 20 62 79 20 74 68 65 20 63 6f 6d 6d 61 6e 64 |d by the command| 00001aa0 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 00001ab0 20 20 4d 79 44 72 61 77 46 69 6c 65 2d 3e 65 6e | MyDrawFile->en| 00001ac0 64 67 72 6f 75 70 28 4d 79 47 72 6f 75 70 29 3b |dgroup(MyGroup);| 00001ad0 0a 0a 46 69 6e 61 6c 6c 79 2c 20 61 20 64 72 61 |..Finally, a dra| 00001ae0 77 66 69 6c 65 20 69 73 20 73 61 76 65 64 20 74 |wfile is saved t| 00001af0 6f 20 61 20 66 69 6c 65 20 61 6e 64 20 64 69 73 |o a file and dis| 00001b00 70 6c 61 79 65 64 20 77 69 74 68 20 74 68 65 20 |played with the | 00001b10 63 6f 6d 6d 61 6e 64 0a 0a 20 20 20 20 20 20 20 |command.. | 00001b20 20 20 20 20 20 20 20 20 20 4d 79 44 72 61 77 46 | MyDrawF| 00001b30 69 6c 65 2d 3e 65 6e 64 28 66 69 6c 65 29 3b 0a |ile->end(file);.| 00001b40 0a 49 74 20 69 73 20 71 75 69 74 65 20 70 65 72 |.It is quite per| 00001b50 6d 69 73 73 69 62 6c 65 20 74 6f 20 64 65 66 69 |missible to defi| 00001b60 6e 65 20 6d 61 6e 79 20 64 72 61 77 66 69 6c 65 |ne many drawfile| 00001b70 73 20 61 74 20 6f 6e 63 65 20 69 6e 20 74 68 65 |s at once in the| 00001b80 20 73 61 6d 65 0a 70 72 6f 67 72 61 6d 2c 20 77 | same.program, w| 00001b90 69 74 68 20 74 68 65 20 63 6f 6d 6d 61 6e 64 73 |ith the commands| 00001ba0 20 66 6f 72 20 63 72 65 61 74 69 6e 67 20 74 68 | for creating th| 00001bb0 65 6d 20 69 6e 74 65 72 6c 65 61 76 65 64 20 68 |em interleaved h| 00001bc0 6f 77 65 76 65 72 20 6f 6e 65 0a 77 69 73 68 65 |owever one.wishe| 00001bd0 73 2e 20 4f 6e 6c 79 20 74 68 65 20 72 65 6c 61 |s. Only the rela| 00001be0 74 69 76 65 20 6f 72 64 65 72 69 6e 67 20 6f 66 |tive ordering of| 00001bf0 20 74 68 65 20 63 6f 6d 6d 61 6e 64 73 20 66 6f | the commands fo| 00001c00 72 20 61 20 67 69 76 65 6e 20 64 72 61 77 66 69 |r a given drawfi| 00001c10 6c 65 0a 61 72 65 20 69 6d 70 6f 72 74 61 6e 74 |le.are important| 00001c20 2e 20 54 68 65 20 4d 79 44 72 61 77 46 69 6c 65 |. The MyDrawFile| 00001c30 2d 3e 20 70 72 65 66 69 78 20 73 6f 72 74 73 20 |-> prefix sorts | 00001c40 6f 75 74 20 77 68 69 63 68 20 63 6f 6d 6d 61 6e |out which comman| 00001c50 64 73 20 61 70 70 6c 79 0a 74 6f 20 4d 79 44 72 |ds apply.to MyDr| 00001c60 61 77 46 69 6c 65 2e 20 0a 0a |awFile. ..| 00001c6a