Font Options

Font Options — How a font should be rendered

Synopsis




typedef     cairo_font_options_t;
enum        cairo_subpixel_order_t;
enum        cairo_hint_style_t;
enum        cairo_hint_metrics_t;

Description

Details

cairo_font_options_t

typedef struct _cairo_font_options cairo_font_options_t;


enum cairo_subpixel_order_t

typedef enum _cairo_subpixel_order {
    CAIRO_SUBPIXEL_ORDER_DEFAULT,
    CAIRO_SUBPIXEL_ORDER_RGB,
    CAIRO_SUBPIXEL_ORDER_BGR,
    CAIRO_SUBPIXEL_ORDER_VRGB,
    CAIRO_SUBPIXEL_ORDER_VBGR
} cairo_subpixel_order_t;

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.

CAIRO_SUBPIXEL_ORDER_DEFAULT Use the default subpixel order for for the target device
CAIRO_SUBPIXEL_ORDER_RGB Subpixel elements are arranged horizontally with red at the left
CAIRO_SUBPIXEL_ORDER_BGR Subpixel elements are arranged horizontally with blue at the left
CAIRO_SUBPIXEL_ORDER_VRGB Subpixel elements are arranged vertically with red at the top
CAIRO_SUBPIXEL_ORDER_VBGR Subpixel elements are arranged vertically with blue at the top

enum cairo_hint_style_t

typedef enum _cairo_hint_style {
    CAIRO_HINT_STYLE_DEFAULT,
    CAIRO_HINT_STYLE_NONE,
    CAIRO_HINT_STYLE_SLIGHT,
    CAIRO_HINT_STYLE_MEDIUM,
    CAIRO_HINT_STYLE_FULL
} cairo_hint_style_t;

Specifies the type of hinting to do on font outlines. Hinting is the process of fitting outlines to the pixel grid in order to improve the appearance of the result. Since hinting outlines involves distorting them, it also reduces the faithfulness to the original outline shapes. Not all of the outline hinting styles are supported by all font backends.

CAIRO_HINT_STYLE_DEFAULT Use the default hint style for for font backend and target device
CAIRO_HINT_STYLE_NONE Do not hint outlines
CAIRO_HINT_STYLE_SLIGHT Hint outlines slightly to improve contrast while retaining good fidelity to the original shapes.
CAIRO_HINT_STYLE_MEDIUM Hint outlines with medium strength giving a compromise between fidelity to the original shapes and contrast
CAIRO_HINT_STYLE_FULL Hint outlines to maximize contrast

enum cairo_hint_metrics_t

typedef enum _cairo_hint_metrics {
    CAIRO_HINT_METRICS_DEFAULT,
    CAIRO_HINT_METRICS_OFF,
    CAIRO_HINT_METRICS_ON
} cairo_hint_metrics_t;

Specifies whether to hint font metrics; hinting font metrics means quantizing them so that they are integer values in device space. Doing this improves the consistency of letter and line spacing, however it also means that text will be laid out differently at different zoom factors.

CAIRO_HINT_METRICS_DEFAULT Hint metrics in the default manner for the font backend and target device
CAIRO_HINT_METRICS_OFF Do not hint font metrics
CAIRO_HINT_METRICS_ON Hint font metrics