"Personal Fonts Maker - 10. PDM: The Project Menu" 10. PDM: The Project Menu 10.1 Load Driver 10.2 Save Driver 10.3 Load Definitions 10.3.1 Commands and Characters 10.3.2 Commands 10.3.3 Characters 10.4 Save Definitions 10.5 Clear Definitions 10.5.1 Commands 10.5.2 Characters 10.6 Check Definitions 10.7 Section 10.7.1 Commands 10.7.2 Characters 10.8 Flush Printer Device 10.9 About 10.10 Quit "Personal Fonts Maker - 10. PDM: The Project Menu" 10. PDM: The Project Menu This chapter describes all the functions which can be accessed from the "Project" menu of the Printer Driver Modifier. All the functions which read or write data from and to peripheral units, and several more, are described here. 10.1 Load Driver This function loads a printer driver into the program's memory. A warning message is displayed if the load operation would clear the data of the driver currently processed, if this has not been saved. If the "Cancel" gadget of the warning message is selected, the function is aborted. The standard file requester (section 3.23) is used to select the printer driver which is to be loaded. Printer drivers are usually stored inside the "printers" drawer, which is contained in the "devs" drawer, of the Amiga Workbench and Extras disks. After the driver has been loaded, the control sequences associated with the commands and characters can be edited by the user, as described in section 9.4.2 ("The Editing Gadget"). The codes stored in the printer driver's internal command tables are converted to the FFDL syntax as specified by the user through the "Decoding Mode" functions (section 11.4). Printer drivers which are part of Amiga operating systems previous to version 1.2 cannot be loaded by the Printer Driver Modifier. 10.2 Save Driver This function saves the current driver. The standard file requester is used to select the name of the driver. It should be noted that printer drivers also have an internal name, which should match the name of the file in which the driver is stored. The internal name is part of the printer driver data loaded with the "Load Driver" function, and cannot be modified. This function initially checks the FFDL sequences written by the user for any errors. This is the same as the operation which can be executed manually by the user with the "Check Definitions" function (section 10.6). The save operation is aborted if any errors are found. Appendix H explains the error messages which may be displayed. The control sequences associated with the commands and characters are packed and optimized as specified by the user through the "Encoding Mode" parameters (section 11.5). After the driver has been saved, the program automatically performs a "Flush Printer Device" operation, as described in section 10.8. 10.3 Load Definitions A driver consists of much more than a table of control sequences. The "Load Driver" and "Save Driver" functions are used to load and store entire printer drivers. The Printer Driver Modifier can also load and save parameter files, similar to those used by the Personal Fonts Maker, containing FFDL sequences associated with commands and characters. A parameter file for the Printer Driver Modifier follows exactly the same format rules for the parameter and macro files of the Personal Fonts Maker. Section 2.6 ("Program and Font Parameters") explains how the data has to be written in such a file. The default file name suffix is ".def" (e.g. "Roman8.def"). The "PDM DEFS" header must appear at the beginning of the file to identify it as a PDM parameter file. The Printer Driver Modifier uses only two keywords and one data type for its parameter files. The two keywords are CHAR and COMM. Both must be followed by a value indicating the character or code they refer to, an equal sign and the FFDL sequence associated with the character or code. Comments may not appear on the right of an FFDL sequence. The COMM parameter indicates that the following FFDL sequence refers to the command whose code is indicated immediately after the COMM keyword. CHAR is used to associate FFDL sequences with characters whose code in the Amiga set is in the range 160 to 255. The code after the CHAR keywords determines to which character in the Amiga set the sequence is to be linked. The numerical values which appear after the CHAR and COMM keywords follow the same encoding scheme as the values displayed in the "Number" gadget (section 9.4.1) of the program's main window. For example: PDM DEFS ; = @, as in German 7-bit character set CHAR 167 = (64) ; "Underline ON" sequence as in ; Epson, IBM Proprinter and NEC Pinwriter COMM 8 = ESC \- (1) contains the information to redefine a character and a command. When this file is loaded with the "Commands and Characters" function (section 10.3.1), the Printer Driver Modifier associates an FFDL sequence with the character whose Amiga code is 167, and an FFDL sequence to the command number 8, which is "Underline On". The standard file requester (section 3.23) is used to select the file containing the parameters. A printer driver must already be in the program's memory when the parameters are loaded. Only the commands or characters referenced to in the parameter file are modified. If any errors are encountered in the parameter file, an error message is displayed and the operation is interrupted. All commands and characters are cleared. Appendix H describes all messages of the Printer Driver Modifier. It is possible to selectively load only the sequences in the file associated with either commands or characters. The following subsections, named as the three menu items, explain how this can be done. 10.3.1 Commands and Characters This function loads all the sequences in the file. The only commands or characters which are not modifed are those for which there is no associated command sequence in the parameter file (and - of course - those for which the new sequence is identical to the current one). 10.3.2 Commands This function only loads the sequences in the parameter file associated with printer commands. These FFDL sequences are introduced by the COMM keyword. Sequences associated with characters (CHAR keyword) are not considered. 10.3.3 Characters This function loads only those FFDL sequences in the parameter file introduced by the CHAR keyword. These are the FFDL sequences associated with the character table. This function can be very useful to modify a printer driver which does not support the downloading of characters whose code is greater than 127. In this case, a 7-bit character set containing the required national characters can be selected by choosing from the sets which come with the data files enclosed with the Personal Fonts Maker and the Printer Driver Modifier. The font to be downloaded must be designed so that all the required national characters whose Amiga code is greater than 127 are placed within the range accessible with 7 bits addressing, and the printer driver should be modified so that these Amiga codes are converted into the new codes of the downloaded set. This can be done more rapidly by loading the same 7-bit character set data file from the files which come both with the Personal Fonts Maker and the Printer Driver Modifier into both programs. Of course, it is also possible to design a new character set and use it with the Personal Fonts Maker and the Printer Driver Modifier. 10.4 Save Definitions This function saves all control sequences defined in the current driver environment to a file. The standard file requester (section 3.23) is used to define the file name and the position where the file is to be stored. The name of the default drawer used to store the control sequence definition files of the Printer Driver Modifier is "PDM_Defs". It is always advisable to save a set of new definitions with this function, even if the printer driver with the same function has also been saved. If a driver which has already been modified must be modified again, it is preferable to load the original driver and then the modified definitions, rather than the driver which has already been modified once. When a driver is loaded, modified and saved more than once, it may happen that the tables used to store the characters and commands may not be used with the maximum efficience. The definitions are not checked for validity before they are saved. All definitions are saved. When the definitions are loaded again, it is possible to selectively load only the sequences associated with commands or characters (section 10.3, "Load Definitions"). Section 11.2 ("Icons") explains how it is possible to associate an icon with the parameter files saved by the program. Any errors encountered during the save operation are signalled by a message, as explained in appendix H. 10.5 Clear Definitions The Printer Driver Modifier has two functions to quickly remove all control sequences associated with either commands or characters. These functions are especially useful if a driver is used as a point of departure to create a substantially different driver, where perhaps only a few commands or characters are used. In this case, the control sequences associated with the unused commands and characters would occupy more memory than necessary. The two functions, described in the following subsections, respectively clear the memory occupied by the command table and the character table. 10.5.1 Commands This function clears all control sequences associated with the printer commands. This is functionally similar to setting all commands to NOAV, as described in section 9.4.2 ("The Editing Gadget"). In fact, if the available memory is sufficient, it is preferable to place a NOAV code in the editing gadget, rather than leaving the gadget empty. 10.5.2 Characters This function clears all sequences associated with the characters whose code is greater than or equal to 160. There is no NOAV code to indicate that a character should not be sent to the printer, as there is for the command table. The only solution is to clear the control sequence, as is done by this function for all characters. 10.6 Check Definitions When a control sequence is written in the editing gadget (section 9.4.2), or loaded from a file (section 10.3, "Load Definitions"), it is not checked by the program to be error-proof. This is done by the "Check Definitions" function, which is also used by the functions which save a printer driver (section 10.2) or modify the decoding mode (section 11.4). This function searches all control sequences for errors. It also verifies that the length of the individual sequences (in the fixed locations mode) or the sum of all the sequences (if the floating locations mode is selected) does not exceed the limits for the single sequences or for all sequences respectively. After an error is found, the search is interrupted, an error message is displayed and the control sequence containing the error becomes the current sequence in the editing gadget (section 9.4.2). The message indicates the type of the error and the position at which it was found. Appendix H describes all messages of the Printer Driver Modifier. After the error message is displayed, the cursor in the editing gadget is positioned over the character where the error was detected. 10.7 Section As already described in section 9.4.1, the program is either in the command mode or in the character mode. This means that at any given time the program can only be used to access the codes of one section of the printer driver, which can be either the command or the character table. The following two subsections explain the two commands which can be used to switch between one section and the other. The command or character which was last selected before a switch to the other mode is selected again when the previous mode is reselected. In addition to the shortcuts assigned to each command, the key can be pressed to switch from one mode to the other. 10.7.1 Commands This function activates the command mode. The program's window is arranged so that the fields with all the necessary information regarding the printer commands are displayed. Section 9.4 ("The PDM: The Main Window") contains a detailed description of each field and gadget. 10.7.2 Characters This command selects the character mode. The appropriate fields and gadgets in the program's window are displayed. 10.8 Flush Printer Device As explained in section 4.13.2 ("Write Font Data/Printer"), in some circumstances a printer driver remains in the computer's RAM even when it is not used. From there, it can be quickly accessed whenever necessary. This can reduce the number of disk swaps, but may have one side-effect when the Printer Driver Modifier is used. If a printer driver is used by a program, but is then modified with the Printer Driver Modifier, only the driver stored on the disk is updated. If a copy of the driver is still held by the operating system in the computer's RAM, that version will be used the driver is needed the next time. The modified version is not used until the driver is removed from the RAM after a memory shortage. The Amiga operating system uses the driver's internal name to distinguish between different drivers. If a new driver with the same internal name as the current driver (most likely one being a variant of the other) is selected, the Amiga behaves as in the case just explained (different versions of the same driver). This command removes the printer driver if it is stored in the RAM, so that the operating system is forced to load the driver again. This means that if the driver has been modified, the new version is used. If another program is currently using the printer device, the driver cannot be "flushed" immediately. The action is deferred until the application using the driver does not need it any more. This is signalled by a message, as described in appendix H. This function is also executed automatically by the "Save Driver" function, described in section 10.2. 10.9 About This is a graphical menu which can be displayed using the mouse. A box appears when this menu item is selected. Some information on the Printer Driver Modifier version, the copyrights and its authors is displayed. 10.10 Quit This command is used to terminate the work with the Printer Driver Modifier. A warning requester appears if the current definitions have not yet been saved. The "Proceed" and "Cancel" gadgets of the requester can be used to confirm or cancel the command. If the choice is confirmed, the program terminates. The windows opened by the Printer Driver Modifier are closed and all memory and resources occupied by the program are freed. It is good practice to always exit from all programs before switching the computer off or resetting the system (with the + + keys). This function can also be executed by selecting the gadget to the left of the title bar on the main window of the Printer Driver Modifier.