I have added new fonts in <my theme>/web/fonts
, and declared those fonts in <my_theme>/web/css/source/_typography.less
. But still my custom fonts not reflecting in my pages.
I'm missing any configurations? anybody have idea over here?
fontsless-cssmagento2theme
I have added new fonts in <my theme>/web/fonts
, and declared those fonts in <my_theme>/web/css/source/_typography.less
. But still my custom fonts not reflecting in my pages.
I'm missing any configurations? anybody have idea over here?
Best Answer
You can add your custom font in your custom theme, creating the
custom.css
file and include css in thedefault_head_blocks.xml
like the below files:app\design\frontend\Vendor\CustomTheme\Magento_Theme\layout/default_head_blocks.xml
And then put your fonts in the below custom theme directory.
**app\design\frontend\Vendor\CustomTheme\web\fonts**
And include your custom fonts in the
custom.css
code like below:app\design\frontend\Vendor\CustomTheme\web\css/custom.css
After including the fonts, run the
php bin/magento setup:static-content:deploy
command.Hope this help. It's working for me.