Skip to content

API Reference / @gtkx/cairo / FontOptions

Class: FontOptions ​

Defined in: packages/cairo/src/font-options.ts:52

Cairo font options (cairo_font_options_t): the rendering settings applied to text, such as antialiasing, hinting and font variations.

Constructors ​

Constructor ​

new FontOptions(other?): FontOptions

Defined in: packages/cairo/src/font-options.ts:66

Creates a set of font options: a copy of other when given, otherwise all settings at their defaults.

Parameters ​

other? ​

FontOptions

Returns ​

FontOptions

Properties ​

__type__ ​

__type__: bigint

Defined in: packages/cairo/src/font-options.ts:63

GType of CairoFontOptions, the boxed type this class is registered under.

Methods ​

equal() ​

equal(other): boolean

Defined in: packages/cairo/src/font-options.ts:112

Returns whether other holds the same settings.

Parameters ​

other ​

FontOptions

Returns ​

boolean


getAntialias() ​

getAntialias(): Antialias

Defined in: packages/cairo/src/font-options.ts:87

Returns the antialiasing mode used for text.

Returns ​

Antialias


getHintMetrics() ​

getHintMetrics(): HintMetrics

Defined in: packages/cairo/src/font-options.ts:97

Returns whether font metrics are quantized to integer pixels.

Returns ​

HintMetrics


getHintStyle() ​

getHintStyle(): HintStyle

Defined in: packages/cairo/src/font-options.ts:77

Returns how outlines are fitted to the pixel grid.

Returns ​

HintStyle


getSubpixelOrder() ​

getSubpixelOrder(): SubpixelOrder

Defined in: packages/cairo/src/font-options.ts:107

Returns the order of subpixels on the display.

Returns ​

SubpixelOrder


getVariations() ​

getVariations(): string | null

Defined in: packages/cairo/src/font-options.ts:137

Returns the OpenType font variations to apply.

Returns ​

string | null


hash() ​

hash(): number

Defined in: packages/cairo/src/font-options.ts:127

Returns a hash of the settings, equal for options that compare equal.

Returns ​

number


merge() ​

merge(other): void

Defined in: packages/cairo/src/font-options.ts:117

Copies every non-default setting of other over this one.

Parameters ​

other ​

FontOptions

Returns ​

void


setAntialias() ​

setAntialias(antialias): void

Defined in: packages/cairo/src/font-options.ts:82

Sets the antialiasing mode used for text.

Parameters ​

antialias ​

Antialias

Returns ​

void


setHintMetrics() ​

setHintMetrics(hintMetrics): void

Defined in: packages/cairo/src/font-options.ts:92

Sets whether font metrics are quantized to integer pixels.

Parameters ​

hintMetrics ​

HintMetrics

Returns ​

void


setHintStyle() ​

setHintStyle(hintStyle): void

Defined in: packages/cairo/src/font-options.ts:72

Sets how outlines are fitted to the pixel grid.

Parameters ​

hintStyle ​

HintStyle

Returns ​

void


setSubpixelOrder() ​

setSubpixelOrder(subpixelOrder): void

Defined in: packages/cairo/src/font-options.ts:102

Sets the order of subpixels on the display, used by subpixel antialiasing.

Parameters ​

subpixelOrder ​

SubpixelOrder

Returns ​

void


setVariations() ​

setVariations(variations): void

Defined in: packages/cairo/src/font-options.ts:132

Sets the OpenType font variations to apply, as a comma-separated axis=value string.

Parameters ​

variations ​

string | null

Returns ​

void


status() ​

status(): Status

Defined in: packages/cairo/src/font-options.ts:122

Returns the error status of the font options, Status.SUCCESS when they are usable.

Returns ​

Status


create() ​

static create(): FontOptions

Defined in: packages/cairo/src/font-options.ts:58

Creates a set of font options with all settings at their defaults, the same as new FontOptions().

Returns ​

FontOptions