1

I'm printing a 3 across by 4 down label on a GX430T. The home position is top left. Some of the text-lines read left to right from the very left edge of the label (i.e. it's using the default (normal, N) text orientation with an X origin of 0 and several evenly spaced Y points). The other text needs to read from the bottom up (i.e. left to right after the label is physically rotated 90 degrees clockwise and adhered to something). To do this, I'm using the "B" switch to rotate the string 270 degrees clockwise.

The problem I'm having is figuring out how to get the text to print left-justified instead of right-justified. Apparently, the center of rotation is on the right side of the string...is there a way to switch the center of rotation to the left side of the string?

^CI34^FO240,850^A0B,20,20,E:ARIALNB.FNT^FH^FDstring^FS
^CI34^FO280,850^A0B,20,20,E:ARIALNB.FNT^FH^FDlonger string^FS"

The result on the label looks something like...

         string
  longer string

and I want...

 string
 longer string

I think ^FB will be the way to go..

Print #1, "^FB900,1,,^FO500,100^A0B,20,20^FDSTRING^FS"
Print #1, "^FB900,1,,^FO540,100^A0B,20,20^FDLONGER STRING^FS"

These are printing left-justified.

MBB70
  • 375
  • 2
  • 16
  • I'm looking at maybe using a field block here, but I think it would be easier to not have have to combine all of my text into one block...the data is coming into the function as an array and each element of the array represents a line to print. – MBB70 Jan 20 '20 at 18:31
  • I'm also looking at this...https://stackoverflow.com/questions/42660007/zpl2-rotating-text-changes-alignment – MBB70 Jan 20 '20 at 18:42

1 Answers1

0

Field Block was the way to go. I passed an array containing the various elements and concatenated them into one element to use in the field block.

experimentalDetailFieldBlock = arrExperimentDetails(7, 1) & "-" & arrExperimentDetails(8, 1) & _
"\&" & arrExperimentDetails(1, 1) & _
"\&" & arrExperimentDetails(2, 1) & _
"\&" & arrExperimentDetails(5, 1) & " (" & Replace(arrExperimentDetails(6, 1), " µg/ml", "") & ")" & _
"\&" & arrExperimentDetails(11, 1) & " - " & arrExperimentDetails(13, 1)

xFont = 26:    yfont = 21:    xOrigin = 300:    yOrigin = 0:    xIncrementValue = 0:    yIncrementValue = 0
Print #1, "^FB1020,5,8,L,^CI34^FO" & xOrigin + xIncrementValue & "," & yOrigin + yIncrementValue & "^A0B," & xFont & "," & yfont & ",E:ARIALNB.FNT^FH^FD" & experimentalDetailFieldBlock & "^FS"

To change the position of other field blocks on the label, I used a variable to replace "1020"

Print #1, "^FB" & fieldBoxOrigin + yIncrementValue & ",5,8,L,^CI34^FO300,0^A0B," & xFont & "," & yfont & ",E:ARIALNB.FNT^FH^FD" & experimentalDetailFieldBlock & "^FS"
MBB70
  • 375
  • 2
  • 16