[cairo] Should we expose cairo_toy_font_face_create?

Carl Worth cworth at redhat.com
Fri Feb 24 15:55:02 PST 2006


On Fri, 24 Feb 2006 11:37:04 -0800, Carl Worth wrote:
> Any likes or dislikes about the API should be made soon. I'll add an
> implementation shortly, and if I haven't heard any complaints, will
> push this out to the central tree after that.

OK. Sorry about all the recent noise on this thread. I'm back to
actually working on it once again.

I'm having a lot of fun being able to commit each piece of this as I
finish, even though the end result isn't yet ready for the live
tree. I'm also working on hooking up gitweb for the personal cairo
trees which will help visibility quite a bit.

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.

If we do then this will be the first time "toy" actually appears in
cairo's API, (though we've been using it in descriptions forever).

And if we do that, it would look a little odd to have a named font
type with no corresponding functions. So maybe we would also export:

	cairo_public cairo_font_face_t *
	cairo_toy_font_face_create (const char          *family,
	                             cairo_font_slant_t   slant,
	                             cairo_font_weight_t  weight)

I don't know how useful this function actually is, other than for
completeness. (Yeah! Even users of the toy font API can make scaled
fonts now!) But if nothing else, perhaps this would make the
connection between cairo_select_font_face and CAIRO_FONT_TYPE_TOY a
bit more obvious.

Anyone see any problems with this?

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060224/6f5d1349/attachment-0001.pgp


More information about the cairo mailing list