5

I want to generate R-Diagrams using a special font, namely Cormorant-Garamond-Light (Cormorant-Light is also possible). The problem is that it works with every other font, but with this one, all spaces are just ignored.

library(ggplot2)
library(extrafont)
data = data.frame(read.table(file="PATH/TO/FILE"))
p = ggplot(data = data, aes(x = data[1], y = data[2]))
p = p + xlab("Time t/s")
p = p + ylab("Temperature T/°C")
p = p + theme(text = element_text(family = "Cormorant Garamond Light"))

After compiling, there is a warning which contains the following:

1: In grid.Call(L_textBounds, as.graphicsAnnot(x$label), ... : font width unknown for character 0x20

The resulting pdf-file looks as follows (the code is shortened to make it faster to read) compiled pdf of the code above

Thanks for potential help!

Alexander Schoch
  • 255
  • 2
  • 11
  • did you end up finding a solution for your problem? I ran into a similar issue and just posted a SO question. Any help is greatly appreciated! https://stackoverflow.com/questions/62067139/warning-in-grid-callc-textbounds-as-graphicsannotxlabel-xx-xy-font-w – mavericks May 28 '20 at 14:27

0 Answers0