Struct FontOptions

FontOptions - How a font should be rendered

The font options specify how fonts should be rendered. Most of the time the font options implied by a surface are just right and do not need any changes, but for pixel-based targets tweaking font options may result in superior output on a particular display.

Constructors

Name Description
this Create FontOptions from a existing cairo_font_options_t*. FontOptions is a reference counted struct. It will call cairo_font_options_destroy when it's reference count is 0. See https://github.com/jpf91/cairoD/wiki/Memory-Management#2.2-structs for more information.

Fields

Name Type Description
_data std.typecons.__T10RefCountedTS5cairo5cairo11FontOptions7PayloadVE3std8typecons24RefCountedAutoInitializei0Z.RefCounted

Properties

Name Type Description
antiAlias [get, set] cairo_antialias_t Convenience property
debugging [get, set] bool Enable / disable memory management debugging for this FontOptions instance. Only available if both cairoD and the cairoD user code were compiled with "debug=RefCounted"
hintMetrics [get, set] cairo_hint_metrics_t Convenience property
hintStyle [get, set] cairo_hint_style_t Convenience property
nativePointer [get] cairo_font_options_t* The underlying cairo_font_options_t* handle

Methods

Name Description
copy Allocates a new font options object copying the option values from original.
create Allocates a new font options object with all options initialized to default values.
getAntiAlias Gets the antialiasing mode for the font options object.
getHintMetrics Gets the metrics hinting mode for the font options object. See the documentation for HintMetrics for full details.
getHintStyle Gets the hint style for font outlines for the font options object. See the documentation for HintStyle for full details.
getSubpixelOrder Gets the subpixel order for the font options object. See the documentation for SubpixelOrder for full details.
merge Merges non-default options from other into this object, replacing existing values. This operation can be thought of as somewhat similar to compositing other onto options with the operation of CAIRO_OPERATION_OVER.
opAssign
opEquals Compares two font options objects for equality.
setAntiAlias Sets the antialiasing mode for the font options object. This specifies the type of antialiasing to do when rendering text.
setHintMetrics 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 HintMetrics for full details.
setHintStyle 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 HintStyle for full details.
setSubpixelOrder 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_ANTIALIAS_SUBPIXEL. See the documentation for SubpixelOrder for full details.
toHash Compute a hash for the font options object; this value will be useful when storing an object containing a FontOptions in a hash table.
checkError

Inner structs

Name Description
Payload

Aliases

Name Description
subpixelOrder convenience alias
Data

Warning

Instances must be created with the create static member function!

auto options = FontOptions.create(); //Correct
options.toHash();
FontOptions options; //Wrong
options.toHash();
FontOptions options;
options = FontOptions.create(); //Correct
options.toHash();

Authors

Johannes Pfau cairoD
Andrej Mitrovic cairoD
cairo team cairo

Copyright

License

cairoD wrapper/bindings Boost License 1.0
cairo LGPL 2.1 / MPL 1.1