EVOLUTION-MANAGER
Edit File: windowsFonts.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: Windows Fonts</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 windowsFonts {grDevices}"><tr><td>windowsFonts {grDevices}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Windows Fonts</h2> <h3>Description</h3> <p>These functions handle the translation of a device-independent R graphics font family name to a windows font description and are available only on Windows. </p> <h3>Usage</h3> <pre> windowsFont(family) windowsFonts(...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>family</code></td> <td> <p>a character vector containing the font family name (<code>"TT"</code> as the first two characters indicates a TrueType font). </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>either character strings naming mappings to display, or new (named) mappings to define.</p> </td></tr> </table> <h3>Details</h3> <p>A windows device is created with a default font (see the documentation for <code>windows</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 something more specific to windows fonts. A list of mappings is maintained and can be modified by the user. </p> <p>The <code>windowsFonts</code> function can be used to list existing mappings and to define new mappings. The <code>windowsFont</code> function can be used to create a new mapping. </p> <p>Default mappings are provided for three device-independent font family names: <code>"sans"</code> for a sans-serif font, <code>"serif"</code> for a serif font and <code>"mono"</code> for a monospaced font. </p> <p>These mappings will only be used if the current font face is 1 (plain), 2 (bold), 3 (italic), or 4 (bolditalic). </p> <h3>See Also</h3> <p><code><a href="windows.html">windows</a></code> </p> <h3>Examples</h3> <pre> if(.Platform$OS.type == "windows") withAutoprint({ windowsFonts() windowsFonts("mono") }) ## Not run: ## set up for Japanese: needs the fonts installed windows() # make sure we have the right device type (available on Windows only) Sys.setlocale("LC_ALL", "ja") windowsFonts(JP1 = windowsFont("MS Mincho"), JP2 = windowsFont("MS Gothic"), JP3 = windowsFont("Arial Unicode MS")) plot(1:10) text(5, 2, "\u{4E10}\u{4E00}\u{4E01}", family = "JP1") text(7, 2, "\u{4E10}\u{4E00}\u{4E01}", family = "JP1", font = 2) text(5, 1.5, "\u{4E10}\u{4E00}\u{4E01}", family = "JP2") text(9, 2, "\u{5100}", family = "JP3") ## End(Not run)</pre> <hr /><div style="text-align: center;">[Package <em>grDevices</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>