To solve your problem once and for all, I'll introduce you to an excellent tool!
1) Download the source: Cinzel ;
2) Access the WebFont Generator tool at Font Squirrel ;
3) Go to the source we just downloaded by clicking Upload ;
4) Check the "Expert" option and set the following options:
5)ClickDownloadyourkit;
6)AfterextractingtheZIPfilesyoudownloaded,"grab" everything that matters and copy to the project in question. I usually use these files:
7)Inthestylesheet.cssfile,changetheurl
bysearchingthesourcefileswithinthefontes/
folder:
@font-face{font-family:'cinzelregular';src:url('fontes/cinzel.regular-webfont.eot');src:url('fontes/cinzel.regular-webfont.eot?#iefix')format('embedded-opentype'),url('fontes/cinzel.regular-webfont.woff2')format('woff2'),url('fontes/cinzel.regular-webfont.woff')format('woff'),url('fontes/cinzel.regular-webfont.ttf')format('truetype'),url('fontes/cinzel.regular-webfont.svg#cinzelregular')format('svg');font-weight:normal;font-style:normal;}
Ofcourseyouhavetomovethefontstothisfolder,except.css,huh!
8)Nowjustlinkthestylesheet.cssfileandenjoyitsglorioussource:
<!DOCTYPEhtml><html><head><title>TutorialFont-faceporLipESprY</title><linkrel="stylesheet" type="text/css" href="stylesheet.css">
<style type="text/css">
.cinzel {
font-family: 'cinzelregular';
}
</style>
</head>
<body>
<p>Um texto normal</p>
<p class="cinzel">Um texto com a fonte Cinzel-regular</p>
</body>
</html>
RESULT:
Ifyouwanttodownloadtheprojectready,youareinmy GitHub / LipESprY / sopt-problem-font-face
It's worth remembering that some browsers do not load certain font types. Newer browsers typically do not have this problem. With such a tool, you address these compatibility issues. This is why several types of this same source ( .ttf, .eot, .svg, .woff, .woff2 ) were generated. Problems with fonts really come to an end!
@edit:
There are currently four font container formats used on the Web: EOT, TTF, WOFF, and WOFF2. Unfortunately, despite the wide variety of options, there is not a single universal format that works across all current and legacy browsers: EOT is only IE-compatible, TTF is partially IE compatible, WOFF offers broader compatibility , but is not available in some older browsers and compatibility with WOFF 2.0 is still being developed in many browsers.
Source: Optimizing Web Fonts by Ilya Grigorik