Include WOFF2 while creating repository data

Change-Id: I28bed21025565e33e690a689e51eb63b8c4d6be4
This commit is contained in:
Santhosh Thottingal
2014-11-17 14:39:01 +05:30
parent 3c65ec183c
commit c0ab42efa8

View File

@@ -60,10 +60,13 @@ foreach ( glob( '../fonts/*/font.ini' ) as $inifile ) {
if ( isset( $font['woff'] ) ) {
$list['fonts'][$fontname]['woff'] = basename( $dir ) . '/' . $font['woff'];
}
if ( isset( $font['woff2'] ) ) {
$list['fonts'][$fontname]['woff2'] = basename( $dir ) . '/' . $font['woff2'];
}
// If font formats are not explicitly defined, scan the directory.
if ( !isset( $list['fonts'][$fontname]['ttf'] ) ) {
foreach ( glob( "$dir/*.{eot,ttf,woff,svg}", GLOB_BRACE ) as $fontfile ) {
foreach ( glob( "$dir/*.{eot,ttf,woff,woff2,svg}", GLOB_BRACE ) as $fontfile ) {
$type = substr( $fontfile, strrpos( $fontfile, '.' ) + 1 );
$list['fonts'][$fontname][$type] = str_replace( dirname( $dir ) . '/', '', $fontfile );
}