Word spacing (source code)

= Word spacing

\b[Word spacing] is the separation between adjacent words in a line of text. Its nominal value comes from the <computer font> and layout settings; <text justification> can adjust it through <typesetting glue>. <Letter spacing> instead changes spacing within the text's sequence of letters. A script without visible word separators needs a different spacing strategy from an English sentence.<CSS Text Module Level 3 by World Wide Web Consortium>[§§6.4 and 7.1–7.2: script-dependent justification and word/letter spacing]{ref}

Suppose three <typesetting boxes> have widths 8, 6 and 10, and the two intervening spaces each have width 3. The <natural line width> is
$$
N=8+3+6+3+10=30.
$$
Adding 1 to each space gives width 32. Adding 1 to every <glyph advance> would generally produce a different layout, because there need not be one <glyph> per word or per stored character. <Word spacing> must therefore be applied to the intended separators rather than inferred from a count of <glyphs>.

In <CSS>, `word-spacing: 1px` specifies additional spacing at the relevant word separators; it does not set every interword gap to exactly one <CSS pixel>.<CSS Text Module Level 3 by World Wide Web Consortium>[§7.1: additional spacing and affected separator characters]{ref}