如何确保 PostScript 中垂直和水平方向的线宽相同? [英] How to ensure line widths are the same vertically and horizontally in PostScript?

查看:54
本文介绍了如何确保 PostScript 中垂直和水平方向的线宽相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PostScript 中线条的宽度是根据用户空间中的距离定义的.在我的用例中,设备空间的纵横比(例如4:3)与用户空间的纵横比(例如1:1)不同,这导致设备空间中的线宽在垂直和水平方向.

The width of a line in PostScript is defined in terms of distances in the user space. In my use case, the aspect ratio of the device space (e.g. 4:3) is different from the aspect ratio of the user space (e.g. 1:1), which causes the line widths in the device space to be different in vertical and horizontal directions.

如何使线宽与线方向无关?setlinewidth 的 PostScript 语言参考手册提到,如果在 stroke 时有效的当前变换矩阵 (CTM) 指定按 x 和 y 维度中的不同因子进行缩放,那么线条的粗细可能会有所不同.

How to make line widths the same regardless of the line orientation? The PostScript Language Reference Manual for setlinewidth mentions that if the current transformation matrix (CTM) in effect at the time of the stroke specifies scaling by different factors in the x and y dimensions, then thickness of the lines can vary.

这是否意味着如果我在调用笔划之前在 x 和 y 维度上设置具有相同缩放因子的 CTM,然后将 CTM 重置为 PostScript 文件中其他地方使用的值,则线宽将相同而不会影响任何内容还有吗?

Does this mean that if I set a CTM with the same scaling factor in x and y dimensions before calling stroke and then reset the CTM to the value used elsewhere in the PostScript file, the line widths will be the same without affecting anything else?

推荐答案

是的.stroke 将生成与 CTM 转换的钢笔形状对应的路径轮廓.您可以使用 setmatrix 为笔建立一致的统一矩阵.

Yes. stroke will generate an outline of the path corresponding to a pen shape transformed by the CTM. You can use setmatrix to establish a consistent uniform matrix for the pen.

matrix currentmatrix
  matrix identmatrix setmatrix
  stroke
setmatrix

这篇关于如何确保 PostScript 中垂直和水平方向的线宽相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆