Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find any X11 fonts error

Tags:

path

r

x11

I am starting to get into R development and I was following a tutorial that in a certain point opens the "X11" to display graphics but when that window opens I get the following error:

Error in axis(side = side, at = at, labels = labels, ...) : could not find any X11 fonts Check that the Font Path is correct. In addition: Warning messages: 1: In function (display = "", width, height, pointsize, gamma, bg, : locale not supported by Xlib: some X ops will operate in C locale 2: In function (display = "", width, height, pointsize, gamma, bg, : X cannot set locale modifiers

I have been Googling around but I can't find how to fix the "font path" of this application, does anybody know?

EDIT

The output of sessionInfo():

> sessionInfo()
R version 2.13.2 (2011-09-30)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] C/UTF-8/C/C/C/C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] galgo_1.1         R.oo_1.8.2        R.methodsS3_1.2.1

loaded via a namespace (and not attached):
[1] tools_2.13.2

When doing names(X11Fonts()):

> names(X11Fonts())
[1] "serif" "sans"  "mono" 
> 
like image 513
Tsundoku Avatar asked Jan 10 '12 17:01

Tsundoku


2 Answers

I "followed" the admin manual, and set the lines in the .bashrc Setting for the new UTF-8 terminal support in Lion.

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

From http://www.mail-archive.com/[email protected]/msg01027.html

like image 135
johno Avatar answered Nov 04 '22 18:11

johno


What does this return:

capabilities("X11")

If you are on .Platform$OS.type == "windows" then you may need to do some further research. I doubt that X11 is installed there by default. But your edit shows that you are on a mac so try this:

names(X11Fonts())
# results on my device 
[1] "serif"        "sans"         "mono"         "Times"       
[5] "Helvetica"    "CyrTimes"     "CyrHelvetica" "Arial"       
[9] "Mincho" 

When I execute X11() at the R command console in the Mac-GUI I get an X11 window and choosing X11/About X11' I see that I have "XQuartz 2.1.6 (xorg-server 1.4.2-apple33)". I am using Leopard (still), but I thought that recent version of Macs installed X11 support by default and I don't remember needing to point R in the right direction to find it either.

like image 44
IRTFM Avatar answered Nov 04 '22 16:11

IRTFM