Function zng::text::word_spacing

source ·
pub fn word_spacing(
    child: impl UiNode,
    extra: impl IntoVar<Length>,
) -> impl UiNode
Expand description

P Extra spacing added to the Unicode U+0020 SPACE character. If not set inherits the word_spacing from the parent widget.

Word spacing is done using the space character “advance” as defined in the font, this unit represents extra spacing added to that default spacing.

A “word” is the sequence of characters in-between space characters. This extra spacing is applied per space character not per word, if there are three spaces between words the extra spacing is applied thrice. Usually the number of spaces between words is collapsed to one, see WhiteSpace, resulting in only one extra spacing.

The Default value signals that word spacing can be tweaked when text justification is enabled, all other values disable automatic adjustments for justification. Relative values are computed from the length of the space ' ' character, so a word spacing of 100.pct() visually adds another space in between words.

This property sets the WORD_SPACING_VAR context var that affects all inner widgets.