Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

embedFonts complains about “Unknown device: pswrite”

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?

like image 895
MvG Avatar asked Jul 03 '14 06:07

MvG


1 Answers

This is because the device is called ps2write these 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:

embedFonts() now defaults to format = "ps2write" for .ps and .eps files. This is available in Ghostscript 9.x (since 2010) whereas the previous default, format = "pswrite", was removed in 9.10.

So the quick fix is to manually pass format = "ps2write" to the embedFonts invocation.

like image 133
MvG Avatar answered Oct 18 '22 13:10

MvG