APPLICATION NOTE #123 TESTING WIDTH TABLES IN XYWRITE III AND III PLUS Rev. 03 The PTEST (Printer Test) command lets you test the accuracy of the width tables in your printer file. This command is useful when you are creating a new printer file or making major changes to an existing file. COMMAND FORMAT The PTEST command has the following basic format: PTEST mode,n,start,end where mode is the two-letter abbreviation or number associated with a XyWrite character display mode (e.g., NM, UL, BO), n is the number of the PT (Print Type) table you are testing, start is the value of the ASCII character you want to start the test with (the default is 32) and end is the value of the ASCII character you want to end the test with (the default is 127). The value of end cannot be greater than 254. RUNNING PTEST When you run PTEST, XyWrite prints a test file that comprises one line for each character in the character set. Each line consists of 25 repetitions of the character followed by an exclamation point and the ASCII value of that character. To use PTEST, perform the following steps. 1. Call or create the printer file and make the modifications you need. For example, to add a new font to an existing printer file: * Create a font table that contains definitions and control codes for the new fonts. (This information is supplied by the printer manufacturer.) * Create a width table using the width information supplied by the manufacturer. (If this information is not available, see Note #1.) * Create or modify a PT (Print Type) table that defines the new font(s). Refer to Chapter 6 in the XyWrite Reference Guide for information on how to create and modify printer files. 2. Store and load the printer file you just modified or created. 3. With the screen clear of any file, test the width of one of the modes in the new PT table. For example, to test the width of normal mode in PT 5: Type: F5ptest nm,5 4. Repeat step 3 for each mode and PT table you want to test. Result: When the test is successful, the characters print out in order, from the narrowest to the widest, and the printed lines lengthen accordingly. If a printed line is followed by a shorter line, then there is a width problem. Refer to the documentation supplied by your printer manufacturer for width information, and then call up your printer file and correct the width table as needed. Note #1 Width Information. If you do not have the width information for the new font, you can use this method to determine the width of each character. 1. Define and copy an existing width table. Rename the table to reference the new font. 2. Run PTEST as described above. 3. Calculate the minimum horizontal motion of your printer by multiplying the MU (Margin Unit) value found in your printer file by 10. (If you have modified this value, use the MU defined with the original printer file supplied by XYQUEST.) 4. Measure the width of each 25-character line. Don't include the exclamation point or the ASCII value in your measurement. 5. Divide the measurement taken above by 25 (the number of characters on the line) and multiply that number by the minimum horizontal motion of your printer (calculated in Step 3). For example, if the width of 25 L's is 2 inches, and your printer moves in 300ths of an inch, the following equation calculates the width of one L: 2/25*300=24 If the result of your calculation is a fraction, you need to convert it to a whole number. You can either round it off to the nearest whole number, or you can "scale it up." To scale up, you multiply all the widths (in every width table in the printer file), as well as the MU and DU values, by a common denominator. Scaling up produces a more accurate width table than rounding off, particularly if many of your widths are fractions. If you choose this option, first determine the width of each character in the width table (or tables). Then review the result, looking for the common denominator. For example, if most of the fractions are halves and quarters, the common denominator is 4. If most of the fractions are thirds and sixths, then the common denominator is 6. Remember, you must multiply ALL widths (and the MU and DU values) by the common denominator, not just the fractional values. Note #2 ASCII 127. ASCII character 127 does not test properly. Ignore the results for this character. Note #3 Lines/Page. If you are using XyWrite III Plus, Version 3.53, the PTEST command has the following form: PTEST mode,n,lines,start,end The additional argument, lines, defines the number of lines PTEST puts on a page. This is useful when you are testing the large points sizes available on laser printers.