Sweden-Number/documentation/psdriver

135 lines
5.2 KiB
Plaintext

Wine PostScript Driver
======================
When complete this will allow Wine to generate PostScript files without needing
an external printer driver. It should be possible to print to a non PostScript
printer by filtering the output through ghostscript.
Installation
------------
The driver behaves as if it were a DRV file called WINEPS.DRV which at the
moment is built into Wine. Although it mimics a 16 bit driver it will work
with both 16 and 32 bit apps, just as win9x drivers do.
To install it add
Wine PostScript Driver=WINEPS,LPT1:
to the [devices] section of win.ini and to set it as the default printer also
add
device=Wine PostScript Driver,WINEPS,LPT1:
to the [windows] section of win.ini and
To run 32 bit apps (and 16 bit apps using the builtin commdlg) you also need to
add certain entries to the registry. The easiest way to do that at the moment
is to use the winelib program programs/regapi/regapi with the file
documentation/psdrv.reg . To do this cd to programs/regapi/regapi and type
`make' to actually make the program, then type
`./regapi setValue <../../documentation/psdrv.reg' . You can obviously edit
psdrv.reg to suit your requirements.
You will need Adobe Font Metric (AFM) files for the (type 1 PostScript) fonts
that you wish to use. You can get these from
ftp://ftp.adobe.com/pub/adobe/type/win/all/afmfiles . The directories base17
or base35 are good places to start. Note that these are only the font metrics
and not the fonts themselves. At the moment the driver does not download
additional fonts, so you can only use fonts that are already present on the
printer.
Then create a [afmfiles] section in your wine.conf (or ~/.winerc) and add a
line of the form
file<n>=/unix/path/name/filename.afm
for each AFM file that you wish to use. [This might change in the future]
You also require a PPD file for your printer. This describes certain
characteristics of the printer such as which fonts are installed, how to select
manual feed etc. Adobe also has many of these on its website, have a look in
ftp://ftp.adobe.com/pub/adobe/printerdrivers/win/all/
Create a [psdrv] section in your wine.conf (or ~/.winerc) and add the
following entry:
ppdfile=/somewhere/file.ppd
By default, the driver will look for a file named default.ppd in the directory
from which you started wine.
To enable colour printing you need to have the *ColorDevice entry in the PPD
set to true, otherwise the driver will generate greyscale.
Note that you need not set printer=on in the [wine] section of wine.conf, this
enables printing via external printer drivers and does not affect wineps.
If you're lucky you should now be able to produce PS files from Wine!
I've tested it with win3.1 notepad/write, Winword6 and Origin4.0 and 32 bit
apps such as win98 wordpad, Winword97, Powerpoint2000 with some degree of
success - you should be able to get something out, it may not be in the right
place.
If you don't have a PostScript printer here is a short additional description
how to get the Wine PostScript Driver running with ghostscript. I had some
success with ghostscript 5.10 from the SuSE 6.2 distribution. My ghostscript
package contains some AFM files in the directory /usr/share/ghostscript/fonts.
I have used these for the [afmfiles] section in my wine.conf (or ~/.winerc)
file.
There are also two PPD file in my ghostscript package. They are located in the
directory /usr/share/ghostscript/5.10. I have used the file cbjc600.ppd because
of the supported papersize. Because my PPD file needed some changes i have
copyed it to /usr/local/etc/gs.ppd and enterd it into the [psdrv] section in
my wine.conf (or ~/.winerc) file.
When i started wine after this settings i got an error when wine tried to pars
the PPD file. There was the ':' missing in the line:
*CloseUI: *PrintColors
After this fix the PPD file was successfull parsed, but printing was still not
possible. The reason is that the PPD file contains no font information. To
create the font information I run wine with -debugmsg +font and redirected the
output into a file. Than I filterd the file for lines containing 'FontName'
using the grep command and extracted the names of the fonts with the cut
command into a new file.
grep FontName LOGFILE | cut -f 2 -d\' | sort -u > add.ppd
Now '*Font ' needs to be inserted at the beginning of each line of the new
file. The end of each line needs to become ': Standard'. The last step is to
add these line to the PPD file. After this I was able to print some text using
wines buildin PostScript driver and ghostscript.
TODO / Bugs
-----------
Driver does read PPD files, but ignores all constraints and doesn't let you
specify whether you have optional extras such as envelope feeders. You will
therefore find a larger than normal selection of input bins in the print setup
dialog box. I've only really tested ppd parsing on the hp4m6_v1.ppd file.
No TrueType download.
StretchDIBits uses level 2 PostScript.
AdvancedSetup dialog box.
Many partially implemented functions.
ps.c is becoming messy.
Notepad often starts text too far to the left depending on the margin
settings. However the win3.1 pscript.drv (under wine) also does this.
Probably many more...
Please contact me if you want to help so that we can avoid duplication.
Huw Davies <h.davies1@physics.ox.ac.uk>