0

I have to add a folder with a font family that has different styles (bold, light, etc.), the fonts are in .ot, .ttf and .woff. The font family and the main folder where the fonts are is called HKExplorerSoft.

How should I add these fonts to the projects and how can I use them later in my CSS? I understand I have to create a @font-face rule, something like:

@font-face {
  font-family: 'HKExplorerSoft';
  src: url('assets/HKExplorerSoft/hkexplorersoft-black-webfont.woff'); 
}

But that doesn't work or I'm not sure how to use this in the CSS later.

Sergi
  • 1,192
  • 3
  • 19
  • 37

3 Answers3

2

If you want to import custom fonts you may have a look to this answer provided here :

Community
  • 1
  • 1
  • I got the right answer there, Thank you. It was a path problem, but I also learned to add different types. – Sergi Mar 31 '17 at 09:51
0

with use this way

.className{
  font-family: 'HKExplorerSoft';
}
Lalji Tadhani
  • 14,041
  • 3
  • 23
  • 40
0

Do it this way (in your stylesheet):

@import url('assets/HKExplorerSoft/hkexplorersoft-black-webfont.woff');

Check that the filepath is correct...

and then use this name in your styles like:

.myclass {
  font-family: 'HKExplorerSoft';
}
Johannes
  • 64,305
  • 18
  • 73
  • 130