Skip to content

API Reference / @gtkx/cairo / FontOptions

Class: FontOptions ​

Defined in: font-options.d.ts:6

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: font-options.d.ts:12

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: font-options.d.ts:10

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

Methods ​

equal() ​

equal(other): boolean

Defined in: font-options.d.ts:30

Returns whether other holds the same settings.

Parameters ​

other ​

FontOptions

Returns ​

boolean


getAntialias() ​

getAntialias(): Antialias

Defined in: font-options.d.ts:20

Returns the antialiasing mode used for text.

Returns ​

Antialias


getHintMetrics() ​

getHintMetrics(): HintMetrics

Defined in: font-options.d.ts:24

Returns whether font metrics are quantized to integer pixels.

Returns ​

HintMetrics


getHintStyle() ​

getHintStyle(): HintStyle

Defined in: font-options.d.ts:16

Returns how outlines are fitted to the pixel grid.

Returns ​

HintStyle


getSubpixelOrder() ​

getSubpixelOrder(): SubpixelOrder

Defined in: font-options.d.ts:28

Returns the order of subpixels on the display.

Returns ​

SubpixelOrder


getVariations() ​

getVariations(): string

Defined in: font-options.d.ts:40

Returns the OpenType font variations to apply.

Returns ​

string


hash() ​

hash(): number

Defined in: font-options.d.ts:36

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

Returns ​

number


merge() ​

merge(other): void

Defined in: font-options.d.ts:32

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

Parameters ​

other ​

FontOptions

Returns ​

void


setAntialias() ​

setAntialias(antialias): void

Defined in: font-options.d.ts:18

Sets the antialiasing mode used for text.

Parameters ​

antialias ​

Antialias

Returns ​

void


setHintMetrics() ​

setHintMetrics(hintMetrics): void

Defined in: font-options.d.ts:22

Sets whether font metrics are quantized to integer pixels.

Parameters ​

hintMetrics ​

HintMetrics

Returns ​

void


setHintStyle() ​

setHintStyle(hintStyle): void

Defined in: font-options.d.ts:14

Sets how outlines are fitted to the pixel grid.

Parameters ​

hintStyle ​

HintStyle

Returns ​

void


setSubpixelOrder() ​

setSubpixelOrder(subpixelOrder): void

Defined in: font-options.d.ts:26

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

Parameters ​

subpixelOrder ​

SubpixelOrder

Returns ​

void


setVariations() ​

setVariations(variations): void

Defined in: font-options.d.ts:38

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

Parameters ​

variations ​

string

Returns ​

void


status() ​

status(): Status

Defined in: font-options.d.ts:34

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

Returns ​

Status


create() ​

static create(): FontOptions

Defined in: font-options.d.ts:8

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

Returns ​

FontOptions