I have a problem with typefaces and PDF-Output in R. On this windows machine there is no Helvetica and the Font used by the device seems to be Arial as you can see below.
The simple problem is, that Arial is used (as I want it to be) but editing the PDF-File it says Helvetica is used. How can I get R to write the correct Name into the PDF-file. pdf(...,family="Arial") won’t work, as this family is not known (grDevices version 2.15.1).
Or can I substitude this font in the PDF afterwards, creating a file with the font I want?
R-PDF-Output

Comparision from this Article:Arial vs. Helvetica

You need to set a new font family for use with
pdf(). This requires you to have Adobe Font Metric files (*.afmfiles) for the fonts you wish to use. You can convert the.ttyfiles to.afmones or find.afmfiles for Arial on the interweb if you don’t already have them.where the character vector
metricscontains the paths to the relevant.afmfiles, The files should be specified in this order:The you use the
pdfFonts()function to add a mapping to these new fontswhere
Arialis the object produced byType1Font()earlier.The final step is to use the
familyargument inpdf()which refers to one of the existing families as defined bypdfFonts():I haven’t tried this as I don’t have Arial on my system nor too many
.afmfiles lying around, but I pieced this together from several sources:An alternative depending on how your system is set-up is to a Cairo-based PDF device as that will use the functions of your system to identify and load fonts based simply on their name. See
?cairo_pdfand then the Cairo Fonts section of?X11for details.