views:

1996

answers:

4

I'm trying to get Internet Explorer to render my pretty fonts. It's not working. They work fine in Firefox and I can see in my Apache access logs that IE has pulled the fonts. So it's parsing the font-face CSS tag, just not rendering them.

The site I used to convert the fonts was: http://www.kirsle.net/wizards/ttf2eot.cgi. I tried that WEFT tool by Microsoft but it wouldn't work properly. After installing and opening it, it said 'First time running it, do this...' then it continually hanged.

Here's my CSS:

@font-face
{
   font-family: 'HelveticaLTCN';
   src: url('HelveticaNeueLTCom-LtCn_0.eot');
   src: local('HelveticaNeuel TCom LtCn'), url('HelveticaNeueLTCom-LtCn_0.ttf') format('TrueType');
}

Any ideas as to why IE isn't rendering the fonts?

EDIT: Should also mention, I'm calling the font with:

p .mytext
{
   font-family: HelveticaLTCN;
}
A: 

IE won't accept a font that includes a format string in the src descriptor - that second src line could be the culprit. What happens if you remove it (or remove the format string?)

Next - sometimes, IE can be a bit pedantic about whether or not you use quotes around values in CSS. Try font-family: "HelveticaLTCN" instead?

arcwhite
I added quotes to each font-family and removed the second 'src' from font-face. Still didn't work. Might give this program a go: http://code.google.com/p/ttf2eot/. I'll report back on the results >.<
panas
Nope. Still fails.
panas
A: 

My suggestion: Never use custom fonts in CSS. Embed the fonts in other format like Adobe Flash. Then, display your contents in Flash, so that your problem will not be appeared.

Never trust IE's CSS display ability.

Shivan Raptor
I was going to use SIFR (I think that's what it's called) to do it. But I'd rather not rely on more technologies. If I can get it working in straight CSS then I'd be happy. If it doesn't work for everybody, I don't care. As long as my boss things it does ;) I just can't see why IE isn't playing nicely with the fonts
panas
I would respectfully disagree, I don't want to reel of the usual list of why flash shouldn't by used for this and that etc.@panas, have you considered using http://typekit.com?
ILMV
@Shivan "@font-face" is getting very good press right now, I don't feel it's stable enough, and for what I see it leads to awkwardly long loading times, and I understand your point in suggesting other solutions, still the question is clear and doesn't really takes other technlogies in consideration.
ZJR
+1  A: 

One thing you need to check is

.css file and .eot should be in same folder if you do url('HelveticaNeueLTCom-LtCn_0.eot')

or do full url path like src:url(http://www.example.com/path/to/url/Helvetica.eot)

Quotes are optional as far as I know.

ps# I am doing font embedding in my blog for long time, its working fine.

S.Mark
The CSS is all embedded in the HTML document. The HTML document and the fonts are in the same directory. Just in case, I tried using full path URLs instead of relative. Still didn't work. Here is the current code: http://codepad.org/j396KfJx If it matters at all, it's running on localhost. Though I can't see why it would. Any more ideas? :/
panas
*{font-family: HelveticaLTCN;}did you tried with * too for all tags? if that one not works, may be probably you should try WEFT again. I use WEFT, its working fine for me.
S.Mark
Nah man, still failed. Are you on Vista? When ever I tried running WEFT, it would crash at that stage of loading fonts for the first time. I tried setting it to run under Windows 98 (compatibility mode) and same thing happened. What version of Windows are you on? :/
panas
Mine is XP, btw if you could publish your test page online somewhere, then some people could look into it.
S.Mark
I don't have a server setup at the moment which I can upload the fonts + html to. But all the relevant code is in that codepad.org link I posted. The only problem I can think of would be the fonts. The code itself is fine. I guess I'll try getting WEFT working.
panas
I was having the same problem with IE. FF and other browsers were fine IE was not. I had tried several online EOT generators and WEFT, which is a horribly buggy program by the way. What I am concluding is that they created invalid fonts. Tried finally using font squirrel, and it works perfectly. It's possible you have invalid or corrupted font files as well.
Jestep
+1  A: 

If you've thrown in the towel or you're still struggling with this I strongly recommend font squirrel. It replaces WEFT far better than any of the other online .eot generators. As a huge bonus, it supplies all needed cross-browser formats in one zip file along with a working CSS+HTML sample page. It's the closest thing yet to @fontface nirvana.

atsjr
It presents the user with nice very informative options, indeed. Pointing out SVG and WOFF ad suitable (in some cases - and it lists which, too) formats, for example.
ZJR