jpayne@68: jpayne@68: jpayne@68:
jpayne@68: jpayne@68:jpayne@68: Top jpayne@68: | jpayne@68:![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68: ![]() |
jpayne@68:
jpayne@68: cairo_font_options_tjpayne@68:cairo_font_options_t — How a font should be rendered jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: cairo_font_options_t * jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_create () jpayne@68: | jpayne@68:
jpayne@68: cairo_font_options_t * jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_copy () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_destroy () jpayne@68: | jpayne@68:
jpayne@68: cairo_status_t jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_status () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_merge () jpayne@68: | jpayne@68:
unsigned long jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_hash () jpayne@68: | jpayne@68:
jpayne@68: cairo_bool_t jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_equal () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_set_antialias () jpayne@68: | jpayne@68:
jpayne@68: cairo_antialias_t jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_get_antialias () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_set_subpixel_order () jpayne@68: | jpayne@68:
jpayne@68: cairo_subpixel_order_t jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_get_subpixel_order () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_set_hint_style () jpayne@68: | jpayne@68:
jpayne@68: cairo_hint_style_t jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_get_hint_style () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_set_hint_metrics () jpayne@68: | jpayne@68:
jpayne@68: cairo_hint_metrics_t jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_get_hint_metrics () jpayne@68: | jpayne@68:
const char * jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_get_variations () jpayne@68: | jpayne@68:
jpayne@68: void jpayne@68: | jpayne@68:jpayne@68: cairo_font_options_set_variations () jpayne@68: | jpayne@68:
typedef | jpayne@68:cairo_font_options_t | jpayne@68:
enum | jpayne@68:cairo_subpixel_order_t | jpayne@68:
enum | jpayne@68:cairo_hint_style_t | jpayne@68:
enum | jpayne@68:cairo_hint_metrics_t | jpayne@68:
The font options specify how fonts should be rendered. Most of the jpayne@68: time the font options implied by a surface are just right and do not jpayne@68: need any changes, but for pixel-based targets tweaking font options jpayne@68: may result in superior output on a particular display.
jpayne@68:cairo_font_options_t *
jpayne@68: cairo_font_options_create (void
);
jpayne@68: Allocates a new font options object with all options initialized jpayne@68: to default values.
jpayne@68: a newly allocated cairo_font_options_t. Free with
jpayne@68: cairo_font_options_destroy()
. This function always returns a
jpayne@68: valid pointer; if memory cannot be allocated, then a special
jpayne@68: error object is returned where all operations on the object do nothing.
jpayne@68: You can check for this with cairo_font_options_status()
.
Since: 1.0
jpayne@68:cairo_font_options_t *
jpayne@68: cairo_font_options_copy (const cairo_font_options_t *original
);
jpayne@68: Allocates a new font options object copying the option values from
jpayne@68: original
jpayne@68: .
original |
jpayne@68: jpayne@68: | jpayne@68: |
a newly allocated cairo_font_options_t. Free with
jpayne@68: cairo_font_options_destroy()
. This function always returns a
jpayne@68: valid pointer; if memory cannot be allocated, then a special
jpayne@68: error object is returned where all operations on the object do nothing.
jpayne@68: You can check for this with cairo_font_options_status()
.
Since: 1.0
jpayne@68:void
jpayne@68: cairo_font_options_destroy (cairo_font_options_t *options
);
jpayne@68: Destroys a cairo_font_options_t object created with
jpayne@68: cairo_font_options_create()
or cairo_font_options_copy()
.
options |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.0
jpayne@68:cairo_status_t
jpayne@68: cairo_font_options_status (cairo_font_options_t *options
);
jpayne@68: Checks whether an error has previously occurred for this jpayne@68: font options object
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.0
jpayne@68:void jpayne@68: cairo_font_options_merge (jpayne@68:cairo_font_options_t *options
, jpayne@68:const cairo_font_options_t *other
);
Merges non-default options from other
jpayne@68: into options
jpayne@68: , replacing
jpayne@68: existing values. This operation can be thought of as somewhat
jpayne@68: similar to compositing other
jpayne@68: onto options
jpayne@68: with the operation
jpayne@68: of CAIRO_OPERATOR_OVER
.
options |
jpayne@68: jpayne@68: | jpayne@68: |
other |
jpayne@68: another cairo_font_options_t |
jpayne@68: jpayne@68: |
Since: 1.0
jpayne@68:unsigned long
jpayne@68: cairo_font_options_hash (const cairo_font_options_t *options
);
jpayne@68: Compute a hash for the font options object; this value will jpayne@68: be useful when storing an object containing a cairo_font_options_t jpayne@68: in a hash table.
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
the hash value for the font options object. jpayne@68: The return value can be cast to a 32-bit type if a jpayne@68: 32-bit hash value is needed.
jpayne@68:Since: 1.0
jpayne@68:cairo_bool_t jpayne@68: cairo_font_options_equal (jpayne@68:const cairo_font_options_t *options
, jpayne@68:const cairo_font_options_t *other
);
Compares two font options objects for equality.
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
other |
jpayne@68: another cairo_font_options_t |
jpayne@68: jpayne@68: |
TRUE
if all fields of the two font options objects match.
jpayne@68: Note that this function will return FALSE
if either object is in
jpayne@68: error.
Since: 1.0
jpayne@68:void jpayne@68: cairo_font_options_set_antialias (jpayne@68:cairo_font_options_t *options
, jpayne@68:cairo_antialias_t antialias
);
Sets the antialiasing mode for the font options object. This jpayne@68: specifies the type of antialiasing to do when rendering text.
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
antialias |
jpayne@68: the new antialiasing mode |
jpayne@68: jpayne@68: |
Since: 1.0
jpayne@68:cairo_antialias_t
jpayne@68: cairo_font_options_get_antialias (const cairo_font_options_t *options
);
jpayne@68: Gets the antialiasing mode for the font options object.
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.0
jpayne@68:void jpayne@68: cairo_font_options_set_subpixel_order (jpayne@68:cairo_font_options_t *options
, jpayne@68:cairo_subpixel_order_t subpixel_order
);
Sets the subpixel order for the font options object. The subpixel
jpayne@68: order specifies the order of color elements within each pixel on
jpayne@68: the display device when rendering with an antialiasing mode of
jpayne@68: CAIRO_ANTIALIAS_SUBPIXEL
. See the documentation for
jpayne@68: cairo_subpixel_order_t for full details.
options |
jpayne@68: jpayne@68: | jpayne@68: |
subpixel_order |
jpayne@68: the new subpixel order |
jpayne@68: jpayne@68: |
Since: 1.0
jpayne@68:cairo_subpixel_order_t
jpayne@68: cairo_font_options_get_subpixel_order (const cairo_font_options_t *options
);
jpayne@68: Gets the subpixel order for the font options object. jpayne@68: See the documentation for cairo_subpixel_order_t for full details.
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.0
jpayne@68:void jpayne@68: cairo_font_options_set_hint_style (jpayne@68:cairo_font_options_t *options
, jpayne@68:cairo_hint_style_t hint_style
);
Sets the hint style for font outlines for the font options object. jpayne@68: This controls whether to fit font outlines to the pixel grid, jpayne@68: and if so, whether to optimize for fidelity or contrast. jpayne@68: See the documentation for cairo_hint_style_t for full details.
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
hint_style |
jpayne@68: the new hint style |
jpayne@68: jpayne@68: |
Since: 1.0
jpayne@68:cairo_hint_style_t
jpayne@68: cairo_font_options_get_hint_style (const cairo_font_options_t *options
);
jpayne@68: Gets the hint style for font outlines for the font options object. jpayne@68: See the documentation for cairo_hint_style_t for full details.
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.0
jpayne@68:void jpayne@68: cairo_font_options_set_hint_metrics (jpayne@68:cairo_font_options_t *options
, jpayne@68:cairo_hint_metrics_t hint_metrics
);
Sets the metrics hinting mode for the font options object. This jpayne@68: controls whether metrics are quantized to integer values in jpayne@68: device units. jpayne@68: See the documentation for cairo_hint_metrics_t for full details.
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
hint_metrics |
jpayne@68: the new metrics hinting mode |
jpayne@68: jpayne@68: |
Since: 1.0
jpayne@68:cairo_hint_metrics_t
jpayne@68: cairo_font_options_get_hint_metrics (const cairo_font_options_t *options
);
jpayne@68: Gets the metrics hinting mode for the font options object. jpayne@68: See the documentation for cairo_hint_metrics_t for full details.
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
Since: 1.0
jpayne@68:const char *
jpayne@68: cairo_font_options_get_variations (cairo_font_options_t *options
);
jpayne@68: Gets the OpenType font variations for the font options object.
jpayne@68: See cairo_font_options_set_variations()
for details about the
jpayne@68: string format.
options |
jpayne@68: jpayne@68: | jpayne@68: |
the font variations for the font options object. The
jpayne@68: returned string belongs to the options
jpayne@68: and must not be modified.
jpayne@68: It is valid until either the font options object is destroyed or
jpayne@68: the font variations in this object is modified with
jpayne@68: cairo_font_options_set_variations()
.
Since: 1.16
jpayne@68:void jpayne@68: cairo_font_options_set_variations (jpayne@68:cairo_font_options_t *options
, jpayne@68:const char *variations
);
Sets the OpenType font variations for the font options object. jpayne@68: Font variations are specified as a string with a format that jpayne@68: is similar to the CSS font-variation-settings. The string contains jpayne@68: a comma-separated list of axis assignments, which each assignment jpayne@68: consists of a 4-character axis name and a value, separated by jpayne@68: whitespace and optional equals sign.
jpayne@68:Examples:
jpayne@68:wght=200,wdth=140.5
jpayne@68:wght 200 , wdth 140.5
jpayne@68:options |
jpayne@68: jpayne@68: | jpayne@68: |
variations |
jpayne@68: the new font variations, or |
jpayne@68: jpayne@68: |
Since: 1.16
jpayne@68:typedef struct _cairo_font_options cairo_font_options_t; jpayne@68:jpayne@68:
An opaque structure holding all options that are used when jpayne@68: rendering fonts.
jpayne@68:Individual features of a cairo_font_options_t can be set or
jpayne@68: accessed using functions named
jpayne@68: cairo_font_options_set_feature_name()
and
jpayne@68: cairo_font_options_get_feature_name()
, like
jpayne@68: cairo_font_options_set_antialias()
and
jpayne@68: cairo_font_options_get_antialias()
.
New features may be added to a cairo_font_options_t in the
jpayne@68: future. For this reason, cairo_font_options_copy()
,
jpayne@68: cairo_font_options_equal()
, cairo_font_options_merge()
, and
jpayne@68: cairo_font_options_hash()
should be used to copy, check
jpayne@68: for equality, merge, or compute a hash value of
jpayne@68: cairo_font_options_t objects.
Since: 1.0
jpayne@68:The subpixel order specifies the order of color elements within
jpayne@68: each pixel on the display device when rendering with an
jpayne@68: antialiasing mode of CAIRO_ANTIALIAS_SUBPIXEL
.
jpayne@68: |
jpayne@68: Use the default subpixel order for jpayne@68: for the target device, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Subpixel elements are arranged horizontally jpayne@68: with red at the left, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Subpixel elements are arranged horizontally jpayne@68: with blue at the left, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Subpixel elements are arranged vertically jpayne@68: with red at the top, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Subpixel elements are arranged vertically jpayne@68: with blue at the top, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
Since: 1.0
jpayne@68:Specifies the type of hinting to do on font outlines. Hinting jpayne@68: is the process of fitting outlines to the pixel grid in order jpayne@68: to improve the appearance of the result. Since hinting outlines jpayne@68: involves distorting them, it also reduces the faithfulness jpayne@68: to the original outline shapes. Not all of the outline hinting jpayne@68: styles are supported by all font backends.
jpayne@68:New entries may be added in future versions.
jpayne@68:jpayne@68: |
jpayne@68: Use the default hint style for jpayne@68: font backend and target device, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Do not hint outlines, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Hint outlines slightly to improve jpayne@68: contrast while retaining good fidelity to the original jpayne@68: shapes, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Hint outlines with medium strength jpayne@68: giving a compromise between fidelity to the original shapes jpayne@68: and contrast, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Hint outlines to maximize contrast, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
Since: 1.0
jpayne@68:Specifies whether to hint font metrics; hinting font metrics jpayne@68: means quantizing them so that they are integer values in jpayne@68: device space. Doing this improves the consistency of jpayne@68: letter and line spacing, however it also means that text jpayne@68: will be laid out differently at different zoom factors.
jpayne@68:jpayne@68: |
jpayne@68: Hint metrics in the default jpayne@68: manner for the font backend and target device, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Do not hint font metrics, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
jpayne@68: |
jpayne@68: Hint font metrics, since 1.0 jpayne@68: |
jpayne@68: jpayne@68: |
Since: 1.0
jpayne@68: