Fontello icon font shows strange characters until cache is cleared when var_dump is output before doctype

1.2k views Asked by At

We use fontello icons across a site and 90% of the time they display correctly in all browsers. For some reason when we var_dump (PHP) code before the html doctype they all break into strange characters (See images below) and are only fixed when the cache is cleared.

The correct icon:

The correct icon

How the icon appears sometimes:

How the icon appears sometimes

An example of the output from source that causes this error would be:

    array(2) {
      [0]=>
      array(16) {
        ["string"]=>
        string(5) "23399"
        ["date"]=>
        string(19) "2013-10-31 00:00:00"
      }
    }
    <!doctype html>
...
1

There are 1 answers

0
LindaJeanne On

Looks like on the occasions where it's not working, it's displaying the character code in a regular text font, instead of the Fontello font.

So, I think you'll find your answer by looking at the CSS, and comparing to the HTML output by the PHP, to see why the wrong font is being applied in these instances.