PDF Typography and Font Control
Control every typographic detail in PDF output: font family, size, weight, line height, letter spacing, and colour for body text, each heading level, and code blocks. Typography settings are independent from web styling and persist across publishes.
PDF typography gives you per-element control over how text renders in your PDF documents. Set global defaults for the entire document, then override specific elements like headings, body text, or code blocks with their own font family, size, weight, line height, letter spacing, and colour. Typography settings apply exclusively to PDF output and do not affect your published website.
Global Defaults
Global defaults apply to all text in the PDF document unless overridden by a per-element setting:
| Property | Description | Default |
|---|---|---|
| Base Font Family | Font family applied to all text elements | System default |
| Base Font Size | Base size for body text (CSS value: rem, px, or pt) | Inherited from theme |
| Base Line Height | Line spacing multiplier applied to all text | 1.6 |
| Base Colour | Text colour applied when per-element colour is empty (hex value) | Inherited from theme |
Per-Element Overrides
Override any global default for specific elements. Each element can have its own complete set of typographic properties:
| Element | Description |
|---|---|
| Body | Paragraphs, list items, table cells, and other body text |
| H1 | Top-level headings |
| H2 | Second-level headings |
| H3 | Third-level headings |
| H4 | Fourth-level headings |
| H5 | Fifth-level headings |
| H6 | Sixth-level headings |
| Code | Inline code and code blocks |
Each element supports these properties:
| Property | Description | Example Values |
|---|---|---|
| fontFamily | Font family name (must be installed on the system) | Georgia, Garamond, Calibri |
| fontSize | Font size as a CSS value | 1rem, 16px, 11pt |
| fontWeight | Numeric weight from 100 (thin) to 900 (black) | 400 (regular), 700 (bold) |
| lineHeight | Unitless line spacing multiplier | 1.4, 1.6, 1.8 |
| letterSpacing | Space between characters as a CSS value | 0.02em, 0.5px |
| color | Text colour as hex value (empty inherits from global) | #333333, #1a1a2e |
| marginTop | Space above (headings only) as a CSS value | 1.5rem, 24px |
| marginBottom | Space below (headings only) as a CSS value | 0.75rem, 12px |
How Typography is Applied
Example Configurations
Three common typography setups for different document types: