@database @node main Chapter05 "Personal Fonts Maker - 5. PFM: The Brush Menu" @{" 5. PFM: The Brush Menu " link 5} @{" 5.1 Load Brush " link 5.1} @{" 5.2 Save Brush " link 5.2} @{" 5.3 Horizontal Flip " link 5.3} @{" 5.4 Vertical Flip " link 5.4} @{" 5.5 Rotate 90 Degrees " link 5.5} @{" 5.6 Italicize " link 5.6} @{" 5.7 Reverse " link 5.7} @{" 5.8 Resize " link 5.8} @{" 5.8.1 Stretch " link 5.8.1} @{" 5.8.2 Halve " link 5.8.2} @{" 5.8.3 Halve Horizontal " link 5.8.3} @{" 5.8.4 Halve Vertical " link 5.8.4} @{" 5.8.5 Double " link 5.8.5} @{" 5.8.6 Double Horizontal " link 5.8.6} @{" 5.8.7 Double Vertical " link 5.8.7} @{" 5.9 Handle " link 5.9} @{" 5.9.1 Upper Left " link 5.9.1} @{" 5.9.2 Upper Right " link 5.9.2} @{" 5.9.3 Centre " link 5.9.3} @{" 5.9.4 Lower Left " link 5.9.4} @{" 5.9.5 Lower Right " link 5.9.5} @endnode @node 5 "Personal Fonts Maker - 5. PFM: The Brush Menu" 5. PFM: The Brush Menu Sections 3.17 ("The 'Pencil/Brush' Gadget") and 3.18 ("Define Brush") introduce some general concepts about the brush and how it can be used. This chapter explains in detail all the functions which can be applied to the brush to load it, save it, transform it or change the position of the handle. A brush must be defined (section 3.18 "Define Brush") before the functions explained in this chapter can be used. Only "Load Brush" and "Handle" will work even if the brush mode is not active. The other menu items are automatically disabled (section 1.9.8 "Menus") by the program when they cannot be used. @endnode @node 5.1 5.1 Load Brush Once a brush has been defined, it can be saved to a file, loaded and re-used again. The brush data is stored in the IFF ILBM (from "Interchange File Format - InterLeaved BitMap") graphical format. This is a standard shared by most Amiga software working with bit-map graphics. This function can be used to load a brush file previously stored by the Personal Fonts Maker or another program using the IFF ILBM format. The standard file requester (section 3.23) allows the user to choose the file to be loaded. An error message is displayed if the file does not contain graphic data in the requested format. Both font environments share the same brush. If a brush has been defined, it will be cleared by the brush being loaded, even if this function is called from the font environment other than the environment in which the original brush was defined. A warning message is displayed before a brush which has not yet been saved is cleared by the brush being loaded. If the selected file contains more than one image, only the last image is loaded. The IFF ILBM format does not make any distinctions between brushes and other types of images, like full screens. The Personal Fonts Maker will load any of these, as long as the image is not too large. The program can load pictures as big as 255 by 255 dots. If the image is wider and/or taller than 255 dots, an error message is displayed. The Personal Fonts Maker also reads some non-graphical data in the IFF file. In particular, the program supports the "BMHD" (from "BitMap HeaDer"), "BODY" and "GRAB" IFF chunks. The program can deal with bitmap masking, multiple-colour to two-colour conversion information and brush handle position data. More information on the IFF format and details on the IFF chunks mentioned above can be found in the official Commodore "'EA IFF 85' Standard for Interchange Format Files" documentation. If the Personal Fonts Maker cannot find and process the necessary instructions in the file on how to convert a multiple-colour image into an on/off dot pattern, the default "OR" conversion mode is applied. This means that for each position of the source image where there is a "1" in one or more bitplanes, the resulting brush bitmap will contain a coloured ("black", or "On") dot. One possible application of this function is the data exchange with programs connected to external hardware devices. In particular, fonts which are available on paper can be read by a scanner and converted into IFF pictures by the software. The resulting characters could then be loaded into the Personal Fonts Maker's memory with this function. Most programs which are bundled with scanning devices have a so-called "Line Art" option. This mode can be activated to produce better looking fonts. @endnode @node 5.2 5.2 Save Brush This function saves the current brush to the specified file. The documentation of the standard file requester (section 3.23), overwrite warning message (section 7.11.4), Workbench icon (section 7.8), problems with peripheral storage units (section 14.1) and brush data formats (sections 2.4 and 5.1) is valid for this function. The program creates an IFF file containing the "BMHD" (from "BitMap HeaDer"), "CMAP" (from "Colour MAP"), "GRAB" and "BODY" IFF chunks. The Commodore documentation contains a detailed technical description of the IFF format and the chunks mentioned here. To the non-technical user, all this means that the brush is saved in such a way that it can be loaded from all programs handling the IFF ILBM format. The file contains information on the brush image and the position of the handle (section 5.9). When the Personal Fonts Maker loads the brush again, both the image and the brush handle associated with the brush will be used. @endnode @node 5.3 5.3 Horizontal Flip The same flip functions already described in section 3.20, which modify the content of the character editing box, also exist for the brush. This function transforms the image contained in the brush into its "mirror" image. The columns of dots, from the left to the right, which originally made up the brush image, are re-arranged from the right to the left, in the same sequence. @endnode @node 5.4 5.4 Vertical Flip This function, like "Horizontal Flip", modifies the brush image. The brush is turned upside-down each time the function is selected. The effect of this function can be undone by repeating the function an even number of times on the same brush. This is also valid for "Horizontal Flip". @endnode @node 5.5 5.5 Rotate 90 Degrees This function rotates the brush by 90 degrees clockwise. The horizontal and vertical dimensions of the brush are reversed. If the brush is square (i.e. if it is as wide as it is tall, in dots) the dimensions do not change. The brush handle remains in the same position. If the function is executed four (or a multiple of four) times on the same brush, the resulting brush will be identical to the original brush. @endnode @node 5.6 5.6 Italicize This function is generally used to produce an italic version of a normal text character. Sections 2.6.13 ("The ITAF Parameter") and 7.4 ("Italic Factor") explain how to set the level of "italicness" of the modified brush. When this function is executed, the image in the brush is slanted to the right. The bottom line of the brush always remains in the same position. The ITAF ("Italic Factor") parameter determines the number of consecutive lines which have to be slanted to the right by one dot, relative to the lines below. If the value specified by ITAF is smaller than or equal to the height of the brush, the brush is not modified. In all other cases, the image resulting from this operation is larger than the original one. The brush width is increased accordingly, so that the image is not cut. The maximum width of the brush is 255 dots. The operation is not performed if the resulting brush would be slanted beyond this limit. The brush itself remains rectangular, i.e. its outline is not italicized. For example, if ITAF is equal to 2, and the brush is 6 dots tall, this function will shift the middle two rows of dots in the image to the right by one position, and the top two rows by two positions, in the same direction. The two bottom rows will remain on the same position. The total brush width will be increased by two dots, so that the resulting image (which has become larger) is not cut. This is one of the functions which are often recorded in a macro sequence and repeated on a group of characters, if not on the whole font, to produce a new font. @endnode @node 5.7 5.7 Reverse This function reverses each dot in the brush image. Coloured dots become transparent, and vice versa. After the function is executed an even (2, 4, 6 etc.) number of times, the resulting brush is the same as the original brush. @endnode @node 5.8 5.8 Resize The functions described in the following subsections modify the size of the brush. The image in the brush is stretched to the new size. The image is never cut. The maximum brush dimensions are 255 columns by 255 lines. The minimum size is one dot. The functions do nothing if the resulting image dimensions would exceed these limits. @endnode @node 5.8.1 5.8.1 Stretch This function stretches the brush to a size defined by the user. The new size is selected by using the mouse in the character editing box. When this function is selected, the "brush stretch" mode begins. When the mouse pointer is over the character editing box it changes its default image to the stretch symbol. This is to remind the user that the "brush stretch" mode is active. The user is requested to define a new size for the brush. To do so, a rectangle must be marked with the mouse, like the brush definition described in section 3.18. The brush stretch mode is active until the user selects one corner of the brush rectangle in the editing box, presses a mouse button, moves the mouse pointer to the opposite corner, and releases the mouse button. The operation can be cancelled by selecting the function again before the left mouse button is pressed in the character editing box. The brush stretch mode can also be interrupted by selecting the "Pencil/Brush" gadget (section 3.17) or the equivalent keyboard shortcuts, or by redefining a new brush. During the selection of the rectangle corresponding to the new size, the mouse pointer is used to select the dot-positions which mark the beginning and end of the rectangle. The two positions represent opposite corners of the rectangle. When the mouse pointer is over the character editing box and a mouse button is pressed (and held down), a green border is drawn around the dot under the pointer. This is to highlight the rectangle which is being selected. One corner of the rectangle will remain linked with the initial position. The other corner will follow the mouse pointer. When the mouse is moved (with the button still pressed), the rectangle will change shape accordingly. When the mouse button is finally released, the definition of the new brush size is complete. The program automatically stretches the brush image to the new size. The resulting brush will have the same height and width as the selected rectangle. @endnode @node 5.8.2 5.8.2 Halve This function halves the brush. The width and the height are halved, therefore the total brush surface is reduced to a quarter of the original brush. This function, like all functions which reduce an image down to a smaller dimension, causes a loss of data. Since the size of the dots which make up the image does not change, the number of dots is reduced. In the case of this function, the resulting image has about one quarter of the the dots in the original brush. Even for a human, it is not easy to decide which dots to "sacrifice". The Personal Fonts Maker reduces the image in a very mechanical way: every second row of dots from the top is "discarded". Then, the same is done for every second dot of the remaining rows. If the dimension which has to be halved contains an odd number of dots, the step rate is calculated in a way that the first and last dots (or columns, or rows) are not removed. A "Double" operation following "Halve" will usually not restore the original image, unless the first image consisted of "bricks" of 2 by 2 dots of the same colour. @endnode @node 5.8.3 5.8.3 Halve Horizontal This function is a subset of "Halve". Only the width is halved, while the height is left unchanged. Every second column, starting from the left, is removed. The same exceptions already described for the "Halve" operation apply if the image consists of an odd number of columns. @endnode @node 5.8.4 5.8.4 Halve Vertical This function "flattens" the brush. The width is not varied, but the brush height is halved. This is done discarding every second row of dots from the top, unless the image consists of an odd number of rows, in which case the procedure is slightly more complex. @endnode @node 5.8.5 5.8.5 Double This function doubles both the horizontal and vertical brush dimensions. The resulting brush will have four times as many dots as the original brush. Like all other brush editing functions, this function is not executed if the resulting brush would exceed the maximum limit of 255 dots, either horizontally or vertically. To double the brush image, the program first duplicates every row of dots, and then does the same with every column. The result is an image where the original dots appear as "bricks" of four dots (2 x 2) having the same colour as the original dot. @endnode @node 5.8.6 5.8.6 Double Horizontal This function is a subset of "Double". The brush is doubled only horizontally. While the width is doubled, the height remains the same. @endnode @node 5.8.7 5.8.7 Double Vertical This function is a subset of "Double". The brush is doubled only vertically. While the height is doubled, the width remains the same as that of the original brush. @endnode @node 5.9 5.9 Handle As described in section 3.17 ("The 'Pencil/Brush' Gadget"), an outline of the brush is associated with the mouse pointer over the character editing box when the brush mode is active. The outline indicates the area over which the brush image would be copied selecting a mouse button. If the brush is larger than the character editing box, or if part of the brush is not over the character editing box, only the part over the box is outlined. The brush outline is moved when the mouse pointer goes from one dot in the box over another dot. If the pointer is moved, but remains over the same dot, the outline is not moved. The Personal Fonts Maker allows the user to select which dot of the brush rectangle should be linked with the mouse pointer. One of five positions can be selected: the four corners, plus the centre of the brush. The following five subsections explain each possible setting in detail. Once the position of the handle has been selected, it can be changed only by choosing a different position, or loading a new brush. The "Flip" and "Rotate" functions do not flip or rotate the position of the brush handle. If the brush size is varied, the handle will be re-positioned so that it stays on the same relative position (a corner or the centre of the brush rectangle). The handle's position is stored with the image data of the brush when the brush is saved (section 5.2 "Save Brush"). When a brush is loaded, the original handle position associated with that brush is restored. @endnode @node 5.9.1 5.9.1 Upper Left This option places the brush handle on the top left corner of the brush. This means that the outline displayed over the character editing box will have its upper left dot under the mouse pointer. This brush position is the only which is guaranteed not to be moved by a brush resizing operation. Therefore, the brush handle will always be linked with the same dot. The top left corner is also the origin of the coordinate systems of different functions of the Personal Fonts Maker. These properties make this handle position particularly interesting when the size of the brush is unknown, as in macro operations, and relative brush movements are recorded (macros are explained in chapter 6). @endnode @node 5.9.2 5.9.2 Upper Right This option links the brush handle with the top right corner of the brush rectangle. @endnode @node 5.9.3 5.9.3 Centre The brush handle position is placed at the centre of the brush. If the centre falls between two dots, the lowest of two dots on the same column, or the rightmost of two horizontally adjacent dots is selected. This is the default initial brush handle position of the Personal Fonts Maker. @endnode @node 5.9.4 5.9.4 Lower Left This option places the handle at the lower left corner of the brush. @endnode @node 5.9.5 5.9.5 Lower Right This option links the brush handle with the lower right corner of the brush rectangle. As for all other positions except "Upper Left", a resizing of the brush implies that the position of the handle is also moved. In all positions except "Upper Left", the handle has to be moved over a different dot if the brush is resized, since three out of four edges of the brush are repositioned by a stretch operation. This is to ensure that the selected relative position (the lower right brush corner, in this case) always remains on the same corner. @ENDNODE