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."
3
  • This page describes how to add the MIME type to IIS. Commented Jul 14, 2014 at 15:50
  • Does stackoverflow.com/questions/5065362/… help? Commented Jul 14, 2014 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 Commented Jul 14, 2014 at 15:56

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

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.

1 Comment

When I have added the font-face, the font doesn't even work on my local machine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.