unicode in ggplot pdf output if Cairo is broken

Multi tool use


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/)
It could be - I had a hard time parsing the error messages, to be honest
– D Swingley
yesterday
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)
I'll try it; at this point I'm not sure even the tar worked: sudo tar fvxz cairo-1.14.2-darwin.13-x86_64.tar.gz -C / x usr/: Can't set user=0/group=0 for usrCan't update time for usr x usr/local/: Can't set user=0/group=0 for usr/local x usr/local/bin/ [....] but I'll study this shortly
– D Swingley
yesterday
I might be the wrong one for this question. Stuck at OSX 10.11.6 (15G21013) due to hardware. Perhaps the interim Apple security updates are preventing writing to certain system locations? I did notice that
../X11/..
was the location of one of the problem files so would try reinstalling the most recent version of XQuartz.– 42-
yesterday
../X11/..
the research.att link seems to be 2015 software anyway, which makes me a bit suspicious that replacing whatever Cairo I've got with what's there would help; what I have in /usr/local/share is of that vintage. I did try loading the cairo library again within Rstudio and it failed in the same way.
– D Swingley
yesterday
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