Rev 36085 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{postscriptFonts}\alias{postscriptFonts}\alias{pdfFonts}\concept{fonts}\concept{encoding}\title{PostScript and PDF Font Families}\description{These functions handle the translation of a \R graphicsfont family name to a PostScript or PDF font description, used by the\code{\link{postscript}} or \code{\link{pdf}} graphics devices.}\usage{postscriptFonts(...)pdfFonts(...)}\arguments{\item{\dots}{either character strings naming mappings to display,or new (named) mappings to define.}}\details{If these functions are called with no argument they list the existingmappings, whereas if they are called with named arguments they addmappings.A PostScript or PDF device is created with a default font family (see thedocumentation for \code{\link{postscript}}), but it is also possibleto specify a font family when drawing to the device (for example, seethe documentation for \code{"family"} in \code{\link{par}} and for\code{"fontfamily"} in \code{\link{gpar}} in the grid package).The font family sent to the device is a simple string name, which must bemapped to a set of PostScript fonts. Separate lists of mappings for\code{postscript} and \code{pdf} devices are maintained for thecurrent \R session and can be added to by the user.The \code{postscriptFonts} and \code{pdfFonts} functions can be usedto list existing mappings and to define new mappings. The\code{\link{Type1Font}} and \code{\link{CIDFont}} functions can beused to create new mappings, when the \code{xxxFonts} function is usedto add them to the database. See the examples.Default mappings are provided for four device-independent familynames: \code{"sans"} for a sans-serif font, \code{"serif"} for a seriffont, \code{"mono"} for a monospaced font, and \code{"symbol"} for asymbol font.Mappings for a number of standard Adobe fonts (and URW equivalents)are also provided: \code{"AvantGarde"},\code{"Bookman"}, \code{"Courier"}, \code{"Helvetica"},\code{"Helvetica-Narrow"}, \code{"NewCenturySchoolbook"},\code{"Palatino"} and \code{"Times"};\code{"URWGothic"}, \code{"URWBookman"}, \code{"NimbusMon"},\code{"NimbusSan"} (synonym \code{"URWHelvetica"}),\code{"NimbusSanCond"}, \code{"CenturySch"}, \code{"URWPalladio"} and\code{"NimbusRom"} (synonym \code{"URWTimes"}).There are also mappings for \code{"ComputerModern"} and\code{"ComputerModernItalic"}.Finally, there are some default mappings for East Asian locales:\code{"Japan1"}, \code{"Japan1HeiMin"}, \code{"Japan1GothicBBB"},and \code{"Japan1Ryumin"} for Japanese;\code{"Korea1"} and \code{"Korea1deb"} for Korean;\code{"GB1"} (Simplified Chinese) for China and Singapore;\code{"CNS1"} (Traditional Chinese) for Hong Kong and Taiwan.The specification of font metrics and encodings is described in the helpfor the \code{\link{postscript}} function.The fonts are not embedded in the resulting PostScript or PDF file, sosoftware including the PostScript or PDF plot file should either embedthe font outlines (usually from \file{.pfb} or \file{.pfa} files) oruse DSC comments to instruct the print spooler to do so.}\value{One or more font mappings.}\seealso{\code{\link{postscript}} and \code{\link{pdf}}; \code{\link{Type1Font}}and \code{\link{CIDFont}} for specifying new font mappings.}\author{Support for Computer Modern fonts is based on a contribution byBrian D'Urso \email{durso@hussle.harvard.edu}.}\examples{postscriptFonts()## This duplicates "ComputerModernItalic".CMitalic <- Type1Font("ComputerModern",c("CM_regular_10.afm", "CM_boldx_10.afm","cmti10.afm", "cmbxti10.afm","CM_symbol_10.afm"),encoding = "TeXtext.enc")postscriptFonts(CMitalic = CMitalic)`Jp_UCS-2` <- CIDFont("TestUCS2",c("Adobe-Japan1-UniJIS-UCS2-H.afm","Adobe-Japan1-UniJIS-UCS2-H.afm","Adobe-Japan1-UniJIS-UCS2-H.afm","Adobe-Japan1-UniJIS-UCS2-H.afm"),"UniJIS-UCS2-H", "UCS-2")pdfFonts(`Jp_UCS-2` = `Jp_UCS-2`)names(pdfFonts())}\keyword{device}