w:kern (Font Kerning)
Enables automatic pair kerning for the run at and above the specified minimum font size (in half-points).
Parent elements
Description
w:kern enables automatic pair kerning for the run, adjusting the spacing between specific character pairs (e.g. AV, WA) to improve visual balance. It is defined in ECMA-376 Part 1 §17.3.2.19.
The w:val attribute specifies the minimum font size (in half-points) above which kerning is applied. For example, w:val="24" enables kerning only when the effective font size is 12 pt or larger. Setting w:val="0" disables kerning regardless of size.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_HpsMeasure |
Non-negative integer in half-points (e.g. 24 = 12 pt). 0 disables kerning. |
Minimum font size at which automatic kerning is enabled. |
Examples
<!-- Enable kerning for runs at 12pt or larger -->
<w:rPr>
<w:kern w:val="24"/>
</w:rPr>
new RunProperties(
new Kern { Val = 24U });
Common Kerning Thresholds
| Font Size | Half-Points | Use Case |
|---|---|---|
| 12 pt | 24 | Body text |
| 14 pt | 28 | Subheading |
| 18 pt | 36 | Heading |
| 24 pt | 48 | Display/Title |
Notes
- Half-Point Values: 1 pt = 2 half-points; 12 pt = 24 half-points.
- Minimum Threshold: Kerning only applies when font size ≥ specified
w:val. - Zero Disables:
w:val="0"disables kerning completely. - Pair-Specific: Kerning adjusts spacing for specific letter pairs based on font metrics.
- Visual Only: No impact on text content or logical layout, purely cosmetic.
- Typical Practice: Use 24 (12 pt) for body, higher for display text.
- Font Support: Effectiveness depends on font kerning pairs; not all fonts support kerning.
- Small Text Impact: Kerning may be imperceptible in very small sizes.
- Typography Best Practice: Enable for headlines and display; disable for sizes <8pt.
- Compatibility: All Office versions support kerning consistently.