From: pcolmer@acorn.co.uk (Philip Colmer)
Newsgroups: comp.sys.acorn,comp.sys.acorn.tech
Subject: PostScript printing (was Re: RiscOS 3.1, Risc Development IDEFS)
Date: 29 Sep 92 07:47:22 GMT
Organization: Acorn Computers Ltd, Cambridge, England

In article <1992Sep29.115639.11080@waikato.ac.nz> bwc@waikato.ac.nz (Ug!) writes:

>PostScipt printers -- finally, they download fonts!  That's right!  So long
>as
>(a) you want them downloaded permanently!
>(b) you want *every* font downloaded *every* time -- not just the ones you
>    use.
>
>Because of option (a), you need to know the password for the printer.
>
>Now what I would like to know is: does RiscOS 3.1 have some way of doing
>temporary downloads that last just for the extent of the job?

Hmmm ... enter memory retrieval mode.

Postscript printing does support both permanent and 'transient' font
downloading. Permanent meaning that the fonts only need to be
downloaded once (so long as the printer isn't reset) and transient
meaning that the fonts are sent with each job.

Now, there are two things that need to be known:

 1. what fonts are resident in the printer
 2. what fonts are being used by the document

The first point is taken care of by using !FontPrint. This allows you
to map RISC OS font names onto Postscript font names. It gets its
initial information from the printer definition file that you dropped
into !Printers, so it is important to use the best matching printer
definition file that you can find, ie if you are using an Apple
LaserWriter Plus, *don't* use the Apple LaserWriter file, use the
Apple LaserWriter Plus file.

By using FontPrint, you can tell the printer manager about any fonts
you might already have permanently installed in the printer (eg from a
font card), or which fonts you want downloaded into the printer on a
permanent basis. As pointed out in the original article, this requires
knowledge of the printer password, which is normally 0.

The second point is dealt with in one of two ways, depending on the
answer to the question "does the application doing the printing know
how to tell the printer driver what fonts are being used?".

This is a new feature to RISC OS 3, which basically allows the printer
driver to only download those fonts which are being used by the
application but which *aren't* already in the printer.

If the application *doesn't* know how to tell the printer driver what
fonts are being used, ie *no* calls whatsoever are made to the new SWI
(see below) after the initial call to PDriver_SelectJob but before any
calls to PDriver_GiveRectangle, then the printer driver includes in
the PostScript a definition of EVERY RISC OS font you have on your
machine that does not have a PostScript equivalent defined.

So, the upshot of all of this is to badger the publishers of the
application you are using into supporting this new SWI so that your
printing works properly.

--Fil.

The new SWI that applications need to call is PDriver_DeclareFont
(&80157):

Entry:          R0 = pointer to font name as passed to Font_FindFont in R1, or
                R0 = 0 to declare that no fonts will be used.

Good exit:      All registers preserved, NZC preserved, V clear.

Error exit:     V set, R0 points to error block.
                All other registers preserved, NZC preserved.

This SWI should be called after the initial PDriver_SelectJob to
create the print job, but before any calls to PDriver_GiveRectangle
have been made. It should be called once for each distinct font name
and encoding to be used, but not for each font size (or colour, etc.).
If a "SWI not known" error is returned (error number &1E7), then the
printer driver is an old one that does not support this SWI. This
specific error should be checked for, ignored, and printing should
continue. Note that due to a bug, some of the old printer drivers
return error number &1E6 (BadTime) instead of &1E7. Therefore the
application will need to check for &1E6 and &1E7 when trying to call
SWI PDriver_DeclareFont.

---------------------------------------------------------------------
        Practise random kindness and senseless acts of beauty