Running embedFonts on some EPS file I created, I get an error message:
> embedFonts("foo.ps")
Unknown device: pswrite
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
defaultdevice
Error in embedFonts("foo.ps") :
status 1 in running command 'gs -dNOPAUSE -dBATCH -q -dAutoRotatePages=/None -sDEVICE=pswrite -sOutputFile=/tmp/Rtmp3Lv0dj/Rembed2cd86df573a1 '-sFONTPATH=' 'foo.ps''
How can I avoid this error?
This is because the device is called
ps2writethese days. Support for writing post script level 1 has been dropped. The next R release (we are currently at 3.1.0, so this might be about 3.2) will contain a fix. Quoting from the list of changes:So the quick fix is to manually pass
format = "ps2write"to theembedFontsinvocation.