CSS @font-face nie działa w IE8

Próbowałem przeczytać wiele artykułów o tym, jak radzić sobie z niestandardowymi czcionkami w IE, ale nigdy nie wydawały mi się działać. Próbowałem przekonwertować czcionki na EOT, ale to też nie działało. Nie jestem pewien, co robię źle, więc wyślę mój kod

@font-face {
  font-family: "Klavika Regular";
    src: url('../fonts/klavika.eot');
    src: local('☺'), url('../fonts/klavika.woff') format('woff'), url('../fonts/klavika.ttf') format('truetype'), url('../fonts/klavika.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}
Author: Cody Guldner, 2011-09-28

4 answers

To działa w ie8/9

Http://dev.bowdenweb.com/a/fonts/serif/alegreya/demo.html

@font-face {
    font-family: 'AftaserifRegular';
    src: url('AftaSerifThin-Regular-webfont.eot');
    src: url('AftaSerifThin-Regular-webfont.eot?#iefix') format('embedded-opentype'),
         url('AftaSerifThin-Regular-webfont.woff') format('woff'),
         url('AftaSerifThin-Regular-webfont.ttf') format('truetype'),
         url('AftaSerifThin-Regular-webfont.svg#AftaserifRegular') format('svg');
    font-weight: normal;
    font-style: normal;

}
 40
Author: albert,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-02-16 14:59:49

Jeśli IE8 myśli, że obsługuje dowolny inny format niż eot z wymienionych poniżej, to prawdopodobnie spróbuje go użyć. Może przydałby ci się hack IE8, jak

src: local('☺'), url('../fonts/klavika.woff') format('woff'), url('../fonts/klavika.ttf') format('truetype'), url('../fonts/klavika.svg') format('svg');
src /*\**/: url('../fonts/klavika.eot')\9

Więc tylko IE8 odczyta ostatnią linię src i tym samym załaduje .eot.

 0
Author: Naoise Golden,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-09-28 11:24:50

Wypróbuj trzy rodzaje formatów CSS dla @ font-face na generatorze FontSquirrel (W "EXPERT..."mode > in section" CSS Formats: "> "more information")

 0
Author: SidorukSV,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-09-28 11:29:09

Warto sprawdzić, czy twój .plik htaccess pozwala na typ pliku.

 0
Author: magicspon,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-10-17 10:37:15