[Cairo] Text API (was: Color transforms)

Owen Taylor otaylor at redhat.com
Mon Jul 21 08:35:17 PDT 2003


On Mon, 2003-07-21 at 11:08, Thorsten.Behrens at Sun.COM wrote:
> Today, Owen wrote:
> 
> > So, you have to draw the line somewhere. Perhaps a "draw these glyphs
> > here, and here's the original text" API makes sense, though.
> >
> That's an option, although not a very clean one.

It's clean, just not at the level you are thinking about. The
application deals with the Pango API, and says "draw this
paragraph here"; Pango interacts with the "not very clean"
API to produce the correct output.

The alternative is to stick "Pango" at the PDF backend for
Cairo level and that isn't an alternative; the API that you
have to thread down though the various levels is huge,
the amount of duplicated code is huge.

> > There's also the question of bidirectional text output.
> > Going back from visual output order to the logical order isn't
> > always possible and is always tricky.
> >
> The original character string should be sufficient, according to our local
> scripting expert. This string is of course in the logical order.

Several issues here:

 - Pango draws each bidirectional segment separately, in visual
   order, which is the sensible way to do it.

 - If you simply provide "here's a paragraph as glyphs, here's
   the text that goes with it" as two big chunks, then there
   isn't sufficient information to do selection of subsections
   of that paragraph available to a PDF viewer.

However, for me to speculate further without re-reading the
relevant parts of the PDF book wouldn't be useful.

Regards,
					Owen






More information about the cairo mailing list