Register a font as a variant as an existing one
This function is a wrapper around register_font()
that allows you to easily
create variants of existing system fonts, e.g. to target different weights
and/or widths, or for attaching OpenType features to a font.
register_variant( name, family, weight = NULL, width = NULL, features = font_feature() )
name |
The new family name the variant should respond to |
family |
The name of an existing font family that this is a variant of |
weight |
One or two of |
width |
One of |
features |
A |
# Get the default "sans" family sans <- match_font("sans")$path sans <- system_fonts()$family[system_fonts()$path == sans][1] # Register a variant of it: register_variant( "sans_ligature", sans, features = font_feature(ligatures = "discretionary") ) registry_fonts() # clean up clear_registry()
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.