0

I am using angular 6 material and using "roboto-fontface" dependency. I am using only regular roboto fonts in my app. But its downloading all the regular,medium and bold fonts and its increasing my app size. Is there any way to download only Regular Roboto fonts. And also Is there any way to stop downloading these fonts from browser. Whenever I load the app fonts downloading and its increasing the loading time. Please suggest me best way to handle these fonts

Oxygen
  • 65
  • 7

1 Answers1

0

You can just import in your application the fonts you need so when you build it only these fonts are included.

If you are using SCSS, SASS, LESS... you can just import the ones you need into your css files e.g

@import './node_modules/roboto-fontface/css/roboto/sass/roboto-fontface-black.scss'
@import './node_modules/roboto-fontface/css/roboto/sass/roboto-fontface-black.scss'
Albert Alises
  • 1,018
  • 1
  • 8
  • 19
  • I added it in angular.json in styles. Now it is displaying everything in that font... I just need it in one component. What shall I do? – Ero Stefano Feb 19 '20 at 21:22