[cairo] Initial tests of cairo's PostScript backend with firefox

Michael Sweet mike at easysw.com
Tue Apr 11 18:41:27 PDT 2006


Carl Worth wrote:
> ...
> 	 196122	minefield-mozilla.ps
> 	1607847	minefield-mozilla-merged.ps
> 	 310802	minefield-mozilla-merged-ps-type3.ps
> 
> The files are here for your viewing pleasure:
> 
> 	http://cairographics.org/~cworth/images/minefield-mozilla.ps
> 	http://cairographics.org/~cworth/images/minefield-mozilla-merged.ps
> 	http://cairographics.org/~cworth/images/minefield-mozilla-merged-ps-type3.ps
> ...
> 	193814	minefield-firefox-1.5.ps
> 	http://cairographics.org/~cworth/images/minefield-firefox-1.5.ps

For fun, I ran these files through the (new) CUPS cupstestdsc program.
The original firefox 1.5 output passed the tests, but the new cairo-
based output had a couple issues:

     - %%Page: needs a page label and ordinal page number; typically
       you will just use the page number twice, e.g.:

           %%Page: 1 1
           ....
           %%Page: 2 2
           ....

     - You have a lot of lines longer than 255 characters; probably
       the simplest fix is to use a LF instead of space as the
       separator.

Also, you can optimize the output size significantly just by defining
procedures like "M" for moveto, etc.  The following document prolog
with the corresponding substitutions in the merges-ps-type3 file
reduced the size of the output by 37k (273936 bytes total):

     %%BeginProlog
     /C{curveto}bind def
     /F{fill}bind def
     /G{setgray}bind def
     /L{lineto}bind def
     /M{moveto}bind def
     /P{closepath}bind def
     /R{setrgbcolor}bind def
     /S{show}bind def
     %%EndProlog

There are other procedures you could define, however these seemed to
be the most used and provide the biggest savings...

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com


More information about the cairo mailing list