Skip to content

Text Positioning

Terry Burton edited this page Mar 28, 2026 · 29 revisions

Text Positioning

Up to nine independent text groups can be positioned using options prefixed with text1 through text9. The old option names textxalign, textyalign, etc. are retained as aliases for text1xalign, text1yalign, etc. Similarly extratextxalign, extratextyalign, etc. are aliases for text2xalign, text2yalign, etc.

Note: Some encoders (e.g. EAN/UPC, ISBN, ISSN, ISMN) provide directly-positioned text where each character is placed by the encoder at a specific location relative to the bars. For this encoder-positioned text, the alignment, direction and offset options do not apply unless the text content is overridden using text1 (or alttext), which switches to the general text layout engine.

text{1-9}xalign

The textNxalign option is used to specify where to horizontally position the text for a given text group.

Values: offleft, left, center, right, offright, justify

Aliases: textxalign = text1xalign, extratextxalign = text2xalign

Example: textxalign=offleft

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=offleft
Encoder: azteccode

Example: textxalign=left

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=left
Encoder: azteccode

Example: textxalign=center

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=center
Encoder: azteccode

Example: textxalign=right

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=right
Encoder: azteccode

Example: textxalign=offright

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=offright
Encoder: azteccode

text{1-9}yalign

The textNyalign option is used to specify where to vertically position the text for a given text group.

Values: below, bottom, center, top, above

Aliases: textyalign = text1yalign, extratextyalign = text2yalign

Example: textyalign=below

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=offright textyalign=below
Encoder: azteccode

Example: textyalign=bottom

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=offright textyalign=bottom
Encoder: azteccode

Example: textyalign=center

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=offright textyalign=center
Encoder: azteccode

Example: textyalign=top

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=offright textyalign=top
Encoder: azteccode

Example: textyalign=above

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=offright textyalign=above
Encoder: azteccode

text{1-9}direction

The textNdirection option is used to specify in which direction to orient text for a given text group.

Values: forward, backward, upward, downward

Aliases: textdirection = text1direction, extratextdirection = text2direction

Example: textdirection=forward

Data:    Test
Options: includetext alttext=Test layers=8 textdirection=forward
Encoder: azteccode

Example: textdirection=backward

Data:    Test
Options: includetext alttext=Test layers=8 textdirection=backward
Encoder: azteccode

Example: textdirection=upward

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=offright
         textyalign=center textdirection=upward
Encoder: azteccode

Example: textdirection=downward

Data:    Test
Options: includetext alttext=Test layers=8 textxalign=offright
         textyalign=center textdirection=downward
Encoder: azteccode

text{1-9}xoffset

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

Aliases: textxoffset = text1xoffset, extratextxoffset = text2xoffset

Example

Data:    TEST
Options: includetext textxalign=center textxoffset=-40
Encoder: code39

text{1-9}yoffset

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

Aliases: textyoffset = text1yoffset, extratextyoffset = text2yoffset

Example

Data:    TEST
Options: includetext textyoffset=-20
Encoder: code39

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.

Clone this wiki locally