/** * cairo_scaled_font_get_font_options: * @scaled_font: a #cairo_scaled_font_t * @options: return value for the font options * * Stores the font options with which @scaled_font was created into * @ctm. **/ void cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font, cairo_font_options_t *options) { if (scaled_font->status) { _cairo_font_options_init_default (options); return; } _cairo_font_options_init_copy (options, &scaled_font->options); }
/** * cairo_font_options_copy: * @original: a #cairo_font_options_t * * Allocates a new font options object copying the option values from * @original. * * Return value: a newly allocated #cairo_font_options_t. Free with * cairo_font_options_destroy(). This function always returns a * valid pointer; if memory cannot be allocated, then a special * error object is returned where all operations on the object do nothing. * You can check for this with cairo_font_options_status(). **/ cairo_font_options_t * cairo_font_options_copy (const cairo_font_options_t *original) { cairo_font_options_t *options; if (cairo_font_options_status ((cairo_font_options_t *) original)) return (cairo_font_options_t *) &_cairo_font_options_nil; options = malloc (sizeof (cairo_font_options_t)); if (!options) { _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_font_options_t *) &_cairo_font_options_nil; } _cairo_font_options_init_copy (options, original); return options; }
/** * cairo_font_options_copy: * @original: a #cairo_font_options_t * * Allocates a new font options object copying the option values from * @original. * * Return value: a newly allocated #cairo_font_options_t. Free with * cairo_font_options_destroy(). This function always returns a * valid pointer; if memory cannot be allocated, then a special * error object is returned where all operations on the object do nothing. * You can check for this with cairo_font_options_status(). **/ cairo_font_options_t * cairo_font_options_copy (const cairo_font_options_t *original) { cairo_font_options_t *options; if (cairo_font_options_status ((cairo_font_options_t *) original)) return (cairo_font_options_t *) &_cairo_font_options_nil; //+EAWebKitChange //11/10/2011 options = cairo_malloc (sizeof (cairo_font_options_t)); //-EAWebKitChange if (!options) { _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); return (cairo_font_options_t *) &_cairo_font_options_nil; } _cairo_font_options_init_copy (options, original); return options; }