I was trying a bunch of things, for some reason the installed font is not being used and the default Calibri is used instead.
My css folder:
granit-webfont.woff
granit-webfont.woff2
test.css
Here is my test.css file
@font-face {
font-family: "granitnormal";
src: url("granit-webfont.woff2") format("woff2"),
url("granit-webfont.woff") format("woff");
font-weight: normal;
font-style: normal;
}
.test {
font-family: "granitnormal";
}
my index.html file
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="css/test.css" />
</head>
<body>
<h1 class="test">Testing</h1>
</body>
I also used this https://www.fontsquirrel.com/tools/webfont-generator to generate woff and woff2 files.