Fonts and font families#
A font family is a collection of faces that appear in different font weight and styles:
You can add faces to the font family:
where the font source is:
and the weight is a number between 100 and 900 or a predefined name
FontWeight900 and the style is
You can retrieve a font source with
which will give you the closest match.
Converting font weight and style from string#
To get a font weight or a font style from a string you can use these two functions:
The inherited value for the font weight is used when the string is “bolder”.