Carsten Oppitz
Carsten Oppitz

Reputation: 132

rgl does not find font family

I face a strange issue with R and package rgl on my Desktop Ubuntu 14.04. While on my laptop with Ubuntu 12.04

title3d(xlab="Mean Market 1", pos=c(1,0,0), col="black",adj=c(0.8,0.8),
        family="Times", cex=1.1)

works perfectly, I get a warning message

font family "Times" not found, using "bitmap"

on my desktop pc. Plotting works, but titles are pretty small. If I check

names(X11Fonts())
# [1] "serif"        "sans"         "mono"         "Times"        "Helvetica"    
# [6] "CyrTimes"     "CyrHelvetica" "Arial"        "Mincho"`

but none works. I installed freetype2 package, reinstalled rgl package but the warning is still there. I tried sans font etc., as well.

Upvotes: 2

Views: 1358

Answers (2)

Abraracurcix
Abraracurcix

Reputation: 11

Carsten Oppitz,

I experienced the same issues that you mention above in my computer with Ubuntu 14.04. After searching for fixing them for a long time and nothing worked, the instructions below, copied from http://www.smnd.sk/kotanyi/index.php?page=rgl, did work perfectly:

a) Terminal, check that you have GNU version >= 3.80:

make -v

b) Download FreeType from: https://sourceforge.net/projects/freetype/files/ e.g. latest version.

c) Extract the downloaded file, enter in the directory where it is saved and type in:

./configure

make

sudo make install

d) Still need to rebuild rgl in R: download its source code from the link appearing in the first link above; without extracting the file, type in:

R CMD INSTALL name_of_archive.tar.gz

e) Enjoy any text size (that R supports) in plot3d objects.

Upvotes: 1

user2554330
user2554330

Reputation: 44977

You can only really count on "serif", "sans", "mono" and "symbol", unless you've used rglFonts to install additional Freetype font files. So "Times" should be "serif".

Upvotes: 0

Related Questions