Method

PangoFontDescriptionset_features

since: 1.56

Declaration [src]

void
pango_font_description_set_features (
  PangoFontDescription* desc,
  const char* features
)

Description [src]

Sets the features field of a font description.

OpenType font features allow to enable or disable certain optional features of a font, such as tabular numbers.

The format of the features string is comma-separated list of feature assignments, with each assignment being one of these forms:

FEATURE=n

where FEATURE must be a 4 character tag that identifies and OpenType feature, and n an integer (depending on the feature, the allowed values may be 0, 1 or bigger numbers). Unknown features are ignored.

Note that font features set in this way are enabled for the entire text that is using the font, which is not appropriate for all OpenType features. The intended use case is to select character variations (features cv01 - c99), style sets (ss01 - ss20) and the like.

Pango does not currently have a way to find supported OpenType features of a font. Both harfbuzz and freetype have API for this. See for example hb_ot_layout_table_get_feature_tags.

Features that are not supported by the font are silently ignored.

Available since: 1.56

Parameters

features

Type: const char*

A string representing the features.

The argument can be NULL.
The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.