extrafont
extrafont copied to clipboard
No font could be found
I loaded the xkcd
font into the current directory. Following steps:
font_import(".", prompt = F)
loadfonts()
# Registering font with R using pdfFonts(): xkcd
ggplot(data = tg, aes(dose, len)) + geom_point() + theme(text=element_text(size=16, family="xkcd"))
# Error in grid.Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
# polygon edge not found
# In addition: Warning message:
# In grid.Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
# no font could be found for family "xkcd"
fonts()
# [1] "xkcd"
fonttable()
# package afmfile fontfile FullName
#1 NA xkcd.afm.gz /Users/mac/Documents/statinference-course-project/xkcd.ttf xkcd
# FamilyName FontName Bold Italic Symbol afmsymfile
#1 xkcd xkcd FALSE FALSE FALSE NA
What could possibly go wrong?
I have the same issue too! I imported fonts at right path and it shows up when calling fonts(), but it just doesn't render in ggplot... Is there any possible solution?