[cairo] Font options patch, first draft

Owen Taylor otaylor at redhat.com
Mon Jul 18 15:59:24 PDT 2005


On Tue, 2005-07-19 at 00:50 +0200, Torsten Schoenfeld wrote:
> On Mon, 2005-07-18 at 18:08 -0400, Owen Taylor wrote:
> 
> > [API proposal]
> 
> I just a minor language-bindings related comment.
> 
> > ===
> > /* Stores surface options into @options, overwriting any existing
> >  * options.
> > void
> > cairo_surface_get_font_options (cairo_surface_t      *surface,
> >                                 cairo_font_options_t *options);
> > ===
> 
> I'm not sure this would map well to languages with namespace support:
> 
>   $surface->get_font_options ($options);
> 
> Getters usually don't modify their arguments -- they just return
> something.  I'm not really able to come up with a better name right now,
> but I think it should be something with 'merge', 'update', 'overwrite'
> or something along those lines.

This would map to a straightforward getter in language bindings; just
like the matrix functions and the font extents functions.

 $options = $surface->get_font_options ();

It's uglier than the font extents functions and (reformed) matrix
options because  cairo_font_options_t can't be stack allocated but
otherwise it follows the same pattern.

I didn't make it return a newly allocated object partially for this
consistency and partially for performance reasons: to cut down
just a tiny bit on the number of places where little blocks of
memory are allocated and freed.

Regards,
						Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050718/09c81f6f/attachment.pgp


More information about the cairo mailing list