2

I'm using Metro UI CSS, but icons are shown as control characters. I've added charset=utf-8" to head section and added AddDefaultCharset utf-8 to httpd.conf. Still the problem persist.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Please help. Thanks in advance.

Paul Varghese
  • 1,635
  • 1
  • 15
  • 30

5 Answers5

1

I had the same issue. Turned out I forgot to copy the font files to the fonts directory. metro-bootstrap.css references the fonts:

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

So they need to be put in the appropriate directory relative to metro-bootstrap.css. If you download Metro-UI-CSS-master.zip, the fonts can be found in the fonts directory.

Adam Szabo
  • 11,302
  • 18
  • 64
  • 100
1

Solution:

  1. Locate your Font directory and allow permission. (*.eot; *.woff; *.ttf; *.svg). And take note of the location.
  2. Edit your metro-icons.css, and put the correct path of the font directory. (I use the browser inspection to check my path is correct)
  3. Refresh your browser.
Eman Jayme
  • 230
  • 2
  • 8
0

If you are using <!DOCTYPE html> as your doctype, I suggest you to try this.

<meta charset="utf-8">

instead of

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

I hope this solves your issue.

Nitesh
  • 15,425
  • 4
  • 48
  • 60
0

You need both the external set of css (metro-bootstrap.css) as well as class="metro"... Here's a working copy: http://jsfiddle.net/67T6c/

<link href="css/metro-bootstrap.css" rel="stylesheet">

<div class="metro">
<i class="icon-home"></i>
</div>

also note that this works in Chrome. However, in IE, you may be limited by the wonderful cross-origin-web-font block. See THIS for details on that: IE9 blocks download of cross-origin web font

Community
  • 1
  • 1
Jim
  • 804
  • 6
  • 17
0

You must also be sure that your web server does not block files download with the extensions required for the font. These are: eot; ttf; woff; svg

I had the same problem and I could not in any way solve the problem of the icons. I later discovered that the problem was due to the web server used for development, Delphi DataSnap stand-alone mode, because of filtering these extensions so these files where not returned to the browser.

For Delphi DataSnap the solution is:

  • Go to WebModuleUnit
  • Select WebFileDispatcher1
  • Dbl-click on WebFileExtensions property and add the file extensions required.