[R] How to load fonts in text3d?

olsen o.o.wolf at qmul.ac.uk
Mon Mar 27 19:09:23 CEST 2017


I'm trying to run the example given in ?text3d as follows:

library(rgl)
open3d()
famnum <- rep(1:4, 8)
family <- c("serif", "sans", "mono", "symbol")[famnum]
font <- rep(rep(1:4, each = 4), 2)
cex <- rep(1:2, each = 16)
text3d(font, cex, famnum, text = paste(family, font), adj = 0.5,
       color = "blue", family = family, font = font, cex = cex)

This results in a couple of warning messages of the following kind:

In rgl.texts(x = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L,  ... :
  font family "serif" not found, using "bitmap"

I would like to use another font instead of bitmap but it seems to
switchback to bitmap whatever argument I give as family e.g. 'family =
"FreeSans"'.
Wonder if this is a bug or I'm doing something wrong.

This is on
R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)
with the following rgl version loaded:
[1] rgl_0.96.0


Thanks in advance for any indications



More information about the R-help mailing list