Appearance
zeropdf / TemplateStyle
Interface: TemplateStyle
Defined in: src/types.ts:1845
A reusable set of typographic and spacing properties applied to template blocks through a TemplateStylesheet. Stylesheet values are merged beneath each block's inline options, so inline options always win.
Note: align accepts the full TextAlign union; image and link blocks ignore "justify" and treat it as "left".
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
align? | TextAlign | Horizontal alignment for laid-out content. | src/types.ts:1857 |
color? | ColorInput | Color used for drawing, text, or highlighting. | src/types.ts:1853 |
direction? | TextDirection | Text direction used for shaping and layout. | src/types.ts:1861 |
fallbackFonts? | PdfFont[] | Fallback fonts used when the primary font lacks a glyph. | src/types.ts:1849 |
font? | PdfFont | Font used to render text. | src/types.ts:1847 |
fontSize? | number | Font size in PDF points. | src/types.ts:1851 |
kerning? | boolean | Whether kerning should be applied where supported. | src/types.ts:1859 |
lineHeight? | number | Line height in PDF points. | src/types.ts:1855 |
margin? | FlowMarginShorthand | CSS-like margin shorthand in PDF points. | src/types.ts:1865 |
marginBottom? | number | Bottom margin in PDF points. | src/types.ts:1871 |
marginLeft? | number | Left margin in PDF points. | src/types.ts:1873 |
marginRight? | number | Right margin in PDF points. | src/types.ts:1869 |
marginTop? | number | Top margin in PDF points. | src/types.ts:1867 |
writingMode? | "horizontal" | "vertical" | Text writing mode. | src/types.ts:1863 |