@font-face Syntax

Auf Font Spring wird eine aktualisierte @font-face Syntax vorgeschlagen, da der Vorschlag von Paul Irish anscheinend auf Android Probleme macht:

@font-face {
	font-family: 'MyFontFamily';
	src: url('myfont-webfont.eot#') format('eot'),
	 url('myfont-webfont.woff') format('woff'),
	 url('myfont-webfont.ttf') format('truetype'),
	 url('myfont-webfont.svg#svgFontName') format('svg');
	}

Internet Explorer <9 has a bug in the parser for the src attribute. If you include more than one font format in the src, IE fails to load it and reports a 404 error. The reason is that IE attempts to load as a file everything between the opening parenthesis all the way to the very last closing parenthesis. To deal with that wrong behavior, you merely declare the EOT first and append a single hash mark. The hash fools IE into thinking the rest of the string is a URL fragment and loads just the EOT file. The other browsers follow the spec and select the format they need based on the src cascade and the format hint.

Possibly related posts (automatically generated)