How to enable Arial font for postcript/pdf figure on Windows?
I need to generate some figure using the Arial font as a requirement for
Following their guidelines, I have converted the windows font files
arial.tff files to .afm using tff2afm (exec file from MikTeX), but when I
try to generate a postcript file, the postcript device does not recognize
the .afm files.
The code I use to test the new font is the following:
And I get the warnings:
In postscript(file = "try.ps", horizontal = F, onefile = F, ... :
unknown AFM entity encountered
Is there another way to convert .tff files into .afm on Windows, or any
other way to use Arial in pdf/postcript on Windows?
Re: How to enable Arial font for postcript/pdf figure on Windows?
I converted the Arial font files from ttf to afm using ttf2afm from MikTex complete installation.
When used in R with the line recommended by Plos, they seem to give correct Arial font graphics: I checked by opening the ps file with a viewer (gsview), a text editor (notepad++) and Adobe illustrator.
However I did not try (but hopefully will do soon) the ultimate test: submission to Plos.
Here is a way to do it: (Mind the trick at step 5)
1) Download ttf2afm.exe (available for ex in the install directory of MikTex complete installation)
2) Fetch the arial ttf files in C:\Windows\Fonts
3) Place ttf2afm.exe and the ttf files in a directory (eg C:/ttf2afm/)
4) Open a DOS window (using cmd). Place yourself into the created directory (using cd). Then type
5) Now, if you used ttf2afm.exe from MikTex you should open the created afm files with a text editor (ex Notepad++) and correct the following things:
• Remove the copyright line (or make it start zith comment and get rid of the (c) copyright symbol )
• At the beginning of 4 of the first lines, the variable name is missing, so add it. Eg in arial.afm:
o FontName ArialMT
o FullName Arial
o FamilyName Arial
o Weight Normal
Now you can use these fonts with the postscript function in R with the following line:
postscript(file="try.ps", horizontal=F, onefile=F, width=4, height=4, pointsize=12,
hist( rnorm(100) )