[cairo] PS backend

Owen Taylor otaylor at redhat.com
Sun May 9 05:19:57 PDT 2004


On Sat, 2004-05-08 at 11:56, Rob Taylor wrote:

> > 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.

I don't have my PDF book to hand at the moment, but I'm pretty sure
there was a way to do "series of positioned glyphs" ... which may have
been repeated operators; it may have been something else.

Note that because of bidi reordering, ligatures, glyph substition, etc,
the glyph stream is frequently not sufficient to allow cut-and-paste to
operate correctly. Again from memory, I think that PDF has two features
to compensate for this:

 - Ability to set up a custom reverse glyph => unicode mapping table
   for a font.
 - Ability to provide the original text.

It will almost certainly take some experimentation to figure out what it
takes to get acroread, xpdf, etc, to handle cut-and-paste right.

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

Pango needs individual glyph positioning; the best you can do do is
notice "hey, glyphs 12-17 are positioned at their natural widths, we can
skip positioning for them".

Regards,
							Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20040509/23777000/attachment.pgp


More information about the cairo mailing list