On 20 October 2017 at 04:21, John <miao...@gmail.com> wrote:
>
> Hi,
>
>    Following Paul's instruction, I have installed the Cairo. I tried to
run
> the program, and there is no error message at all. I did see the Chinese
> title in the plot if I ask my RStudio to show the plot (if I type "p1"),
> but the pdf file shows the plots without the Chinese titles.


[...]

>
> cairo_pdf("test_plot_chinese.pdf")
> print(m2)
> dev.off()
>

The help page for cairo_pdf says: "
‘cairo_pdf’ and ‘cairo_ps’ sometimes record _bitmaps_ and not vector
graphics.  On the other hand, they can (on suitable platforms) include a
much
     wider range of UTF-8 glyphs, and embed the fonts used.
"
I am not sure what sometimes means but maybe the fonts are not embedded in
the pdf-file?

try:
embed_fonts('test_plot_chinese.pdf')

note that it might fails if you haven't installed gs (ghostscript)


Regards
Martin

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to