Skip to content

Text Positioning

Terry Burton edited this page Jan 31, 2026 · 29 revisions

Text Positioning

textxalign

The textxalign option is used to specify where to horizontally position the text.

  • textxalign=offleft
  • textxalign=left
  • textxalign=center
  • textxalign=right
  • textxalign=offright
  • textxalign=justify

textyalign

The textyalign option is used to specify where to vertically position the text.

  • textyalign=below
  • textyalign=bottom
  • textyalign=center
  • textyalign=top
  • textyalign=above

textdirection

The textdirection option is used to specify in which direction to orient text.

  • textdirection=forward
  • textdirection=backward
  • textdirection=upward
  • textdirection=downward

textxoffset

The horizontal position of the text in points relative to the leftmost bar or modules.

textyoffset

The vertical position of the text in points relative to the base of the bars or modules.

Notes

  • By default (in the absence of textxalign or textyalign), each character of text is placed immediately below the corresponding modules where this is possible.
  • Where there isn't such a direct relationship then the default is to position the text centrally beneath the symbol.

extratextxalign, extratextyalign, extratextdirection, extratextxoffset, extratextyoffset

  • Any extra text can be position using the extratextxalign, extratextyalign, extratextdirection, extratextxoffset and extratextyoffset options that function the same as their textxalign, textyalign, textdirection, textxoffset and textyoffset analogues.

Examples

Code 128 with horizontally centered text:

Data:    Test123
Options: includetext textxalign=center
Encoder: code128

QR Code with text positioned above the symbol:

Data:    Test
Options: includetext alttext=Test textyalign=above
Encoder: qrcode

Data Matrix with text oriented upward to the right of the symbol:

Data:    Test
Options: includetext alttext=Test textxalign=offright textdirection=upward
Encoder: datamatrix

Code 39 with adjusted text position:

Data:    TEST
Options: includetext textxoffset=10 textyoffset=5
Encoder: code39

Clone this wiki locally