Don P
Don P

Reputation: 63567

CSS: Font-face not working on Chrome

How can I tell why the font is not being displayed?

I'm in Chrome - so .ttf should work. I checked that I can navigate to the file using my URL bar, and I can download it so permissions are fine.

I have a page that declares a @font-face:

@font-face {
  font-family: 'entypo';
  src: url('/css/fonts/entypo.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

p { font-family: 'entypo'; }

Upvotes: 2

Views: 7655

Answers (2)

James Coyle
James Coyle

Reputation: 10398

The @font-face cannot be within a block. Common practice is to have it at the top of the CSS file.

Your source:

#lookgram {
  @font-face {
    font-family: 'entypo';
    src: url("/entypo.eot");
    src: url("/entypo.eot?#iefix") format("embedded-opentype"), url("/entypo.woff") format("woff"), url("/entypo.ttf") format("truetype"), url("/entypo.svg#entypo") format("svg");
    font-weight: normal;
    font-style: normal;
  }

  @font-face {
    font-family: 'entypo_social';
    font-style: normal;
    font-weight: 400;
    src: url("/css/fonts/entypo-social.woff") format("woff");
  }

  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, "lucida grande", tahoma, verdana, arial, sans-serif;
}

Upvotes: 4

Webmaster
Webmaster

Reputation: 11

There is a known bug with chrome relating to web-font as ive had a similar problem. Its worth noting the article at https://stackoverflow.com/questions/21984543/google-chrome-bug-website-not-displaying-text. The article gives a few ideas as how but not why this bug is occurring - and at times fairly random!

Hope this helps

Upvotes: 0

Related Questions