cairo.font_options
Module for [FontOptions] class
class FontOptions
Types 1
classFontOptions : gobject.boxed.Boxed
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.
Methods
FontOptions self()Returns `this`, for use in `with` statements.cairo.font_options.FontOptions copy()Allocates a new font options object copying the option values from original. Returns: a newly allocated #cairofontoptionst. Free with [cairo.fontoptions.FontOptions.destroy]. This function always r...cairo.types.Bool equal(cairo.font_options.FontOptions other)Compares two font options objects for equality.cairo.types.Antialias getAntialias()Gets the antialiasing mode for the font options object. Returns: the antialiasing modecairo.types.ColorMode getColorMode()Gets the color mode for the font options object. See the documentation for #cairocolormode_t for full details. Returns: the color mode for the font options objectuint getColorPalette()Gets 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)Gets the custom palette color for the color index for the font options object.cairo.types.HintMetrics getHintMetrics()Gets the metrics hinting mode for the font options object. See the documentation for #cairohintmetrics_t for full details. Returns: the metrics hinting mode for the font options objectcairo.types.HintStyle getHintStyle()Gets the hint style for font outlines for the font options object. See the documentation for #cairohintstyle_t for full details. Returns: the hint style for the font options objectcairo.types.SubpixelOrder getSubpixelOrder()Gets the subpixel order for the font options object. See the documentation for #cairosubpixelorder_t for full details. Returns: the subpixel order for the font options objectstring getVariations()Gets the OpenType font variations for the font options object. See [cairo.fontoptions.FontOptions.setVariations] for details about the string format. Returns: the font variations for the font optio...gulong hash()Compute a hash for the font options object; this value will be useful when storing an object containing a #cairofontoptions_t in a hash table. Returns: the hash value for the font options object. T...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.ty...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.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 #cairocolormode_t for full details.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.types.COLORPALETTED...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...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 #cairohintmetrics_t for full deta...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 doc...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 [ca...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 comm...cairo.types.Status status()Checks 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].