[cairo] Serious concerns about cairo

Vladimir Vukicevic vladimirv at gmail.com
Sat Sep 23 17:21:11 PDT 2006


On 9/23/06, Mike Emmel <mike.emmel at gmail.com> wrote:
> Exactly and pango is not a solution for everybody. I disagree about cairo
> not being in the font business. Excellent text layout facilites along with glyph
> drawing go together. The argument agianst having a engine is more a
> argument to just use pango but if pango is not a viable solution then
> you the open source community has nothing more to offer. If you don't
> want cairo to offer fonts then
> we need a public api for plugging in the font engine and the current
> font code should be stripped from from the api. Right now once you get
> past the toy stage you just have a bunch of dead code.

Sure, and the toy API is labelled as a toy precisely because of that;
you can't use it to "grow into" a real text layout system.  Like I
said, I didn't like seeing the toy API included to begin with, because
it makes people feel like there's something more powerful there, and
they get frustrated when they realize that there isn't.

I agree that pango is not a solution for everybody; perhaps someone
should write something, but whatever that "something" is, it can be
done on top of cairo, instead of inside it.  We (Mozilla) use
Uniscribe, pango, or ATSU for text layout, and we draw glyphs with
cairo_show_glyphs().  Nothing stops you from doing something similar,
or wrapping it with a cross-platform wrapper and contributing it.
Pango's license is unfortunate, because pango already does much of
this, but we can't fix that.

> If  cairo_scaled_font_t and  cairo_font_face_t where public structures
> that allowed the user to provide a implementation then your assertion
> that cairo is not in the font business would be true.

How so?  cairo_scaled_font_t and cairo_font_face_t store information
about the current platform-specific font, and the implementation knows
how to render glyphs from those fonts to a cairo surface.  A
particular surface (or font impl) can fast-path show_glyphs -- e.g. my
Quartz backend knows that if the font is an ATSU font, it can pull out
the bits it needs and call CGContextShowGlyphs or similar directly.
If there's something related to glyph rendering that's not working,
then it's a bug that should be fixed.

Cairo is in the glyph rendering business; it's not in the text layout
business.  Text layout is a very complex problem that's already been
solved by other tools; it sounds like you're already on your way to
creating a version of pango that suits your needs.  You may want to
take a look at PangoLite, which I think might be what you need, though
I haven't looked at it in too much detail.

   - Vlad


More information about the cairo mailing list