[cairo] cairo-created PDFs are too large

Ian Britten britten at caris.com
Wed Dec 3 07:14:31 PST 2008


Adrian Johnson wrote:

> There isn't anything you can do to reduce the size other than upgrade to 
> each new release when available. There are some things you can do that 
> would increase the size unnecessarily like creating a new font face each 
> time you draw some text as cairo embeds a separate font for each font face.

Can you clarify whether I'm into this case with what I'm doing?

Our rendering engine draws one character/glyph at a time (Since each
glyph needs to be positioned/rotated/etc, may be using different
faces, different sizes (subscripts), colours, etc).

As such, I'm "creating a new font face" for each glyph to be drawn.
However, I'm always creating a Cairo face from a FT_Face, and the
actual FT_Face is cached/shared amongst all the Cairo faces that
use it.  As such, the number of unique FT_Faces used is relatively
low, compared to the number of Cairo faces I 'create' (ie: Allocate).

I haven't been watching my PDF file sizes, and am probably not too
concerned about their size for now (As long as they're practical),
but I figured I should know if I'm into this case or not...

Many thanks for any info!
Ian



More information about the cairo mailing list