0

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

asked Aug 10, 2020 at 13:02

1 Answer 1

0

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
1

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.