You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Restarted my R session,
Removed and re-installed the extrafontdb package before re-importing the fonts;
Restarted my computer; and
Inspected the font table and warnings.
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() and loadfonts() it appears to register on all devices:
font_import(system.file('assets', 'fonts', package='climatecomms'), prompt=FALSE)
# Scanning ttf files in C:/Users/rensa/Code/climate-comms/inst/assets/fonts ...# Extracting .afm files from .ttf files...# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\Gotham-Black.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/Gotham-Black# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\Gotham-BlackItalic.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/Gotham-BlackItalic# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\Gotham-Bold.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/Gotham-Bold# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\Gotham-BoldItalic.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/Gotham-BoldItalic# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\helvetica-neue-ltpro-bdcn.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/helvetica-neue-ltpro-bdcn# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\helvetica-neue-ltpro-ltcn.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/helvetica-neue-ltpro-ltcn# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\Montserrat-Bold.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/Montserrat-Bold# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\Montserrat-BoldItalic.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/Montserrat-BoldItalic# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\Montserrat-Regular.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/Montserrat-Regular# C:\Users\rensa\Code\climate-comms\inst\assets\fonts\Montserrat-RegularItalic.ttf => C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics/Montserrat-RegularItalic# Found FontName for 10 fonts.# Scanning afm files in C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/metrics# Writing font table in C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/fontmap/fonttable.csv# Writing Fontmap to C:/Users/rensa/Documents/R/win-library/3.6/extrafontdb/fontmap/Fontmap...
loadfonts()
# Registering font with R using windowsFonts(): Gotham Black# Registering font with R using windowsFonts(): Gotham Bold# Registering font with R using windowsFonts(): HelveticaNeueLT Pro 57 Cn# Registering font with R using windowsFonts(): HelveticaNeueLT Pro 47 LtCn# Registering font with R using windowsFonts(): Montserrat# Registering font with R using pdfFont(): Gotham Black# Registering font with R using pdfFont(): Gotham Bold# Registering font with R using pdfFont(): HelveticaNeueLT Pro 47 LtCn# No regular (non-bold, non-italic) version of HelveticaNeueLT Pro 57 Cn. Skipping setup for this font.# Registering font with R using pdfFont(): Montserrat# Registering font with R using postscriptFont(): Gotham Black# Registering font with R using postscriptFont(): Gotham Bold# Registering font with R using postscriptFont(): HelveticaNeueLT Pro 47 LtCn# No regular (non-bold, non-italic) version of HelveticaNeueLT Pro 57 Cn. Skipping setup for this font.# Registering font with R using postscriptFont(): Montserrat
fonts()
# [1] "Gotham Black" "Gotham Bold" "HelveticaNeueLT Pro 57 Cn" "HelveticaNeueLT Pro 47 LtCn"
[5] "Montserrat"
Everything looks good in fonttable() too. But I've tried test plots with both ggplto2 and base graphics using png(), pdf() and cairo_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) and extrafontdb (1.0) on R 3.6.0 on Windows 10 1903. (Should I not be using the CRAN version of extrafontdb with the dev reelase of extrafont?)
The text was updated successfully, but these errors were encountered:
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
?)The text was updated successfully, but these errors were encountered: