as_font_weight: Convert weight and width to numerics

View source: R/match_fonts.R

as_font_weightR Documentation

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)

Arguments

weight, width

character vectors with valid names for weight or width

Value

An integer vector matching the length of the input

Examples

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")
)


systemfonts documentation built on May 29, 2024, 9:20 a.m.