CUPS 1.4.3 && printing UTF-8 text

Helge Blischke h.blischke at acm.org
Tue Jul 5 07:17:02 PDT 2011


Matthias Apitz wrote:

>> Matthias Apitz wrote:
>>
>> > The not embedded font files must be somehow the result of a missing PPD
>> > file information if I call 'texttops' for testing this way:
>> >
>> > # CHARSET=utf-8 ~/cups-1.4.3/filter/texttops 1 rleigh myfile 1 ""
>> > # ~/CUPS-UTF8.txt �> /tmp/ps
>> > DEBUG: ppd = SetCommonOptions(num_options 0, options 0, 1) gives 0
>> > DEBUG: ppd arg of WriteProlog() 0?
>> > DEBUG: charset file /usr/local//share/cups/charsets/utf-8
>> > DEBUG: NumFonts 15
>> > DEBUG: Download fonts 2?
>> > DEBUG: Download fonts ppd 0?
>> > DEBUG: Download fonts ppd 0?
>> >
>> > (I inserted some more DEBUG statements to see what it is missing).
>> >
>> > I don't know what I should provide exactly as PPD information, even
>> > after reading for a while the docs :-(
>> >
>>
>> Fonts get embedded in the PS file by using the PPD env variable, like
>>
>> # CHARSET=utf-8 PPD=/usr/local/etc/cups/ppd/pdf.ppd
>> # ~/cups-1.4.3/filter/texttops 1 rleigh myfile 1 "" ~/CUPS-UTF8.txt  >
>> # /tmp/ps
>>
> 
> Hello,
> 
> With the existing (and added in our CUPS installation) FreeFonts, we are
> printing happy UTF-8 text files (even if there are still missing a lot of
> glyphs and the subject in general needs more attention in the future);
> 
> one problem is showing up in production environment:
> 
> the resulting Postscript output which is sent to the printer is because of
> the embedded FreeFonts around 1 Mbyte for a simple text page and the
> printer has to interprete this bunch of data; it takes on a normal HP
> Laserjet 205 seconds for 10 print jobs of each 1 MByte data, i.e. an
> average of 20 secs for a page;
> 
> I tested the following:
> 
> 1. used texttops to convert the UTF-8 text to Postscript as shown above
> 2. convert the Postscript file to PCL with:
> gs -dBATCH -dNOPAUSE -sDEVICE=ljet4 -sOutputFile=file.pcl -sPAPERSIZE=a4
> file.ps 3. print the resulting PCL file with -o raw via CUPS;
> 
> the result is promising:
> - the file is only 200 KByte for a page
> - it takes 55 secs to print 10 files
> 
> Comments?
> Is there some work in progress to integrate CUPS and Ghostscript in that
> way?
> 
> Thanks
> 
>      matthias

The better way would be to enhance the texttops filter to do font 
subsetting, i. e. to embed only the part of the font's glyph descriptions 
which are actually used.

A brute force way to do this would be to digest the primary texttops output 
by ghostscript using the ps2write device, which does (or at least can be 
configured to do) font subsetting of both Type1 and TrueType fonts.
But note that this requires a ghostscript release 9.01 or greater (to ensure 
the ps2write outout is linearly processabel and DSC conformant).

Helge





More information about the cups mailing list