Skip to content

Fonts and styles

Each entry of fonts, by family name: the name the font style property uses. Paths are resolved by the host, relative to the template by default.

fonts:
Inter: { regular: fonts/Inter-Regular.ttf, bold: fonts/Inter-Bold.ttf, fallback: [Arabic] }
Arabic: { regular: fonts/NotoSansArabic-Regular.ttf }

Type: text · Required

Path of the regular face (TrueType or OpenType), resolved by the host’s font provider.

Type: text

Path of the bold face.

Type: text

Path of the italic face.

Type: text

Path of the bold italic face.

Type: list of text

Declared families to take characters from when this family has no glyph for them, in order.

Each entry of styles, by name, applied with style on bands, elements, table columns, rows and cells. A style has the style properties below, and can extend another.

styles:
default: { font: Inter, fontSize: 9pt }
heading: { fontSize: 14pt, fontWeight: bold }
total: { extends: heading, align: end, borderTop: 0.75pt solid #000000 }

Type: text

Name of the style this one inherits from.

A named set of style properties. Bands, elements, styles, table columns, rows and cells all have these. They cascade: from the band, to the element’s named style (following extends), to the element’s own properties. Text properties are inherited by what a band or stack contains; box properties (background, padding, borders and vertical alignment) are not.

Type: text

A font family declared in fonts. Default Helvetica.

Type: length

Font size. Default 10pt.

Type: keyword

Normal or bold.

One of:

  • normal
  • bold

Type: true or false

Uses the italic face.

Type: true or false

Underlines the text.

Type: color

Text color. Default black.

Type: color

Fill color of the box. Not inherited.

Type: keyword

Horizontal alignment of text. Default start.

One of:

  • start
  • end
  • left
  • center
  • right
  • justify

Type: keyword

Base direction of text. Default auto.

One of:

  • auto
  • ltr
  • rtl

Type: keyword

Vertical alignment of the content in its box. Default top; not inherited.

One of:

  • top
  • middle
  • bottom

Type: number

Multiple of the font size.

Type: keyword

Breaking words across lines with a hyphen. Default manual: only at soft hyphens.

One of:

  • manual: Only at soft hyphens (U+00AD) in the text, which show as a hyphen when a line breaks there.
  • auto: Also where the language’s hyphenation patterns allow, when a word does not fit the rest of the line. The language is the element’s language, or the document’s.
  • none: Never inside words; soft hyphens are ignored.

Type: edges

Space between the border and the content. Not inherited.

Type: stroke

All four borders; the side properties override it. Not inherited.

Type: stroke

The top border.

Type: stroke

The right border.

Type: stroke

The bottom border.

Type: stroke

The left border.

A style that applies where its condition holds, to the value it belongs to: once for a text, row by row for a table column. Its named style, then its own properties, go over the element’s style; later rules go over earlier ones. Texts, table columns (for their data cells) and before and footer cells take them, in when. A rule has the style properties, and these:

- type: text
value: "{Amount:C}"
when:
- { if: =Amount < 0, color: "#C00000" }
- { if: =Amount > 10000, style: highlight }

Type: expression · Required

The condition, a boolean expression in the value’s scope: =Amount < 0.

Type: text

A named style to apply where the condition holds, before the rule’s own properties.

Style properties taken from the data: each an expression evaluated with the value it belongs to (once for a text, row by row for a table column), going over the element’s style and its when rules. A result that is empty, or not a colour, size or weight, leaves the property as it is. Texts, table columns and before and footer cells take them, in styleFrom, and a table’s header row in headerStyleFrom:

- type: text
value: "{Status}"
styleFrom: { color: =StatusColor, fontWeight: "=Priority > 2" }

Type: expression

Text colour: #RRGGBB, a colour name such as red or LightGray, or transparent.

Type: expression

Fill colour of the box, written as color is.

Type: expression

A font family.

Type: expression

Font size: a number of points, or text with a unit such as 9pt.

Type: expression

Font weight: bold or normal (a CSS weight of 600 or more is bold), or true for bold.