Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
cairo-font-options.c File Reference
#include "cairoint.h"

Go to the source code of this file.

Functions

void _cairo_font_options_init_default (cairo_font_options_t *options)
 _cairo_font_options_init_default: : a #cairo_font_options_t
cairo_font_options_t * cairo_font_options_create (void)
 cairo_font_options_create:
cairo_font_options_t * cairo_font_options_copy (const cairo_font_options_t *original)
 cairo_font_options_copy: : a #cairo_font_options_t
void cairo_font_options_destroy (cairo_font_options_t *options)
 cairo_font_options_destroy: : a #cairo_font_options_t
cairo_status_t cairo_font_options_status (cairo_font_options_t *options)
 cairo_font_options_status: : a #cairo_font_options_t
void cairo_font_options_merge (cairo_font_options_t *options, const cairo_font_options_t *other)
 cairo_font_options_merge: : a #cairo_font_options_t : another #cairo_font_options_t
cairo_bool_t cairo_font_options_equal (const cairo_font_options_t *options, const cairo_font_options_t *other)
 cairo_font_options_equal: : a #cairo_font_options_t : another #cairo_font_options_t
unsigned long cairo_font_options_hash (const cairo_font_options_t *options)
 cairo_font_options_hash: : a #cairo_font_options_t
void cairo_font_options_set_antialias (cairo_font_options_t *options, cairo_antialias_t antialias)
 cairo_font_options_set_antialias: : a #cairo_font_options_t : the new antialiasing mode
cairo_antialias_t cairo_font_options_get_antialias (const cairo_font_options_t *options)
 cairo_font_options_get_antialias: : a #cairo_font_options_t
void cairo_font_options_set_subpixel_order (cairo_font_options_t *options, cairo_subpixel_order_t subpixel_order)
 cairo_font_options_set_subpixel_order: : a #cairo_font_options_t : the new subpixel order
cairo_subpixel_order_t cairo_font_options_get_subpixel_order (const cairo_font_options_t *options)
 cairo_font_options_get_subpixel_order: : a #cairo_font_options_t
void cairo_font_options_set_hint_style (cairo_font_options_t *options, cairo_hint_style_t hint_style)
 cairo_font_options_set_hint_style: : a #cairo_font_options_t : the new hint style
cairo_hint_style_t cairo_font_options_get_hint_style (const cairo_font_options_t *options)
 cairo_font_options_get_hint_style: : a #cairo_font_options_t
void cairo_font_options_set_hint_metrics (cairo_font_options_t *options, cairo_hint_metrics_t hint_metrics)
 cairo_font_options_set_hint_metrics: : a #cairo_font_options_t : the new metrics hinting mode
cairo_hint_metrics_t cairo_font_options_get_hint_metrics (const cairo_font_options_t *options)
 cairo_font_options_get_hint_metrics: : a #cairo_font_options_t

Variables

static const cairo_font_options_t cairo_font_options_nil

Function Documentation

void _cairo_font_options_init_default ( cairo_font_options_t *  options)

_cairo_font_options_init_default: : a #cairo_font_options_t

Initializes all fileds of the font options object to default values.

Definition at line 53 of file cairo-font-options.c.

{
    if (options == (cairo_font_options_t *)&cairo_font_options_nil)
       return;
  
    options->antialias = CAIRO_ANTIALIAS_DEFAULT;
    options->subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT;
    options->hint_style = CAIRO_HINT_STYLE_DEFAULT;
    options->hint_metrics = CAIRO_HINT_METRICS_DEFAULT;
}

Here is the caller graph for this function:

cairo_font_options_t* cairo_font_options_copy ( const cairo_font_options_t *  original)

cairo_font_options_copy: : a #cairo_font_options_t

Allocates a new font options object copying the option values from .

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().

Definition at line 103 of file cairo-font-options.c.

{
    cairo_font_options_t *options = malloc (sizeof (cairo_font_options_t));

    if (!options)
       return (cairo_font_options_t *)&cairo_font_options_nil;

    *options = *original;

    return options;
}
cairo_font_options_t* cairo_font_options_create ( void  )

cairo_font_options_create:

Allocates a new font options object with all options initialized to default values.

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().

Definition at line 77 of file cairo-font-options.c.

{
    cairo_font_options_t *options = malloc (sizeof (cairo_font_options_t));

    if (!options)
       return (cairo_font_options_t *)&cairo_font_options_nil;

    _cairo_font_options_init_default (options);

    return options;
}

Here is the call graph for this function:

void cairo_font_options_destroy ( cairo_font_options_t *  options)

cairo_font_options_destroy: : a #cairo_font_options_t

Destroys a #cairo_font_options_t object created with with cairo_font_options_create() or cairo_font_options_copy().

Definition at line 123 of file cairo-font-options.c.

{
    if (options == (cairo_font_options_t *)&cairo_font_options_nil)
       return;

    free (options);
}
cairo_bool_t cairo_font_options_equal ( const cairo_font_options_t *  options,
const cairo_font_options_t *  other 
)

cairo_font_options_equal: : a #cairo_font_options_t : another #cairo_font_options_t

Compares two font options objects for equality.

Return value: TRUE if all fields of the two font options objects match

Definition at line 186 of file cairo-font-options.c.

{
    return (options->antialias == other->antialias &&
           options->subpixel_order == other->subpixel_order &&
           options->hint_style == other->hint_style &&
           options->hint_metrics == other->hint_metrics);
}
cairo_antialias_t cairo_font_options_get_antialias ( const cairo_font_options_t *  options)

cairo_font_options_get_antialias: : a #cairo_font_options_t

Gets the antialising mode for the font options object.

Return value: the antialiasing mode

Definition at line 243 of file cairo-font-options.c.

{
    return options->antialias;
}
cairo_hint_metrics_t cairo_font_options_get_hint_metrics ( const cairo_font_options_t *  options)

cairo_font_options_get_hint_metrics: : a #cairo_font_options_t

Gets the metrics hinting mode for the font options object. See the documentation for cairo_hint_metrics_t for full details.

Return value: the metrics hinting mode for the font options object

Definition at line 349 of file cairo-font-options.c.

{
    return options->hint_metrics;
}
cairo_hint_style_t cairo_font_options_get_hint_style ( const cairo_font_options_t *  options)

cairo_font_options_get_hint_style: : a #cairo_font_options_t

Gets the hint style for font outlines for the font options object. See the documentation for cairo_hint_style_t for full details.

Return value: the hint style for the font options object

Definition at line 314 of file cairo-font-options.c.

{
    return options->hint_style;
}

cairo_font_options_get_subpixel_order: : a #cairo_font_options_t

Gets the subpixel order for the font options object. See the documentation for cairo_subpixel_order_t for full details.

Return value: the subpixel order for the font options object

Definition at line 279 of file cairo-font-options.c.

{
    return options->subpixel_order;
}
unsigned long cairo_font_options_hash ( const cairo_font_options_t *  options)

cairo_font_options_hash: : a #cairo_font_options_t

Compute a hash for the font options object; this value will be useful when storing an object containing a cairo_font_options_t in a hash table.

Return value: the hash value for the font options object. The return value can be cast to a 32-bit type if a 32-bit hash value is needed.

Definition at line 208 of file cairo-font-options.c.

{
    return ((options->antialias) |
           (options->subpixel_order << 4) |
           (options->hint_style << 8) | 
           (options->hint_metrics << 16));
}
void cairo_font_options_merge ( cairo_font_options_t *  options,
const cairo_font_options_t *  other 
)

cairo_font_options_merge: : a #cairo_font_options_t : another #cairo_font_options_t

Merges non-default options from into , replacing existing values. This operation can be thought of as somewhat similar to compositing onto with the operation of CAIRO_OPERATION_OVER.

Definition at line 160 of file cairo-font-options.c.

{
    if (options == (cairo_font_options_t *)&cairo_font_options_nil)
       return;

    if (other->antialias != CAIRO_ANTIALIAS_DEFAULT)
       options->antialias = other->antialias;
    if (other->subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT)
       options->subpixel_order = other->subpixel_order;
    if (other->hint_style != CAIRO_HINT_STYLE_DEFAULT)
       options->hint_style = other->hint_style;
    if (other->hint_metrics != CAIRO_HINT_METRICS_DEFAULT)
       options->hint_metrics = other->hint_metrics;
}
void cairo_font_options_set_antialias ( cairo_font_options_t *  options,
cairo_antialias_t  antialias 
)

cairo_font_options_set_antialias: : a #cairo_font_options_t : the new antialiasing mode

Sets the antiliasing mode for the font options object. This specifies the type of antialiasing to do when rendering text.

Definition at line 225 of file cairo-font-options.c.

{
    if (options == (cairo_font_options_t *)&cairo_font_options_nil)
       return;
    
    options->antialias = antialias;
}
void cairo_font_options_set_hint_metrics ( cairo_font_options_t *  options,
cairo_hint_metrics_t  hint_metrics 
)

cairo_font_options_set_hint_metrics: : a #cairo_font_options_t : the new metrics hinting mode

Sets the metrics hinting mode for the font options object. This controls whether metrics are quantized to integer values in device units. See the documentation for cairo_hint_metrics_t for full details.

Definition at line 330 of file cairo-font-options.c.

{
    if (options == (cairo_font_options_t *)&cairo_font_options_nil)
       return;

    options->hint_metrics = hint_metrics;
}
void cairo_font_options_set_hint_style ( cairo_font_options_t *  options,
cairo_hint_style_t  hint_style 
)

cairo_font_options_set_hint_style: : a #cairo_font_options_t : the new hint style

Sets the hint style for font outlines for the font options object. This controls whether to fit font outlines to the pixel grid, and if so, whether to optimize for fidelity or contrast. See the documentation for cairo_hint_style_t for full details.

Definition at line 295 of file cairo-font-options.c.

{
    if (options == (cairo_font_options_t *)&cairo_font_options_nil)
       return;
    
    options->hint_style = hint_style;
}
void cairo_font_options_set_subpixel_order ( cairo_font_options_t *  options,
cairo_subpixel_order_t  subpixel_order 
)

cairo_font_options_set_subpixel_order: : a #cairo_font_options_t : the new subpixel order

Sets the subpixel order for the font options object. The subpixel order specifies the order of color elements within each pixel on the display device when rendering with an antialiasing mode of CAIRO_ANTIALIAS_SUBPIXEL. See the documentation for

cairo_subpixel_order_t for full details.

Definition at line 260 of file cairo-font-options.c.

{
    if (options == (cairo_font_options_t *)&cairo_font_options_nil)
       return;
    
    options->subpixel_order = subpixel_order;
}
cairo_status_t cairo_font_options_status ( cairo_font_options_t *  options)

cairo_font_options_status: : a #cairo_font_options_t

Checks whether an error has previously occurred for this font options object

Return value: CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY

Definition at line 141 of file cairo-font-options.c.

{
    if (options == (cairo_font_options_t *)&cairo_font_options_nil)
       return CAIRO_STATUS_NO_MEMORY;
    else
       return CAIRO_STATUS_SUCCESS;
}      

Variable Documentation

const cairo_font_options_t cairo_font_options_nil [static]