[cairo] PDF type3 font support; Just bugs to fix before cairo 1.2

Carl Worth cworth at cworth.org
Mon May 15 12:57:54 PDT 2006


I just pushed out new support for emitting type 3 fonts in output from
the PDF backend.

I haven't yet re-tested with using firefox[1] "print to file" to
exercise the PDF backend, but it should already be better than
before[2].

With that feature in place, there are now no features left on the
roadmap for the cairo 1.2 release:

	http://cairographics.org/ROADMAP

Instead, all that's there is a list of bug fixes. Two of the bugs have
special priority since they have API implications:

1) cairo_{ps,pdf}_surface_set_dpi have no effect

   The API implication here is that we've recently proposed replacing
   these functions with a new cairo_surface_set_fallback_resolution.
   Christian Biesinger and Emmanuel Pacaud have worked together on an
   initial patch for this (see the ps-pdf-dpi branches/threads). And
   I'll respond on those existing threads as to what's left.

2) cairo_set_line_width should immediately use CTM

   We've got the line-width-scale test case that demonstrates this
   problem. I think the solution should be straightforward. Currently
   we're saving the line width and passing it down to the backend
   stroke functions. Instead we should save and pass a "pen" which
   consists of a line width as well as a matrix (the CTM at the time
   the line width was set). Thanks to Keith Packard for suggesting
   this approach.

   Then the only trick will be to fix all the backends to implement
   that pen properly. I think this won't be hard as the backends are
   not using any available matrix for the path itself, (cairo has
   already transformed the path coordinates), so any matrix available
   in PostScript, PDF or SVG, say, should be available to be used to
   transform the pen.

It's definitely time for another snapshot, but I'd like to get fixes
for the above two issues into the next one. So I'll try fixing both of
those this afternoon and getting 1.1.8 out this evening.

Wish me luck, (or better, feel free to pitch in some help with either
of those).

-Carl

PS. After these bugs are fixed, we've only got bugs left with fixes
that don't impact the API at all. So the next sort will be to separate
bugs existed in 1.0 (lower priority) from the new regressions since
1.0 (higher priority).

[1] It would be nice to be able to use "stock" cairo with firefox
--enable-system-cairo, and I think we're really close to that
now. Vladimir, I've been expecting some comments on the merging I did
of mozilla patches. Can I expect that soon? If there's more that needs
to be done I'd really like to see it happen before cairo 1.2 if
possible.

[2] The PDF Type3 font embedding I just did should help cut down file
sizes, (previously we were repeating the glyph path vectors every time
the same glyph needed to appear in the output). But there are still
some more improvements that could be done, both for file size and for
quality:

  1. We're currently repeating glyph paths for every scale at which a
     glyph appears in the output. We could reduce file size by sharing
     unscaled paths and scaling with a value other than 1 when
     selecting the font with the Tf operator.

  2. PDF type3 fonts don't support hinting, so on-screen display of
     the PDF output will not look nearly as good as it could. Kristian
     previously implemented some TrueType font subsetting and
     embedding. When that gets re-enabled it will allow for much nicer
     display of cairo-generated PDF files---at least when using
     TrueType fonts---it might also allow for text selection as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060515/86080c12/attachment.pgp


More information about the cairo mailing list