2014年3月21日金曜日

ie11 , 10 でttfフォントを2回読み込むと表示されなくなるから注意

@font-face {
    font-family: 'untitled-font1';
    src: url('/untitled-font-1.eot');
    src: url('/untitled-font-1.eot?#iefix') format('embedded-opentype'),
         url('/untitled-font-1.woff') format('woff'),
         url('/untitled-font-1.ttf') format('truetype'),
         url('/untitled-font-1.svg#M+1cregular') format('svg');
    src: url('/untitled-font-1.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

こう記述していたらie11,10だけwebフォントが表示されなくなった
原因はttfファイルを2つ読んでいたからかもしれない
解決法は、最後の src: url('/untitled-font-1.ttf') format('truetype');を削除すれば解決