Skip to contents

Sets the global font. Note that fonts used in traces and other layout components inherit from the global font.

Usage

go_layout_font(
  arg = NULL,
  ...,
  color = NULL,
  family = NULL,
  lineposition = NULL,
  shadow = NULL,
  size = NULL,
  style = NULL,
  textcase = NULL,
  variant = NULL,
  weight = NULL,
  skip_invalid = FALSE
)

Arguments

arg

Optional named list, or graph object of the same type, to initialise properties from (constructors). Named arguments take precedence.

...

Further properties, including nested properties in "magic underscore" form, e.g. marker_size = 10 for marker = list(size = 10). Property values may be one-sided formulas, evaluated in data for add_*() functions.

color

Color: a CSS color string or R color name.

family

HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available. String.

lineposition

Sets the kind of decoration line(s) with text, such as an "under", "over" or "through" as well as combinations e.g. "under+over", etc. Any combination of "under", "over", "through" joined with "+", or one of "none".

shadow

Sets the shape and color of the shadow behind text. "auto" places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options. String.

size

Number in the interval [1, Inf].

style

Sets whether a font should be styled with a normal or italic face from its family. One of "normal", "italic".

textcase

Sets capitalization of text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. One of "normal", "word caps", "upper", "lower".

variant

Sets the variant of the font. One of "normal", "small-caps", "all-small-caps", "all-petite-caps", "petite-caps", "unicase".

weight

Sets the weight (or boldness) of the font. Integer in the interval [1, 1000].

skip_invalid

If TRUE, silently drop invalid properties instead of raising an error.

Value

Each go_*() function returns a graph object of the same class as its name; add_*() functions return the modified figure.

Details

go_layout_font() create validated graph objects (named lists). Every property is checked against the plotly.js schema when an object is created or modified (see plotly_obj-modify()).

See also