Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_font_features

Get available OpenType features in a font


Description

This is a simply functions that returns the available OpenType feature tags for one or more fonts. See font_feature() for more information on how to use the different feature with a font.

Usage

get_font_features(
  family = "",
  italic = FALSE,
  bold = FALSE,
  path = NULL,
  index = 0
)

Arguments

family

The name of the font family

italic

logicals indicating the font style

bold

logicals indicating the font style

path

path an index of a font file to circumvent lookup based on family and style

index

path an index of a font file to circumvent lookup based on family and style

Value

A list with an element for each of the input fonts containing the supported feature tags for that font.

Examples

# Select a random font on the system
sys_fonts <- systemfonts::system_fonts()
random_font <- sys_fonts$family[sample(nrow(sys_fonts), 1)]

# Get the features
get_font_features(random_font)

textshaping

Bindings to the 'HarfBuzz' and 'Fribidi' Libraries for Text Shaping

v0.3.4
MIT + file LICENSE
Authors
Thomas Lin Pedersen [cre, aut] (<https://orcid.org/0000-0002-5147-4711>), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.