I have had some fun in the last few days trying to put together an annotated map of China with R and some public GIS data: http://sourceforge.net/projects/outmodedbonsai/files/snpMatrix%20next/1.17.7.11/China_Choropleth_Maps.pdf/download It is done, and rather nice... there are a few issues: - the default pdf() device cannot do CJK with embedded fonts - and cairo_pdf() is not hooked up to Sweave yet. I have had a quick look, and it does not look too complicated, other than the fact that cairo_pdf() is mutually exclusive with pdf(); and the jpeg/png are new to 2.13 so it is probably just nobody has gotten round to it. (and cairo_pdf() also behaves differently with the onefile option). I guess I am almost saying I might get my hand dirty or help somebody else who wants to. So it is probably best to start some discussion. - Some of the ghostscript/CID font instructions in pdf() are a bit bizarre... - An earlier version of the above map does not work well with part of ghostscript (http://bugs.ghostscript.com/show_bug.cgi?id=692620). So that limits to some extent post-processing of cairo_pdf() output.
Sweave, cairo_pdf, CJK, ghostscript
4 messages · Duncan Murdoch, Brian Ripley, Hin-Tak Leung
On 11-10-21 8:57 PM, Hin-Tak Leung wrote:
I have had some fun in the last few days trying to put together an annotated map of China with R and some public GIS data: http://sourceforge.net/projects/outmodedbonsai/files/snpMatrix%20next/1.17.7.11/China_Choropleth_Maps.pdf/download It is done, and rather nice... there are a few issues: - the default pdf() device cannot do CJK with embedded fonts - and cairo_pdf() is not hooked up to Sweave yet. I have had a quick look, and it does not look too complicated, other than the fact that cairo_pdf() is mutually exclusive with pdf(); and the jpeg/png are new to 2.13 so it is probably just nobody has gotten round to it. (and cairo_pdf() also behaves differently with the onefile option). I guess I am almost saying I might get my hand dirty or help somebody else who wants to. So it is probably best to start some discussion.
It is not hard to write your own device functions, especially in 2.14.0. See rgl::rgl.Sweave for an example. Duncan Murdoch
- Some of the ghostscript/CID font instructions in pdf() are a bit bizarre... - An earlier version of the above map does not work well with part of ghostscript (http://bugs.ghostscript.com/show_bug.cgi?id=692620). So that limits to some extent post-processing of cairo_pdf() output.
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
On Sat, 22 Oct 2011, Duncan Murdoch wrote:
On 11-10-21 8:57 PM, Hin-Tak Leung wrote:
I have had some fun in the last few days trying to put together an annotated map of China with R and some public GIS data: http://sourceforge.net/projects/outmodedbonsai/files/snpMatrix%20next/1.17.7.11/China_Choropleth_Maps.pdf/download It is done, and rather nice... there are a few issues: - the default pdf() device cannot do CJK with embedded fonts - and cairo_pdf() is not hooked up to Sweave yet. I have had a quick look, and it does not look too complicated, other than the fact that cairo_pdf() is mutually exclusive with pdf(); and the jpeg/png are new to 2.13 so it is probably just nobody has gotten round to it. (and cairo_pdf() also behaves differently with the onefile option). I guess I am almost saying I might get my hand dirty or help somebody else who wants to. So it is probably best to start some discussion.
It is not hard to write your own device functions, especially in 2.14.0. See rgl::rgl.Sweave for an example.
And guess what the example in the Sweave manual uses? cairo_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
1 day later
--- On Sat, 22/10/11, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
On Sat, 22 Oct 2011, Duncan Murdoch wrote:
On 11-10-21 8:57 PM, Hin-Tak Leung wrote:
I have had some fun in the last few days trying to
put together an annotated map of China with R and some public GIS data:
http://sourceforge.net/projects/outmodedbonsai/files/snpMatrix%20next/1.17.7.11/China_Choropleth_Maps.pdf/download It is done, and rather nice... there are a few
issues:
- the default pdf() device cannot do CJK with
embedded fonts - and cairo_pdf() is not hooked up to Sweave yet. I have had a quick look, and it does not look too complicated, other than the fact that cairo_pdf() is mutually exclusive with pdf(); and the jpeg/png are new to 2.13 so it is probably just nobody has gotten round to it. (and cairo_pdf() also behaves differently with the onefile option). I guess I am almost saying I might get my hand dirty or help somebody else who wants to. So it is probably best to start some discussion.
It is not hard to write your own device functions,
especially in 2.14.0.? See rgl::rgl.Sweave for an example. And guess what the example in the Sweave manual uses?? cairo_pdf() ...
I don't want a new device - I just wanted cairo_pdf() to be hooked up to Sweave as an alternative to the default pdf(). See my later post with the patch against R trunk and the worked examples. It looks like cairo_pdf() is just using my current fontconfig settings.