[cairo] using cairo in c++

Bill Spitzak spitzak at d2.com
Wed Oct 12 18:34:55 PDT 2005



Carl Worth wrote:

> I thought the conclusion of that discussion was that if some code
> wanted an interface with an implicit thread-local-storage-based
> context, then that interface could be layered on top of the
> explicit-context interface in cairo. Any reason that won't work for
> you here?

There still is the need to declare whatever method you use to get the 
cairo context. Also since this interface is likely to depend on the 
toolkit it means a fancy drawing code is never going to be portable 
between toolkits.

> One thing we've talked about is documenting cairo_select_font_face to
> be guaranteed to support a short list of font family names. I thought
> we had an open bug report on this. I can't find that bug report now,
> but I think it recommended using the CSS2 generic font family names,
> which appear to be:
> 
> 	sans, sans-serif, cursive, fantasy, monospace
> 	http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families
> 
> What I would also like to do is to fix things so that no name doesn't
> work, (that is, one will always get at least _some_ font, and never an
> error from cairo_select_font_face). And I'd even like the
> cairo_show_text interface to guarantee that _some_ glyph gets drawn
> for every character, even if cairo has to get different glyphs from
> different fonts, or even just create some glyph, (perhaps in the style
> of pango hex boxes), for missing glyphs.
> 
> So, those are the kinds of guarantees I'd like to provide, which
> should pretty much let you use any font listing approach you see
> fit. And if you need better guarantees between the font lister and the
> font selector, (such as, say, error reporting from selection), then
> you would use the "native" selector that goes along with whatever font
> lister you are using, and call cairo_set_font_face rather than
> cairo_select_font_face.
> 
> Does that sound reasonable to you?

Yes this sounds exactly like what I need, thanks!

I still think a "toy font lister" would be a nice addition for cairo, 
but I will try to write and debug it into fltk, and then see if I can 
convince you to add my version someday :-).


More information about the cairo mailing list