I have been trying to build a website using a static site generator. I want to import a font that I downloaded from the web into one of my .scss files. I have been trying to do this for hours now without any success and I am not able to understand where I am going wrong. Any help would be greatly appreciated.
So, my file structure looks like this:
- Assets
- scss
- style.scss
- fonts
- geometry-soft-pro
- Geometry_Soft_Pro-Bold_N-webfont.woff
- Geometry_Soft_Pro-Bold_N-webfont.woff2
- stylesheet.css
- geometry-soft-pro
- scss
Now, the contents of the Assets/fonts/stylesheet.css are:
@font-face {
font-family: "Geometry_Soft_Pro-Bold_N";
src: url("Geometry_Soft_Pro-Bold_N-webfont.woff2") format("woff2"),
url("Geometry_Soft_Pro-Bold_N-webfont.woff") format("woff");
font-weight: normal;
font-style: normal;
}
This file was auto generated by fontsquirrel when downloaded a web-font kit from there.
Now, in style.scss, I am importing the stylesheet.css using the following code snippet:
@import "../fonts/geometry-soft-pro/stylesheet";
I removed the .css in the path above following this recommendation since I am importing a .css file into a .scss. (Also, I have tried keeping .css and it doesn't work either)
I am trying to use the font for a title using the following code snippet:
#home-title {
font-family: "Geometry_Soft_Pro-Bold_N", $fonts;
margin: 0;
font-size: 5em;
text-align: center;
}
And the result that I am getting is not the geometry_soft_pro font that I was expecting.
To test against the scenario that my font is being overridden somewhere else in my stylesheets, I have verified using inspect element on my browser. The font-family is not overridden anywhere. This seems like such a trivial issue and I have spent hours trying to fix it. I have run out of ideas on how to go ahead. Any kind of help would really greatly appreciated. Thank you very much!