如何在后记文件中写入弧形文本

编程入门 行业动态 更新时间:2024-10-28 09:18:44
本文介绍了如何在后记文件中写入弧形文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有这个,但是我想使文本像圆弧一样对齐。

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

更多推荐

如何在后记文件中写入弧形文本

本文发布于:2023-10-29 20:24:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1540648.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:弧形   后记   文本   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!