Good afternoon, I'm trying to install a font in my Angular 8 project, I've already downloaded it and saved it in the assets folder, but I can't find how to insert it in the project.
I found this:
@font-face {
font-family: lato;
src: url(assets/font/Lato.otf) format("opentype");
}
but I don't know where to insert it
You need to put your fonts in the 'assets' folder (you can also create a fonts sub-folder inside the assets folder) and refer to it in the Styles:
Once done, you can call the sources like this:
You can put
@font-face
in your global definition ofstyles.css
orstyles.scss
and call them from anywhere in the application - as long as your component has a specific CSS/SCSS.styles.css
orstyles.scss
is already defined inangular-cli.json
. If you want to create a different CSS/SCSS file, and declare it in the angular-cli.json along with itstyles.css
orstyles.scss
put it like this: