^GB
Graphic BoxPreview: partialDraws a box or a line. With thickness equal to the height it becomes a solid bar — the basis of every reversed header.
Syntax
^GBw,h,t,c,rParameters
| Parameter | Description and accepted values | If omitted |
|---|---|---|
| w | Box width in dots.Thickness to 32000 dots | Value of t |
| h | Box height in dots.Thickness to 32000 dots | Value of t |
| t | Border thickness in dots. Equal to the height, the box becomes solid.1 to 32000 dots | 1 dot |
| c | Line colour.B black or W white | B |
| r | Corner rounding, from square to fully rounded.0 to 8 — corner rounding | 0 |
How it works
^GB draws a rectangle. The width and height are the outer dimensions and the thickness is the border. A thickness equal to the height collapses the rectangle into a solid filled bar, which is how horizontal rules and reversed header blocks are made.
Because a line is just a very thin box, ^GB covers the separators that divide a shipping label into sections: ^GB700,3,3 is a 700-dot horizontal rule, and swapping the arguments gives a vertical one.
The colour parameter draws in white instead of black, which only makes sense on top of something already black. Corner rounding softens the corners on a scale of 0 to 8.
Example
^XA
^FO40,40^GB520,120,4^FS
^FO70,80^A0N,40,40^FDBoxed^FS
^XZRendering…
How the preview on this site handles it
Position, dimensions, thickness and colour are drawn. Corner rounding is ignored, so rounded boxes preview with square corners.
Common mistakes
- Expecting ^GB to fill the box. It draws a border — set the thickness to the height for a solid bar.
- A thickness larger than the box, which the printer clamps rather than reporting.
- White boxes on blank stock. They print nothing, since the media is already white.