From fa2e4b2be0e0909461a03a29718e64c36b1283b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Thu, 31 Mar 2022 14:57:50 +0200 Subject: [PATCH] import font locale en test --- core/include/update.inc.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 731798da..4e92dc3e 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -941,10 +941,25 @@ if ($this->getData(['core', 'dataVersion']) < 11400) { if (is_array($files)) { $this->deleteData(['fonts', 'files']); foreach ($files as $fontId => $fontName) { - $this->setData(['fonts', 'files', $fontId, [ - 'name' => ucfirst($fontId), + if (file_exists(self::DIR_DATA . 'fonts' . $fontName)) { + $this->setData(['fonts', 'files', $fontId, [ + 'name' => ucfirst($fontId), + 'font-family'=> $fontId . ', sans-serif', + 'resource' => $fontName + ]]); + } + } + } + // Consersion des fontes importées + // Conversion des fontes locales + $imported = $this->getData(['fonts', 'imported']); + if (is_array($imported)) { + $this->deleteData(['fonts', 'imported']); + foreach ($imported as $fontId => $fontName) { + $this->setData(['fonts', 'imported', $fontId, [ + 'name' => $fontId, 'font-family'=> $fontId . ', sans-serif', - 'resource' => $fontName + 'resource' => 'https:\/\/fonts.cdnfonts.com\/css\/' . $fontId ]]); } }