Learn R Programming

systemfonts (version 1.1.0)

as_font_weight: Convert weight and width to numerics

Description

It is often more natural to describe font weight and width with names rather than numbers (e.g. "bold" or "condensed"), but underneath these names are matched to numeric values. These two functions are used to retrieve the numeric counterparts to names

Usage

as_font_weight(weight)

as_font_width(width)

Value

An integer vector matching the length of the input

Arguments

weight, width

character vectors with valid names for weight or width

Examples

Run this code
as_font_weight(
  c("undefined", "thin", "ultralight", "light", "normal", "medium", "semibold", 
    "bold", "ultrabold", "heavy")
)

as_font_width(
  c("undefined", "ultracondensed", "extracondensed", "condensed", "semicondensed", 
  "normal", "semiexpanded", "expanded", "extraexpanded", "ultraexpanded")
)

Run the code above in your browser using DataLab