ZPL2-旋转文本更改对齐方式 [英] ZPL2 - Rotating text changes alignment
问题描述
我正在ZPL2中使用^ A命令来打印Q字体,并且我希望它旋转90度.我认为由于第一个^ FO参数为零,因此该行将在标签的左边缘上方打印"00":
I'm using the ^A command in ZPL2 to print the Q font, and I want it rotated 90 degrees. I would think this line would print the "00" up against the left edge of the label since the first ^FO parameter is zero:
^XA
^PR2
^MD15
^PW1200
^LL590
^LH0,0
^FB500,14,,^FO0,135^AQR,1,1^FD00^FS
^PQ1
^XZ
. . .但事实并非如此.在整个标签上缩进了大约四分之一.使用相同的代码,我将^ AQR与^ AQN换出,"00"打印在右边缘的右上角.
. . . but it's not. It's indented about a fourth of the way across the label. Using that same code, I swap out ^AQR with ^AQN and the "00" prints right up against the left edge.
有人可以告诉我我在做什么错吗?我正在使用GX430t,如果有帮助的话.我不确定这样做,因为标签以相同的方式显示它.
Can anyone tell me what I'm doing wrong? I'm using a GX430t if that makes a difference. I'm not sure it does since labelary displays it the same way.
谢谢
推荐答案
ZPL中的旋转有点奇怪.它不能像HTML画布或其他现代图形环境那样工作,而图形表面的大小会影响旋转.
Rotation in ZPL is a bit odd. It does not work like HTML canvas or other modern graphics environments where the size of the drawing surface affects the rotation.
由于使用的是标签,请查看以下ZPL,它是示例的简化版本,没有字体旋转和标签尺寸,并添加了一个框来显示您定义的^FB
的范围. (字体Q行高为〜25点:14x25 ==350.)
Since you are using labelary, take a look at the following ZPL, which is a simplified version of your example, without the font rotation and label dimensions, and with a box added to show the extent of the ^FB
you defined. (The font Q line height is ~25 dots : 14x25 == 350.)
^XA
^LH0,0
^FPH
^FO0,135^GB500,350^FS
^FB500,14,,^FO0,135^AQ,1,1^FD00^FS
^XZ
现在让我们添加字体旋转,使^FB
也旋转.由于图形不会旋转,因此我们将交换^GB
的宽度和高度以显示框的等效旋转:
Now let's add in the font rotation which causes the ^FB
to rotate as well. Since graphics don't rotate, we will swap the width and height of the ^GB
to show the equivalent rotation of the box:
^XA
^LH0,0
^FPH
^FO0,135^GB350,500^FS
^FB500,14,,^FO0,135^AQR,1,1^FD00^FS
^XZ
我想您现在可以看到轮换的工作方式. ^FB
围绕^FO
点旋转.但是根据^FB
的尺寸,也有一些内置的x,y转换.
I think you can now see how the rotation worked. The ^FB
rotates around the ^FO
point. But there is also some built in x,y translation based on the dimensions of the ^FB
.
这篇关于ZPL2-旋转文本更改对齐方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!