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

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
);
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.