Skip to content

Text

Prints text with optional alignment, emphasis, font, size, and wrapping settings.

Example

{
  "type": "text",
  "content": "Hello from print-blocks",
  "align": "center",
  "bold": true
}

Fields

FieldTypeDescription
typerequired"text"

Discriminator for text blocks.

contentrequiredstring

Text to print.

  • Minimum length: 1
  • Maximum length: 5000
alignoptionalstring

Horizontal text alignment.

  • Allowed: "left", "center", "right"
boldoptionalboolean

Print text in bold.

fontoptionalstring

Printer font to use.

  • Allowed: "A", "B", "C", "D", "E", "special-A", "special-B"
underlineoptionalstring

Underline style.

  • Allowed: "1dot-thick", "2dot-thick", "none"
invertoptionalboolean

Print light text on a dark background.

sizeoptionalobject

Character width and height scaling.

Nested fields
FieldTypeDescription
widthrequired1 | 2 | 3 | 4 | 5 | 6 | 7 | 8

Horizontal character scale from 1 through 8.

heightrequired1 | 2 | 3 | 4 | 5 | 6 | 7 | 8

Vertical character scale from 1 through 8.

wordBreakoptionalstring

Text wrapping strategy.

  • Allowed: "break-all", "break-word"
inlineoptionalboolean

Do not feed a line after printing this text.