[cairo] User font take 2

Torsten Schoenfeld kaffeetisch at gmx.de
Mon May 8 11:56:05 PDT 2006


On Mon, 2006-05-08 at 14:28 -0400, Kristian Høgsberg wrote:

> > >     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.
> 
> This is unfortunate, but in line with the rest of the API.  The cairo
> API generally don't export the subtypes of the different objects, so
> in cases where we have functions that operate exclusively on one
> specific subtype we loose type safety. Other examples are
> cairo_xlib_surface_set_drawable(), cairo_ps_surface_set_size(),
> cairo_pattern_add_color_stop_rgb() (well in this case the names match,
> but it only works for gradient patterns).

Ah, OK.  I didn't realize cairo_user_font_face_t is a sub-type of
cairo_font_face_t.

-- 
Bye,
-Torsten



More information about the cairo mailing list