1

I've tried to setup MIME types in many different way like:

<staticContent> <mimeMap fileExtension=".woff" mimeType="application/woff" /> <mimeMap fileExtension=".woff" mimeType="font/woff" /> <mimeMap fileExtension=".woff" mimeType="font/opentype" /> <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" /> <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> </staticContent> 


But in any case I get an error: Uncaught SyntaxError: Unexpected token ILLEGAL tinymce.woff:1 Tested in last version of firefox and chrome

4
  • How did you get the woff file? This looks like a problem within the file. Commented Jun 2, 2014 at 14:43
  • @JanDvorak It was used before i come to team. I am involved into bug fixing Commented Jun 2, 2014 at 14:58
  • How are you trying to load those files? The error message sounds like the browser is trying to parse them as Javascript, which isn't right. Commented Jun 2, 2014 at 15:12
  • @duskwuff I load it like <script src="/WebMvcLOP/Scripts/Libs/tinymce/skins/lightgray/fonts/tinymce.woff"></script> Commented Jun 2, 2014 at 15:47

1 Answer 1

3

You cannot load fonts using a <script> tag. That's only used for Javascript files.

Fonts must be loaded using a @font-face CSS rule, e.g:

@font-face { font-family: 'Gill Sans'; src: url('/s/gillsans.woff') format('woff'); font-weight: normal; font-style: normal; } 

For more information, see MDN's article on @font-face.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.