Mark Van De Vyver
2004-Mar-15 05:41 UTC
[R] Correct Computer Modern font in postscript(..) output
Hi, I'm trying to get the correct font used when generating italic text in an R grahic. I have a set of labels that print correctly except it seems the italic text is justr a slanted version of the TeX computer modern normal font... I'm using R v1.8.1 on Windows XP, and I get the same result if I build the pdf using Adobe Acrobat or using MikTeX The labels: grpNames<-c(expression(paste("lo ", italic(d[n]))), expression(italic(d[n])), expression(paste("hi ", italic(d[n]))), expression(paste("lo ", italic(LM[1]))), expression(italic(LM[1])), expression(paste("hi ", italic(LM[1]))), expression(italic(d[n])), expression(italic(LM[1])), expression(italic(LM[2]))) The postscript command: postscript(file = "Rplots.ps", onefile = F, height=6,width=10, paper="a4", family="ComputerModern",bg="transparent", horizontal=F, pointsize=10, print.it=F) Is this the best currently available, or is there some way to get the correct font used when using italics? TIA Mark
Prof Brian Ripley
2004-Mar-15 08:11 UTC
[R] Correct Computer Modern font in postscript(..) output
family="ComputerModern" gives you CMSL10, which is the `correct font'.>From src/main/devPS.c:/* Computer Modern as recoded by Brian D'Urso */ { "ComputerModern", {"CM_regular_10.afm", "CM_boldx_10.afm", "CM_italic_10.afm", "CM_boldx_italic_10.afm", "CM_symbol_10.afm"} }, and CM_italic_10.afm specifies CMSL10: there is no italic font in standard Computer Modern, and the `correct font' is the one the designer intended. What did you think the `correct font' was? Please do read the posting guide and its references, and try to write more informative (and less accusatory) messages. On Mon, 15 Mar 2004, Mark Van De Vyver wrote:> Hi, > I'm trying to get the correct font used when generating italic text in an R > grahic. I have a set of labels that print correctly except it seems the > italic text is justr a slanted version of the TeX computer modern normal > font... I'm using R v1.8.1 on Windows XP, and I get the same result if I > build the pdf using Adobe Acrobat or using MikTeX > > The labels: > > grpNames<-c(expression(paste("lo ", italic(d[n]))), > expression(italic(d[n])), expression(paste("hi ", italic(d[n]))), > expression(paste("lo ", italic(LM[1]))), > expression(italic(LM[1])), expression(paste("hi ", italic(LM[1]))), > expression(italic(d[n])), expression(italic(LM[1])), > expression(italic(LM[2]))) > > The postscript command: > > postscript(file = "Rplots.ps", > onefile = F, height=6,width=10, > paper="a4", family="ComputerModern",bg="transparent", > horizontal=F, pointsize=10, > print.it=F) > > Is this the best currently available, or is there some way to get the > correct font used when using italics?Well, that is `building' a postscript file, not PDF: if you want PDF you should be using pdf(). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595