The OpenD Programming Language

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.

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();

Constructors

this
this(cairo_font_options_t* ptr)

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.

Members

Aliases

subpixelOrder
alias subpixelOrder = getSubpixelOrder

convenience alias

Functions

copy
FontOptions copy()

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

getAntiAlias
AntiAlias getAntiAlias()

Gets the antialiasing mode for the font options object.

getHintMetrics
HintMetrics getHintMetrics()

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

getHintStyle
HintStyle getHintStyle()

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

getSubpixelOrder
SubpixelOrder getSubpixelOrder()

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

merge
void merge(FontOptions other)

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.

opEquals
bool opEquals(const(FontOptions) other)

Compares two font options objects for equality.

setAntiAlias
void setAntiAlias(AntiAlias antialias)

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

setHintMetrics
void setHintMetrics(HintMetrics metrics)

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
void setHintStyle(HintStyle style)

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
void setSubpixelOrder(SubpixelOrder order)

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
size_t 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.

Properties

antiAlias
AntiAlias antiAlias [@property setter]
AntiAlias antiAlias [@property getter]

Convenience property

debugging
bool debugging [@property getter]
bool debugging [@property setter]

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
HintMetrics hintMetrics [@property setter]
HintMetrics hintMetrics [@property getter]

Convenience property

hintStyle
HintStyle hintStyle [@property setter]
HintStyle hintStyle [@property getter]

Convenience property

nativePointer
cairo_font_options_t* nativePointer [@property getter]

The underlying cairo_font_options_t* handle

Static functions

create
FontOptions create()

Allocates a new font options object with all options initialized to default values.

Meta