[cairo] PS backend

Rob Taylor robtaylor at fastmail.fm
Sat May 8 08:56:41 PDT 2004


On Wed, 05 May 2004 19:49:28 -0700, "Keith Packard" <keithp at keithp.com>
said:
> 
> Oh, that's another huge part of the job -- we've got to convert glyph
> outlines from the underlying font system to whatever format is needed by 
> PDF.  I think that's well documented, but may take a bit of work.

A lot of this work has been done by libgnomeprint for t1 and tt fonts,
I'll probably reuse that for them. Another interesting point is wether
applications can 'download' a font on the fly to cairo, for example for a
PDF rendering application to render embedded fonts..

> One final piece of PDF work -- I think PDF separates the code for drawing 
> the text from the code which describes what the text says.  If we want to 
> support this, we'll need some kind of PDF-specific API that applications 
> (or pango) can call to label strings with their content.

Well, as i read the standard, ToUnicode CMaps are used to provide a
unicode sting from a given text object. This probbaly means that for
decent PDF text output (with selectable text, etc) we need a stateful
text api (start block, write text with/without positioning, stop block),
If we want to allow per-glyph x/y positioning, as far as i can tell the
way to do this within a text block is to use a sequence of Tm and Tj
operators.. though there may be an issue with this as i notice that
pangopdf simply resets font and xy info for every glyph (i.e. a separate
text block for every glyph, if i read it correctly), though i think
gnomeprint does it this way.

Q for Owen: does this kind of interface work for Pango? what do you need
for good layout?

Rob Taylor




More information about the cairo mailing list