Releasing Printer Power from a QL

Author(s): Peter Hale
Publication: Update Magazine
Pub Details: Update January 1990
Date: January 1990
Pages: 33-36

Many with a QL do not know how to get the most out of their printers. This is particularly true of those using QUILL who would like fancier documents, but feel they are limited to the enhancements (highlights) provided in QUILL (High & Low Scipt, Bold and Underlined).

This article describes (in possibly excessive detail) how to get the most out of a printer from within a QUILL document. The road to delight may seem a little untidy, but the printer power released from within your QL will be more than you could get from all but the most powerful and complicated word processors on other computers.

As illustration we will refer to the QL printer, partly because so many people have this printer, but also because it uses Epson printer codes and therefore has direct application to any Epson compatible printer.

If you understand QUILL documents, printer codes and the use of install_bas, go immediately to TABLE I and the section USING PRINTER CODES.

THE QUILL DOCUMENT

As viewed on the monitor screen the QUILL file shows the effect of embedded (invisible) codes in representing text. For example, pressing F4 then B changes subsequent text to a different color that represents a bold face to the text to be printed. Pressing F4 then B again releases the color and returns it to the original. But no one sees any specific character on the screen.

The code for bold is QUILL-specific. It is not visible on-screen but is in the _doc. Actually there are two different codes: one to turn on the bold highlight, the other to turn it off.

When printing a QUILL _doc, you have noticed that drive 1 on your setup will whirr. This is QUILL searching for a file called printer_dat which has data to change (translate) QUILL’s own codes into codes that can be understood by the printer.

Thus, printing a document from within QUILL is a three-part exercise (as it is with any other, lesser wordprocessing program):

1) The typist prepares the QUILL _doc by invisibly embedding codes in the document through judicious use of the F4 key and its parameters.

2) The printer_dat file (otherwise called the printer driver) translates embedded codes into ones understood by the printer. The values in a given printer_dat file filter the QUILL _doc file on its way to the serial port, changing QUILL codes to printer codes.

3) When the printer receives codes in a “language” it understands, it changes the printer font or enhancement that will apply to printing subsequent text.

OK. Got that? If not, try re-reading it because it is important to understanding what follows.

PRINTER CODES

We will use the QL printer manual for specific references. Some will cite it as one of the more obfuscating documents in computerdom. Those who accept this canard have lived a sheltered life, unexposed to other printer manuals, all of which were written by summa cum laude graduates of the IBM school of technical writing.

As imperfect as the QL printer manual is, it is really very good. Like other manuals it lists the different codes (often called commands in other manuals) and what each does. In the QL printer manual there is a table on pages 67 and 68.

All codes are expressed in one of three ways: Symbolic (character representation in a format left over from teletype days), Hex or Decimal. The three are interchangeable. [Some printers, such as the older Mannesman-Tallys, have unique codes, but we are talking here about Epson compatible printers.]

The codes themselves are generally non-printing characters or start with a non-printing character. They can be represented symbolically or by decimal or hex digits through install_bas. For examples see pages 4 and 6 of the Information section of the QL manual itself.

The table in the printer’s manual lists commands, briefly describes each command’s function, and refers to the page in the manual where you may or may not learn more about its use.

Most printer codes are preceeded by ESC (in decimal: 27, in hex: 1B). Some, such as condensed, double-wide and form feed have single codes.

Printer command codes with ESC are followed by a letter or other non-numeric character, and possibly a third and fourth numeric character.

When a string of characters arrives at the printer and one of the codes is present, the printer reads the codes. If the code is ESC, it knows to pay attention to the characters that follow until they no longer make sense as printer commands. Then the printer treats subsequent code as characters to be printed in the commanded way until another command arrives telling it to do something else.

If we could place other codes within a QUILL document, we could release the power of the printer, so pay attention to what follows.

USING INSTALL_BAS

The SuperBASIC program install_bas that came with QUILL enables us to insert codes in a QUILL document to access features built into the printer.

The codes will be visible on the QUILL screen as characters from the QL character set, but will not be sent to the printer head. Before arriving at the printer, through the magic of translation, the character will be translated into printer commands (control codes).

Thus we will choose characters that are not normally part of English text. These are characters accessed by holding the CTRL and SHIFT keys simultaneously and pressing one of the alphabetic characters. The characters resulting tend to be Greek or Scandanavian ones rarely needed.

The reason for install_bas is to modify the file install_dat (a collection of data about codes for a number of printers) and to create printer_dat, the working data file for your specific printer.

Load and run install_bas in the usual way. It must be on drive 1 on a medium with install_dat, printer_dat and a working copy of QUILL.

It takes time to load, then you must specify the drive on which installation and driver data are kept. This is usually drive 1 since QUILL defaults to drive 1 for printer_dat.

Next, the prompt asks if you are using a standard serial port (ser1 or ser2) to the printer. This is the choice even if you have a parallel printer but are using a parallel interface cable. The option for a non-standard serial port or a parallel port only applies if there is a special port for PAR such as is found on a Super QBOARD disc controller.

It takes a few minutes for the QL to organize data from the install_dat and printer_dat files, then the screen presents a list of printers and notes the most recently installed driver.

We won’t repeat instructions for installing printer drivers that are so ablely presented on pages 3 to 7 in that section of the QL manual called Information – there isn’t space here.

Instead, we will briefly step through the process of modifying an EPSON FX-80 driver. On page 6 of the Information section the right-hand column of the table is a close approximation of the FX-80 driver, except that the port is ser1 and the preamble code should spell ESC in upper case characters if it is to work.

Move the cursor over EPSON FX-80 with the down cursor key and press F1 to copy it. Then move the cursor to the copy and press F2 to edit it.

The cursor will be over the driver name. Press a right or left cursor key to change it, then type a printer name (up to 14 characters) and press ENTER.

The other lines are translates even if they don’t admit it. The ones from PORT to SUPERSCRIPT OFF are dedicated and handled differently from those specifically called TRANSLATE.

The PREAMBLE CODE shown is ESC,@,ESC,R,NUL. On an FX-80 printer this resets the printer to a default state and selects the USA character set. ESC,@ is the common reset code for almost all printers, but the QL printer has no optional character sets. On a QL printer, change the PREAMBLE CODE to ESC,@ so that it resets whenever a new document is printed. Type ESC,”@ then ENTER. It should look like ESC,@ with no “.

Why the ” before the @? Symbolic codes may be entered directly in CAPITAL letters. The next part of the command is separated by a comma. The @ is preceeded by ” since it is not symbolic code but is needed as part of the command.

You could enter @ in decimal code (64) or even do both parts in decimal by typing 27,64. When you press ENTER, it looks like ESC,@.

Also change the POSTAMBLE CODE to be FF, if your printer does not automatically Form Feed after printing. (For fun, put in FF,BEL so the printer signals when finished printing.)

Now move the cursor to the Translate lines. If you have a QL printer, use the right cursor key to remove the TRANSLATE1 and press ENTER. All other Epson compatible printers require this line so that the £ sign prints correctly.

In the next 8 TRANSLATE lines insert codes that will permit access to virtually all the printer’s power. First add the capacity to send the ESCape code to the printer. With it we can manufacture most other control codes. Then add single keys that will allow use of condensed, double-wide, elite, italic and proportional printing.

[Note that older EPSON compatible printers may not be able to do proportional or italic printing – check your manual.]

In TRANSLATE2 press the right arrow then type “«,ESC. (the character « is found with Control-Shift X, a mnemonic for “Xscape”]. Press ENTER. The value for TRANSLATE2 should be «,ESC.

Henceforth, whenever you insert « in a Quill document, it will be translated on its way to the printer as the ESCape code (decimal 27), and the character immediately following it will be perceived as an instruction to the printer. More on this below in USING PRINTER CODES in QUILL.

See TABLE I for what to put in each of the other 7 TRANSLATES. We have left TRANSLATE10 free for you to design your own specific code.

TABLE 1

Translate  What you type                   Control    Function
 Code                                      Shift Key
   2       "«,ESC                            X=«      Send ESCape to printer
   3       "ŏ,SO                             D=ŏ      Start double-wide pitch    (5/in)
   4       "É,SI                             C=É      Start condensed pitch     (17/in)
   5       "O,ESC,"M                         E=O      Start elite pitch    (12 char/in)
   6       "Ñ,ESC,"4                         I=Ñ      Turn on italic feature
   7       "µ,ESC,"p,SOH                     P=µ      Start proportional pitch  (11/in)
   8       "θ,DC4,ESC,"W,"0,DC2,ESC,"P       N=θ      return to Normal pitch    (10/in)
   9       "Φ,ESC,"p,"0,ESC,"5               R=Φ      Release italic and proportional

Note that the choice of Control-Shift key has mnemonic value – i.e. Control-Shift P starts proportional pitch and Control-Shift R releases it. Having just one “Release” key would be nice, but install_bas only allows 10 codes per translate.

Further, Control-Shift N returns the printer to Normal pitch indiscriminately of which pitches were set. Thus if a section of the document were set for double-wide, condensed and you wished to change to condensed, it would be necessary to release both then reinstate the condensed. Piggy-backing the release codes is a function of the limit of 10 translates in the standard install_bas.

See the text on Using Printer Codes in QUILL_docs.

USING PRINTER CODES in QUILL

Using the power is simple. Whenever you wish to use an enhancement not found within QUILL, use one of the Translate codes we have devised by inserting it as a text character when a change in printer function is desired.

Functions can be concatenated (chained) to achieve a desired effect. Thus double-wide, condensed, elite is theoretically possible simply by preceeding the text that you desire in that format with ŏÉO. When you wish to terminate that effect, simply type θ (Control-Shift N) to return to normal (pica, 10 pitch) width.

Some functions are not explicitly provided in the TRANSLATE codes developed here. You can construct your own with the « (Control-Shift X) command. A very useful one is «x1, which turns on the NLQ or LQ mode of any Epson compatible printer. Use «x0 to return to draft mode.

If you prefer Double-strike to NLQ, try «G («H turns it off). For real quality, albeit at a slow pace, combine NLQ and Double-strike.

You are on your own from here as to what features you want to explore, but there are some WARNINGS!

First, when inserting these new control codes within QUILL text, QUILL thinks they are printable characters. Thus if the code is the first character in a paragraph, QUILL performs word wrap and justification as if the code were printable. It’s not, so the output on that line shifts one or more characters to the left, giving a ragged right edge to the paragraph.

The common solution is to insert the codes in what is otherwise a blank line between paragraphs or only at the end of a paragraph in the blank spaces remaining. Termination codes are less often a problem since they generally come at the end of a paragraph where there are no more characters to print.

Second, inserting codes within a line so that one or more words are in a contrasting highlight, as is done when using italics to indicate a foreign word is tricky. Changing pitch within a line or anywhere is even trickier, n’est-ce pas? Ñn’est-ce pas?Φ

QUILL does not know that pitch has changed when it formats text. For that you would need text87.

The solution to that is to treat lines that have custom enhancements as separate paragraphs with wider right margins. When changing pitch within a line or a document, some trial and error with sample print outs may be necessary.

Third, proportional spacing is a simple way to increase the text on a given page by about 10 percent. Characters such as i and l take less linear space than m or n. It is not recommended with right justification since there will be a ragged right edge. To take advantage of the extra word count extend the right margin 10 percent.

Finally, none of these tricks will work unless a copy of the printer_dat file is in drive 1 when QUILL begins to print. You learn the meaning of frustration if, after all this work, the document ends up with a batch of garbage instead of the expected enhancements.


Those who find that using install_bas is harder than they like can get custom copies made for their printer from EMSoft. The charge is $5.00.

With the five dollars send a disk or microcartridge with a working copy of QUILL (or QLWP), install_bas, install_dat and printer_dat. Include a photocopy of the pages in your printer’s manual with the printer codes in summary form.

On the returned disk, you will receive a _doc file demonstrating the printer’s power.

As another service to disk drive users, EMSoft will convert your PSION suite to default to flp_ rather than to mdv_. Send a disk with a direct copy of each of your four PSION programs and install_bas and $5.00. A special datesetting boot with the ability to select any of the PSION suite will be added.

Get both services together for just $8.00.

Send to:
EMSoft, P.O. Box 8763, Boston, MA 02114