cssfontsadobe-brackets

I downloaded a webfont but it only works in brackets


So I downloaded a font (legally I bought it) and the font looks really good. but it only displays in the brackets live preview. when I open it in chrome, it just refuses to work. I followed all the instructions on the font when I bought it. Can anyone help me?

This is an image of the bracket font display which is what I want: this is an image of the bracket font display which is what I want

And this is the exact same code when I open the index.html file in Google Chrome. and this is the exact same code when I open the index.html file in Google Chrome.

This is the code I am using to get the font in CSS

@font-face{
   font-family:"Ethnocentric W05 Italic";
   src:url("/fonts/MTI-WebFonts-367222846/Fonts/5118942/e91f32ff-44ec-47c0-afd3-5cdeeb6c73c8.woff2") 
   format("woff2");
}

and this is what I used to put it in the header

font-family: "Ethnocentric W05 Italic";

Solution

  • If you declare a custom font using @font-face, the browser will try to fake the bold and italic styles if it can’t find them.

    Instead of defining separate font-family values for each font, You can use same font-family name for each font, and define the matching styles, like so:

    [css]@font-face {
    font-family: 'Ubuntu';
    src: url('Ubuntu-R-webfont.eot');
    font-weight: normal;
    font-style: normal;
    }
    
    @font-face {
    font-family: 'Ubuntu';
    src: url('Ubuntu-I-webfont.eot');
    font-weight: normal;
    font-style: italic;
    }
    
    @font-face {
    font-family: 'Ubuntu';
    src: url('Ubuntu-B-webfont.eot');
    font-weight: bold;
    font-style: normal;
    }
    
    @font-face {
    font-family: 'Ubuntu';
    src: url('Ubuntu-BI-webfont.eot');
    font-weight: bold;
    font-style: italic;
    }
    
    .test {
    font-family: Ubuntu, arial, sans-serif;
    }[/css]
    

    Then all you need to do is apply that single font-family to your target, and any nested bold or italic styles will automatically use the correct font, and still apply bold and italic styles if your custom font fails to load.