Trouble with extrafont

Hello! I am trying to use extrafont to load a web font that I have downloaded from Google Fonts. After going through the usual process of using ttf_import to import the files, I can see the font family in the fonttable() output. However, when I try and actually use the font via theme(), it does not appear to work- it's as if it can't see it. From what I was reading, some of the extrafont documentation suggests that there may be another installation/registration step needed for custom TTF fonts, and that it might be specific to the graphics device- but I don't grok enough of how RStudio Cloud does graphics to know if that's something I need to be doing. Here's a link illustrating the issue:

https://rstudio.cloud/project/1217974

Any help would be most appreciated!

Font renderings issues are usually specific to the device, so it'd help if you could clarify what device you'd like to use (as well as a reprex). Note that, in addition to extrafont, you can also use showtext and ragg to render custom fonts. showtext should work with any device, except for the RStudio (<1.4) graphics device, but there's a workaround

Thank you for the reply! And sorry, I should've made it more clear that I am working in RStudio Cloud (things work just fine in RStudio Desktop). The reprex is at the RStudio Cloud link in my post. Is that not the right way to to provide it?

I have been able to use showtext as a workaround, but unfortunately it is not quite enough for my use case. It works by computing the outline for the font and drawing that, but the result is that the final PDF does not actually include the text itself- it's just got the outlines for the glyphs, so it displays on the screen OK, but it is not possible to copy and paste the title, etc. out of the PDF. Ragg produces raster output, and I need vector output.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.