R - no spaces printed when using fonts (extrafont)

会有一股神秘感。 提交于 2019-12-22 09:39:49

问题


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!

来源:https://stackoverflow.com/questions/47035667/r-no-spaces-printed-when-using-fonts-extrafont

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!