PipeDream Printer Driver Editing

This section describes how to use and edit PipeDream printer drivers.

Text can be printed from a PipeDream file to any text-based printer compatible with your computer by setting up the printer in the usual way and giving the Print command.

You can also create documents containing highlight codes that specify particular type styles and effects, such as bold and underlined text, superscripts and subscripts, and alternative fonts. However, depending on the make and style of printer, different control codes may be needed to print these effects.

PipeDream caters for these differences by reading a printer driver from disc. The printer driver then converts standard PipeDream highlights to a particular text-based printer’s codes so that you need not be concerned with them. PipeDream is supplied with printer drivers for dot matrix, daisy wheel and HP PCL printers.

If you want to create a printer driver for your own type of printer, or a different printer driver for one of the printers for which printer drivers are supplied, it is easiest to start with an existing printer driver and modify that. The following section describes the format of the printer drivers and how to change an existing printer driver.

Printer drivers are ordinary data files which you can load into PipeDream to edit. To do so, give the Edit Printer Driver command:

Menu Command Tool Key Cmd-sequence
Print Edit printer driver PGD

The standard printer driver files are called BJ10, DotMatrix, HPJet and DaisyWheel. If others have been created, they will appear in the dialogue box. Load the one you want to edit by selecting it in the dialogue box, then click the Edit button (or press Return↵).

You will see a mixture of comment lines and option lines. The comment lines just describe how the driver works and are ignored by PipeDream. Any line in which column A is blank is a comment line so remember to write your comments in columns B onwards. A line with an entry in column A is an option line and is interpreted by PipeDream as specifying a translation of some sort. The general form of an option line is as follows:

Type   on-codes   off-codes   Y/N   Comment

Not all of the fields need to be filled in although normally at least the first two fields will be. If you specify more fields than a particular option requires, PipeDream will treat the remaining fields as comments.

Codes

To enter the codes required by your printer into a printer driver, you will need to extract the code sequences from your printer documentation. Unfortunately, the standard of printer documentation varies from the excellent to the diabolical. If you cannot understand your printer documentation, do not be disheartened—it is not your fault. But you will need to find someone who is even more conversant with the inner workings of computers than yourself to help you.

Codes can be entered in several ways:

"M" indicates the upper-case ‘m’ character

8   indicates 8, which is the ASCII backspace character.

&20  indicates hexadecimal 20, which is the ASCII space character

$20  $ is a synonym for hexadecimal

ESC is the escape character (ASCII 27)

If you need other control characters, you must specify them in decimal or hexadecimal form.

You can use any of the above forms Always use the form that makes the code most easily understandable. The codes can be separated by either spaces or commas; use whichever you find more readable.

Options

There are five option types described below.

Highlights

Hn   on-codes   off-codes   off-at-CR?   comment

Example:

H1   ESC "E"    ESC "R"     Y            underline

Highlight options generally have four parameters.

In column A the highlight number is specified following an H.

The on-codes in column B specify what codes the printer requires to start the highlight.

In column C, specify what codes the printer requires to stop the highlight.

In column D, specify whether PipeDream should switch off the highlight automatically at the end of the cell. For most types of highlight, you should set this to Y, meaning yes. For alternate font and other global highlights, you would set it to N.

The example shows how the daisy wheel printers should do underlining. It is switched on by ESC "E" (these are ASCII characters 27,69) and switched off by ESC "R" (ASCII 27,82). PipeDream will switch it off at the end of each cell.

The line could be written

H1   27,69      27,82       Y            underline

and would have an identical effect.

Some printers do not have automatic facilities for underlining and bold effects, but you might still be able to create these effects with a special printer driver facility. Suppose your printer does not do underlining but it can backspace the print head, i.e. it can move the print head backwards so that the next character printed overwrites the previous character. You can use this to print each character, backspace, and print an underline character before moving on to the next character. To do this, you would specify the following line in the printer driver:

H1   ?,8,"_"                Y            underline

The ? is a special symbol which means ‘each character’ to PipeDream. If you include a string containing a ?, PipeDream prints the string for every character, replacing the ? with each character. Notice that if you want to send a real question mark from the printer driver you must put double quotation marks around the question mark, i.e. " ? ".

So, in this case, when you switch on underlining, every character to be underlined will be sent to the printer followed by ASCII 8 which is backspace, followed by an underline.

If your printer has no automatic bold facilities, you can perform a double strike with

H1   ?,8,?                  Y            bold

Foreign Characters

Many characters are represented differently by the computer than they are by the printer. You need a way of telling the printer how to print such characters.

For example, if you were writing to an American company, you might want to be able to produce the ¢ (cent) symbol. You could redefine the # character to be the ¢ character. On daisy wheel printers, you would redefine the cent symbol as follows:

"¢"   ESC   "Y"   cent

The character in column A specifies what is to be redefined.

The codes in column B specify how to print it. All other fields are ignored.

This option can very often be used to print foreign characters which your printer does not appear to support in its character set or on its daisy wheel. Many printers enable you to move the print-head backwards and print another character on top of the last one printed. You can use this to build composite characters, as in the examples below:

"à"   "a",8,"`"

"é"   "e",8,"´"

"ñ"   "n",8,"~"

Each of these examples works by printing an ordinary letter, specifying character 8 to backspace over the letter just printed and printing another character on top.

Linefeeds

PipeDream sends out a carriage return character (CR: ASCII 13) at the end of each line. Many printers also expect a linefeed character (LF: ASCII 10) to follow the carriage return. You can use the LF option, setting it to LF Y or LF N, to specify that PipeDream should send a linefeed character too.

If you find that all of your text is being printed on one line and the printer is not winding the paper on, you must specify linefeeds to be sent in the printer driver. Conversely, if the printer is double spacing, your printer driver is specifying linefeeds when it should not. Double spacing is when the printer prints an extra blank line in between every text line. Some printers have a DIP-switch with which you can control whether linefeeds are automatically added by the printer. Generally, you should set the DIP-switch to the position which works best with the most software that you use, and then configure the PipeDream printer driver to fit in with the DIP-switch setting.

Highlight Codes

The recommended assignment of highlight codes is as follows:

Code  Function Example
1 Underline underlined type
2 Bold bold type
3 Extended character 
4 Italics italic type
5 Subscript H2O
6 Superscript e=mc2
7 Alternative font alternative font
8 User defined

(Although all eight codes may be assigned to any printer function, it is recommended that you adhere to the above assignments for compatibility if you wish to transfer your documents to Fireworkz.)

In every case you use the same highlight code to switch the highlight on and off.

So in the sentence

The black cat had 1very1 long whiskers.

highlight 1 is being used to switch underlining on and then off so that only the word very will be underlined.

In most cases printer drivers will also switch off the highlight automatically at the end of the cell. However you can specify that a highlight should not be switched off at the end of a cell. On the screen PipeDream displays bold text, underlined text, italic text, superscripts and subscripts. The other highlights are displayed as their highlight number in inverse.

Pages

Many printers have special codes to wake them up or send them back to sleep or finish a page. You can specify these codes with the following three options. Each option will send out all of the codes entered in column B, but will ignore any other columns.

PON   ESC "I" 1 Printer on

POFF            Printer off

EP    12        End of page

The Printer on string is sent at the beginning of the document, and the Printer off string at the end of the document. If you print with the Wait between pages option turned on, PipeDream sends the Printer on string at the beginning of every page, and the Printer off string at the end of every page.

Many printers have a formfeed facility which enables them to rotate the print roller smoothly and quietly to the start of subsequent pages when each page has finished printing. To specify a string which will perform the formfeed operation, you use the EP field. If the string contains a formfeed character (ASCII 12), PipeDream will send out the string when it has no more text to print on the page. If the string does not contain a formfeed, PipeDream prints blank lines to end the page and then sends out the string.

Note that the page length the printer assumes may be different from the one that you have set in PipeDream is assuming. Sending a formfeed to the printer will wind the paper to the end of the printer’s page length, no matter what page length you have set in the document.

Microspacing

If you format your text on the screen with the Justify option turned on in the Options dialogue box, you will notice that PipeDream inserts extra spaces between some of the words to display each line to the same length. Consequently some pairs of words have bigger gaps between them than others.

Many printers enable you to control the distance in tiny increments that the print-head moves in between printing each character. This is called microspacing. Most daisy wheel and dot-matrix printers are capable of microspacing. If your printer has microspacing, you can use this facility to even out the gaps between words in justified text. Microspaced text often gives a more professional look.

Microspacing works by distributing the extra space needed to justify the text evenly across the line, rather than simply adding whole extra space units. Text which has been justified and microspaced looks much more attractive than text justified by adding extra space in whole units.

Note that microspacing is not the same as proportional spacing. Proportional spacing is the printing of characters in their own individual widths. So a proportionally spaced i takes up less space than a proportionally spaced m. The text you are now reading is proportionally spaced. You can use the proportional spacing on your printer, if it has it, but if you do you will lose the justification of your lines and any column alignment you might have. If you are interested in proportional spacing, you would do much better to use RISC OS outline fonts and RISC OS printer drivers.

You control microspacing by using the following three options in the printer driver:

HMIP   HMI   prefix

HMIS   HMI   suffix

HMIO   HMI   offset

You can also specify the number of ‘units per character’. Note that this is not the pitch. To get the pitch, divide the units per character into the spacing unit. If the spacing unit is 1/120", and there are 10 units per character (this is the default in PipeDream, set by the Microspace dialogue box), then the pitch is 120/10 which equals 12 pitch. So the default pitch is 12, unless you alter this by giving a different ‘units per character’ value in the Microspace dialogue box.

HMI stands for ‘horizontal motion increment’, which is jargon for the amount the printer is instructed to position its print-head. HMI is a printing term not to be confused with the printer driver options, HMIP, HMIS, and HMIO. HMI is sometimes called CSI (‘column spacing index’) or ‘intercharacter space’.

To summarise, if your printer can move its carriage in small increments, probably 1/120ths of an inch, then you can probably get PipeDream and your printer to microspace justified text.

If you have trouble understanding the following explanation, don’t worry. Microspacing is very confusing! However, it is very likely that your printer adheres to either the Diablo standard or the Epson standard and you can enter the examples shown here without having to reason it out.

Set the HMIP option to the code sequence that your printer needs to set its HMI, CSI or intercharacter spacing or whatever else it is called in your printer manual.

Offset (HMIO)

Since printers vary in the number they require to set their HMI to the desired value, the printer driver editor enables you to specify an offset which adjusts the number which is sent to the printer. You use the HMIO option to set this number.

For example, Juki daisy wheel printers, which conform to the common Diablo standard, require you to send the number 11 in order to set the HMI to 10. So, in this case, you would set the HMIO option to 1, which tells PipeDream to add 1 to the HMI before sending it to the printer.

Example:

HMIP   ESC,US   (Juki, Diablo)

HMIO   1

With Epson printers, you can only set the intercharacter spacing, which is in addition to the space that a character normally takes. In this case, you must tell PipeDream to subtract the size of the character from the HMI, since the HMI number that PipeDream generates already includes the size of the characters. Unfortunately, the width of the characters depends on the current pitch of printing, and the printer driver can only subtract a constant from the HMI, not a number which varies with the pitch.

The best solution to this is to force the Epson to print in a particular pitch when microspacing. You can do this by including a ‘pitch set’ command in the HMIP option. Then you can safely put the constant value into the HMIO field, knowing that the printer will be forced to a particular pitch.

Example:

HMIP   ESC,"M",ESC,32   (Epson, 12 pitch)

HMIO   247

The ESC,"M" is the command you use to force the Epson to print in 12 pitch (10 units per character). ESC,32 is the Epson command to set the intercharacter spacing.

The HMIO setting, 247, is the number which tells PipeDream to subtract 9 from the HMI. How does it do this? Well, for numbers less than 128 (i.e. O to 127), the printer driver adds the number to the HMI. Hence putting 1 in the field for the Juki example causes PipeDream to add 1. For numbers between 128 and 255, PipeDream subtracts an amount. The amount which is subtracted is calculated by subtracting the number in the HMIO field from 256.

To take the example above, 256 - 247 = 9, so PipeDream subtracts 9 from the HMI to calculate the number to send to the printer.

Thus, if you want to tell your Epson to microspace in 10 pitch characters you would enter the following:

HMIP   ESC,"P",ESC,32   (Epson, 10 pitch)

HMIO   245

ESC,"P" tells the Epson to select 10 pitch characters. ESC,32 tells the Epson to set the intercharacter spacing.

The HMIO setting is equivalent to 245 - 256 which equals -11. -11 is required because 10 pitch characters have 12 units per character (120/ 10).

Note that with the examples shown for Epson printers, the microspace unit that you can use is fixed according to the example you choose. For the 12 pitch example, you must give the number 12 (which specifies 10 pitch) in the Microspace Pitch command.

Suffix (HMIS)

This option is rarely used. It specifies the code sequence that PipeDream must output after the HMIP and the HMI itself.

Summary

PipeDream outputs the three options relevant to microspacing in the following order:

  1. HMIP
  2. n +/- HMIO
  3. HMIS

Saving Your Printer Driver

Remember to save the printer driver once you have finished editing it by clicking the Save option on the Files menu. If you don’t save it, PipeDream will continue to use the unedited version.