From fe988fd4847f1e2e79f4da24d0e516ac87229c28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 28 Jul 2020 14:13:20 +0200 Subject: [PATCH] Use getFont SCSS function --- .../files/font/families/Open Sans/font.css | 20 +++++++++---------- .../lib/system/style/FontManager.class.php | 2 +- wcfsetup/install/files/style/icon/icon.scss | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/wcfsetup/install/files/font/families/Open Sans/font.css b/wcfsetup/install/files/font/families/Open Sans/font.css index 1e9cdcf2ad..7c2b71c6ed 100644 --- a/wcfsetup/install/files/font/families/Open Sans/font.css +++ b/wcfsetup/install/files/font/families/Open Sans/font.css @@ -8,7 +8,7 @@ font-family: 'Open Sans'; font-style: normal; font-weight: 300; - src: local('Open Sans Light'), local('OpenSans-Light'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-Light.woff2") format('woff2'); + src: local('Open Sans Light'), local('OpenSans-Light'), url(getFont("OpenSans-Light.woff2", "Open%20Sans", "1595938323")) format('woff2'); } @font-face { @@ -16,7 +16,7 @@ font-family: 'Open Sans'; font-style: italic; font-weight: 300; - src: local('Open Sans Light Italic'), local('OpenSans-LightItalic'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-LightItalic.woff2") format('woff2'); + src: local('Open Sans Light Italic'), local('OpenSans-LightItalic'), url(getFont("OpenSans-LightItalic.woff2", "Open%20Sans", "1595938323")) format('woff2'); } @font-face { @@ -24,7 +24,7 @@ font-family: 'Open Sans'; font-style: normal; font-weight: 400; - src: local('Open Sans Regular'), local('OpenSans-Regular'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-Regular.woff2") format('woff2'); + src: local('Open Sans Regular'), local('OpenSans-Regular'), url(getFont("OpenSans-Regular.woff2", "Open%20Sans", "1595938323")) format('woff2'); } @font-face { @@ -32,7 +32,7 @@ font-family: 'Open Sans'; font-style: italic; font-weight: 400; - src: local('Open Sans Italic'), local('OpenSans-Italic'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-Italic.woff2") format('woff2'); + src: local('Open Sans Italic'), local('OpenSans-Italic'), url(getFont("OpenSans-Italic.woff2", "Open%20Sans", "1595938323")) format('woff2'); } @font-face { @@ -40,7 +40,7 @@ font-family: 'Open Sans'; font-style: normal; font-weight: 600; - src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-SemiBold.woff2") format('woff2'); + src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'), url(getFont("OpenSans-SemiBold.woff2", "Open%20Sans", "1595938323")) format('woff2'); } @font-face { @@ -48,7 +48,7 @@ font-family: 'Open Sans'; font-style: italic; font-weight: 600; - src: local('Open Sans SemiBold Italic'), local('OpenSans-SemiBoldItalic'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-SemiBoldItalic.woff2") format('woff2'); + src: local('Open Sans SemiBold Italic'), local('OpenSans-SemiBoldItalic'), url(getFont("OpenSans-SemiBoldItalic.woff2", "Open%20Sans", "1595938323")) format('woff2'); } @font-face { @@ -56,7 +56,7 @@ font-family: 'Open Sans'; font-style: normal; font-weight: 700; - src: local('Open Sans Bold'), local('OpenSans-Bold'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-Bold.woff2") format('woff2'); + src: local('Open Sans Bold'), local('OpenSans-Bold'), url(getFont("OpenSans-Bold.woff2", "Open%20Sans", "1595938323")) format('woff2'); } @font-face { @@ -64,7 +64,7 @@ font-family: 'Open Sans'; font-style: italic; font-weight: 700; - src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-BoldItalic.woff2") format('woff2'); + src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url(getFont("OpenSans-BoldItalic.woff2", "Open%20Sans", "1595938323")) format('woff2'); } @font-face { @@ -72,7 +72,7 @@ font-family: 'Open Sans'; font-style: normal; font-weight: 800; - src: local('Open Sans ExtraBold'), local('OpenSans-ExtraBold'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-ExtraBold.woff2") format('woff2'); + src: local('Open Sans ExtraBold'), local('OpenSans-ExtraBold'), url(getFont("OpenSans-ExtraBold.woff2", "Open%20Sans", "1595938323")) format('woff2'); } @font-face { @@ -80,6 +80,6 @@ font-family: 'Open Sans'; font-style: italic; font-weight: 800; - src: local('Open Sans ExtraBold Italic'), local('OpenSans-ExtraBoldItalic'), url("../font/getFont.php?family=Open%20Sans&filename=OpenSans-ExtraBoldItalic.woff2") format('woff2'); + src: local('Open Sans ExtraBold Italic'), local('OpenSans-ExtraBoldItalic'), url(getFont("OpenSans-ExtraBoldItalic.woff2", "Open%20Sans", "1595938323")) format('woff2'); } diff --git a/wcfsetup/install/files/lib/system/style/FontManager.class.php b/wcfsetup/install/files/lib/system/style/FontManager.class.php index c9ba1d4a9d..bfbe2ff589 100644 --- a/wcfsetup/install/files/lib/system/style/FontManager.class.php +++ b/wcfsetup/install/files/lib/system/style/FontManager.class.php @@ -99,7 +99,7 @@ class FontManager extends SingletonFactory { $file->flush(); $file->close(); - $css = str_replace('url("' . $filename . '")', 'url("../font/getFont.php?family='.rawurlencode($family).'&filename='.rawurlencode($filename).'")', $css); + $css = str_replace('url("' . $filename . '")', 'url(getFont("'.rawurlencode($filename).'", "'.rawurlencode($family).'", "'.TIME_NOW.'"))', $css); } file_put_contents($this->getCssFilename($family), $css); diff --git a/wcfsetup/install/files/style/icon/icon.scss b/wcfsetup/install/files/style/icon/icon.scss index 133ce5c4b7..60bce55ea2 100644 --- a/wcfsetup/install/files/style/icon/icon.scss +++ b/wcfsetup/install/files/style/icon/icon.scss @@ -1,11 +1,11 @@ /* do NOT reference fonts directly, always make use of 'getFont.php' */ @font-face { font-family: 'FontAwesome'; - src: url('../font/getFont.php?filename=fontawesome-webfont.eot&v=4.7.0'); - src: url('../font/getFont.php?filename=fontawesome-webfont.eot&v=4.7.0#iefix') format('embedded-opentype'), - url('../font/getFont.php?filename=fontawesome-webfont.woff2&v=4.7.0') format('woff2'), - url('../font/getFont.php?filename=fontawesome-webfont.woff&v=4.7.0') format('woff'), - url('../font/getFont.php?filename=fontawesome-webfont.ttf&v=4.7.0') format('truetype'); + src: url(getFont('fontawesome-webfont.eot', '', '4.7.0')); + src: url(getFont('fontawesome-webfont.eot', '', '4.7.0') + "#iefix") format('embedded-opentype'), + url(getFont('fontawesome-webfont.woff2', '', '4.7.0')) format('woff2'), + url(getFont('fontawesome-webfont.woff', '', '4.7.0')) format('woff'), + url(getFont('fontawesome-webfont.ttf', '', '4.7.0')) format('truetype'); font-weight: normal; font-style: normal; } -- 2.20.1