To easily incorporate a custom font into your website, create a designated font folder (for example: myFontFolder) and utilize the @font-face generator. This tool automatically prompts users to download the specified font, ensuring it displays correctly on your site. In the code snippet below, myFontFolder refers to the directory housing the font files, while fontName signifies the name of the font within this myFontFolder. Assuming you possess the .eot, .ttf, .woff, and .svg versions of the font in myFontFolder, insert the following code at the start of your style sheet. Remember to substitute myFontFolder with your actual folder's name and replace fontName with your font's specific name:
@font-face {
font-family: "fontName";
src: url('myFontFolder/fontName.eot');
src: url('myFontFolder/fontName.eot?#iefix') format('embedded-opentype'),
url('myFontFolder/fontName.woff') format('woff'),
url('myFontFolder/fontName.ttf') format('truetype'),
url('myFontFolder/fontName.svg')format('svg');
}
Once you're prepared to apply your chosen font, simply reference its name like so:
h1 {
font-family: yourFont;
}