后记定义字符串变量

postscript define string variable

我想创建一个名为 units 的变量来存储字符串 "cm"。我尝试通过以下方式做到这一点:

1) /units (cm) def
2) /units "cm" def
3) /units cm def
4) /units "cm" string def

这里有一个程序不会 运行:

/units (cm) def
0 0 moveto 100 100 lineto

none其中的工作,这个怎么办?

更明确地说,这是我要创建的程序:

/units (cm) def
/Times-Roman findfont 20 scalefont setfont
300 300 moveto units show stroke

这个:

/units (cm) def
/Times-Roman findfont 20 scalefont setfont
300 300 moveto units show
showpage

也许就是你想要的