wch / extrafont

Tools for using fonts in R graphics
315 stars 48 forks source link

No spaces printed in PDF device #56

Closed lauracespedesarias closed 6 years ago

lauracespedesarias commented 6 years ago

Hello,

First, extrafont is great! Thanks so much for maintaining this package. I am trying to make figures using Myriad Pro. To do so I am using the 'pdf' function and choosing the family "Myriad Pro". I get the PDF with all the text in Myriad Pro as desired but with no spaces between words! I am getting warning messages after every line where I include spaces in the text (In text.default(x + ats/perdeg, y + dy - 0.5 * cxy[2], labs, adj = c(0.4, : font width unknown for character 0x20).

Below is the part of the script used to produce the figure: pdf("H_sampling_V3.pdf", family="Myriad Pro", width=4.527559,height=5.90551) plot(d_leu,col=makeTransparent("green4",alpha=0.3),add=T,border="green4") text(-102,15,"Mexico",cex=0.75) lines(c(-102,-100),c(16,18),col="gray30")

The following is printed in the PDF as 'ElSalvador', with no space

text(-83,18,"El Salvador",cex=0.75) lines(c(-88.5,-88.5+3),c(14,17),col="gray30") maps::map.scale(x=-108,y=-17,relwidth = 0.2,metric=TRUE,ratio = FALSE,cex=0.7) dev.off()

Do you have idea what I could be doing wrong? I also tried using 'embed_fonts' and I got an error saying that the GhostScript was not found. I appreaciate very much any help on this. Thank you in advance.

Best,

Laura

wrmadsen commented 3 years ago

Did you figure out how to solve the GhostScript was not found error message?