[cairo] Should we expose cairo_toy_font_face_create?

Behdad Esfahbod behdad at cs.toronto.edu
Fri Feb 24 16:07:11 PST 2006


On Fri, 24 Feb 2006, Carl Worth wrote:

> Anyway, I ran into something interesting:
>
> > +typedef enum _cairo_font_type {
> > +    CAIRO_FONT_TYPE_FT,
> > +    CAIRO_FONT_TYPE_WIN32,
> > +    CAIRO_FONT_TYPE_ATSUI
> > +} cairo_font_type_t;
>
> It turns out that that's not enough since we also have a toy font
> face, so we'll need to add CAIRO_FONT_TYPE_TOY there as well. This is
> because users can call cairo_select_font_face, then
> cairo_get_font_face, then cairo_font_face_get_type and we need a value
> to return.
[...]
> Anyone see any problems with this?

How about "simple"?

By not having the enum however, you can have private types ;).
Also, for forward compatibility, please note in docs for all
these enums that new values may be added in later versions...
We had a similar problem when adding new values to an enum in
glib, Pango would assert_not_reached, simply not expecting
anything to be added in the future...

> -Carl

--behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
	-- Dan Bern, "New American Language"


More information about the cairo mailing list