Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Setting variable fonts is easy enough as using normal fonts. Set up font-family, src, font-weight range, and font-stretch range, and you are good to go.

Setup

  1. Download the font file and extract under simplytheme/src/fonts/

  2. Include the style file in simplytheme.libraries.yml under fonts: css: theme: src/fonts/yourfont/style.css: {}

  3. To serve Google fonts locally, there’s no css file provided by default. Use this tool to generate the css file to save some effort. https://gwfh.mranftl.com/fonts

  4. Make sure the font css file does have the font-weight range and font-stretch range defined.

Without defining the font-weight and font-stretch will produce issues for browser font weight rendering. Suggested font-weight range is: 100 1000; and font-stretch: 75% 100%; as default.

...