Michael Rennie
2008-Jul-06 21:41 UTC
[R] Issue with postscript figures using WinAnsi encoding
Hi there, I've hit a bump in writing postscript files with special characters in the WinAnsi encoding on a windows machine. Here's some sample code: ########################################### postscript(file = "test.eps", encoding="WinAnsi.enc", width = 3, height = 5.5, onefile = TRUE, horizontal=FALSE, family = "sans", title = "testfig", fonts = "sans") plot(1:5, 1:5, ylab = " \211") dev.off() ############################################# If I then try to open the above file in GSview, it doesn't work and I get all sorts of errors. I initially thought this might be an issue with ghostscript, but then I looked into the .eps file with a text editor, and see this under the encoding: % begin encoding /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /minus /period /slash Does this mean there's an issue in R where it's not able to define certain characters from WinAnsi into postscript characters or something? I'm sort of new to all this, so excuse me if my terminology is inaccurate. If I use pdf() on the above code, I can open a nice .pdf that works nicely. Also, I've successfully generated .eps files without WinAnsi encoding that open happily in GSview. What looks like a potentially related topic in the archives is here: http://tolstoy.newcastle.edu.au/R/e2/help/07/05/17184.html However, I'm not clear on how I might be able to use this info. to help myself. If anyone can provide any assistance, I would be eternally grateful. Oh, and I'm using R 2.4.1. Cheers, Mike -- Michael D. Rennie Ph.D. Candidate University of Toronto at Mississauga 3359 Missisagua Rd. N. Mississauga, ON L5L 1C6 Ph: 905-828-5452 Fax: 905-828-3792 www.utm.utoronto.ca/~w3rennie
Michael Rennie
2008-Jul-06 22:02 UTC
[R] Issue with postscript figures using WinAnsi encoding
Hi there, I've hit a bump in writing postscript files with special characters in the WinAnsi encoding on a windows machine. Here's some sample code: ########################################### postscript(file = "test.eps", encoding="WinAnsi.enc", width = 3, height = 5.5, onefile = TRUE, horizontal=FALSE, family "sans", title = "testfig", fonts = "sans") plot(1:5, 1:5, ylab = " \211") dev.off() ############################################# If I then try to open the above file in GSview, it doesn't work and I get all sorts of errors. I initially thought this might be an issue with ghostscript, but then I looked into the .eps file with a text editor, and see this under the encoding: % begin encoding /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /minus /period /slash Does this mean there's an issue in R where it's not able to define certain characters from WinAnsi into postscript characters or something? I'm sort of new to all this, so excuse me if my terminology is inaccurate. If I use pdf() on the above code, I can open a nice .pdf that works nicely. Also, I've successfully generated .eps files without WinAnsi encoding that open happily in GSview. What looks like a potentially related topic in the archives is here: http://tolstoy.newcastle.edu.au/R/e2/help/07/05/17184.html However, I'm not clear on how I might be able to use this info. to help myself. If anyone can provide any assistance, I would be eternally grateful. Oh, and I'm using R 2.4.1. Cheers, Mike [[alternative HTML version deleted]]
Michael Rennie
2008-Jul-10 13:48 UTC
[R] Issue with postscript figures using WinAnsi encoding
Hi, Just so this doesn't end up being a dead-end post, here's what I figured out: It's a GSview issue- for whatever reason, the version of GSview (4.9) that I am using doesn't recognize WinAnsi encoding. I imagine there is a way to fix this, but I don't care, because specifying an alternative encoding value ("CP1250.enc" works fine) jives nicely with GSview, and I can still get the special characters I was after. I welcome any ghostscript gurus lurking on the list to provide hints on why the WinAnsi encoding isn't recognized in GSview and whether or not there are any workarounds to the problem, but I appear to be working happliy (for now, at least) using East European encoding. Thanks to Paul for some hints on where to start looking for the problem. Mike On Sun, Jul 6, 2008 at 5:41 PM, Michael Rennie <michael.rennie at utoronto.ca> wrote:> > Hi there, > > I've hit a bump in writing postscript files with special characters in the > WinAnsi encoding on a windows machine. > > Here's some sample code: > > ########################################### > postscript(file = "test.eps", encoding="WinAnsi.enc", > width = 3, height = 5.5, onefile = TRUE, horizontal=FALSE, family > "sans", > title = "testfig", fonts = "sans") > > plot(1:5, 1:5, ylab = " \211") > > dev.off() > > ############################################# > > If I then try to open the above file in GSview, it doesn't work and I get > all sorts of errors. > > I initially thought this might be an issue with ghostscript, but then I > looked into the .eps file with a text editor, and see this under the > encoding: > > % begin encoding > /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef > /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef > /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef > /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef > /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright > /parenleft /parenright /asterisk /plus /comma /minus /period /slash > > Does this mean there's an issue in R where it's not able to define certain > characters from WinAnsi into postscript characters or something? I'm sort of > new to all this, so excuse me if my terminology is inaccurate. > > If I use pdf() on the above code, I can open a nice .pdf that works nicely. > Also, I've successfully generated .eps files without WinAnsi encoding that > open happily in GSview. > > What looks like a potentially related topic in the archives is here: > > http://tolstoy.newcastle.edu.au/R/e2/help/07/05/17184.html > > However, I'm not clear on how I might be able to use this info. to help > myself. > > If anyone can provide any assistance, I would be eternally grateful. > > Oh, and I'm using R 2.4.1. > > Cheers, > > Mike > > -- > Michael D. Rennie > Ph.D. Candidate > University of Toronto at Mississauga > 3359 Missisagua Rd. N. Mississauga, ON L5L 1C6 > Ph: 905-828-5452 Fax: 905-828-3792 > www.utm.utoronto.ca/~w3rennie > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- -- Michael D. Rennie Ph.D. Candidate University of Toronto at Mississauga 3359 Missisagua Rd. N. Mississauga, ON L5L 1C6 Ph: 905-828-5452 Fax: 905-828-3792 www.utm.utoronto.ca/~w3rennie