Forums

Issue with Icon Fonts in Chrome 23

I was actually pleased to see that there is another corresponding thread dealing with an Icon Font issue in Chrome 23. I decided to start my own because, uh, well I just didn’t want to but in and I just want the visibility (sorry, frustration levels are high).

I work at an academic library and we are now public testing a small room reservation system we built where–except for the logo–we swapped all icons (keys and locks and users and menus, etc.) with icon fonts (Icomoon, specifically).

I thought I might be having a local issue, but my coworkers are experiencing the same thing in Chrome only. Basically, the icon fonts are a.) mostly not displaying and b.) mucking up the display when they do appear. This might be shoddy code, I’m cool with that – but it’s pervasive, because I use the same font-face and icon fonts on several concurrent redesigns. None of them show in Chrome.

The upshot is that all the icons display properly in IE8/9 / Firefox / Safari / Opera.

A couple hours googling have illustrated that, by far, I am not the only one with this issue. There have been a dead ends, but hopefully the community here can help me figure it out.

For reference, the dead ends include something about MIME Type, resetting character encoding in Chrome settings, clearing your cache (well, duh), using absolute URL’s in @font-face declaration, and so on.

Randomly, sometimes, everything appears correctly in Chrome. Lol, I’m going nuts. Check it out in something like Firefox / Safari before hitting it with Chrome to see what I mean.

Note: I’m using SASS, and the .css file on both sites is compressed. Here is my font-face code and once class example of how I’m using it.

Thanks, @chrisburton, for the wicked-fast replies! I’m too quick to test and respond. I changed-up the src URI with an absolute path and the browser tricked me by displaying the icons appropriately.

After a few subsequent refreshes, the icons were lost / or funkified the display.

At other times I’ve used a different icon font, Chris’s was the approach I used. But just like hitting-up fontsquirrel or whatever, I just plugged in the Icomoon CSS that came with the DL. If that’s a poor CSS, I’m cool with changing it, but with a font as popular as Icomoon I’m surprised it hasn’t come up or been fixed yet.

If I’m guessing right, you’re experiencing this bug on Windows. Some of my other users had this issue. But there’s an easy workaround for it: Use the PUA encoding. You can reset the encoding of your font to PUA in the font tab of the IcoMoon app. Another solution would be to reorder the font formats in your @font-face so that WOFF is placed before TTF and SVG.

SVG fonts render better in the browsers that support them. Therefore I put them first by default.

@Keyamoon – I think you hit this right on the head. I made the quick swap secretly and my complaints from my colleagues have suddenly dropped off. The best part is that, wow, that fix is just so logical / easy.