Synopsis

#include <adg-1/adg.h>

struct              AdgFontStyle;
struct              AdgFontStyleClass;
AdgFontStyle *      adg_font_style_new                  (void);
cairo_font_options_t * adg_font_style_new_options       (AdgFontStyle *font_style);
cairo_scaled_font_t * adg_font_style_get_scaled_font    (AdgFontStyle *font_style,
                                                         const cairo_matrix_t *ctm);
void                adg_font_style_set_color_dress      (AdgFontStyle *font_style,
                                                         AdgDress dress);
AdgDress            adg_font_style_get_color_dress      (AdgFontStyle *font_style);
void                adg_font_style_set_family           (AdgFontStyle *font_style,
                                                         const gchar *family);
const gchar *       adg_font_style_get_family           (AdgFontStyle *font_style);
void                adg_font_style_set_slant            (AdgFontStyle *font_style,
                                                         cairo_font_slant_t slant);
cairo_font_slant_t  adg_font_style_get_slant            (AdgFontStyle *font_style);
void                adg_font_style_set_weight           (AdgFontStyle *font_style,
                                                         cairo_font_weight_t weight);
cairo_font_weight_t adg_font_style_get_weight           (AdgFontStyle *font_style);
void                adg_font_style_set_size             (AdgFontStyle *font_style,
                                                         gdouble size);
gdouble             adg_font_style_get_size             (AdgFontStyle *font_style);
void                adg_font_style_set_antialias        (AdgFontStyle *font_style,
                                                         cairo_antialias_t antialias);
cairo_antialias_t   adg_font_style_get_antialias        (AdgFontStyle *font_style);
void                adg_font_style_set_subpixel_order   (AdgFontStyle *font_style,
                                                         cairo_subpixel_order_t subpixel_order);
cairo_subpixel_order_t adg_font_style_get_subpixel_order
                                                        (AdgFontStyle *font_style);
void                adg_font_style_set_hint_style       (AdgFontStyle *font_style,
                                                         cairo_hint_style_t hint_style);
cairo_hint_style_t  adg_font_style_get_hint_style       (AdgFontStyle *font_style);
void                adg_font_style_set_hint_metrics     (AdgFontStyle *font_style,
                                                         cairo_hint_metrics_t hint_metrics);
cairo_hint_metrics_t adg_font_style_get_hint_metrics    (AdgFontStyle *font_style);

Object Hierarchy

  GObject
   +----AdgStyle
         +----AdgFontStyle
               +----AdgPangoStyle

Properties

  "antialias"                gint                  : Read / Write
  "color-dress"              AdgDress              : Read / Write
  "family"                   gchar*                : Read / Write
  "hint-metrics"             gint                  : Read / Write
  "hint-style"               gint                  : Read / Write
  "size"                     gdouble               : Read / Write
  "slant"                    gint                  : Read / Write
  "subpixel-order"           gint                  : Read / Write
  "weight"                   gint                  : Read / Write

Description

Contains parameters on how to draw texts such as font family, slanting, weight, hinting and so on.

Details

struct AdgFontStyle

struct AdgFontStyle;

All fields are private and should not be used directly. Use its public methods instead.

Since 1.0


struct AdgFontStyleClass

struct AdgFontStyleClass {
};

adg_font_style_new ()

AdgFontStyle *      adg_font_style_new                  (void);

Constructs a new font style initialized with default params.

Returns :

a newly created font style. [transfer full]

Since 1.0


adg_font_style_new_options ()

cairo_font_options_t * adg_font_style_new_options       (AdgFontStyle *font_style);

Creates a new set of cairo_font_options_t filled with the values picked from font_style. The returned value must be freed with cairo_font_options_destroy().

font_style :

an AdgFontStyle object

Returns :

a newly allocated list of cairo font options. [transfer full]

Since 1.0


adg_font_style_get_scaled_font ()

cairo_scaled_font_t * adg_font_style_get_scaled_font    (AdgFontStyle *font_style,
                                                         const cairo_matrix_t *ctm);

Gets the scaled font of font_style. The returned font is owned by font_style and must not be destroyed by the caller.

font_style :

an AdgFontStyle object

ctm :

the current transformation matrix

Returns :

the scaled font. [transfer none]

Since 1.0


adg_font_style_set_color_dress ()

void                adg_font_style_set_color_dress      (AdgFontStyle *font_style,
                                                         AdgDress dress);

Sets a new color dress on font_style. The new dress should be related to the original dress: you cannot set a dress used for font styles to a dress managing fonts.

The validation of the new dress is done by calling adg_dress_are_related() with dress and the previous dress as arguments: check out its documentation for details on what is a related dress.

font_style :

an AdgFontStyle

dress :

the new color dress to use. [transfer none]

Since 1.0


adg_font_style_get_color_dress ()

AdgDress            adg_font_style_get_color_dress      (AdgFontStyle *font_style);

Gets the color dress used by font_style.

font_style :

an AdgFontStyle

Returns :

the current color dress. [transfer none]

Since 1.0


adg_font_style_set_family ()

void                adg_font_style_set_family           (AdgFontStyle *font_style,
                                                         const gchar *family);

Sets a new family.

font_style :

an AdgFontStyle object

family :

the new family. [transfer none]

Since 1.0


adg_font_style_get_family ()

const gchar *       adg_font_style_get_family           (AdgFontStyle *font_style);

Gets the family of font_style. The returned pointer refers to internally managed text that must not be modified or freed.

font_style :

an AdgFontStyle object

Returns :

the requested family. [transfer none]

Since 1.0


adg_font_style_set_slant ()

void                adg_font_style_set_slant            (AdgFontStyle *font_style,
                                                         cairo_font_slant_t slant);

Sets a new slant variant on font_style.

font_style :

an AdgFontStyle object

slant :

the new slant. [type gint]

Since 1.0


adg_font_style_get_slant ()

cairo_font_slant_t  adg_font_style_get_slant            (AdgFontStyle *font_style);

Gets the slant variant of font_style.

font_style :

an AdgFontStyle object

Returns :

the slant variant. [type gint][transfer none]

Since 1.0


adg_font_style_set_weight ()

void                adg_font_style_set_weight           (AdgFontStyle *font_style,
                                                         cairo_font_weight_t weight);

Sets a new weight variant on font_style.

font_style :

an AdgFontStyle object

weight :

the new weight. [type gint]

Since 1.0


adg_font_style_get_weight ()

cairo_font_weight_t adg_font_style_get_weight           (AdgFontStyle *font_style);

Gets the weight variant of font_style.

font_style :

an AdgFontStyle object

Returns :

the weight variant. [type gint][transfer none]

Since 1.0


adg_font_style_set_size ()

void                adg_font_style_set_size             (AdgFontStyle *font_style,
                                                         gdouble size);

Sets a new size (in global space) on font_style.

font_style :

an AdgFontStyle object

size :

the new size

Since 1.0


adg_font_style_get_size ()

gdouble             adg_font_style_get_size             (AdgFontStyle *font_style);

Gets the size (in global space) of font_style.

font_style :

an AdgFontStyle object

Returns :

the size variant.

Since 1.0


adg_font_style_set_antialias ()

void                adg_font_style_set_antialias        (AdgFontStyle *font_style,
                                                         cairo_antialias_t antialias);

Sets a new antialias mode.

font_style :

an AdgFontStyle object

antialias :

the new antialias mode. [type gint]

Since 1.0


adg_font_style_get_antialias ()

cairo_antialias_t   adg_font_style_get_antialias        (AdgFontStyle *font_style);

Gets the antialias mode used.

font_style :

an AdgFontStyle object

Returns :

the requested antialias mode. [type gint][transfer none]

Since 1.0


adg_font_style_set_subpixel_order ()

void                adg_font_style_set_subpixel_order   (AdgFontStyle *font_style,
                                                         cairo_subpixel_order_t subpixel_order);

Sets a new subpixel order mode.

font_style :

an AdgFontStyle object

subpixel_order :

the new subpixel order mode. [type gint]

Since 1.0


adg_font_style_get_subpixel_order ()

cairo_subpixel_order_t adg_font_style_get_subpixel_order
                                                        (AdgFontStyle *font_style);

Gets the subpixel order mode used, that is the order of color elements within each pixel on the display device when rendering with an antialiasing mode of CAIRO_ANTIALIAS_SUBPIXEL.

font_style :

an AdgFontStyle object

Returns :

the requested subpixel order mode. [type gint][transfer none]

Since 1.0


adg_font_style_set_hint_style ()

void                adg_font_style_set_hint_style       (AdgFontStyle *font_style,
                                                         cairo_hint_style_t hint_style);

Sets a new hint style mode.

font_style :

an AdgFontStyle object

hint_style :

the new hint style mode. [type gint]

Since 1.0


adg_font_style_get_hint_style ()

cairo_hint_style_t  adg_font_style_get_hint_style       (AdgFontStyle *font_style);

Gets the hint style mode used, that is how to fit outlines to the pixel grid in order to improve the appearance of the result.

font_style :

an AdgFontStyle object

Returns :

the requested hint style mode. [type gint][transfer none]

Since 1.0


adg_font_style_set_hint_metrics ()

void                adg_font_style_set_hint_metrics     (AdgFontStyle *font_style,
                                                         cairo_hint_metrics_t hint_metrics);

Sets a new hint metrics state.

font_style :

an AdgFontStyle object

hint_metrics :

the new hint metrics state. [type gint]

Since 1.0


adg_font_style_get_hint_metrics ()

cairo_hint_metrics_t adg_font_style_get_hint_metrics    (AdgFontStyle *font_style);

Gets the state on whether to hint font metrics.

font_style :

an AdgFontStyle object

Returns :

the requested hint metrics state. [type gint][transfer none]

Since 1.0

Property Details

The "antialias" property

  "antialias"                gint                  : Read / Write

Type of antialiasing to do when rendering text.

Default value: 0


The "color-dress" property

  "color-dress"              AdgDress              : Read / Write

The fallback color dress to bind to this style.


The "family" property

  "family"                   gchar*                : Read / Write

The font family name, encoded in UTF-8.

Default value: NULL


The "hint-metrics" property

  "hint-metrics"             gint                  : Read / Write

Whether to hint font metrics, that is align them to integer values in device space.

Default value: 0


The "hint-style" property

  "hint-style"               gint                  : Read / Write

How outlines must fit to the pixel grid in order to improve the glyph appearance.

Default value: 0


The "size" property

  "size"                     gdouble               : Read / Write

Font size in user space units.

Allowed values: >= 0

Default value: 10


The "slant" property

  "slant"                    gint                  : Read / Write

Variant of a font face based on its slant.

Default value: 0


The "subpixel-order" property

  "subpixel-order"           gint                  : Read / Write

The order of color elements within each pixel on the display device when rendering with subpixel antialiasing mode.

Default value: 0


The "weight" property

  "weight"                   gint                  : Read / Write

Variant of a font face based on its weight.

Default value: 0