本文介绍了如何在后记文件中写入弧形文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个,但是我想使文本像圆弧一样对齐。
I have this, But I want to have text alignment like an arc. Is it possible?
/outputtext { /data exch def /rot exch def /xfont exch def /y1 exch def /x1 exch def /Times-Roman findfont xfont scalefont setfont x1 y1 moveto rot rotate data show rot neg rotate } def % x y fontsize rotation (text) outputtext 20 300 12 0 (text1) outputtext 20 400 12 90 (text2) outputtext 20 500 12 90 (text3) outputtext 20 600 12 0 (text4) outputtext showpage推荐答案
不确定为什么要避免翻译,不清楚动态是什么意思。但是这段代码无需翻译即可提供类似于旋转的效果。但是,如果不定义中心,就无法真正拥抱弧线(通过 translate 和 rotate 或以 cos 和 sin )并考虑(以某种方式)字符宽度。 Adobe示例代码完成了所有这一切。我的代码不在这里。
Not sure why you want to avoid translate, and it's not clear what you mean by "dynamically". But this code gives rotation-like effects without translating. But you can't really hug an arc without defining a center (either with translate and rotate, or algebraically with cos and sin) and accounting (somehow) for the character widths. The Adobe example code does all of this. My code here does not.
%! /rottxt { 4 dict begin /ang exch def /str exch def /ang ang str length div def { pop pop ang rotate } str kshow end } def 30 150 moveto /Palatino-Roman 20 selectfont (This is) -20 rottxt ( some ro) 20 rottxt (tated T) -40 rottxt (ext!!!!!) -100 rottxt showpage
更多推荐
如何在后记文件中写入弧形文本
发布评论