I am building a module with Magento 2. I need to add custom font. All I did is to create a
Module/NameSpace/view/frontend/web/css/source/_typography.less
.lib-font-face(
@family-name:'circular’,
@font-path: ‘@{baseDir}fonts/lineto-circular-pro-medium’,
@font-weight: @font-light
);
.lib-font-face(
@family-name:'circular’,
@font-path: ‘@{baseDir}fonts/lineto-circular-pro-book’,
@font-weight: @font-normal
);
.lib-font-face(
@family-name:'circular’,
@font-path: ‘@{baseDir}fonts/lineto-circular-pro-bold’,
@font-weight: @font-bold
);
I also added my fonts to Module/NameSpace/view/frontend/web/fonts
However, the fonts don't show up or load. Do you know why? Thanks
1 Answer 1
Add you module Vendor_ModuleName in @font-path
.lib-font-face(
@family-name:'circular’,
@font-path: ‘@{baseDir}Vendor_ModuleName/fonts/lineto-circular-pro-medium’,
@font-weight: @font-light
);
answered Dec 26, 2020 at 14:40
Altravista
9311 gold badge11 silver badges32 bronze badges
-
Any help custom font magento.stackexchange.com/q/328534/57334 thanks.zus– zus2021年01月04日 13:14:07 +00:00Commented Jan 4, 2021 at 13:14
default