Unicode characters not displayed on Mac OS X

I am trying to display Unicode characters in a plot, but they do not appear on Mac OS X 10.10. I use cairo_pdf, as this solution worked well on Fedora 20 OS, but not in this case. I checked that I have the Cairo and Pango ports available on my Mac, so the problem could be due to incorrect font loading in the R session. Any suggestions? Thanks in advance.

cairo_pdf(file='test.pdf') pdfFonts("serif") par(family="serif") plot(1,1, main=expression("\u2600")) dev.off() sessionInfo() R version 3.2.3 (2015-12-10) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.10.5 (Yosemite) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.2.3 
+5
source share

Source: https://habr.com/ru/post/1257658/


All Articles