Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@font-face custom icon font only showing unicodes

Tags:

css

I'm using a custom icon-font using CSS3's @font-face and in older version of Google Chrome, only the unicodes are showing and are not being replace or rendered in my custom font, which shows the glyphs for those unicodes.

Here is the @font-face syntax that I am using:

@font-face{
    font-family:'glyphs';
    src:url('../fonts/glyphs.eot');
    src:url('../fonts/glyphs.eot?#iefix') format('embedded-opentype'),
        url('../fonts/glyphs.svg#glyphs') format('svg'),
        url('../fonts/glyphs.woff') format('woff'),
        url('../fonts/glyphs.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

Any idea why the unicodes are showing and not the symbols that are part of the icon-font?

like image 902
Irfan Mir Avatar asked Dec 05 '22 11:12

Irfan Mir


1 Answers

You're possibly running into unicode-range limitations. As described here you can define in a font-face declaration which Unicode characters are covered. It could very well be that older Chrome versions only replaced Latin characters by default. You should be able to fix this by adding this to your font-face declaration:

unicode-range: U+00-FFFF;

Having said that, it could very well be that you're only having a local issue. Check in your Chrome settings, under Advanced Settings, under Web Content click Customize Fonts, then at the bottom check the current setting for Encoding. Changing its value to "Unicode (UTF-8)" could solve the issue as well.

like image 61
Niels Keurentjes Avatar answered Feb 14 '23 04:02

Niels Keurentjes