[R] win.metafile() and family

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jun 18 16:44:49 CEST 2009


Where did you get the idea that Helvetica was a Windows font family 
name?  (It is a Linotype trademark font name.)  It is rarely seen on 
Windows, so attempts to use it almost always end up with a font 
substitution, often to Arial which is already the default family in 
win.metafile().  That will be equally true for most PDF viewers (but 
Acrobat's substitution will be much less faithful).

See Wikipedia and http://www.ms-studio.com/articles.html for the 
history and differences between Helvetica and Arial. You can (or 
could) buy Helvetica from Adobe for Windows.  (There was a film about 
Helvetica for its 50th anniversary, shown on BBC TV.)

You can only specify font families in a device-specific way, apart 
from the device-independent values of "serif", "sans" and "mono".
So pdf() and the windows() set of devices do it differently, and their 
help pages do point you to the appropriate help.

?win.metafile points you to ?windowsFonts, which has all the details 
(except a list of possible families, since that depends on what you 
have installed under Windows, and the default for that depends on the 
version and language of Windows).  If you have Helvetica installed, 
?windowsFonts tells you (in principle) how to add it as a font family.

On Thu, 18 Jun 2009, Simon Pickett wrote:

> Hi all,
>
> I recently discovered how great win.metafile is for getting high 
> resolution graphics into word.

Be careful: Word has been adept at mangling metafiles on insertion, 
and even more so if you attempt to edit them.

> Having problems with specifying families though...
>
> #pdf works fine
> pdf("test.pdf",width=14,height=9)
> par(family="Helvetica")
> plot(1:10)
> text(4,4,"trial")
> dev.off()
> windows
>      2
>
> #metafile doesnt like helvetica family
> win.metafile("test.wmf",width=14,height=9)
> par(family="Helvetica")
> plot(1:10)
> There were 12 warnings (use warnings() to see them)
> text(4,4,"trial")
> Warning message:
> In text.default(4, 4, "trial") :
>  Font family not found in Windows font database
> dev.off()
> windows
>      2
>
> Trawled through messages on here and read Rdegva but couldnt find 
> the answer. Are there any user friendly windows user guides about 
> all this?
>
> R 2.8.1
> Windows XP 2003
>
> Cheers, Si.
>
> Dr. Simon Pickett
> Research Ecologist
> Land Use Department
> Terrestrial Unit
> British Trust for Ornithology
> The Nunnery
> Thetford
> Norfolk
> IP242PU
> 01842750050
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list