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.
Fields
Name |
Type |
Description |
_data
|
std.typecons.__T10RefCountedTS5cairo5cairo11FontOptions7PayloadVE3std8typecons24RefCountedAutoInitializei0Z.RefCounted |
|
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
|
|
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 |