Search code examples
cssfontsfont-awesomefont-faceglyphicons

Custom font icon not rendering properly in chrome


I have used icomoon to generate my custom font icon ttf and created font face using it.

While using it in chrome some times i'm getting invalid fonts instead of the actual fonts.

font icon with issue

font icon without issue

While checking the font family of the invalid characters it applies "Times New Roman" font family.

enter image description here

Note: This issue occurs only when we load the css and fonts from the CDN.

Can anyone help me to resolve this issue?


Solution

  • This issue is due to the browser unable to read the font icons as a UTF-8 encoded character since the style sheets are fed without content type from the CDN.

    I have set the response content type as text/css;charset=UTF-8 and it fixed the issue.