Rev 86104 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/grDevices/man/windowsFonts.Rd% Part of the R package, https://www.R-project.org% Copyright 1995-2024 R Core Team% Distributed under GPL 2 or later\name{windowsFonts}\title{Windows Fonts}\alias{windowsFont}\alias{windowsFonts}\concept{fonts}\description{These functions handle the translation of a device-independent \Rgraphics font family name to a windows font description and are availableonly on Windows.}\usage{windowsFont(family)windowsFonts(...)}\arguments{\item{family}{a character vector containing the font family name(\code{"TT"} as the first two characters indicates a \I{TrueType} font).}\item{\dots}{either character strings naming mappings to display,or new (named) mappings to define.}}\details{A windows device is created with a default font (seethe documentation for \code{windows}), 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 \pkg{grid} package).The font family sent to the device is a simple string name, which must bemapped to something more specific to windows fonts. A list ofmappings is maintained and can be modified by the user.The \code{windowsFonts} function can be used to list existingmappings and to define new mappings. The \code{windowsFont}function can be used to create a new mapping.Default mappings are provided for three device-independent font familynames: \code{"sans"} for a sans-serif font, \code{"serif"} for a seriffont and \code{"mono"} for a monospaced font.These mappings will only be used if the current font face is1 (plain), 2 (bold), 3 (italic), or 4 (bold italic).}\seealso{\code{\link{windows}}}\examples{\donttest{% but in reg-examples1.Rif(.Platform$OS.type == "windows") withAutoprint({windowsFonts()windowsFonts("mono")})\dontrun{## set up for Japanese: needs the fonts installedwindows() # 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")}}}\keyword{device}