【发布时间】:2019-07-13 16:15:33
【问题描述】:
我希望将一些文本转换为 Postscript。使用here 和here 中的以下方法适用于某些字体,但不是全部。我很困惑为什么会这样。
它适用于 Times,使用 Postscript 名称 TimesNewRomanPSMT。 它不适用于 Snell Roundhand、Postscript 名称、SnellRoundhand。
两者都是 .ttf 字体。 两者都位于我 iMac 上的 /Library/Fonts 中。
当找不到字体并默认为 Helvetica 时,是否会在某处创建 Postscript 错误消息?如果有,在哪里?
在 R 中有没有更好的方法从文本创建 Postscript 文件?
library(grImport)
# Must use Postscript name of file. See Font Body app in MacOS
cat("%!PS
/SnellRoundhand findfont
100 scalefont
setfont
newpath
0 0 moveto
(yfde) show", file = "data/y.ps")
PostScriptTrace("data/y.ps", "data/y.xml")
letters <- readPicture("data/y.xml")
grid.picture(letters)
【问题讨论】: