6
<!doctype html>
<html>
  <head>
    <title>Test Ubuntu</title>
    <link href="http://fonts.googleapis.com/css?family=Ubuntu:regular" rel="stylesheet" type="text/css" />
    <style>
    body { font-family: 'Ubuntu', sans-serif; }
    </style>
  </head>
  <body>
    Test Ubuntu
  </body>
</html>

shows the font in chrome and firefox... but in ie9, if i add the doctype line, it breaks!? works fine without it.

i would like to get it working in all three browsers (with doctype? because sometimes other stuff like css relies on having doctype there? or doesn't look right without it) if possible?

thanks!

Rakka Rage
  • 15,941
  • 8
  • 33
  • 45

3 Answers3

3

Actually, this looks to be a feature. If you turn on the developer toolbar (F12), select the "Script" tab, and hit refresh on this test page, you should see something like this:

CSS3117: @font-face failed cross-origin request. Resource access is restricted. font?kit=_tMhxyW6i8lbI7YsUdFlGA

It looks like this is answered in a different post.

Community
  • 1
  • 1
paulcam
  • 884
  • 5
  • 14
2

Can you please try to add the content in the STYLE element to a css-file and replace STYLE with a LINK element refering to it?

IE executes inline scripts before external scripts, this may be a similar bug / feature.

madr
  • 655
  • 4
  • 16
0

if i add

<meta http-equiv="X-UA-Compatible" content="IE=8" />

then i can add the doctype line back in without breaking the fonts in ie9..

thanks :)

Rakka Rage
  • 15,941
  • 8
  • 33
  • 45
  • 1
    not really a solution though ... it may fix your fonts, but it will break plenty of other things if you fall back to IE8 mode. :-/ – Spudley Feb 26 '11 at 20:27
  • 1
    The difference may be that on Google's preview website the font is being served from the same domain as the page, but in yours the font is being served from a different domain. – Gaurav Feb 28 '11 at 07:34