w:w (Character Width Scaling)
Scales the width (horizontal extent) of each character in a run as a percentage of normal width, producing condensed or expanded text.
Parent elements
Description
w:w applies a horizontal scaling factor to all characters in a run, without changing the font size. A value of 100 means normal (unscaled) width. Values less than 100 produce condensed text; values greater than 100 produce expanded text.
It is defined in ECMA-376 Part 1 §17.3.2.43.
Note: this element has the same local name as the width attribute used on w:tblInd, w:tblW, etc. In w:rPr context, w:w is always the character-scaling element.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_TextScale |
Integer from 1 to 600 (percentage, e.g. 200 = 200% = double width) |
Horizontal scaling factor as a percentage of normal. |
Examples
<!-- Condensed text at 80% width -->
<w:r>
<w:rPr>
<w:w w:val="80"/>
</w:rPr>
<w:t>Condensed text</w:t>
</w:r>
<!-- Expanded text at 150% width -->
<w:r>
<w:rPr>
<w:w w:val="150"/>
</w:rPr>
<w:t>Expanded text</w:t>
</w:r>
using DocumentFormat.OpenXml.Wordprocessing;
// 80% condensed
var condensed = new Run(
new RunProperties(new CharacterScale { Val = 80 }),
new Text("Condensed text")
);
// 150% expanded
var expanded = new Run(
new RunProperties(new CharacterScale { Val = 150 }),
new Text("Expanded text")
);
Notes
- The scaling is applied to glyph widths only; it does not affect font metrics like ascent or descent.
- Condensing below about 60–70% or expanding beyond 200% generally degrades readability.
w:wis distinct fromw:kern(which adjusts space between character pairs) andw:spacing(which adds uniform space between all characters in the run).