Remove ttf format from repo and thereby from fontface css
TTF files are not removed, the entries for them from the repo is removed. Generated CSS will also skip ttf. TTF format is not required for any browser now a days. https://caniuse.com/#feat=woff Change-Id: I018e74f6a50e63f55adeca480c03124092fba015
This commit is contained in:
@@ -91,15 +91,15 @@ class FontRepoCompiler {
|
||||
$info['fontstyle'] = $font['fontstyle'];
|
||||
}
|
||||
|
||||
foreach ( [ 'ttf', 'woff', 'woff2' ] as $format ) {
|
||||
foreach ( [ 'woff', 'woff2' ] as $format ) {
|
||||
if ( isset( $font[$format] ) ) {
|
||||
$info[$format] = $this->getFontWebPath( $fontpath, $fontdir, $font[$format] );
|
||||
}
|
||||
}
|
||||
|
||||
// If font formats are not explicitly defined, scan the directory.
|
||||
if ( !isset( $info['ttf'] ) ) {
|
||||
foreach ( glob( "$fontpath/*.{ttf,woff,woff2}", GLOB_BRACE ) as $fontfile ) {
|
||||
if ( !isset( $info['woff'] ) ) {
|
||||
foreach ( glob( "$fontpath/*.{woff,woff2}", GLOB_BRACE ) as $fontfile ) {
|
||||
$type = substr( $fontfile, strrpos( $fontfile, '.' ) + 1 );
|
||||
$info[$type] = $this->getFontWebPath( $fontpath, $fontdir, basename( $fontfile ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user