APPLICATION NOTE #151 USING THE HERCULES GRAPHICS CARD PLUS WITH XYWRITE III PLUS Rev. 02 RELATED FILES: XYWRITE1.FNT, LOADFONT.COM, HERCULES.PRN, TEXTFLIP.COM The Hercules Graphics Card Plus, which is a product of Hercules Computer Technology, offers a text mode, graphics mode, and RamFont mode. XyWrite III Plus supports the text mode and the RamFont mode; it does not support the graphics mode. This application note explains the procedure for using the Hercules Graphics Card Plus and a XYQUEST-developed font file to display italic, superscript, subscript, and strikethrough fonts on the screen. PROGRAM REQUIREMENTS To use this procedure, you must have the Hercules Graphics Card Plus installed according to the instructions in the Graphics Card Plus Owner's Manual, and XyWrite III Plus installed according to the XyWrite III Plus Installation Guide. In addition, you need the following files: XYWRITE1.FNT Character sets for italic, superscript, subscript, and strikethrough modes. LOADFONT.COM A XYQUEST program for loading XYWRITE1.FNT into memory. This program is based on the Hercules program RAMFONT.COM. HERCULES.PRN A XyWrite printer file that contains all the display settings for the Hercules Graphics Card Plus. TEXTFLIP.COM A Hercules program for switching between RamFont mode and text mode. These files are available from XYQUEST's Technical Support Department; just call or write to request copies. PROGRAM DESCRIPTION The Hercules RamFont mode allows up to 12 separate fonts (or character sets) to be defined at one time, and each font supports 256 characters. Hercules refers to these fonts as types 1 through 12 (see Note #1). The XYQUEST-developed font file (XYWRITE1.FNT) produces normal, italic, superscript, and subscript screen fonts. In addition, the font file supports the underline, highlight (bold), strikethrough, and reverse attributes for each screen font. You can view the available combinations by displaying the color table, as explained later under "Screen Displays" (see Note #2). PROGRAM STARTUP Copy XYWRITE1.FNT and LOADFONT.COM onto your working disk or into the root directory of your hard disk. Then call the AUTOEXEC.BAT file and add the following command before the command that starts the XyWrite editor (see Note #3). loadfont xywrite1.fnt Now store AUTOEXEC.BAT and restart your computer. SCREEN DISPLAYS XyWrite uses 29 standard character modes (including Redlining modes), which are identified by two-letter abbreviations (NM for normal, BO for bold, etc.). In addition, you can use the numbers associated with screen colors (0 to 255) as character modes. Each character mode is associated with a screen display and with a printing style. The screen display of these modes varies depending on the computer setup you have. For example, if you have a monochrome monitor, mode 5 displays as standard white characters on a black backgound; if you install a Hercules Graphics Card Plus and load XYWRITE1.FNT, mode 5 displays as italic white characters on a black background. With a color monitor, mode 5 displays as standard magenta characters on a black background; if you install a Hercules Graphics In-Color Card Plus and load XYWRITE1.FNT, mode 5 displays as italic magenta characters on a black background. To view the screen displays available on your computer, be sure LONG.HLP is loaded and then: Press: Alt-F9 Press: w Type: color table Press: Result: The color table appears on the screen. This table shows you the screen display associated with each number (e.g., mode 5 appears in italic). These numbers are, in turn, associated with XyWrite character modes (MD NM, MD BO, etc.) in a special display settings file, described later. CUSTOMIZING XYWRITE To effectively use XyWrite with the Hercules Graphics Card Plus, you need to: 1. Customize the display settings to accommodate the new screen fonts. This means changing the values built into XyWrite. 2. Specify a printing style for the new character modes you will be using. Selecting Display Settings To simplify step 1 above, XYQUEST has developed a special printer file called HERCULES.PRN. This printer file, which is stored on the same disk as the program files listed above, assigns a display number to each of the standard character modes, including the Insert and Delete modes used during Redlining. HERCULES.PRN also defines how defined blocks, headers, and window borders will be displayed. To use HERCULES.PRN: 1. Copy it onto your working disk (or into the XyWrite directory on your hard disk). 2. Call STARTUP.INT. 3. Define and copy one of the lines that starts with the bold letters BC. The copied line must appear before the line that loads your standard printer file. 4. Delete everything between the BC and the carriage return. 5. After the BC: Type: load hercules.prn 6. Store and run STARTUP.INT. Type: F5st Type: F5run startup.int Result: By running STARTUP.INT, you initialized all the XyWrite settings, including the display settings contained in HERCULES.PRN. These settings will load automatically each time you start XyWrite. Displaying Italic Mode XyWrite does not have a mnemonic for italic, nor does it provide a key sequence to invoke italic (see Note #4). In HERCULES.PRN, we assigned the italic screen fonts as follows: MD FL Italic MD FU Italic Underline MD SO Bold Italic MD FR Bold Italic Underline Once you have loaded HERCULES.PRN, you can invoke italic by issuing the MD FL command. Type: F5md fl Result: The text from this point to the end of the document (or to the next mode command) appears in italic. You can also invoke italic by issuing the MD command with a number from the color table that is associated with an italic screen display (see Note #5). For example: Type: F5md 5 Modifying HERCULES.PRN Once you are familiar with the contents and effect of HERCULES.PRN, you may want to modify it to suit your needs. You can select whatever numbers you want for the character modes. Just be sure that you don't use the same display number for two different character modes. Let's say you want MD RV to be associated with the italic screen display rather than a reverse screen display. 1. Call HERCULES.PRN to the screen. 2. Move the cursor to the line that defines screen display for reverse mode. Type: F5se /md rv/ 3. Change the value after the equals sign to 5. 4. Move the cursor to the line that defines the screen display for flashing mode. Type: F5se /md fl/ 5. Delete the line. Press: Alt-F5 (Alternatively, you can assign an unused display number to this mode, but you cannot use the display number five for more than one character mode.) 6. Store and load HERCULES.PRN. Result: You can invoke on-screen italic by pressing Ctrl-4 or issuing the MD RV command. Defining Printing Styles As explained above, XYQUEST has selected MD FL, MD FU, MD SO, and MD FR to represent the italic screen displays. If you want the text in these display modes to also print in italic (or italic underline, etc.), you must first be sure your printer offers italic fonts. If it does, then you need to add the appropriate mode statements to the PT tables in your standard printer file. 1. Call your printer file to the screen. 2. Check the lists of available attributes and fonts to see if your printer supports italic. (These lists are located near the beginning of the printer file, in the comments section.) If it does, move to step 3. If it does not, you cannot print italic text. 3. Add mode statements for the italic screen displays. If your printer supports an italic attribute (as, for example, the Epson FX printer does), type the font name, a plus sign, and then the attribute name (or names). For example: MD FL+ELITE+ITALIC MD FU+ELITE+ITALIC+UNDERLINE MD SO+ELITE+EMPHASIZED+ITALIC MD FR+ELITE+EMPHASIZED+ITALIC+UNDERLINE If your printer supports an italic font (as, for example, the PostScript printers do), you use the font name exactly as shown in the font list. For example: MD FL+10TIMES-ITALIC ˙20 MD FU+10TIMES-ITALIC+UNDERLINE MD SO+10-TIMES-BOLD-ITALIC MD FR+10 TIMES-BOLD-ITALIC+UNDERLINE If you modified HERCULES.PRN to associate screen italics with different character modes, be sure you use those character modes in the mode statements. If you are using screen display numbers as character modes, then your mode statements might look like this: MD 5+10TIMES-ITALIC MD 21+10TIMES-ITALIC+UNDERLINE MD 133+10TIMES-BOLD-ITALIC MD 149+10TIMES-BOLD-ITALIC+UNDERLINE 4. Store and load the printer file. Result: When you TYPE your document, all the text that appears in MD FL (or MD 5) will print in 10-point Times Italic, all the text that appears in MD SO (or MD 133) will print in 10-point Times Bold Italic, etc. (If you don't include a mode statement for one of the character modes, XyWrite will use the printing style associated with normal mode in PT 1. RUNNING WITH MEMORY-RESIDENT PROGRAMS Most memory-resident, popup programs don't support RamFont modeÄyour screen display becomes illegible if you invoke such a program while Ramfont mode is active. Hercules Computer Technology has therefore developed a program that allows you to easily toggle between text mode and RamFont mode. A copy of this program, which is called TEXTFLIP.COM, is on the disk with the other RamFont programs supplied by XYQUEST. To use TEXTFLIP.COM: 1. Copy the program TEXTFLIP.COM onto your working disk (or into the root directory of your hard disk). 2. Call AUTOEXEC.BAT. 3. Immediately before the line that loads the XyWrite editor: Type: textflip 4. Store AUTOEXEC.BAT and restart your computer. Result: TEXTFLIP is now loaded into memory. TEXTFLIP uses the hot keys Alt-Shift-T to turn text mode on, and Alt-Shift-R to turn RamFont mode on. In order to use these hot keys from XyWrite, you need to modify your keyboard file. (See Note #6.) 1. Call the keyboard file to the screen. Type: F5call ibm.kbd 2. Move the cursor to the table for the AltShift keys. Type: F5se /table=alt+shift/ 3. Move the cursor to key definition 19, which represents the R key. Type: F5se /19=/ 4. Delete the "r" and type in an ASCII 0 (null). To enter the ASCII 0: Type: Alt-Shift-0 Result: ASCII 0 appears as a blank space. 5. Repeat steps 3 and 4 for key definition 20, which represents the T key. 6. Store and load the keyboard file. Result: The TEXTFLIP hot keys will now work properly. If you want to switch to text mode (perhaps to use a popup program), press Alt-Shift-T. To return to RamFont mode (so you can again see on-screen italics), press Alt-Shift-R. 7. If you want the keyboard file to be loaded automatically each time you start XyWrite, add the command to STARTUP.INT. (Use the procedure described under "Selecting Display Settings.") Note #1 Font Types vs Display Modes. XyWrite display modes 0 through 11 correspond to Hercules fonts 1 through 12. If you want to use RamFont to edit a character associated with XyWrite mode 5, you need to edit Hercules font type 6. Modes 12 through 15 are not supported by Hercules. Note #2 Invisible Mode. In the standard XyWrite setup, display mode 0 is an invisible mode, which means that text typed in this mode does not appear on the screen. XyWrite uses the invisible mode in conjunction with the DX (Display Off) function call. If you are using the Hercules Graphics Card Plus and have loaded XYWRITE.FNT, mode 0 is normal mode. That means the DX function call will not turn the display off. Note #3 Unloading XYWRITE1.FNT. To unload the fonts, at the DOS prompt issue the LOADFONT command without an argument. C:>loadfont If you want to unload the fonts automatically when you quit XyWrite, enter the command in your AUTOEXEC.BAT file, immediately after the line that starts the XyWrite editor. Your AUTOEXEC.BAT file might then look like this: loadfont xywrite1.fnt editor loadfont Note #4 Underline Mode. You can create a Save/Get key so that you can change to italic mode by pressing Alt and the assigned Save/Get (e.g., Alt-I for italic). Refer to the XyWrite III Plus Reference Guide for information about creating a XyWrite program and assigning it to a Save/Get key. Note #5 Changing Modes. If you habitually use the Ctrl-# combination to change modes, you must press Ctrl-0 before using an MD command. Note #6 TEXTFLIP Hot Keys. There are other hot keys available with TEXTFLIP besides Alt-Shift-T and Alt-Shift-R, but they are incompatible with XyWrite. Note #7 DOS 4.0. DOS 4.0 does not support the Hercules Graphics Card.