<!-- Migration of the rank images -->
<instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_migrate_rank_images.php</instruction>
+
+ <!-- Update of the Google Fonts -->
+ <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_update_google_font.php</instruction>
</instructions>
</package>
--- /dev/null
+<?php
+
+/**
+ * Re-downloads all Google Fonts.
+ *
+ * @author Tim Duesterhus
+ * @copyright 2001-2021 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core
+ */
+
+use wcf\system\background\BackgroundQueueHandler;
+use wcf\system\background\job\DownloadGoogleFontBackgroundJob;
+
+$families = \glob(WCF_DIR . 'font/families/*/font.css');
+
+foreach ($families as $css) {
+ $family = \basename(\dirname($css));
+
+ BackgroundQueueHandler::getInstance()->enqueueIn(
+ new DownloadGoogleFontBackgroundJob($family),
+ 10 * 60
+ );
+}
--- /dev/null
+<?php
+
+namespace wcf\system\background\job;
+
+use wcf\system\style\FontManager;
+
+/**
+ * Downloads a Google Font family.
+ *
+ * @author Tim Duesterhus
+ * @copyright 2001-2021 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Background\Job
+ * @since 5.4
+ */
+final class DownloadGoogleFontBackgroundJob extends AbstractBackgroundJob
+{
+ /**
+ * @inheritDoc
+ */
+ const MAX_FAILURES = 5;
+
+ /**
+ * @var string
+ */
+ protected $family;
+
+ public function __construct(string $family)
+ {
+ $this->family = $family;
+ }
+
+ /**
+ * @return int every 10 minutes
+ */
+ public function retryAfter()
+ {
+ return 10 * 60;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function perform()
+ {
+ FontManager::getInstance()->downloadFamily($this->family);
+ }
+}