cairo.font_options
Module for [FontOptions] class
Types 1
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.
cairo.font_options.FontOptions copy() nothrowAllocates a new font options object copying the option values from original. Returns: a newly allocated #cairo_font_options_t. Free with [cairo.font_options.FontOptions.destroy]. This function alwa...cairo.types.Bool equal(cairo.font_options.FontOptions other) nothrowCompares two font options objects for equality.cairo.types.Antialias getAntialias() nothrowGets the antialiasing mode for the font options object. Returns: the antialiasing modecairo.types.ColorMode getColorMode() nothrowGets the color mode for the font options object. See the documentation for #cairo_color_mode_t for full details. Returns: the color mode for the font options objectuint getColorPalette() nothrowGets the current OpenType color font palette for the font options object. Returns: the palette indexcairo.types.Status getCustomPaletteColor(uint index, out double red, out double green, out double blue, out double alpha) nothrowGets the custom palette color for the color index for the font options object.cairo.types.HintMetrics getHintMetrics() nothrowGets the metrics hinting mode for the font options object. See the documentation for #cairo_hint_metrics_t for full details. Returns: the metrics hinting mode for the font options objectcairo.types.HintStyle getHintStyle() nothrowGets the hint style for font outlines for the font options object. See the documentation for #cairo_hint_style_t for full details. Returns: the hint style for the font options objectcairo.types.SubpixelOrder getSubpixelOrder() nothrowGets the subpixel order for the font options object. See the documentation for #cairo_subpixel_order_t for full details. Returns: the subpixel order for the font options objectstring getVariations() nothrowGets the OpenType font variations for the font options object. See [cairo.font_options.FontOptions.setVariations] for details about the string format. Returns: the font variations for the font opti...gulong hash() nothrowCompute 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. Returns: the hash value for the font options object....void merge(cairo.font_options.FontOptions other) nothrowMerges 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.ty...void setAntialias(cairo.types.Antialias antialias) nothrowSets the antialiasing mode for the font options object. This specifies the type of antialiasing to do when rendering text.void setColorMode(cairo.types.ColorMode colorMode) nothrowSets 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.void setColorPalette(uint paletteIndex) nothrowSets 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.types.COLOR_PALETTE...void setCustomPaletteColor(uint index, double red, double green, double blue, double alpha) nothrowSets 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...void setHintMetrics(cairo.types.HintMetrics hintMetrics) nothrowSets 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 de...void setHintStyle(cairo.types.HintStyle hintStyle) nothrowSets 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 doc...void setSubpixelOrder(cairo.types.SubpixelOrder subpixelOrder) nothrowSets 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 [ca...void setVariations(string variations) nothrowSets 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 comm...cairo.types.Status status() nothrowChecks whether an error has previously occurred for this font options object Returns: [cairo.types.Status.Success], [cairo.types.Status.NoMemory], or [cairo.types.Status.NullPointer].