The RISC OS Printing System (part 4)

PrintEdit and datafiles

As we have seen, most bit image printers use very similar code structures, and therefore any variations do not require a new dumper module or back end. The different codes and data requirements for t ese are so alike they can usually use PDumperDM or similar dumper, the changes in data being held in files which can be found in the Printers directory. These printer definition files store al the data that the particular printer system needs.

Let's look at a typical printer definition file. On the RISC OS 3.7 CD­ROM, or the RISC OS Support Discs, find the Printers directory and open it.

Note: most of these printer definition files are 'squashed' files even though they're displayed as printer definitions.

Load Edit (or your usual text editor), and open the Epson directory and then load the FX-80 file. If the first four letters are SQSH followed by unreadable text, the file is squashed. ou will need to unsquash it first, remembering to change its filetype to squash first. This is the file which contains all the data for the Epson FX80, an old 9-pin dot matrix printer.

Some of the file's contents can be read. pr_nme: Epson FX80 is the line which defines the printer's name. sh_nme: FX-80 is the line which defines the text below the icon on the iconbar. sp_nme: dp de ines the sprite to be used on the iconbar. res: 7 is the number of graphics resolutions. Next is the graphics resolution data (repeated seven times). After all these come the text codes (for raw text only printing). However, most of the data is held in codes which are not easily readable!

How do we modify this data?

Load the !PrintEdit application and drag this file onto its icon on the iconbar. You might get a message saying it is a file in the old format, but just click on OK. The printer definition editor win ow opens:

Most of this window is straightforward. Looking at the Graphics modes, click on the icon A. A menu of graphics resolutions opens; select 120 by 144 dpi. A large Graphics mode window opens. It ca be seen that this printer is black and white. Large and small halftone refers to the size of dots produced to get a greyscale (as used in newsprint photographs). Error diffusion is a more complicate greyscaling technique which is more random and gives a better result. The x and y resolutions are shown in dpi (dots per inch). It uses the PDumperDM which is known to the system as module number 1, and the palette file called 0 is used for colour (grey) matching.

At this stage, we will gloss over interlacing, dump depth etc, but the Esc code sequences for particular actions can be seen. Close the window. (Do not click on Delete mode!) Now look at the area B i the Printer definition editor window. This deals with printer's text mode printing (using the characters' shapes stored in the printer's ROM).

Click on Edit draft highlights... A new window opens containing all the codes sequences for text printing; some of these might be familiar to those of you who cut their wordprocessing teeth on InterW rd in the BBC Micro days! Lastly, click on Edit character mappings... at the bottom of the Printer definition window. A window containing the character mappings opens.

These show how non-standard characters can be produced, again using ESC code sequences. For example, the pound sign sequence is "switch to UK alphabet print # switch back to previous alphabet".

All the above are user-editable, so any dp class of printer can be catered for using this PrintEdit application since the control sequences can be entered to match the printers. You may like to ook at other printer definition files or even the file for your own printer - but don't change anything!

For a more detailed account of how to use PrintEdit, look at your RISC OS 3 User Guide. PostScript files cannot be altered by PrintEdit since these are of a standard format.

Inside a PostScript file

Load the file PoScript , found in the Printers directory, into Edit. You may have to unsquash it first. This file shows all the data required for a standard PostScript printer.

There is only one resolution, and the prologue is the set of commands to set up the printer (this is stored in the PDriverPS module).

Notice the font list. This is the list of PostScript font equivalent shapes for the most common RISC OS font names (Risc first). This file only uses two fonts found in all PostScript printers, A obe Standard and Adobe special.

The user could add extra font names referring to their printer manual. The file PoScriptF is the same but allows for a faster parallel port connection. In fact, there are very few differences, just the resolution settings, between all the PostScript files underlining how standard PostScript is. All the work is actually done by the PDriverPS module, hence the simplicity of these printer def nition files.

Other files used

If you have !Printers version 1.53 or below (RISC OS 3.1 to RISC OS 3.6), then open up the !Printers application directory.

If you have RISC OS 3.7 or later, open !Boot. Choices.Printers . You should see the dp or ps etc directories and a file called Settings . In the dp or psPrData . Both of these files are of type prntdefn .

Look at the Settings file first. Load it into Edit. This file contains the present settings for each printer you have loaded when you use !Printers. It is in a 'shorthand' but some parts re recognisable. The PrData file contains the full settings, as viewed in PrintEdit, for each printer being used in the dp class. There is a PrData for each class of printer (in its cla s directory). Needless to say, do not alter anything in these files!

If you only use a PostScript printer, you will need to look in the ps directory for the above files.

How is this data held in memory?

Module PDriver sets up two 256-byte blocks of memory. Both contain the configuration data for the dumper (PDumperDM etc.) These are used when selecting the required dumper. I will return to thes data blocks at a later date.

That's it for this month. Next month we start to delve into the PDriver SWI's and produce a printing routine!


Source: Archive Magazine 13.7
Publication: Archive Magazine
Contributor: Brian Pickard