Jeffrey Horner
2008-Jul-24 20:29 UTC
[R] Should this PDF render correctly without font embedding?
A professor here at Vanderbilt sent me the following code. Each of the text strings should right justify against the center vertical bar, but because of font issues it doesn't. I understand that there are workarounds, but I was just curious if this was consistent across all platforms. On linux with R 2.7.1 and R-trunk (r46103), both acrobat reader 8 and kpdf render it incorrectly. How about Mac or Windows? Is this a platform config issue, or something else? pdf('temp.pdf', width=11, height=8.5) plot(0,0,xlim=c(0,1),ylim=c(0,1),type='n') abline(v=.5) # pos=2 is for right-alignment text(0.5,0.9, 'Yo', pos=2) text(0.5,0.8, 'Yo Yo', pos=2) text(0.5,0.7, 'Yo Yo Yo', pos=2) text(0.5,0.6, 'Yo Yo Yo Yo', pos=2) text(0.5,0.5, 'Yo Yo Yo Yo Yo', pos=2) text(0.5,0.4, 'Yo Yo Yo Yo Yo Yo', pos=2) text(0.5,0.3, 'Yo Yo Yo Yo Yo Yo Yo', pos=2) dev.off() Jeff -- http://biostat.mc.vanderbilt.edu/JeffreyHorner
stephen sefick
2008-Jul-24 20:53 UTC
[R] Should this PDF render correctly without font embedding?
Mac OS X 10.3.5 R 2.7.1 works fine in the quartz window. Screwed up in Preview with the pdf device On Thu, Jul 24, 2008 at 4:29 PM, Jeffrey Horner <jeff.horner@vanderbilt.edu> wrote:> A professor here at Vanderbilt sent me the following code. Each of the text > strings should right justify against the center vertical bar, but because of > font issues it doesn't. I understand that there are workarounds, but I was > just curious if this was consistent across all platforms. On linux with R > 2.7.1 and R-trunk (r46103), both acrobat reader 8 and kpdf render it > incorrectly. How about Mac or Windows? Is this a platform config issue, or > something else? > > pdf('temp.pdf', width=11, height=8.5) > plot(0,0,xlim=c(0,1),ylim=c(0,1),type='n') > abline(v=.5) > # pos=2 is for right-alignment > text(0.5,0.9, 'Yo', pos=2) > text(0.5,0.8, 'Yo Yo', pos=2) > text(0.5,0.7, 'Yo Yo Yo', pos=2) > text(0.5,0.6, 'Yo Yo Yo Yo', pos=2) > text(0.5,0.5, 'Yo Yo Yo Yo Yo', pos=2) > text(0.5,0.4, 'Yo Yo Yo Yo Yo Yo', pos=2) > text(0.5,0.3, 'Yo Yo Yo Yo Yo Yo Yo', pos=2) > dev.off() > > Jeff > -- > http://biostat.mc.vanderbilt.edu/JeffreyHorner > > ______________________________________________ > R-help@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. >-- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis [[alternative HTML version deleted]]
Rolf Turner
2008-Jul-24 21:04 UTC
[R] Should this PDF render correctly without font embedding?
On 25/07/2008, at 8:29 AM, Jeffrey Horner wrote:> A professor here at Vanderbilt sent me the following code. Each of > the text strings should right justify against the center vertical > bar, but because of font issues it doesn't. I understand that there > are workarounds, but I was just curious if this was consistent > across all platforms. On linux with R 2.7.1 and R-trunk (r46103), > both acrobat reader 8 and kpdf render it incorrectly. How about Mac > or Windows? Is this a platform config issue, or something else? > > pdf('temp.pdf', width=11, height=8.5) > plot(0,0,xlim=c(0,1),ylim=c(0,1),type='n') > abline(v=.5) > # pos=2 is for right-alignment > text(0.5,0.9, 'Yo', pos=2) > text(0.5,0.8, 'Yo Yo', pos=2) > text(0.5,0.7, 'Yo Yo Yo', pos=2) > text(0.5,0.6, 'Yo Yo Yo Yo', pos=2) > text(0.5,0.5, 'Yo Yo Yo Yo Yo', pos=2) > text(0.5,0.4, 'Yo Yo Yo Yo Yo Yo', pos=2) > text(0.5,0.3, 'Yo Yo Yo Yo Yo Yo Yo', pos=2) > dev.off()Did a quick check on my Imac --- both Preview and Adobe Reader render the result incorrectly; the text string encroach increasingly upon the vertical line as the number of ``Yo's'' increases. It renders fine on the on- screen X11 device. Session info: > sessionInfo() R version 2.7.1 (2008-06-23) i386-apple-darwin8.10.1 locale: C attached base packages: [1] datasets utils stats graphics grDevices methods base other attached packages: [1] misc_0.0-4 fortunes_1.3-4 MASS_7.2-41 cheers, Rolf Turner ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
(Ted Harding)
2008-Jul-24 21:08 UTC
[R] Should this PDF render correctly without font embedding?
On 24-Jul-08 20:29:09, Jeffrey Horner wrote:> A professor here at Vanderbilt sent me the following code. Each of the > text strings should right justify against the center vertical bar, but > because of font issues it doesn't. I understand that there are > workarounds, but I was just curious if this was consistent across all > platforms. On linux with R 2.7.1 and R-trunk (r46103), both acrobat > reader 8 and kpdf render it incorrectly. How about Mac or Windows? Is > this a platform config issue, or something else? > > pdf('temp.pdf', width=11, height=8.5) > plot(0,0,xlim=c(0,1),ylim=c(0,1),type='n') > abline(v=.5) ># pos=2 is for right-alignment > text(0.5,0.9, 'Yo', pos=2) > text(0.5,0.8, 'Yo Yo', pos=2) > text(0.5,0.7, 'Yo Yo Yo', pos=2) > text(0.5,0.6, 'Yo Yo Yo Yo', pos=2) > text(0.5,0.5, 'Yo Yo Yo Yo Yo', pos=2) > text(0.5,0.4, 'Yo Yo Yo Yo Yo Yo', pos=2) > text(0.5,0.3, 'Yo Yo Yo Yo Yo Yo Yo', pos=2) > dev.off() > > JeffInterestingly (Debian Linux, R 2.7.1), while I get the same as you with acrobat reader and (after printing to file as temp.ps) I also get the same when I view this PostScript file with gnome-gv, if instead I send the plot to the postscript device in the first place, i.e. the first line is postscript('temp.ps', width=11, height=8.5) then when I view this temp.ps in gnome-gv the slignment is perfect! Best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 24-Jul-08 Time: 22:08:56 ------------------------------ XFMail ------------------------------