APPLICATION NOTE #121 POSTSCRIPT PRINTER FILES Rev. 05 PostScript is a page description programming language produced by Adobe Systems Inc. that is used to drive certain printers and typesetters. Such printers include the Apple LaserWriter II NT, the QMS-PS 820, and the IBM 4216 Personal Pageprinter. This application note describes the PostScript printer files that are currently available, and gives you the information you need to use them effectively. AVAILABLE PRINTER FILES There are five PostScript printer files available for use with XyWrite III Plus, Version 3.55 or later. They are 3POST13.PRN, 3POST35N.PRN, 3POST35C.PRN, 3POST43.PRN and 3POST29.PRN. The table at the end of this file describes the font families and printers supported by each printer file. Select the correct printer file for your printer; if the printer is not listed, choose the file that supports your printer's internal fonts. Each printer file contains a PC (Printer Control) table that allows you to switch between portrait and landscape printing, and to access different paper trays. You use the PC (Printer Control) or PB (Page Begin) command to invoke the different codes in the PC table, as explained in the sections "Printing in Landscape Orientation" and "Using Multiple Paper Trays." An explanation of the available PC codes is provided in the table at the bottom of the page. ADDING A FONT The printer files are set up for 12-point type in each font. PostScript allows you to print in any size, so you may want to add other sizes to your printer file. For example, you may want to print your document in 10-point type with 16-point headlines. To do this, you need to create a font table for each new size you want to use and then either create a new PT (Print Type) table or modify the mode definitions in one of the existing PT tables. To use a 10-point Times Roman font, you must first create a font table for it. The following procedure describes one method for creating font tables. A program for making fonts is described in the "Automatic Font Tables" section of this document. 1. Define and copy the 12-point Times Roman font table (see Note #1). Type: F5se /fo:12times/ Move the cursor to the beginning of the line and press F1. Move the cursor to the first character of the next font table and press F1 again. Press: F7 (to copy the defined block) Press: F3 (to restore the defined block) 2. Change the name of the new font table from 12TIMES to 10TIMES. 3. Change the font entry statement (line 2 of the font table) so that it contains the number 10 rather than 12. 4. Change the VL (Vertical Leading) setting to the value you want. In this example, you might change the VL setting to 12 (see Note #2). 5. Change the scaling factor in the width table from 12 to 10. The two versions of the font table are shown below. FO:12TIMES FO:10TIMES FO< ) s T 12 f ( FO< ) s T 10 f ( VL=14 VL=12 UW:12*TIMES UW:10*TIMES US:SUB US:SUB ET ET Repeat this procedure for each new font. Remember that each typeface in a family requires a separate font table, so if you are planning to use 10-point Times Roman Bold and 10-point Times Roman Italic as well, you need to create font tables for each of them. Once you have created the required font tables, you need to create a PT (Print Type) table that references them. 1. Define and copy an existing PT table. 2. Assign a unique number to it. You can use any available number between 1 and 255 (except PT=32). The tables do not have to be in numerical order. 3. Enter the correct mode definitions. Your completed table might look like this: PT=4 MD NM+10TIMES MD BO+10TIMES-BOLD MD UL+10TIMES+UNDERLINE MD RV+10TIMES-ITALIC MD BU+10SYMBOL MD BR+10TIMES-BOLD-ITALIC MD SU+10TIMES+SUPERSCRIPT MD SD+10TIMES+SUBSCRIPT CREATING EXPANDED AND CONDENSED FONTS Makefont is a PostScript command that allows you to create expanded and condensed fonts by setting the width and height of a font to different values. For example, a 12-point font will have a condensed look if it is scaled to a 9-point width; the same font will have an expanded look if it is scaled to a 15-point width. The procedure for creating an expanded or condensed font is the same as for adding a new font, except the font entry statement of the font table has the following format: FO< ) s font [w 0 0 h 0 0] m ( where font is the font name abbreviation (from the list in the printer file), w defines the width of the font, and h defines the height of the font. The value for w is also used in the UW (Use Width Table) statement and the value for h is used to calculate the VL (Vertical Leading) value. Following are font tables for 12-point condensed and expanded fonts. FO:12TIMES-CONDENSED FO< ) s T [9 0 0 12 0 0] m ( VL=14 UW:9*TIMES US:SUB ET ; FO:12TIMES-EXPANDED FO< ) s T [15 0 0 12 0 0] m ( VL=14 UW:15*TIMES US:SUB ET ; POSTDEF.PGM, which is described below in "Automatic Font Definitions," can be used to create scaled fonts also. FOREIGN LANGUAGE SUPPORT Foreign language characters (accents, punctuation, etc.) are available in all PostScript printer files. You can output these special characters in all standard text fonts. To produce a foreign language character, you simply type the ASCII character you want into the text. For example, to produce a lowercase e with an acute accent (‚): Type: Alt-Shift-130 For a list of ASCII characters and the numbers associated with them, refer to Appendix A of the XyWrite Reference Guide. For a list of the foreign language characters that you can print out using one of the PostScript printer files, refer to Application Note #165, PostScript Symbol Set. Because foreign language support involves much more internal processing than would otherwise be required, it slows down the output of the first page of each file. If you do not use foreign characters, you could reduce the processing time. Call our Technical Services Department for more information. AUTOMATIC FONT TABLES XYQUEST provides a program called POSTDEF.PGM to help you make font tables. You can use this program, which is available on request, to make either regular or scaled font definitions. (Scaled fonts are either compressed or expanded.) To use POSTDEF.PGM, call your printer file and locate a font table that defines the font for which you want an additional point size. Put your cursor on the first line (FO:) of the font table. For instance, if you wish to make 24-point Helvetica-Bold, the cursor must be on the first line of an existing Helvetica-Bold font definition. Then activate the program: Type: F5run postdef.pgm Result: The program will ask you if you want a regular or a scaled font. Press the appropriate response: R regular S scaled Scaled fonts are either compressed (i.e., horizontal size less than vertical size) or expanded (i.e., horizontal size greater than vertical size). For instance, to compress 24 Helvetica-Bold slightly, you might specify a horizontal size of 22. To expand it a bit, you might specify a horizontal size of 26. Specify the point sizes when asked. All point sizes must be whole numbers. If you make a mistake while entering any number, press Esc to exit the program, then start again. Your new font definition will follow XyWrite font naming conventions, i.e., point size followed by font name (24HELVETICA-BOLD). For scaled fonts, the convention is vertical/horizontal followed by font name (24/22HELVETICA-BOLD). The standard formula for computing VL is also used (see Note #2). POSTDEF.PGM creates font definitions only. You must still build PT tables to use the new fonts. Tip If you plan to make many new font definitions, you can load POSTDEF.PGM to a Save/Get key for easy access. To do this: Type: F5ldpm postdef.pgm,x where "x" is the alphanumeric key of your choice. To use the program, press Alt-x. PUTTING POSTSCRIPT CODES INTO THE FILE All five printer files contain a PostScript "font." You can use this font to put PostScript coding directly into your file. For example, you can use the PostScript font to draw lines. To use the PostScript font, you must first assign it to a mode in a PT table. For example: MD RV+POSTSCRIPT Once you store and load the printer file, you can change to reverse mode to type PostScript codes. The information you enter in reverse mode will not be printed as text, but will be sent to the printer for processing. When you are done entering the PostScript code, change to normal mode and continue entering or editing text. There are a few characteristics of working in PostScript mode with XyWrite that you must keep in mind. * You cannot enter a carriage return when you are in PostScript mode unless you have assigned the PostScript font to mode normal (MD NM) in a PT table. (XyWrite returns to normal mode at the end of every line, which disrupts the PostScript coding.) * Variables are not automatically reset when you return to a normal text mode, so you must be careful about precisely which PostScript commands you enter in this fashion. Be sure to reset any variables you change. * When you enter a PostScript mode, XyWrite remembers its current page position and returns to that spot when you exit the PostScript mode. That means you can be in the middle of the page when you enter PostScript commands to draw a line at the top of the page. After the printer draws the line, it returns to the middle of the page, exactly where it was when it encountered the PostScript commands. PRINTING IN LANDSCAPE ORIENTATION In standard printing (also called portrait printing), characters are printed across the 8-1/2-inch dimension of the page. In landscape printing, characters are printed across the 11-inch dimension of the page. Landscape printing is convenient if you want to print a spreadsheet, a document with many snaked columns, or an envelope. PostScript printers allow you to use all fonts in either portrait or landscape orientation. In XyWrite, you use the PC (Printer Control) or PB (Page Begin) command to change orientations (see Note #3): PC if the entire file is in landscape, and PB if you are mixing landscape and portrait within a file. The PB and PC commands refer to a table in the PostScript printer file which contains the coding the printer needs to change orientations (refer to the table at the end of this file). The default orientation is portrait, which means you don't need to issue a PC or PB command if you are printing only in portrait orientation. However, if you want to print in landscape orientation, the PC or PB command is required. To print an entire document in landscape, type the PC 1 command at the beginning of the file. Then change the PL (Page Length), FD (Form Depth), and RM (Right Margin) format settings so they match the landscape page dimension. Press: Ctrl-Home Type: F5pc 1 Type: F5fd 48 Type: F5pl 45,47,40 Type: F5rm 105 Use the PB command to change orientation from page to page (see Note #4). To do that, you enter the PB command at the end of the page that precedes the one you want to rotate. For example, suppose you want pages 1 and 3 to print in portrait orientation, and page 2 to print in landscape. 1. Move the cursor to the end of page 1. 2. Enter the PB command for landscape orientation. Type: F5pb 1 3. Insert a PG (Page Break) command followed by a carriage return. Type: F5pg 4. Enter the formatting commands for landscape orientation (as described above). 5. Move the cursor to the end of page 2. 6. Enter the PB command for portrait orientation. Type: F5pb 2 7. Repeat step 3. 8. Reestablish the formatting commands for portrait orientation. Let's take a look at another example. If the first two or more pages of the file are in landscape, there is an extra step that you must perform. This extra step is necessary because of the way XyWrite processes PB commands that are on the first page of the file: it processes the control string at the top of page one and at the top of page two. To avoid this duplicate processing: 1. Move the cursor to the beginning of the file and enter the PB command for landscape orientation: Type: F5pb 1 2. Enter the formatting commands for landscape orientation as described above. 3. Move the cursor to the beginning of line 2 and enter the following PB command: Type: F5pb 4. Move the cursor to the end of the last page of landscape orientation. 5. Complete steps 6 through 8 of the previous procedure. PRINTING ON LEGAL-SIZED PAPER If you want to print your document on legal-sized paper (8-1/2 by 14), you must first be sure your printer is set up properly. Printer setup involves different things on different printers. For example, on NEC LC890 printers, you must select "Legal" on the printer's front panel menu; on Apple LaserWriter NTX printers, you must have the legal-size paper tray inserted in the printer. Refer to the printer manual for specific information. Once the printer is ready: 1. Call the file you want to print. 2. Enter the PB command for legal-sized paper. Type: F5pb 7 3. Change the PL (Page Length) and FD (Form Depth) commands to take advantage of the 14-inch paper length. For example: Type: F5fd 81 Type: F5pl 74,78,70 USING MULTIPLE PAPER TRAYS Some PostScript printers have more than one paper tray. XyWrite uses PC codes to tell the printer which paper tray to use. Refer to the PC table at the end of this file for a list of the paper trays supported. The default paper tray is tray #1, so you don't need to issue a PB command to access it unless you are returning to tray #1 after using another tray. To change paper trays, use the appropriate PB command. For example, to use the second paper tray: 1. Move the cursor to the end of the page that precedes the one you want to print from paper tray #2. 2. Type: F5pb 4 3. Insert a PG (Page Break) command followed by a carriage return. Type: F5pg Result: All pages that follow the one containing the PB command will be printed on paper from the paper tray #2. MANUALLY FED ENVELOPES Use the following formatting commands when manually feeding envelopes from the multi-purpose tray: PB 8 LM 52 TP 20 FD 45 PL 42,44,40 RM 90 When using a multi-purpose tray, set the paper guides so that the envelope feeds properly. Insert the envelope face down into the printer. Enter the name and address you want to print on the envelope. When viewed in expanded mode, your completed file should be formatted like the following example: ÿAEPB8ÿAFÿAELM52ÿAFÿAETP20ÿAFÿAEFD45ÿAFÿAEPL42,44,40ÿAF ÿAERM90 ÿAFÿAEPT1ÿAF Catherine Cross 44 Manning Park Billerica, MA 01821 Note #1 Font Names. XyWrite and PostScript demand adherence to precise font-naming conventions. When copying an existing font table to create a new one, always copy a font table for the same typeface as the one you need to add. (For example, if you want to create 16-point Helvetica Bold, copy the 12-point Helvetica Bold font table, not the 12-point Helvetica Oblique table). That way you are sure that the font names are correct. For a list of the required font names, refer to the beginning of the printer file. Note #2 Vertical Spacing. To calculate the VL value, we recommend that you use the following formula: for type sizes that are 8 point or less, add 1 to the point size; for type sizes between 9 and 14, add 2 to the point size; for type sizes 15 and larger, add 3 to the point size. Note #3 PC vs PB Command. Both the PC (Printer Control) and PB (Page Begin) commands allow you to send control strings from the PC table to the printer. The difference between the two commands is the order in which XyWrite processes them. XyWrite processes the PC command after it processes other commands that affect the top of a page (e.g., top margin, running header); it processes the PB command as the first command on the next page (unless it is at the beginning of a file, in which case it processes PB as the first command in the file). Note #4 Rotating Part of a Page. This application note describes the procedure for rotating the entire text portion of a page. If you want to rotate just part of a page, refer to the PostScript Language Reference Manual for information. Note #5 XyWrite III Users. If you have XyWrite III, Version 3.1, or XyWrite III Plus, Version 3.54 or lower, you can use most of the procedures described in this application note. The exceptions are the procedures that require the PB (Page Begin) command. Note #6 Additional Fonts. XyWrite's PostScript printer files contain font tables only for the printers' internal fonts. If you purchase additional downloadable fonts, please call XYQUEST's Technical Services Department for assistance. PRINTER FILES 3POST13.PRN No. of Fonts: 13 Font Families: Courier, Helvetica, Times Roman, and Symbol Printers: Apple LaserWriter, Dataproducts LZR 2665, TI Omni Laser 2106/13, 2115/13 3POST35N.PRN No. of Fonts: 35 Font Families: Courier, Helvetica, Helvetica Narrow, Times Roman, Symbol, ITC Avant Garde, ITC Bookman Light, New Century Schoolbook, Palatino, Zapf Chancery, and Zapf Dingbats Printers: Apple LaserWriter II NT, II NTX, Dataproducts LSR 1260, Laser Connection PSjet/PSjet+, NEC Silent Writer LC-890, NEC Silent Writer II 290, Silent Writer LC-890XL, QMS Jet Script, QMS-PS 820, 810, Ricoh PC Laser 6000/PS, Varityper VT6000-P, VT600-W, Wang LCS15, Wang LCS8, Hewlett-Packard PostScript Printer Cartridge for IID, IIP, Pacific Data Products PacificPage Cartridge 3POST35C.PRN No. of Fonts: 35 Font Families: Same as 3POST35C except supports Helvetica Condensed instead of Helvetica Narrow Printers: QMS-PS 1500, QMS-PS 2200, Quadram QuadLaser PS, Qume ScripTEN, TI Omnilaser 2106, 2108, 2115, and QMS ColorScript 100 Model 10,20,30 3POST43.PRN No. of Fonts: 43 Font Families: Courier, Helvetica, Helvetica Light, Helvetica Black, Times Roman, Symbol, ITC Avant Garde, ITC Bookman Light, ITC Garamond, ITC Korinna, New Century Schoolbook, Palatino, Zapf Chancery, and Zapf Dingbats Printers: IBM 4216 Personal Pageprinter, IBM 4216 Personal Pageprinter II, IBM 4250 II Electro Compositor, IBM 3812, 3816, 3820, 3825, 3827, 3835 Pageprinters 3POST29.PRN No. of Fonts: 29 Font Families: Courier, Helvetica, Times Roman, Symbol, ITC Avant Garde, ITC Lubalin Graph, ITC Souvenir, and New Century Schoolbook Printers: Digital PrinterServer 40 Plus, PrinterServer 20, ScriptPrinter PC TABLE PC Purpose PostScript Code 1 Landscape ) s restore 790 0 translate 90 rotate save x y moveto ( 2 Portrait ) s restore 0 790 translate -90 rotate save x y moveto ( 3 Paper Tray #1 ) s save statusdict begin 1 setpapertray end restore ( 4 Paper Tray #2 ) s save statusdict begin 2 setpapertray end restore ( 5 Paper Tray #3 ) s save statusdict begin 3 setpapertray end restore ( 6 Paper Tray 3 ) s save statusdict begin 3 setpapertray end restore w/envelopes 790 0 translate 90 rotate save x y moveto ( 7 Legal Manual ) s restore save /x 18 def /y 972 def legal statusdict begin /manualfeed true def end l save ( 8 Manual Env. ) s save statusdict begin 1 setpapertray end restore 790 0 translate 90 rotate save x y moveto def statusdict begin /manualfeed true def end ( ###