[Cairo] Text API (was: Color transforms)

Owen Taylor otaylor at redhat.com
Mon Jul 21 06:29:07 PDT 2003

On Mon, 2003-07-21 at 05:53, Thorsten.Behrens at Sun.COM wrote:
> On Fri, Owen wrote:
> > Just remember that any Cairo text API's for applications will be
> > more or less "toy"; for heavy-duty usage, you need a Pango equivalent.
> > So, there is no point in getting too fancy with the part that
> > isn't "draw these glyphs at these positions".
> >
> There's at least one subtlety: for string search working in PDF export,
> mere glyphs are not sufficient. You need the original string for that. So,
> if Cairo really wants to provide useful PDF exports (other possible
> formats, like e.g. SVG, might pose similar problems), a glyph export might
> not be enough.

There are quite a few features of PDF that a simple drawing API won't
handle ... text flow information is an example fairly similar to the
one you raise (If you have a series of boxes with text on the page,
what's the ordering of them), but also hyperlinks, indices, etc.

So, you have to draw the line somewhere. Perhaps a "draw these glyphs
here, and here's the original text" API makes sense, though.

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. I don't have my PDF book 
with me at the moment, so I can't look up how that is supposed t
o work.


More information about the cairo mailing list