Background Text Printer
by D.J.Holden

This application allows any text file to be printed on an FX-80 compatible printer as a background task, while you continue with other applications. When run, this program installs its icon on the icon bar. Clicking Menu over that icon displays a menu allowing various options to be set.

The Text Style submenu allows any of the available styles (N.L.Q., Condensed etc.) to be selected. The Page Length, Left Margin and Skip Lines submenus allow the corresponding options to be set. These options can be toggled on or off by clicking on the corresponding entry in the top level menu.

Choosing Reset generates a printer reset (Esc-@), while choosing Stop Print aborts the current print job. Finally Quit terminates the program.

Dragging a file icon results in the file being printed out. If the file type is not one of Text, Command or Obey, then the program will request confirmation before printing it. The printing takes place in the background, so that other applications can still be used while printing is taking place. The number of bytes left to be printed is displayed below the icon bar icon.

The print job starts with any codes required to set up the selected options (text style, page length etc.), followed by the contents of the file. Apart from any international characters, which are replaced by (user definable) Escape sequences, the file is sent to the printer unchanged, so additional control codes may be included in the file.

The program can be easily modified according to requirements. Relevant parts are: PROCfonts (2370) and PROCset_font (2250), which determine the available text styles; lines 440-460, which generate the codes for page length, left margin and skip lines; line 650, which determines which file types are accepted without confirmation; lines 760-1060, which determine the sequences used to print international characters (including pound signs), and line 1480, which sends the printer reset sequence.

The program will print any character from the RISC OS Latin1 alphabet which is available on an Epson FX-80 compatible printer, including those such as the pound sign which are not available in the default character set. The international characters are printed by calling PROCint(country,code), where country is the number of the Epson character set containing the character, and code is the ASCII code of the character in the set. The variable country% in line 110 holds the number of the default character set. Refer to your printer manual for more details of international character sets.

All printed output is sent to the device 'Printer:', so the printer type must be set up correctly, either by the '*Configure Print <n>' option, or with *FX 5,<n>, otherwise output will be sent to the wrong place.
