wch / extrafont

Tools for using fonts in R graphics
315 stars 48 forks source link

Gostscript call fails #28

Closed M-Russell closed 11 years ago

M-Russell commented 11 years ago

Thanks for doing the hard work on this package.

I have been trying extrafont out with R3.0.0 on a windows 7 64bit PC.

I can install and load fonts just fine.

When I run the example and get to:

embed_fonts('fonttest.pdf', outfile='fonttest-embed.pdf')

I get:

Error: /undefinedfilename in ("fonttest.pdf") Operand stack:

Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push Dictionary stack: --dict:1175/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- Current allocation mode is local Last OS error: Invalid argument GPL Ghostscript 9.07: Unrecoverable error, exit code 1 Error in embedFonts(file = file, format = format, outfile = outfile, options = paste(paste("-I", : status 1 in running command 'C:/gs/gs9.07/bin/gswin64c.exe -dNOPAUSE -dBATCH -q -dAutoRotatePages=/None -sDEVICE=pdfwrite -sOutputFile=C:\Users\mbpssmr\AppData\Local\Temp\RtmpWGZ2Ku\Rembed234c60bc65f "-sFONTPATH=" -I"C:\R\R-3.0.0\library\extrafontdb\fontmap" "\"fonttest.pdf\""' In addition: Warning message: running command 'C:/gs/gs9.07/bin/gswin64c.exe -dNOPAUSE -dBATCH -q -dAutoRotatePages=/None -sDEVICE=pdfwrite -sOutputFile=C:\Users\mbpssmr\AppData\Local\Temp\RtmpWGZ2Ku\Rembed234c60bc65f "-sFONTPATH=" -I"C:\R\R-3.0.0\library\extrafontdb\fontmap" "\"fonttest.pdf\""' had status 1

However if I go to the command line and run gs manually:

C:\Rwd>C:/gs/gs9.07/bin/gswin64c.exe -dNOPAUSE -dBATCH -q - AutoRotatePages=/None -sDEVICE=pdfwrite -sOutputFile=out.pdf "-sFONTPATH=" -I"C:\R\R-3.0.0\library\extrafontdb\fontmap" "font_plot.pdf"

Everything works and I get a pdf with fonts correctly embedded.

"\"fonttest.pdf\""' causes the problem with /undefinedfilename.

When this is corrected gs runs, but does not produce a useful output untill sOutputFile is set to something useful.

wch commented 11 years ago

I think it may be the same as #27. Can you try the solution there and see if it works?

M-Russell commented 11 years ago

Thank you for your reply.

I tried the successful solution to #27

devtools::install_github('extrafont', 'wch', 'embedfont-space')

and got the error:

Installing github repo(s) extrafont/embedfont-space from wch Installing extrafont.zip from https://github.com/wch/extrafont/archive/embedfont-space.zip Error: server error: (500) Internal Server Error

The earlier version in that thread:

devtools::install_github('extrafont', 'wch', 'v0.14')

completes successfully with the final lines:

Reloading installed extrafont Registering fonts with R

However the same error occurs:

Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push Dictionary stack: --dict:1175/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- Current allocation mode is local Last OS error: Invalid argument GPL Ghostscript 9.07: Unrecoverable error, exit code 1 Error in embedFonts(file = file, format = format, outfile = outfile, options = paste(paste("-I", : status 1 in running command 'C:/gs/gs9.07/bin/gswin64c.exe -dNOPAUSE -dBATCH -q -dAutoRotatePages=/None -sDEVICE=pdfwrite -sOutputFile=C:\Users\mbpssmr\AppData\Local\Temp\Rtmpus2PS5\Rembed1ce07bc46c0a "-sFONTPATH=" -I"C:\R\R-3.0.0\library\extrafontdb\fontmap" "\"font_ggplot.pdf\""' In addition: Warning message: running command 'C:/gs/gs9.07/bin/gswin64c.exe -dNOPAUSE -dBATCH -q -dAutoRotatePages=/None -sDEVICE=pdfwrite -sOutputFile=C:\Users\mbpssmr\AppData\Local\Temp\Rtmpus2PS5\Rembed1ce07bc46c0a "-sFONTPATH=" -I"C:\R\R-3.0.0\library\extrafontdb\fontmap" "\"font_ggplot.pdf\""' had status 1

As thread #27 indicated.

Is it possible embedfont-space has been removed from the server?

Thanks

Matt

erikriverson commented 11 years ago

We had this error occur, too. It happened immediately after updating to R 3.0.0. If I recall, it had something to do with the extranfontdb package. Perhaps I had to uninstall and reinstall it, or simply regenerate the Fontmap in extrafontdb by calling font_import() again?

I wish I could remember exactly the steps I took to fix it, but it was something along those lines.

Hope this helps, --Erik

On Wed, May 1, 2013 at 2:53 PM, M-Russell notifications@github.com wrote:

Thank you for your reply.

I tried the successful solution to #27

devtools::install_github('extrafont', 'wch', 'embedfont-space')

and got the error:

Installing github repo(s) extrafont/embedfont-space from wch Installing extrafont.zip from https://github.com/wch/extrafont/archive/embedfont-space.zip Error: server error: (500) Internal Server Error

The earlier version in that thread:

devtools::install_github('extrafont', 'wch', 'v0.14')

completes successfully with the final lines:

Reloading installed extrafont Registering fonts with R

However the same error occurs:

Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push Dictionary stack: --dict:1175/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- Current allocation mode is local Last OS error: Invalid argument GPL Ghostscript 9.07: Unrecoverable error, exit code 1 Error in embedFonts(file = file, format = format, outfile = outfile, options = paste(paste("-I", : status 1 in running command 'C:/gs/gs9.07/bin/gswin64c.exe -dNOPAUSE -dBATCH -q -dAutoRotatePages=/None -sDEVICE=pdfwrite -sOutputFile=C:\Users\mbpssmr\AppData\Local\Temp\Rtmpus2PS5\Rembed1ce07bc46c0a "-sFONTPATH=" -I"C:\R\R-3.0.0\library\extrafontdb\fontmap" "\"font_ggplot.pdf\""' In addition: Warning message: running command 'C:/gs/gs9.07/bin/gswin64c.exe -dNOPAUSE -dBATCH -q -dAutoRotatePages=/None -sDEVICE=pdfwrite -sOutputFile=C:\Users\mbpssmr\AppData\Local\Temp\Rtmpus2PS5\Rembed1ce07bc46c0a "-sFONTPATH=" -I"C:\R\R-3.0.0\library\extrafontdb\fontmap" "\"font_ggplot.pdf\""' had status 1

As thread #27 indicated.

Is it possible embedfont-space has been removed from the server?

Thanks

Matt

— Reply to this email directly or view it on GitHub.

wch commented 11 years ago

Oops, it needs the master branch now. Try doing:

devtools::install_github('extrafont', 'wch')
M-Russell commented 11 years ago

That works now.

Thanks

On 1 May 2013 21:04, Winston Chang notifications@github.com wrote:

Oops, it needs the master branch now. Try doing:

devtools::install_github('extrafont', 'wch')

— Reply to this email directly or view it on GitHubhttps://github.com/wch/extrafont/issues/28#issuecomment-17303118 .

wch commented 11 years ago

@gavinsimpson Are you using the latest version from github? I didn't send this to CRAN yet - I think it was fixed shortly after a release and after waiting the requisite month that CRAN wants, I forgot to release it. If the github version works for you, I'll send this version to CRAN.

gavinsimpson commented 11 years ago

And, I take it all back. So sorry for the noise. This is now working as you state.

wch commented 11 years ago

Great, good to hear. It's not noise - you also reminded me that I need to send to CRAN...

gavinsimpson commented 11 years ago

Could you; that'd be great. I'm about to write a post on using extrafont to draw plots using Arial for submission to the journal PLOS One and send them some instructions to update the ones they have for doing this with R. Using extrafont is super easy in comparison, but don't want to send to them if the CRAN version isn't working.

wch commented 11 years ago

OK, sent to CRAN - hopefully it'll go through and show up in the next few days. All this reminds me that I should also try to push through the branch with OTF and TTC handling, which I've been holding off on for over a year because they weren't very nice in the past when I was trying to figure out how the license stuff should work...

gavinsimpson commented 11 years ago

Great, thanks!