ifont: Fix empty font glyphs for IE8

The embedded font is included inline in the stylesheets. IE falls back and
tries to load one of the other font sources which was not exported by the web
server. This fix moves the fontello directory to public and add add a
prefix path to the embedded stylesheet.

refs #6417
This commit is contained in:
Marius Hein 2015-01-28 17:03:23 +01:00
parent 7ef86ddf49
commit 9d05190517
17 changed files with 16 additions and 7 deletions

View File

@ -38,15 +38,17 @@ class LessCompiler
/**
* Create a new instance
*
* @param string $basePath Provide web base path optional
*/
public function __construct()
public function __construct($basePath = null)
{
require_once 'lessphp/lessc.inc.php';
$this->lessc = new lessc();
$this->lessc->setVariables(
array(
'baseurl' => '\'' . Zend_Controller_Front::getInstance()->getBaseUrl(). '\''
'baseurl' => '\'' . $basePath. '\''
)
);
}

View File

@ -11,7 +11,7 @@ use Icinga\Web\LessCompiler;
class StyleSheet
{
protected static $lessFiles = array(
'../application/fonts/fontello-ifont/css/ifont-embedded.css',
'fonts/fontello-ifont/css/ifont-embedded.less',
'css/vendor/tipsy.css',
'css/icinga/defaults.less',
'css/icinga/layout-colors.less',
@ -96,7 +96,8 @@ class StyleSheet
$cache->send($cacheFile);
return;
}
$less = new LessCompiler();
$less = new LessCompiler(dirname($_SERVER['PHP_SELF']));
foreach ($lessFiles as $file) {
$less->addFile($file);
}

View File

@ -1,8 +1,8 @@
@font-face {
font-family: 'ifont';
src: url('../font/ifont.eot?75097146');
src: url('../font/ifont.eot?75097146#iefix') format('embedded-opentype'),
url('../font/ifont.svg?75097146#ifont') format('svg');
src: url('@{baseurl}/fonts/fontello-ifont/font/ifont.eot?75097146');
src: url('@{baseurl}/fonts/fontello-ifont/font/ifont.eot?75097146#iefix') format('embedded-opentype'),
url('@{baseurl}/fonts/fontello-ifont/ifont.svg?75097146#ifont') format('svg');
font-weight: normal;
font-style: normal;
}

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,6 @@
# fontello-ifont has been moved
The font directory has been moved to the public structure because of Internet Explorer version 8 compatibility. The
common way for browsers is to include the binary embeded font type in the javascript. IE8 falls back and include one of
the provided font sources. Therefore it is important to have the font files available public and exported by the
HTTP server.