Using embeded font
Make a file at
root/data/font.toml
1 2
title_font = "\"Montserrat\", sans-serif" content_font = "\"muli\", sans-serif"
We have 6 embeded font
"\"Montserrat\", sans-serif"
"\"Merriweather\", serif"
"\"muli\", sans-serif"
"\"Courgette\", cursive"
"\"Source Sans Pro\", sans-serif"
"\"League Gothic\", sans-serif"
Using custom css
Add custom css file
1 2 3
... custom_css = ["css/font.css"] ...
config/_default/params.toml
Set the above param and add file to assets/css/font.css
In your font.css file, add font-face something like this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
@font-face { font-family: 'Montserrat'; src: url('../fonts/montserrat-black.woff2') format('woff2'), url('../fonts/montserrat-black.woff') format('woff'); font-weight: 900; font-style: normal; } @font-face { font-family: 'Merriweather'; src: url('../fonts/merriweather-regular.woff2') format('woff2'), url('../fonts/merriweather-regular.woff') format('woff'); font-weight: 400; font-style: normal; }
Add your fonts file at root/static/fonts/myfont.xxx (If your url in step2 is ('../fonts/myfont.xxx')).
Make a font.toml file at root/data/font.toml and make variables as below.
1 2
title_font = "\"Montserrat\", sans-serif" content_font = "\"Merriweather\", serif"
Import google font
Make a file at root/layouts/partials/head/custom-head.html
and then load font style.
|
|