Reputation: 21
I need to install a Postscript type 42 font (https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5012.Type42_Spec.pdf) into some Postscript printers (HP and Lexmark). There are manual ways described to do this through using the Windows printer drivers, however I'm doing this on Linux and would prefer to do this by sending the printer a piece of Postscript (along with the font). Can anyone suggest some Postscript make the font resident in the printer. (I do not want to send the font to the printer for each job as it is ~40 MB long.)
Upvotes: 0
Views: 688
Reputation: 31139
If the manual ways are using the Windows print drivers, then they must be doing it through PostScript (or, just possibly, PCL but that's less likely). The problem is that there is no real standard for downloading fonts permanently.
You also haven't given specifics of the printers involved. Unless the printers have some kind of non-volatile storage then you can't install the font permanently, as soon as the power goes off the font will be lost and will need to be downloaded once more.
Unless you need the font on every single job, its somewhat wasteful to install it on the printer (again, unless it has non-volatile storage) because it will use that 40 MB of memory permanently. That's 40 MB less memory for other print jobs to use which can result in slower printing times and/or print failures due to insufficient memory.
To install the font in VM until the next power cycle you need to exit the job server loop, which means you need to know the job server password. Normally this is 0.
Then you execute serverdict begin 0 exitserver
or (better) true 0 startjob
and then define the font. That will persist until the next power cycle.
Downloading to a disk is more involved. In order to download the font to disk you would normally open a file on disk and write the file to a specific location, often %disk0%/fonts. Of course, since your font is so large, it may well be that it isnmm't a font at all, but a CIDFont, which is not the same thing. In this case you would normally write the file in %disk0%/CIDFonts.
Your best bet to solve this is (probably) to follow the steps for Windows and find out exactly what gets sent to the printer (if necessary by spooling the file to disk). You can then duplicate that. If you can get the file spooling to work you can capture the result take it to Linux and just send that file to the printer. Assuming your printers don't have non-volatile storage sufficiently large to hold the font, you can keep the file and send it to the printer on reboots.
Perhaps more challenging is arranging that the PostScript producing application doesn't embed the font. Unless you have good control over the production of the PostScript, most applications will embed anything outside the standard base 13 faces, or 136 fonts, because its hard to interrogate printers to find out what fonts are installed.
[edit]
I'd still suggest that you try and capture whatever is being written by the Windows drivers you referenced in the question. The location of fonts on a PostScript printer isn't guaranteed, and I strongly suspect will be different from system to system.
The first thing to do is probably to find out what the disk layout of the printers is, you'll need a PostScript program to do that, something like:
%!
0 0 moveto
/Helvetica findfont 12 scalefont setfont
(/*)
{
show
currentpoint exch pop dup 780 gt {
showpage
0 0 moveto
}{
15 add 0 exch moveto
}ifelse
}
256 string filenameforall
Warning! That program could potentially produce a lot of pages of output.
From there you'll need to look for something like 'CIDFont', very often stored as something like '/Resource/CIDFont' but may be any number of levels of directory down.
You can then open a file in that directory, write the content of the font to that file, and close it, then restart the printer.
So you'll need to do something like :
%!
/Dest (/Resource/CIDFont/MyFontname) (w) file def
/DataString 1024 string def
loop
{
currentfile DataString readstring exch
Dest DataString writestring
not {
Dest closefile
exit
} if
}
....
....
font goes in here
....
....
You'll want to check the CIDFont is available afterwards of course, so this :
%!
0 0 moveto
/Helvetica findfont 12 scalefont setfont
(/*)
{
show
currentpoint exch pop dup 780 gt {
showpage
0 0 moveto
}{
15 add 0 exch moveto
}ifelse
}
256 string /CIDFont resourceforall
will print all the available CIDFonts.
Note that if your font is a CIDFont its type is not 42, that's a regular Font type. CIDFonts with TrueType outlines are type 2 CIDFonts.
BTW have you considered asking your printer manufacturers support desk for help ? Its entirely possible they have an automated means of doing this whole procedure.
You should also be aware that writing stuff directly to a printer's hard disk is potentially damaging to your printer, and your manufacturer may well regard doing so as having voided the warranty.
Upvotes: 1