Adding custom fonts to GitHub pages
I had this problem as well. I had fonts working properly locally, but couldn't seem to get it right on GitHub.
I figured out how to do this: The root of the gitHub.io page appears to be different than the local root directory, which leads to fonts in the wrong folder.
This is my code:
@font-face {
font-family: F16;
src: url("../SubSkipper/F16_Panel Font.ttf") format('truetype');
font-weight: bold;
font-style: normal;
}
SubSkipper is the name of my project and the .ttf font is in the apparent root directory what I mean by this is: "SubSkipper/" .
The path ../
goes back one level, then opens the root directory (SubSkipper) of the project as it appears locally.