![Creative The name of the picture]()

Clash Royale CLAN TAG#URR8PPP
unicode in ggplot pdf output if Cairo is broken
I have been using cairo_pdf(...)
to ggplot pdf's that contain unicode for phonetic (IPA) characters (like "u025B"). This worked great until today when I updated RStudio to 1.1.456 and R to 3.5.1 (running on OS X 10.13.5). Now, when I call cairo_pdf(...)
I get a message saying "failed to load cairo DLL". I have done install.packages("Cairo")
and now library("Cairo") spits out a series of messages:
cairo_pdf(...)
cairo_pdf(...)
install.packages("Cairo")
Error: package or namespace load failed for ‘Cairo’:
.onLoad failed in loadNamespace() for 'Cairo', details:
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Cairo/libs/Cairo.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Cairo/libs/Cairo.so
Reason: Incompatible library version: Cairo.so requires version 19.0.0 or later, but libfreetype.6.dylib provides version 17.0.0
I'm not sure whether I should try to work out what has changed in Cairo or R, or learn a different way to put unicode characters in plots. I did try .png outputs but the quality was inadequate.
tx
SystemRequirements: cairo (>= 1.2 http://www.cairographics.org/)
1 Answer
1
The most recent version of the system cairo
package in the Mac http://r.research.att.com/libs/
directory is: http://r.research.att.com/libs/cairo-1.14.2-darwin.13-x86_64.tar.gz
cairo
http://r.research.att.com/libs/
You might get some information and possibly even some success with the suggested method at the bottom the the libs page. Open Terminal.app and paste these two lines (all of them) into the Unix console:
curl -O http://r.research.att.com/libs/cairo-1.14.2-darwin.13-x86_64.tar.gz
sudo tar fvxz gmp-4.2.4-darwin8-bin4.tar.gz -C /
I edited your tags since the other possibility of a system issue is whether Rstudio honors or recognizes the location of the cairo
lib.
cairo
On my Rstudio installation it seems to. I was able to load, update, run: detach("package:Cairo", unload=TRUE)
, and reload the (R) Cairo package from the R console. But I'm not a particularly knowledgeable user of Rstudio. I'm still using the CRAN distributed R.app.
detach("package:Cairo", unload=TRUE)
../X11/..
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
So this appears to be a question of "how to install an updated freetype library?" If you look at the DESCRIPTION file, you see:
SystemRequirements: cairo (>= 1.2 http://www.cairographics.org/)
– 42-
yesterday