FontOptions

An opaque structure holding all options that are used when rendering fonts.

Individual features of a #cairo_font_options_t can be set or accessed using functions named <function>cairo_font_options_set_<emphasis>feature_name</emphasis>()</function> and <function>cairo_font_options_get_<emphasis>feature_name</emphasis>()</function>, like cairo.font_options.FontOptions.setAntialias and cairo.font_options.FontOptions.getAntialias.

New features may be added to a #cairo_font_options_t in the future. For this reason, cairo.font_options.FontOptions.copy, cairo.font_options.FontOptions.equal, cairo.font_options.FontOptions.merge, and cairo.font_options.FontOptions.hash should be used to copy, check for equality, merge, or compute a hash value of #cairo_font_options_t objects.

Members

Functions

copy
cairo.font_options.FontOptions copy()

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

equal
cairo.types.Bool equal(cairo.font_options.FontOptions other)

Compares two font options objects for equality.

getAntialias
cairo.types.Antialias getAntialias()

Gets the antialiasing mode for the font options object.

getColorMode
cairo.types.ColorMode getColorMode()

Gets the color mode for the font options object. See the documentation for #cairo_color_mode_t for full details.

getColorPalette
uint getColorPalette()

Gets the current OpenType color font palette for the font options object.

getCustomPaletteColor
cairo.types.Status getCustomPaletteColor(uint index, double red, double green, double blue, double alpha)

Gets the custom palette color for the color index for the font options object.

getHintMetrics
cairo.types.HintMetrics getHintMetrics()

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

getHintStyle
cairo.types.HintStyle getHintStyle()

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

getSubpixelOrder
cairo.types.SubpixelOrder getSubpixelOrder()

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

getVariations
string getVariations()

Gets the OpenType font variations for the font options object. See cairo.font_options.FontOptions.setVariations for details about the string format.

hash
gulong hash()

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.

merge
void merge(cairo.font_options.FontOptions other)

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

setAntialias
void setAntialias(cairo.types.Antialias antialias)

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

setColorMode
void setColorMode(cairo.types.ColorMode colorMode)

Sets the color mode for the font options object. This controls whether color fonts are to be rendered in color or as outlines. See the documentation for #cairo_color_mode_t for full details.

setColorPalette
void setColorPalette(uint paletteIndex)

Sets the OpenType font color palette for the font options object. OpenType color fonts with a CPAL table may contain multiple palettes. The default color palette index is CAIRO_COLOR_PALETTE_DEFAULT.

setCustomPaletteColor
void setCustomPaletteColor(uint index, double red, double green, double blue, double alpha)

Sets a custom palette color for the font options object. This overrides the palette color at the specified color index. This override is independent of the selected palette index and will remain in place even if cairo.font_options.FontOptions.setColorPalette is called to change the palette index.

setHintMetrics
void setHintMetrics(cairo.types.HintMetrics hintMetrics)

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.

setHintStyle
void setHintStyle(cairo.types.HintStyle hintStyle)

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.

setSubpixelOrder
void setSubpixelOrder(cairo.types.SubpixelOrder subpixelOrder)

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.types.Antialias.Subpixel. See the documentation for #cairo_subpixel_order_t for full details.

setVariations
void setVariations(string variations)

Sets the OpenType font variations for the font options object. Font variations are specified as a string with a format that is similar to the CSS font-variation-settings. The string contains a comma-separated list of axis assignments, which each assignment consists of a 4-character axis name and a value, separated by whitespace and optional equals sign.

status
cairo.types.Status status()

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

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.