首页 > 解决方案 > postscript 定义字符串变量

问题描述

我想创建一个名为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

没有哪个工作,怎么能做到这一点?

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

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

标签: postscript

解决方案


这:

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

可能是你想要的


推荐阅读