Open jimjam-slam opened 4 years ago
I experienced a potentially similar problem with Lato fonts, also a common TTF, in a thesis written in R markdown.
Any included ggplots with had empty labels (no numbers/letters).
Yet, compiling a ggplot with Lato worked well in R studio interface:
When saving the plot with ggsave, the font was not embedded and the graph had empty labels.
However, running embed_fonts("Lato Light Plot.pdf", outfile="Lato Light Plot - embed.pdf")
worked well to embed the fonts afterward.
Just as in the single ggplot graph, my thesis had empty labels.
Yet, executing the embedding command (with the complete compiled thesis) again brought all the labels back, i.e. embed_fonts("thesis.pdf", outfile="thesis_embeded.pdf")
.
(FYI: The error message in the Rmd file was "`Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font width unknown for character 0x20à"
I'm having a recurring problem where I'm able to register and load a TrueType font, but the resulting plot falls back to Arial without any error or warning appearing.
I first had this problem with Montserrat (retrieved from google fonts). The problem persisted for several days, during which I:
extrafontdb
package before re-importing the fonts;Nothing appeared to fix the problem, but when I went back a couple of days later, Montserrat was suddenly working perfectly (unfortunately, I never worked out why Montserrat suddenly started working).
Now I've acquired Gotham Bold and Gotham Black, and I'm having the same problem. There are no warnings or errors; when I
font_import()
andloadfonts()
it appears to register on all devices:Everything looks good in
fonttable()
too. But I've tried test plots with both ggplto2 and base graphics usingpng()
,pdf()
andcairo_pdf()
devices. Montserrat and my HelveticaNeue variants work perfectly, while Gotham Black and Gotham Bold default to Arial silently (note that they are read as separate font families but correctly show an Italic and a non-Italic variant for each):This is with
extrafont
0.17.0.9000 (GitHub:wch/extrafont@227e6e3
) andextrafontdb
(1.0) on R 3.6.0 on Windows 10 1903. (Should I not be using the CRAN version ofextrafontdb
with the dev reelase ofextrafont
?)