[cairo] GTKCairo development

Carl Worth cworth at east.isi.edu
Mon May 3 16:12:27 PDT 2004

On Mon, 3 May 2004 17:48:59 -0700 (PDT), Jon Smirl wrote:
> If Pango belongs a layer above Cairo then Cairo should have no text API at all
> and all text should be handled by the higher layers.

Cairo needs a text API as text is a primary element of 2D
documents. Nobody wants cairo to generate PDF output that has text
converted to paths.

The "real" text API of cairo, (ie. what is intended to be used by
serious text consumers such as pango), is the following:

	Accept an array of glyphs (ie. indexes into a specific font),
	along with an absolute coordinate for each glyph. Cairo then
	renders each glyph at the specified coordinate.

This should be complete support for everything that pango needs, as they
helped us design it. If not, the pango developers should please let us

> If instead you think we need some text support in Cairo so that it can be
> blended with other things, then that text support should be Pango, not just a
> partial support of text for convenient languages like English.

The Cairo API described above is not restricted to any language. Any
glyph from any font can be rendered at any location.

Owen did decry the "toy" API in cairo. This is just a simple interface
to accept a string of UTF-8 characters and a single coordinate. It lays
the characters next to each other, (in an unspecified fashion).

This "toy" API only exists so that we can write "Hello World" programs
without needing a library like pango to lay the text out for us. Owen is
absolutely right that it should never be used by a real GTK+ program
that has access to pango.

> If Cairo is meant to be a portable API I would think it needs Pango. What's the
> point of making my drawing code portable if all of my text code isn't.

The fact of the matter is that users have demanded that cairo be able to
produce "native" text on multiple platforms. This means that cairo must
be able to use distinct the native font systems on distinct platforms.


More information about the cairo mailing list