w:sz (Font Size)
Specifies the font size in half-points (e.g., w:val='24' equals 12pt).
Parent elements
Description
w:sz sets the font size for the run. It is defined in ECMA-376 Part 1 §17.3.2.38.
The value is expressed in half-points (twips-of-a-point): a value of 24 equals 12 pt, 28 equals 14 pt, and so on. The complex-script equivalent is w:szCs.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_HpsMeasure |
Positive integer in half-points (e.g. 20 = 10 pt, 24 = 12 pt, 28 = 14 pt, 32 = 16 pt, 72 = 36 pt). |
Font size in half-points. |
Examples
<!-- 14pt font -->
<w:rPr>
<w:sz w:val="28"/>
</w:rPr>
new RunProperties(
new FontSize { Val = "28" });
<!-- 10pt font with complex script size -->
<w:rPr>
<w:sz w:val="20"/>
<w:szCs w:val="20"/> <!-- Same size for complex script text -->
</w:rPr>
new RunProperties(
new FontSize { Val = "20" }, // 10 pt
new FontSizeComplexScript { Val = "20" }); // Complex script 10 pt
Common Font Sizes
| Point Size | Half-Points | Use Case |
|---|---|---|
| 8 pt | 16 | Small text, footnotes |
| 9 pt | 18 | Small body text |
| 10 pt | 20 | Standard body text |
| 11 pt | 22 | Body text (default) |
| 12 pt | 24 | Body text, standard |
| 14 pt | 28 | Subheading |
| 16 pt | 32 | Heading |
| 18 pt | 36 | Large heading |
| 24 pt | 48 | Title |
| 28 pt | 56 | Large title |
| 36 pt | 72 | Display |
Font Size Conversion Reference
| Half-Points | Points | Common Use | Typical Rendering |
|---|---|---|---|
| 16 | 8 | Small footnotes, annotations | Tiny, hard to read |
| 18 | 9 | Footnotes, captions | Very small |
| 20 | 10 | Standard body text (compact) | Small but readable |
| 22 | 11 | Body text (default in many apps) | Readable |
| 24 | 12 | Standard body text (most common) | Comfortable reading |
| 28 | 14 | Subheading, emphasis | Larger emphasis |
| 32 | 16 | Section heading | Prominent |
| 36 | 18 | Major heading | Very prominent |
| 40 | 20 | Large heading | Significant |
| 48 | 24 | Title, display | Very large |
| 56 | 28 | Large title | Extra large |
| 72 | 36 | Display heading | Dominant |
| 96 | 48 | Large display | Poster-like |
| 144 | 72 | Extra large display | Billboard-like |
Best Practices for Font Sizing
Hierarchy Example
- Title: 28-36 pt (56-72 half-points)
- Heading 1: 18-20 pt (36-40 half-points)
- Heading 2: 14-16 pt (28-32 half-points)
- Heading 3: 12-13 pt (24-26 half-points)
- Body Text: 10-12 pt (20-24 half-points)
- Footnotes/Captions: 8-9 pt (16-18 half-points)
Size Ratios
Maintain readable proportions:
- Body to heading: 1.2× to 1.5× (e.g., 12 pt body + 16-18 pt heading)
- Major heading to minor heading: 1.25× (e.g., 16 pt vs 12-13 pt)
- Title to body: 2× to 3× (e.g., 24 pt title + 12 pt body)
Complex Script Font Size (w:szCs)
When using complex-script text (Arabic, Hebrew, Devanagari), apply w:szCs for matching height:
<w:rPr>
<w:sz w:val="24"/> <!-- ASCII/Western: 12 pt -->
<w:szCs w:val="24"/> <!-- Complex script: same visual height -->
</w:rPr>
Note: Complex scripts often require slightly larger sizes for equal legibility; some developers set w:szCs = 1.1 to 1.2× w:sz.
Notes
- Half-Points: Divide
w:valby 2 to get points; e.g.,24→ 12 pt. - Complex Script: Use
w:szCsfor Arabic, Hebrew, and other complex-script text. - Consistency: Ensure complex-script size is proportional to ASCII size for proper rendering.
- Minimum Size: Most applications support minimum font sizes down to 1 pt (2 half-points).
- Maximum Size: Extremely large font sizes (>1000 pt) may cause rendering issues.
- Visual Impact: Size affects document layout; larger fonts increase line height and page count.
- Accessibility: Very small fonts (<8 pt) reduce readability; follow accessibility guidelines.
- Inheritance: If not specified, size is inherited from applied style or document defaults.
- Scaling: Font size is independent of printer resolution; specified size renders consistently.
- Compatibility: Font sizes render consistently across all Office versions.
- Printer Limitations: Some printers may have maximum or minimum font sizes; test output.
- Screen vs Print: Font sizes render similarly on screen and in print, but may appear different due to DPI.