zpl

Zebra printer mashing text with overlapping letters to unreadable label


I'm attempting to print simple text on a Zebra label (1" x 4"): D1D00.

ZPL source

^XA
^PW812
^LL203
^LH0,0
^CF0,120
^FO270,80
^FB312,1,0,C,0
^FDD1D00^FS
^XZ

Issue

The resulting label looks like D10D0-, but with the 10D mashed together. It should be D1D00.

This also happens when I substitute G,H,M,N for the second D (e.g. D3G00). Other letters print as expected (D1A05).

Any thoughts on how to fix this?


Solution

  • You can test your ZPL on Labelary Online ZPL Viewer.

    To explain the issues I added an image of the annotated command reference below.

    Issue: not enough line-width in ^FB

    The field-block is limited to 312 dots line-width (see image, yellow line): ^FB312,1,0,C,0.

    This is not sufficient for the text D1D00. The other texts you tried may fit in there because of different character widths.

    See also the assistive linter warning on Labelary:

    ^FD: Text does not fit on 1 line; last line contains overlapping text

    Annotated ZPL reference for ^FB

    annotated ZPL reference for field-block

    ZPL Reference on Zebra docs:

    Solution: add more line-width in ^FB

    Try to give the line more space, e.g. 512 dots: ^FB512,1,0,C,0. This will also fit wider characters like 5 capital "M"s MMMMM inside a readable line without overlapping:

    If this moves the centered text to far to the right, try to adjust the x-value of field-origin respectively, e.g. ^FO170,80.

    ZPL:

    ^XA
    ^PW812
    ^LL203
    ^LH0,0
    ^CF0,120
    ^FO170,80
    ^FB512,1,0,C,0
    ^FDMMMMM^FS
    ^XZ
    

    Renders to: rendered ZPL with 100 dots more width