fontsmaterial-designfont-facewebfontsicon-fonts

Icon fonts : some icon display as text instead on my machine


This is an issue about how my machine sees the web, not a personal web project. On my machine, some icon fonts display as literal text (the name of the icon) instead of the graphic icon itself.

Environnement

Also

For example, this is how I see https://developers.google.com/web/ google-icons-not-showing

and https://material.io/icons/ material-icons-not-showing

Any help appreciated


Solution

  • The webpages OP has shown uses the Material Icons font via Google Web Fonts. They serve a CSS file like:

    @font-face {
      font-family: 'Material Icons';
      font-style: normal;
      font-weight: 400;
      src: local('Material Icons'), 
           local('MaterialIcons-Regular'), 
           url(https://fonts.gstatic.com/s/materialicons/v21/2fcrYFNaTjcS6g4U3t-Y5UEw0lE80llgEseQY3FEmqw.woff2) format('woff2');
    }
    
    .material-icons {
      font-family: 'Material Icons';
      ...
    }
    

    It will always try to load the local version of "Material Icons" font first, before the web font. Therefore, if OP has an outdated or customized version of "Material Icons", the desired effect won't be shown.

    To fix this, delete the local "Material Icons" font, or replace it with the latest version if you still want a local copy.