Last data update: 2014.03.03

R: X11 Fonts
X11FontsR Documentation

X11 Fonts


These functions handle the translation of a device-independent R graphics font family name to an X11 font description.






a character string containing an X11 font description.


either character strings naming mappings to display, or new (named) mappings to define.


These functions apply only to an X11 device with type = "Xlib"X11(type = "cairo") uses a different mechanism to select fonts.

Such a device is created with a default font (see the documentation for X11), but it is also possible to specify a font family when drawing to the device (for example, see the documentation for "family" in par and for "fontfamily" in gpar in the grid package).

The font family sent to the device is a simple string name, which must be mapped to something more specific to X11 fonts. A list of mappings is maintained and can be modified by the user.

The X11Fonts function can be used to list existing mappings and to define new mappings. The X11Font function can be used to create a new mapping.

Default mappings are provided for three device-independent font family names: "sans" for a sans-serif font, "serif" for a serif font and "mono" for a monospaced font. Further mappings are provided for "Helvetica" (the device default), "Times", "CyrHelvetica", "CyrTimes" (versions of these fonts with Cyrillic support, at least on Linux), "Arial" (on some platforms including OS X and Solaris) and "Mincho" (a CJK font).

See Also



utopia <- X11Font("-*-utopia-*-*-*-*-*-*-*-*-*-*-*-*")
X11Fonts(utopia = utopia)


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(grDevices)
> png(filename="/home/ddbj/snapshot/RGM3/R_rel/result/grDevices/x11Fonts.Rd_%03d_medium.png", width=480, height=480)
> ### Name: X11Fonts
> ### Title: X11 Fonts
> ### Aliases: X11Font X11Fonts
> ### Keywords: device
> ### ** Examples
> X11Fonts()
[1] "-*-times-%s-%s-*-*-%d-*-*-*-*-*-*-*"

[1] "-*-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*"

[1] "-*-courier-%s-%s-*-*-%d-*-*-*-*-*-*-*"

[1] "-adobe-times-%s-%s-*-*-%d-*-*-*-*-*-*-*"

[1] "-adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*"

[1] "-cronyx-times-%s-%s-*-*-%d-*-*-*-*-*-*-*"

[1] "-cronyx-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*"

[1] "-monotype-arial-%s-%s-*-*-%d-*-*-*-*-*-*-*"

[1] "-*-mincho-%s-%s-*-*-%d-*-*-*-*-*-*-*"

> X11Fonts("mono")
[1] "-*-courier-%s-%s-*-*-%d-*-*-*-*-*-*-*"

> utopia <- X11Font("-*-utopia-*-*-*-*-*-*-*-*-*-*-*-*")
> X11Fonts(utopia = utopia)
null device