I had this problem before, and with manufacturers of printers, firmware and languages.
First, some paraphrased explanations directly from the ZPL II 2014 Programming Guide (P1012728-009 Rev. A).
"The ^ TB command prints a text block with a specific width and height. The text block has an automatic word wrap function. If the text exceeds the block height, the text is truncated."
โThe ^ FB (field block) command allows you to print text in the format of a specific type of block. It can format the string ^ FD (data field) into a block of text using the source, font and rotation specified for the text line, and it contains an automatic word wrap function . "
Technically, the difference between a text block and a field block is that the height is in points for the first and lines for the last.
Also note that although not mentioned, the ^ FB command also truncates text that does not match the specified number of lines, and here, where the font size A0 > and the line spacing FB now plays an important role in determining whether to show or trim this second or the third line.
By the way, in other languages, such as TSPL, there is no truncation of text blocks - if you point the block at 3 lines in height, but there is enough text for 4 lines, line 4 overlaps line 3 to indicate this - which may seem awful, but it better data loss during truncation, which is not obvious.
For both teams:
- "Using ^ FT (field set) for your data, the source origin is the last possible line of text, which means that the field block will be filled from bottom to top."
- "Using ^ FO (Field Origin) means that the field block will be filled from top to bottom."
In fact, I managed to execute the ^ FB command, as expected, but this may be due to the fact that ^ TB is not implemented in the firmware, I have worked with (Bluetooth printer compatible with ZPL II).
You can test the following snippet for the 2x2 label in the Labelary Viewer :
^XA ~TA0 ^MTD ^MNW ^MMT ^MFN ~SD15 ^PR6 ^PON ^PMN ^PW406 ^LS0 ^LRN ^LL406 ^LT0 ^LH0,0 ^CI0 ^XZ ^XA ^FO324,10,0^FB386,2,0,C,0^A0R,36,28.8^FH^FD"The King" Cupcake^FS ^FO278,10,0^FB386,1,0,C,0^A0R,28,22.4^FH^FDUse By 11/24/2015 02:45 PM^FS ^FO152,10,0^FB386,1,0,C,0^A0R,24,19.2^FH^FD11/24/2015 02:45 PM^FS ^FO62,140,0^FB250,1,0,R,0^A0R,24,19.2^FH^FDSL: 4 hours^FS ^FO38,10,0^FB386,1,0,L,0^A0R,18,14.4^FH^FDPREP DATE:^FS ^FO8,10,0^FB386,1,0,L,0^A0R,28,22.4^FH^FD11/24/2015 10:45 AM^FS ^FO62,10,0^FB50,1,0,L,0^A0R,24,19.2^FH^FDEMP:^FS ^FO92,10,0^FB376,3,0,J,0^A0R,18,14.4^FH^FDIngredients: 1 1/2 cups all-purpose flour, 1 teaspoon baking powder, 1/2 teaspoon salt, 8 tablespoons (1 stick) unsalted butter, room temperature, 1 cup sugar, 3 large eggs, 1 1/2 teaspoons pure vanilla extract, 3/4 cup milk.^FS ^PQ3,,,Y ^XZ
In particular, I executed the commands A0 and FD using FB . Using the viewer, you can quickly test the effects of the transition from FT and FO in the line of ingredients, the effects of changing the font size A0 and the effects of changing the FB of the number of lines from 3 to 2 (the viewer does not cut the text btw).
Of course, there is no match for the actual printing of the label, since your ZPL II compatible printer may or may not trim the text according to its manufacturer and firmware version.
I hope this helps!