EVOLUTION-MANAGER
Edit File: postscriptFonts.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: PostScript and PDF Font Families</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for postscriptFonts {grDevices}"><tr><td>postscriptFonts {grDevices}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>PostScript and PDF Font Families</h2> <h3>Description</h3> <p>These functions handle the translation of a <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> graphics font family name to a PostScript or PDF font description, used by the <code><a href="postscript.html">postscript</a></code> or <code><a href="pdf.html">pdf</a></code> graphics devices. </p> <h3>Usage</h3> <pre> postscriptFonts(...) pdfFonts(...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>either character strings naming mappings to display, or named arguments specifying mappings to add or change.</p> </td></tr> </table> <h3>Details</h3> <p>If these functions are called with no argument they list all the existing mappings, whereas if they are called with named arguments they add (or change) mappings. </p> <p>A PostScript or PDF device is created with a default font family (see the documentation for <code><a href="postscript.html">postscript</a></code>), but it is also possible to specify a font family when drawing to the device (for example, see the documentation for <code>"family"</code> in <code><a href="../../graphics/html/par.html">par</a></code> and for <code>"fontfamily"</code> in <code><a href="../../grid/html/gpar.html">gpar</a></code> in the <span class="pkg">grid</span> package). </p> <p>The font family sent to the device is a simple string name, which must be mapped to a set of PostScript fonts. Separate lists of mappings for <code>postscript</code> and <code>pdf</code> devices are maintained for the current <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> session and can be added to by the user. </p> <p>The <code>postscriptFonts</code> and <code>pdfFonts</code> functions can be used to list existing mappings and to define new mappings. The <code><a href="Type1Font.html">Type1Font</a></code> and <code><a href="Type1Font.html">CIDFont</a></code> functions can be used to create new mappings, when the <code>xxxFonts</code> function is used to add them to the database. See the examples. </p> <p>Default mappings are provided for three device-independent family names: <code>"sans"</code> for a sans-serif font (to <code>"Helvetica"</code>), <code>"serif"</code> for a serif font (to <code>"Times"</code>) and <code>"mono"</code> for a monospaced font (to <code>"Courier"</code>). </p> <p>Mappings for a number of standard Adobe fonts (and URW equivalents) are also provided: <code>"AvantGarde"</code>, <code>"Bookman"</code>, <code>"Courier"</code>, <code>"Helvetica"</code>, <code>"Helvetica-Narrow"</code>, <code>"NewCenturySchoolbook"</code>, <code>"Palatino"</code> and <code>"Times"</code>; <code>"URWGothic"</code>, <code>"URWBookman"</code>, <code>"NimbusMon"</code>, <code>"NimbusSan"</code> (synonym <code>"URWHelvetica"</code>), <code>"NimbusSanCond"</code>, <code>"CenturySch"</code>, <code>"URWPalladio"</code> and <code>"NimbusRom"</code> (synonym <code>"URWTimes"</code>). </p> <p>There are also mappings for <code>"ComputerModern"</code>, <code>"ComputerModernItalic"</code> and <code>"ArialMT"</code> (Monotype Arial). </p> <p>Finally, there are some default mappings for East Asian locales described in a separate section. </p> <p>The specification of font metrics and encodings is described in the help for the <code><a href="postscript.html">postscript</a></code> function. </p> <p>The fonts are not embedded in the resulting PostScript or PDF file, so software including the PostScript or PDF plot file should either embed the font outlines (usually from ‘<span class="file">.pfb</span>’ or ‘<span class="file">.pfa</span>’ files) or use DSC comments to instruct the print spooler or including application to do so (see also <code><a href="embedFonts.html">embedFonts</a></code>). </p> <p>A font family has both an <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>-level name, the argument name used when <code>postscriptFonts</code> was called, and an internal name, the <code>family</code> component. These two names are the same for all the pre-defined font families. </p> <p>Once a font family is in use it cannot be changed. ‘In use’ means that it has been specified <em>via</em> a <code>family</code> or <code>fonts</code> argument to an invocation of the same graphics device already in the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> session. (For these purposes <code>xfig</code> counts the same as <code>postscript</code> but only uses some of the predefined mappings.) </p> <h3>Value</h3> <p>A list of one or more font mappings. </p> <h3>East Asian fonts</h3> <p>There are some default mappings for East Asian locales:<br /> <code>"Japan1"</code>, <code>"Japan1HeiMin"</code>, <code>"Japan1GothicBBB"</code>, and <code>"Japan1Ryumin"</code> for Japanese; <code>"Korea1"</code> and <code>"Korea1deb"</code> for Korean; <code>"GB1"</code> (Simplified Chinese) for mainland China and Singapore; <code>"CNS1"</code> (Traditional Chinese) for Hong Kong and Taiwan. </p> <p>These refer to the following fonts </p> <table summary="Rd table"> <tr> <td style="text-align: left;"> Japan1 (PS) </td><td style="text-align: left;"> <code>HeiseiKakuGo-W5</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> Linotype Japanese printer font</td> </tr> <tr> <td style="text-align: left;"> Japan1 (PDF) </td><td style="text-align: left;"> <code>KozMinPro-Regular-Acro</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> from Adobe Reader 7.0 Japanese Font Pack</td> </tr> <tr> <td style="text-align: left;"> Japan1HeiMin (PS) </td><td style="text-align: left;"> <code>HeiseiMin-W3</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> Linotype Japanese printer font</td> </tr> <tr> <td style="text-align: left;"> Japan1HeiMin (PDF) </td><td style="text-align: left;"> <code>HeiseiMin-W3-Acro</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> from Adobe Reader 7.0 Japanese Font Pack</td> </tr> <tr> <td style="text-align: left;"> Japan1GothicBBB </td><td style="text-align: left;"> <code>GothicBBB-Medium</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> Japanese-market PostScript printer font</td> </tr> <tr> <td style="text-align: left;"> Japan1Ryumin </td><td style="text-align: left;"> <code>Ryumin-Light</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> Japanese-market PostScript printer font</td> </tr> <tr> <td style="text-align: left;"> Korea1 (PS) </td><td style="text-align: left;"> <code>Baekmuk-Batang</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> TrueType font found on some Linux systems</td> </tr> <tr> <td style="text-align: left;"> Korea1 (PDF) </td><td style="text-align: left;"> <code>HYSMyeongJoStd-Medium-Acro</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> from Adobe Reader 7.0 Korean Font Pack</td> </tr> <tr> <td style="text-align: left;"> Korea1deb (PS) </td><td style="text-align: left;"> <code>Batang-Regular</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> another name for Baekmuk-Batang</td> </tr> <tr> <td style="text-align: left;"> Korea1deb (PDF) </td><td style="text-align: left;"> <code>HYGothic-Medium-Acro</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> from Adobe Reader 4.0 Korean Font Pack</td> </tr> <tr> <td style="text-align: left;"> GB1 (PS) </td><td style="text-align: left;"> <code>BousungEG-Light-GB</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> TrueType font found on some Linux systems</td> </tr> <tr> <td style="text-align: left;"> GB1 (PDF) </td><td style="text-align: left;"> <code>STSong-Light-Acro</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> from Adobe Reader 7.0 Simplified Chinese Font Pack</td> </tr> <tr> <td style="text-align: left;"> CNS1 (PS) </td><td style="text-align: left;"> <code>MOESung-Regular</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> Ken Lunde's CJKV resources</td> </tr> <tr> <td style="text-align: left;"> CNS1 (PDF) </td><td style="text-align: left;"> <code>MSungStd-Light-Acro</code></td> </tr> <tr> <td style="text-align: left;"> </td><td style="text-align: left;"> from Adobe Reader 7.0 Traditional Chinese Font Pack</td> </tr> <tr> <td style="text-align: left;"> </td> </tr> </table> <p><code>BousungEG-Light-GB</code> can be found at <a href="ftp://ftp.gnu.org/pub/non-gnu/chinese-fonts-truetype/">ftp://ftp.gnu.org/pub/non-gnu/chinese-fonts-truetype/</a>. Ken Lunde's CJKV resources are at <a href="ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/samples/">ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/samples/</a>. These will need to be installed or otherwise made available to the postscript/PDF interpreter such as ghostscript (and not all interpreters can handle TrueType fonts). </p> <p>You may well find that your postscript/PDF interpreters has been set up to provide aliases for many of these fonts. For example, ghostscript on Windows can optionally be installed to map common East Asian fonts names to Windows TrueType fonts. (You may want to add the <code>-Acro</code> versions as well.) </p> <p>Adding a mapping for a CID-keyed font is for gurus only. </p> <h3>Author(s)</h3> <p>Support for Computer Modern fonts is based on a contribution by Brian D'Urso. </p> <h3>See Also</h3> <p><code><a href="postscript.html">postscript</a></code> and <code><a href="pdf.html">pdf</a></code>; <code><a href="Type1Font.html">Type1Font</a></code> and <code><a href="Type1Font.html">CIDFont</a></code> for specifying new font mappings. </p> <h3>Examples</h3> <pre> postscriptFonts() ## This duplicates "ComputerModernItalic". CMitalic <- Type1Font("ComputerModern2", c("CM_regular_10.afm", "CM_boldx_10.afm", "cmti10.afm", "cmbxti10.afm", "CM_symbol_10.afm"), encoding = "TeXtext.enc") postscriptFonts(CMitalic = CMitalic) ## A CID font for Japanese using a different CMap and ## corresponding cmapEncoding. `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()) </pre> <hr /><div style="text-align: center;">[Package <em>grDevices</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>