[cairo] User font take 2

Torsten Schoenfeld kaffeetisch at gmx.de
Mon May 8 11:07:19 PDT 2006

On Mon, 2006-05-08 at 12:34 -0400, Kristian Høgsberg wrote:

> So, to flesh out the API a bit more, here's what I think would work (I
> haven't implemented this yet, just looking for comments):

I have two small comments on the naming from a language binding point of
view.  These are solely based on the names of the functions/methods, so
my arguments become irrelevant if there are specific reasons for the

>     cairo_font_face_t *
>     cairo_create_user_font_face(cairo_matrix_t *glyph_to_user);

Functions that have the cairo_ prefix should either create a cairo_t or
have a cairo_t as their first argument.  This function looks like a
cairo_font_face_t constructor, so maybe give it a cairo_font_face_
prefix?  (Though that would probably become rather long.)

>     cairo_t *
>     cairo_user_font_face_add_glyph(cairo_font_face_t    *font_face,
>                                    cairo_content_t       content,
>                                    cairo_text_extents_t *metrics,
>                                    int                   ucs4,
>                                    int                   index);

This has a cairo_user_font_face_ prefix but takes a cairo_font_face_t as
its first argument.  The prefix of a method should match the object that
method works on.  Also, the name doesn't really state that this method
returns a new cairo_t.


More information about the cairo mailing list