Comment 97 for bug 978120

Revision history for this message
cliddell (cjl) wrote :

Okay, so it's clear that the Toshiba has an issue with how we handle TrueType/Type42 fonts - I know I'm repeating myself, but the Postscript is *totally* correct, many other interpreters from many source handle it happily, and both myself and another engineer with a great deal of Postscript experience have carefully reviewed it, found nothing incorrect (although, we both agree it is not how we would have written it!).

So, again, I would urge you (Tomas) to contact Toshiba and report this as a bug - their interpreter is failing to interpret valid and logically correct Postscript.

Anyway, back to our immediate concern. The issue can be worked around by adding the following to the Ghostscript command line (when called from CUPs):

-dHaveTrueTypes=false -c "<< /MaxFontItem 500000 >> setuserparams " -f <input file>

What we have is the "HaveTrueTypes" setting which tells ps2write whether it should emit TrueType/Type42 fonts. Setting it to "false" means we convert the TTF outlines into bitmaps. This can happen in two ways: the bitmaps can be used to create a Type 3 Postscript font (this is preferred as it results in smaller file size, executes quicker on the target and often results in better quality output), or they are just normal image data in the PS.

The choice between the two approaches is dictated by the value of "MaxFontItem" - any glyph larger than MaxFontItem will end up as "normal" image data, rather than in a Type 3 font. Hence, I included code to set the value of MaxFontItem quite high, meaning we'll use the Type 3 font approach as often as is reasonable - but I'm wary about setting it too high, as I don't want to trigger resource problems on the target printers.

Till, this definitely should only apply to Toshiba printers (maybe just the Estudio range), and ideally, it would be good to set the resolution for Ghostscript to that of the target printer, or an integer division thereof: i.e. if the printer is 600dpi, you could reasonably set the resolution to 300dpi. It would preferable to avoid scaling by a non-integer value from both a performance and quality point of view.

Any questions, just ask...... (although, I can't promise a good answer!)