[cairo] [PATCH] PS/PDF improve efficiency of text output

Behdad Esfahbod behdad at behdad.org
Mon Sep 25 09:08:15 PDT 2006


On Sun, 2006-09-24 at 23:08 -0400, Dominic Lachowicz wrote:
> > Well, it can be used in write_to_png too.
> 
> Right, but not for your stated purpose of getting human-readable
> output. PNG with compression level 0 is as indecipherable as with -9.

Right.  I said my /motivation/ was readable PS/PDF.  Another API that is
quite as backend-specific is cairo_set_fallback_resolution(), but we
decided to make it general instead of three different ones.   We can
improve this by documenting that it only has effect on vector surfaces,
and also document that PS/PDF/SVG are vector backends.  Possibly even
add a cairo_surface_is_vector().  Similarly, compression level can be
set on any file-backed surface.


> > Donno about SVG, but that has
> > some support for compression too I assume?
> 
> It's not uncommon to gzip the entire SVG, so that may be a useful
> addition to cairo. But there isn't any meaningful compression on a
> smaller scale. It's pretty easy to get human-readable output from a
> compressed SVG just by running gzcat on it, for instance.

Right.  So again, 0 is used for not compressing SVG, 1 to 9 is used as
gzip compression level.  But we want uncompressed SVG as default, so we
probably need per-backend default compression level.

> Best,
> Dom

-- 
behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"



More information about the cairo mailing list