0

I'm using a specific font in my web page called "Ethnocentric". Because this font won't already be installed on client machines, I've included "@@font-face" in th style in the web page. But when I open the site using IE 10 on a PC that I know doesn't have this font installed, it fails. What am I doing wrong?

@@font-face {
    font-family: "Ethnocentric";
    src: url(/ethnocentric.ttf) format("truetype"); 
}

.ethnocentricFont {
    font-family: "Ethnocentric", sans - serif;
}

The Ethocentric.ttf file is located in my wwwroot folder, and I'm referencing the font as follows:

 <p class="ethnocentricFont" style="display: inline-block; color: gainsboro; font-size: 18px; text-align: left; margin: 0 auto; vertical-align: middle; margin-left: 8px;">My Heading</p>

The font displays correctly in Chrome, but not in IE10. I just read this article - maybe this is why it's not working in IE.

StackOverFlowArticle

Ross Kelly
  • 477
  • 1
  • 6
  • 23
  • OK, and was the installable bit in the TTF file set? – Mr Lister Feb 24 '18 at 08:33
  • Also, there should be no spaces in `sans-serif`. Maybe some browsers choke on that while others don't. – Mr Lister Feb 24 '18 at 08:34
  • Try to use `woff` or `eot` file types for webfonts. There are online converters available: https://everythingfonts.com/ttf-to-woff. Note: those file types may need to be added to the server mime-types in IIS. – VDWWD Feb 24 '18 at 10:47
  • @MrLister. I don't think so. It seems you have to change the embedding level of your TTF file. TTF fonts work in IE 9 onwards only when the embedding bits are set to installable. I tried the tool that sets this in the font but it's compiled for 32-bit Windows. I noticed another users who said he compiled it for 64-bit, but when I download it, my AV complained it had a virus!. – Ross Kelly Feb 24 '18 at 12:56
  • @MrLister The spaces were strangely added by StackOverflow. I managed to download the 64-bit version and it successfully set the embedding bits to installable. I haven't republished my site yet, but will try it later today and then post the results. – Ross Kelly Feb 24 '18 at 13:05

0 Answers0