0

I have never used a custom font before and have been trying to add it into my application. I have downloaded this font onto my computer and have made a separate file called 'Font' and in that i have put the font file.

I went into my CSS and have wrote this code:

@font-face {
font-family:'Open Sans';
src: url('../Font/OpenSans-Light.ttf');
}

The font isn't working at all and I'm wondering why it is not working?

Any ideas?

I am applying it to different sections, I should of said:

.title {
font-family: 'Open Sans';
font-size: 25px;
margin: 0 auto;
color: #52a3cc;
text-align: center;
}

I get this error message in IE Developer Tools:

"@font-face failed OpenType embedding permission check. Permission must be Installable."
Ben Clarke
  • 256
  • 1
  • 6
  • 23
  • [This page](http://codingstill.com/2013/01/set-mime-types-for-web-fonts-in-iis/) describes how to add the MIME type to IIS. – mason Jul 14 '14 at 15:50
  • Does http://stackoverflow.com/questions/5065362/ie9-blocks-download-of-cross-origin-web-font help? – Lukos Jul 14 '14 at 15:55
  • I have embedded fonts and can't get away with just TTF fonts, because not all browsers support all formats. I use woff, eot, ttf and svg – Lukos Jul 14 '14 at 15:56

2 Answers2

1

You code should work if you can download http://www.yoursite.com/CorrectPath/OpenSans-Light.ttf in a browser.

If you cannot download it, you need to add at MIME types like SethG suggested.

Other thought

Open Sans is available via Google Fonts, so you do not have to host it by yourself.

enter image description here

enter image description here

enter image description here

Win
  • 61,100
  • 13
  • 102
  • 181
0

I've had issues with this in the past. If you're using IIS Express to test this, you might have issues. For some reason, when IIS doesn't have a MIME type with which to serve content, it won't serve it. Make sure that whatever version of IIS you're using, be it IIS Express or IIS, has a MIME type for .ttf files.

SethGunnells
  • 1,269
  • 1
  • 12
  • 19