In RGui, I'm running the following bit of code: windowsFonts(A=windowsFont("Times New Roman")) plot(0,0, ylab='y axis', xlab='x axis',main='title',family="A") The labels and title appear in Times New Roman font. So far, so good. However, when I right click the figure and select 'Save as postscript...', I get a .eps file of the plot, but without the font formatting that I applied. Is there any way to apply the formatting so that it gets saved? [[alternative HTML version deleted]]
> On Jun 23, 2016, at 10:15 AM, A A via R-help <r-help at r-project.org> wrote: > > In RGui, I'm running the following bit of code: > windowsFonts(A=windowsFont("Times New Roman")) > plot(0,0, ylab='y axis', xlab='x axis',main='title',family="A") > The labels and title appear in Times New Roman font. So far, so good. However, when I right click the figure and select 'Save as postscript...', I get a .eps file of the plot, but without the font formatting that I applied. Is there any way to apply the formatting so that it gets saved?I'm now a Windows user but I expect that the windowsFonts function is setting the fonts for the interactive graphics device rather than the postscript device. You should try reviewing: ?postscriptFonts ?postscript # if you want to control the device settings> > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.David Winsemius Alameda, CA, USA
Not that I am an expert, but you should probably be using the direct approach rather than pointing and clicking. ?postscript ?cairo_ps -- Sent from my phone. Please excuse my brevity. On June 23, 2016 10:15:15 AM PDT, A A via R-help <r-help at r-project.org> wrote:>In RGui, I'm running the following bit of code: >windowsFonts(A=windowsFont("Times New Roman")) >plot(0,0, ylab='y axis', xlab='x axis',main='title',family="A") >The labels and title appear in Times New Roman font. So far, so good. >However, when I right click the figure and select 'Save as >postscript...', I get a .eps file of the plot, but without the font >formatting that I applied. Is there any way to apply the formatting so >that it gets saved? > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >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.
You may want to use the showtext package that converts fonts into curves in your graph. Below is the sample code: library(showtext) ## Load Times New Roman fonts on Windows font.add("times", regular = "times.ttf", bold = "timesbd.ttf") showtext.auto() setEPS() postscript("test.eps") par(family = "times") plot(rnorm(100), main = "Test Font") dev.off() Best, Yixuan 2016-06-23 13:15 GMT-04:00 A A via R-help <r-help at r-project.org>:> In RGui, I'm running the following bit of code: > windowsFonts(A=windowsFont("Times New Roman")) > plot(0,0, ylab='y axis', xlab='x axis',main='title',family="A") > The labels and title appear in Times New Roman font. So far, so good. However, when I right click the figure and select 'Save as postscript...', I get a .eps file of the plot, but without the font formatting that I applied. Is there any way to apply the formatting so that it gets saved? > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.-- Yixuan Qiu <yixuan.qiu at cos.name> Department of Statistics, Purdue University