APPLICATION NOTE #233 ADDING POSTSCRIPT SOFT FONTS TO XyWrite 4.0 PostScript laser printers have resident typefaces, typically in a configuration of 35 or more standard fonts. The standard XyWrite 4.0 printer files include font definitions and width tables for these built-in typefaces. If you want to add more fonts to your system, you can purchase downloadable typefaces from Adobe Systems Inc. or other third-party manufacturers. This application note describes a XYQUEST-developed program that creates the font definitions and width tables needed to use downloaded PostScript fonts with XyWrite 4.0. INTRODUCTION XyWrite 4.0, like any electronic text processing system, needs a width measurement value for each character in a proportional font. This enables the system to calculate how many characters fit on a line, perform hyphenation, and observe margins. It is also required for full justification of text where fractional spaces are inserted between letters and words in order to fill out the line and create even right text instead of ragged right. Most major manufacturers of PostScript Type 1 (or compatible) fonts supply the width measurement value of their soft fonts in AFM (Adobe Font Metrics) files. The AFM files are delivered on disk as part of each font package you purchase. XYQUEST developed the ADDPS4 (Add PostScript) program to read the width information contained in AFM files furnished by the font manufacturer, convert that information into XyWrite 4.0 font definitions and width tables, test the resulting mini-printer files, and merge the font information with any of XyWrite's existing PostScript printer files (see Note #2). Note #1 Limitations. ADDPS4 works with all standard PostScript text fonts; it does not work with specialty typefaces such as Expert Sets, Symbol, or Dingbats. ADDPS4 can process up to eight fonts per session. If you have more than that, you need to complete one session of ADDPS4 and then start another. Note #2 Non-Standard PostScript Printer Files. If you have modified the original PostScript printer file, the Merge Fonts routine may not work. Any automated merging routine relies upon search commands. Though every attempt has been made to search for standard elements existing in each of XyWrite's PostScript printer drivers, no merging routine can anticipate every customization scheme. INSTALLATION ADDPS4 is available on request from XYQUEST's Technical Services department. Once you have obtained a copy, install it as follows: 1. Run XyWrite 4.0. 2. Close all open windows. 3. Insert the disk containing the ADDPS4 files into a floppy disk drive. Note #3 Floppy Disk Drive. You must install ADDPS4 from a floppy disk, not from a network drive or subdirectory on your hard disk. 4. Run the INSTALL procedure. For example, if the ADDPS4 disk is in drive A: Type: F5run a:install4 Result: The Choose Drives dialog box appears. 5. If the drive letters of the source and target drives are correct, go to step 6. Otherwise, type in the letters of the drives you are using. 6. Press or activate the OK pushbutton. Result: The Choose Paths dialog box appears. 7. If the directory names are correct, go to step 8. Otherwise, type in the names of the directories you are using. 8. Press or activate the OK pushbutton. Result: The installation program copies the required files into the directory you specified above (\XY4\ADDPS4 by default). When all the files are copied, the Installation Concluded dialog box appears. This dialog box lists the next steps in the procedure,Äit is for your information only. 9. Press or activate the OK pushbutton. GETTING READY Before running ADDPS4, you must install the AFM files supplied with the soft fonts. In addition, we recommend that you: * Download the soft fonts to the printer so that you can test the results of the width tables created by ADDPS4 before modifying your printer file. * Reboot the computer. * Make a backup copy of the XyWrite 4.0 printer file you plan to modify. Installing AFM Files To install AFM files: 1. Insert the floppy disk that contains the AFM files in an available drive. (This disk was supplied by the font manufacturer. Refer to the documentation you received with the soft font for more information.) 2. Change to the directory you specified for AFM files. For example: Type: F5cd \xy4\ADDPS4\afm 3. Go to DOS. Type: F5dos 4. At the DOS prompt, issue the COPY command. For example, if the disk containing the AFM files is in drive A: Type: copy a:*.afm 5. Return to XyWrite. Type: exit Downloading Soft Fonts To download fonts, you must use a separate utility, such as PSDOWN, which is supplied by Adobe Systems, Inc. with its soft fonts. Neither XyWrite 4.0 nor ADDPS4 downloads soft fonts to a PostScript printer. Once you have downloaded the fonts, we recommend that you reboot your computer because downloading programs sometimes affect printing. Backing up the Printer File One of the tasks that ADDPS4 performs is to modify the printer file that you specify. It is always a good idea to make a backup copy of a file to which you are going to make extensive changes. Use the COPY command to make a backup of the printer file. For example: Type: F5copy post35n.prn post35n.bak RUNNING ADDPS4 You can use ADDPS4 to perform several tasks, and not all of them have to be completed at one session. You can interrupt the program at several points and save the work you completed to that point. To start ADDPS4: Press: Ctrl+Alt+Shift+A The ADDPS4 action bar appears, with the Add PostScript menu pulled down. The Add PostScript menu has the following options: Select Fonts Test Fonts Merge Fonts AFM Directory Disk Maintenance Each of these options is discussed in detail below. AFM Directory When you installed ADDPS4, you specified a directory for AFM files. For this session of ADDPS4, the AFM files may be in a different location (for example, you may want to use AFM files that are on a floppy disk). To override the default AFM directory: 1. Select AFM Directory from the Add PostScript menu. Result: The Choose AFM Source Directory dialog box appears. 2. Type in the location of the AFM files you want to convert. (Be sure to specify both the drive and path, even if it is the root directory of a floppy disk.) 3. Press or activate the OK pushbutton. Result: ADDPS4 will use the AFM files in the location specified in step 2. Convert AFM Files to XyWrite To convert the information in the AFM files to the width tables and font definitions that XyWrite uses, you need to first assign a type style to each font (see Note #4) you want to add to the XyWrite 4.0 printer file: Note #4 Typeface vs Font. A typeface is a family of fonts designed to be used together. While a typical PostScript laser printer has 35 fonts, this grouping really represents only eleven typefaces. Examples of typeface families would be Times-Roman, Helvetica, or Garamond. While some typefaces include eight or more fonts, others (such as Zapf Chancery) have only one. Within most typefaces there is a set of fonts in various styles or weights: usually normal, italic, bold, and bold-italic. Other standard PostScript fonts include light, heavy, black, kursiv, or oblique. Some of these fonts represent an alternate name for one of the basic four (kursiv and oblique are functionally equivalent to italic). Other font names indicate an intermediate weight (heavy is between normal and bold). To assign styles: 1. Choose Select Fonts from the Add PostScript menu. Result: The Select AFM Files dialog box appears. 2. Highlight the name of the first AFM file you are converting. 3. If you are not sure what font is represented by the AFM filename, activate the Review highlighted font name check box. If you activate this check box and then activate the Select pushbutton, ADDPS4 displays a description of the highlighted font. Press to return to the Select AFM Files dialog box. 4. Press or activate the Select pushbutton. Result: The Select the Type Style dialog box appears. 5. Indicate the style you want to assign to the selected font by activating one of the following pushbuttons. Normal Italic Bold Bold-Italic Custom Tip: If you aren't sure which style is appropriate, activate the Help pushbutton. 6. Press or activate the OK pushbutton. Result: The Select AFM Files dialog box appears. Tip: If you make a mistake during the Type Style selection process, activate the Start Over pushbutton. ADDPS4 will cancel the selections you made to that point so you can start the selection process again. 7. Repeat steps 2-6 for each font you want to convert. Note #5 Floppy Disks. If you are converting files from a series of floppy disks, activate the Refresh directory pushbutton each time you change floppy disks. If you activate this check box and then activate the Select pushbutton, ADDPS4 updates the list of AFM files displayed in the Select AFM Files dialog box. When you have assigned a style to all the fonts you want to convert, you can start the actual conversion process: Activate the Convert Fonts pushbutton in the Select AFM Files dialog box. Result: ADDPS4 begins converting the selected fonts to a printer file in XyWrite format. During the conversion procedure, ADDPS4 displays a report on screen showing the font name being processed, its numbered position on the list, and the total number of fonts on the list (e.g., ``Processing GaramondRegularItalic, Font 2 of 4''). A ``Working. . .'' message also appears, including a row of dots that increase in number as a font is processed. Because the conversion takes time and the screen is otherwise quiet, this message confirms that the program is active. The speed of the conversion varies from machine to machine, but several minutes per font should be allowed. When the conversion is complete, ADDPS4 returns to the main menu. At this point, you have a choice of proceeding to another step or quitting ADDPS4. To continue, see ``Testing Converted Fonts'' or ``Merge Fonts with Existing PostScript Printer File.'' To quit, see ``Exiting ADDPS4'' at the end of this application note. Testing Converted Fonts Because the ADDPS4 program converts width values properly for most fonts, the testing portion of the ADDPS4 program is optional. It is included to give you the opportunity to confirm the success of the conversion and to make any necessary corrections before modifying the printer file. To test the converted fonts: 1. If you haven't already done so, download the fonts you want to test. (See ``Getting Ready'' for more information on downloading fonts.) Note #6 Quitting ADDPS4. You must exit ADDPS4 to download fonts. 2. If you are not already running ADDPS4, start it. a. Press: Ctrl+Alt+Shift+A b. Activate the Resume previous ADDPS4 session radio button. c. Press or activate the OK pushbutton. Result: The main menu appears. 3. Select Test Fonts from the Add PostScript menu. Result: ADDPS4 displays a screen that reminds you to download the PostScript soft fonts before testing. a. If the fonts are not yet in printer memory, activate the Save work and quit pushbutton, download the fonts, and start the ADDPS4 program again (step 2 above). b. If the fonts are already in printer memory, activate the Proceed pushbutton. Result: The Test Converted Fonts dialog box appears. 4. Activate the Print Goal Test radio button. 5. Press or activate the Do pushbutton. Result: ADDPS4 loads the printer file created during the conversion process and sends a copy of the file GOAL to the printer. GOAL contains one line for every character in every font converted during this ADDPS4 session (which amounts to about 5 printer pages per font). Each character is printed repeatedly across a line that is 5 inches long. 6. Review the printed pages. If XyWrite is using the correct width, the lines should be nearly the same length. If there are characters with an incorrect width value, their lines will be noticeably longer or shorter than the rest. 7. If the widths are accurate, go to step 18. Otherwise, go to step 8. Note #7 Irregular Lines. Slight irregularities are normal for PostScript printers. If a line is short or long by more than 1/8 inch, you should correct it. 8. If the widths need to be corrected, activate the Fix Goal Test radio button in the Test Converted Fonts dialog box. 9. Activate the Do pushbutton. Result: ADDPS4 asks if you want to fix a line or print a page. 10. Activate the Fix a line radio button. Result: ADDPS4 displays the file GOAL in graphic view. 11. Place the cursor on the first line that printed incorrectly. Note #8 Screen Display. The lines will display with uniform length on screen; refer to the printout to find irregular lines. 12. Press F9. Result: The Fix Character dialog box appears. 13. Activate the appropriate radio button to indicate if the line is too short or too long. 14. In the percentage field, enter your best estimate of the percentage needed to make the line length uniform with the others. Use the current, incorrect length of the line as 100%, and perform your calculations from there. Tip: Activate the Help pushbutton for some examples of irregular lines and the percentage adjustments needed to correct them. 15. Activate the Do pushbutton. Result: ADDPS4 adjusts the character width according to your estimate, and you are again presented with the choice of fixing a line or printing a page. 16. To see the effect of the correction, activate the Print a page radio button. If necessary, repeat steps 11-15. 17. Repeat steps 10-16 for each line you want to correct. 18. Activate the Print Para Test radio button to test the ADDPS4 printer file on full justification and attribute changes. 19. Activate the Do pushbutton. 20. Review the printout. If there are lines that do not justify correctly, try printing GOAL again, then repeat steps 8-16. 21. When testing is complete, activate the Done pushbutton. Result: The main menu appears. At this point, you have a choice of proceeding to another step or quitting ADDPS4. To continue, see ``Merge Fonts with Existing PostScript Printer File.'' To quit, see ``Exiting ADDPS4'' at the end of this application note. Merge Fonts with Existing PostScript Printer File To merge the new fonts with your original PostScript printer files (see Note #2): 1. If you are not already running ADDPS4, start it. a. Press: Ctrl+Alt+Shift+A b. Activate the Resume previous ADDPS4 session radio button. c. Press or activate the OK pushbutton. Result: The main menu appears. 2. Select Merge Fonts from the Add PostScript menu. Result: The Merge Fonts dialog box appears. 3. Highlight the printer file you want to modify. 4. Press or activate the OK pushbutton. Result: ADDPS4 merges the information about the new fonts into the printer file you selected. From this point on, you may use your new fonts with XyWrite 4.0 and they will appear on the Typeface menu. Note #9 Screen/Printer Font Lists. There are two tables in the printer file that you should modify to reflect the fonts you just added to the printer file. One of these tables matches printer fonts to screen fonts, so that when you switch to graphic view XyWrite will use the appropriate screen font. The second table defines a list of synonyms for printer fonts so you can print a document on different printers without changing font names in a document. Both of these tables can be modified by using the Printer Setup option in the File menu. Refer to the XyWrite Command Reference Guide for instructions. Disk Maintenance The Disk Maintenance option makes it easy to remove files generated by the program from your hard disk. ADDPS4 generates three new files each time the program is run. Two of them, GOAL and PARA, are overwritten in future sessions. One, the test printer file, remains on disk after the fonts have been merged. Also, quitting ADDPS4 before fonts have been completely processed and tested may generate a file called VALUES.DFL. These files, along with any stray *.BAK files created by the program, may be reviewed and deleted in Disk Maintenance. To use this option: 1. Select Disk Maintenance from the Add PostScript menu. Result: The Disk Maintenance dialog box appears. 2. Highlight the file you want to delete from the disk. 3. Activate the Delete pushbutton. 4. Repeat steps 2 and 3 for each file you no longer want. 5. Activate the Finished pushbutton to return to the menu. QUITTING ADDPS4 To exit from the ADDPS4 program and return to XyWrite 4.0: 1. Select Exit ADDPS4 from the Exit menu. If you have completed the ADDPS4 process (including merging the font information into the printer file), then the program is cancelled and the original XyWrite settings are restored. If you are exiting before completing the required steps in the ADDPS4 process, then you are presented a dialog box that presents several options. 2. To exit, activate one of the following radio buttons. Save work for future editing session and quit Quit without saving 3. Press or activate the OK pushbutton. The XyWrite settings that were in effect before you started ADDPS4 are restored. You can restart ADDPS4 at any time by pressing Ctrl+Alt+Shift+A.