EVOLUTION-MANAGER
Edit File: embedFonts.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: Embed Fonts in PostScript and PDF</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 embedFonts {grDevices}"><tr><td>embedFonts {grDevices}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Embed Fonts in PostScript and PDF</h2> <h3>Description</h3> <p>Runs Ghostscript to process a PDF or PostScript file and embed all fonts in the file. </p> <h3>Usage</h3> <pre> embedFonts(file, format, outfile = file, fontpaths = character(), options = character()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>file</code></td> <td> <p>a character string giving the name of the original file.</p> </td></tr> <tr valign="top"><td><code>format</code></td> <td> <p>the format for the new file (with fonts embedded) given as the name of a ghostscript output device. If not specified, it is guessed from the suffix of <code>file</code>.</p> </td></tr> <tr valign="top"><td><code>outfile</code></td> <td> <p>the name of the new file (with fonts embedded).</p> </td></tr> <tr valign="top"><td><code>fontpaths</code></td> <td> <p>a character vector giving directories that Ghostscript will search for fonts.</p> </td></tr> <tr valign="top"><td><code>options</code></td> <td> <p>a character vector containing further options to Ghostscript.</p> </td></tr> </table> <h3>Details</h3> <p>This function is not necessary if you just use the standard default fonts for PostScript and PDF output. </p> <p>If you use a special font, this function is useful for embedding that font in your PostScript or PDF document so that it can be shared with others without them having to install your special font (provided the font licence allows this). </p> <p>If the special font is not installed for Ghostscript, you will need to tell Ghostscript where the font is, using something like <code>options="-sFONTPATH=path/to/font"</code>. </p> <p>You will need <code>ghostscript</code>: the full path to the executable can be set by the environment variable <span class="env">R_GSCMD</span>. If this is unset, a GhostScript executable will be looked for by name on your path: on a Unix alike <code>"gs"</code> is used, and on Windows the setting of the environment variable <span class="env">GSC</span> is used, otherwise commands <code>"gswi64c.exe"</code> then <code>"gswin32c.exe"</code> are tried. </p> <p>The <code>format</code> is by default <code>"ps2write"</code>, when the original file has a <code>.ps</code> or <code>.eps</code> suffix, or <code>"pdfwrite"</code> when the original file has a <code>.pdf</code> suffix. For versions of Ghostscript before 9.10, <code>format = "pswrite"</code> or <code>format = "epswrite"</code> can be used: as from 9.14 <code>format = "eps2write"</code> is also available. If an invalid device is given, the error message will list the available devices. </p> <p>Note that Ghostscript may do font substitution, so the font embedded may differ from that specified in the original file. </p> <p>Some other options which can be useful (see your Ghostscript documentation) are <span class="option">-dMaxSubsetPct=100</span>, <span class="option">-dSubsetFonts=true</span> and <span class="option">-dEmbedAllFonts=true</span>. </p> <h3>Value</h3> <p>The shell command used to invoke Ghostscript is returned invisibly. This may be useful for debugging purposes as you can run the command by hand in a shell to look for problems. </p> <h3>See Also</h3> <p><code><a href="postscriptFonts.html">postscriptFonts</a></code>, <code><a href="Devices.html">Devices</a></code>. </p> <p>Paul Murrell and Brian Ripley (2006) Non-standard fonts in PostScript and PDF graphics. <em>R News</em>, 6(2):41–47. <a href="https://www.r-project.org/doc/Rnews/Rnews_2006-2.pdf">https://www.r-project.org/doc/Rnews/Rnews_2006-2.pdf</a>. </p> <hr /><div style="text-align: center;">[Package <em>grDevices</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>