Graphics Reference
In-Depth Information
On top of this, PDF files have their own quirks when it comes to fonts. The PDF specification has
14 “core” fonts. These are fonts that every PDF renderer has, and they include standards such
as Times, Helvetica, and Courier. If you create a PDF with these fonts, any PDF renderer should
display it properly.
If you want to use a font that is notone of these core fonts, though, there's no guarantee that the
PDF renderer on a given device will have that font, so you can't be sure that the font will display
properly on another computer or printer. To solve this problem, non-core fonts can be embedded
into the PDF; in other words, the PDF file can itself contain a copy of the font you want to use.
If you are putting multiple PDF figures in a PDF document, you may want to embed the fonts in
the finished document instead of in each figure. This will make the final document smaller, since
it will only have the font embedded once, instead of once for each figure.
Embedding fonts with R can be a tricky process, but the extrafont package handles many of
the ugly details for you.
NOTE
As of this writing, extrafont will only import TrueType (.ttf) fonts, but it may support other common
formats, such as OpenType (.otf), in the future.
See Also
For more on controlling text appearance, see Changing the Appearance of Text .
Using Fonts in Windows Bitmap or Screen Output
Problem
You are using Windows and want to use fonts other than the basic ones provided by R for bitmap
or screen output.
Solution
The extrafont package can be used to create bitmap or screen output. The procedure is similar
to using extrafont with PDF files ( Using Fonts in PDF Files ). The one-time setup is almost the
same, except that Ghostscript is not required:
install.packages( "extrafont" )
library(extrafont)
Search WWH ::




Custom Search