Skip to main content

Module font_features

Module font_features 

Source
Expand description

OpenType features a piece of text asks its font for, such as tabular figures.

A feature does not change which font the text is set in. It picks one of the forms the font already has: digits of one width, a ligature left apart, a stylistic set. That is why text with a type role may take features too, where it may not name a font.

The list travels in the FontFeatureSettings property as fixed 8-byte records, the four tag bytes and then the value as a little-endian u32. The Renderer turns it into Compose’s fontFeatureSettings string once, when the property changes.

Structs§

FontFeature
One OpenType feature and its value. Compose’s TextStyle.fontFeatureSettings entry, CSS’s font-feature-settings entry.

Constants§

FONT_FEATURE_LEN
Bytes of one feature record: the tag, then the value.
FONT_FEATURE_TAG_AT
Where each part of a record starts.
FONT_FEATURE_VALUE_AT
MAX_FONT_FEATURES
The most features one node may carry. The Renderer reports a longer list as a protocol error and draws the text without any of them.

Functions§

font_feature_bytes
The records of features, in order, as the FontFeatureSettings property carries them.