Buenas noches.
Entiendo que
IE (trabajo con la versión 11) no trabaja con las fuentes
TTF, sino con las
EOT.
Así las cosas, si el navegador resulta ser IE, entonces quisiera añadir una regla CSS con la fuente .eot. Y si resulta ser cualquier otro explorador, entonces añadir una fuente ttf.
Llevo lo siguiente, pero no sirve:
Código Archivo externo:
Ver original<link type="text/css" rel="stylesheet" href="hojaCSS.css" id="hojaCSS" />
Código Javascript
:
Ver original<script type="text/javascript">
window.onload = function()
{
var hojaCSS = document.getElementById("hojaCSS");
var infDelNavegador = window.navigator.userAgent;
var trident = infDelNavegador.indexOf("Trident");
var version11 = infDelNavegador.indexOf("rv:11.");
if( (trident != -1) && (version11 != -1) )
{
alert("Es IE");
hojaCSS.innerHTML('@font-face {font-family:"Harlow Solid Italic"; font-weight:normal; font-size:14px; src:url(HARLOWS.eot);}');
}
else
{
alert("No es IE");
hojaCSS.innerHTML('@font-face {font-family:"Harlow Solid Italic"; font-weight:normal; font-size:14px; src:url(HARLOWSI.TTF);}');
}
}
</script>
Código HTML:
Ver original<p>Este texto debe aparecer con fuente Harlowsi
</p>
Saludos cordiales ![Stress](http://static.forosdelweb.com/fdwtheme/images/smilies/stress.png)
![Stress](http://static.forosdelweb.com/fdwtheme/images/smilies/stress.png)
PD. Perdón, se me fue. A ver si alguien puede mover este post a javascript.