From 07087dbb06f37e197906ba625dedd1e8f1a54196 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Mon, 13 Nov 2017 15:38:34 +0530 Subject: [PATCH] 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 --- includes/FontRepoCompiler.php | 6 +- resources/js/ext.uls.webfonts.repository.js | 80 +-------------------- 2 files changed, 5 insertions(+), 81 deletions(-) diff --git a/includes/FontRepoCompiler.php b/includes/FontRepoCompiler.php index eab9ebe5..a6250e3f 100644 --- a/includes/FontRepoCompiler.php +++ b/includes/FontRepoCompiler.php @@ -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 ) ); } diff --git a/resources/js/ext.uls.webfonts.repository.js b/resources/js/ext.uls.webfonts.repository.js index 898b0427..e98f5b60 100644 --- a/resources/js/ext.uls.webfonts.repository.js +++ b/resources/js/ext.uls.webfonts.repository.js @@ -401,17 +401,14 @@ }, "fonts": { "AbyssinicaSIL": { - "ttf": "AbyssinicaSIL/AbyssinicaSIL-R.ttf?9e3d4", "woff": "AbyssinicaSIL/AbyssinicaSIL-R.woff?893c7", "woff2": "AbyssinicaSIL/AbyssinicaSIL-R.woff2?361f7" }, "Akkadian": { - "ttf": "Akkadian/Akkadian.ttf?39422", "woff": "Akkadian/Akkadian.woff?fc09d", "woff2": "Akkadian/Akkadian.woff2?1e0a3" }, "Alef": { - "ttf": "Alef/Alef-Regular.ttf?fce9c", "woff": "Alef/Alef-Regular.woff?2b430", "woff2": "Alef/Alef-Regular.woff2?a2499", "variants": { @@ -420,12 +417,10 @@ }, "Alef Bold": { "fontweight": "bold", - "ttf": "Alef/Alef-Bold.ttf?42297", "woff": "Alef/Alef-Bold.woff?bd85f", "woff2": "Alef/Alef-Bold.woff2?7c873" }, "Amiri": { - "ttf": "amiri/amiri-regular.ttf?d51fb", "woff": "amiri/amiri-regular.woff?e8973", "woff2": "amiri/amiri-regular.woff2?1f55e", "variants": { @@ -436,35 +431,29 @@ }, "Amiri Bold": { "fontweight": "bold", - "ttf": "amiri/amiri-bold.ttf?6d012", "woff": "amiri/amiri-bold.woff?63eb0", "woff2": "amiri/amiri-bold.woff2?a0e74" }, "Amiri Bold Italic": { "fontweight": "bold", "fontstyle": "italic", - "ttf": "amiri/amiri-boldslanted.ttf?76aa4", "woff": "amiri/amiri-boldslanted.woff?44410", "woff2": "amiri/amiri-boldslanted.woff2?b0128" }, "Amiri Italic": { "fontstyle": "italic", - "ttf": "amiri/amiri-slanted.ttf?d166d", "woff": "amiri/amiri-slanted.woff?7d658", "woff2": "amiri/amiri-slanted.woff2?a90a0" }, "Artaxerxes": { - "ttf": "Artaxerxes/Artaxerxes.ttf?79a74", "woff": "Artaxerxes/Artaxerxes.woff?c1ed7", "woff2": "Artaxerxes/Artaxerxes.woff2?7a96e" }, "CharisSIL": { - "ttf": "CharisSIL/CharisSIL-R.ttf?20bec", "woff": "CharisSIL/CharisSIL-R.woff?3a622", "woff2": "CharisSIL/CharisSIL-R.woff2?b2a18" }, "ComicNeue": { - "ttf": "ComicNeue/ComicNeue-Regular.ttf?51c27", "woff": "ComicNeue/ComicNeue-Regular.woff?ff5e6", "woff2": "ComicNeue/ComicNeue-Regular.woff2?44c5e", "variants": { @@ -474,33 +463,27 @@ }, "ComicNeue Bold": { "fontweight": "bold", - "ttf": "ComicNeue/ComicNeue-Bold.ttf?9969d", "woff": "ComicNeue/ComicNeue-Bold.woff?cc2d9", "woff2": "ComicNeue/ComicNeue-Bold.woff2?c1376" }, "ComicNeue Oblique": { "fontstyle": "italic", - "ttf": "ComicNeue/ComicNeue-Regular-Oblique.ttf?aaf71", "woff": "ComicNeue/ComicNeue-Regular-Oblique.woff?45c14", "woff2": "ComicNeue/ComicNeue-Regular-Oblique.woff2?4ddaf" }, "Doulos SIL": { - "ttf": "DoulosSIL/DoulosSIL-R.ttf?bbad3", "woff": "DoulosSIL/DoulosSIL-R.woff?f76f6", "woff2": "DoulosSIL/DoulosSIL-R.woff2?61737" }, "East Syriac Adiabene": { - "ttf": "EastSyriacAdiabene/SyrCOMAdiabene.ttf?73604", "woff": "EastSyriacAdiabene/SyrCOMAdiabene.woff?cfbf0", "woff2": "EastSyriacAdiabene/SyrCOMAdiabene.woff2?9ff2e" }, "Estrangelo Edessa": { - "ttf": "EstrangeloEdessa/SyrCOMEdessa.ttf?63083", "woff": "EstrangeloEdessa/SyrCOMEdessa.woff?c4484", "woff2": "EstrangeloEdessa/SyrCOMEdessa.woff2?3e525" }, "FreeFont-Thaana": { - "ttf": "FreeFontThana/FreeFont-Thaana.ttf?ccecc", "woff": "FreeFontThana/FreeFont-Thaana.woff?0f06e", "woff2": "FreeFontThana/FreeFont-Thaana.woff2?ad021", "variants": { @@ -509,12 +492,10 @@ }, "FreeFont-Thaana Bold": { "fontweight": "bold", - "ttf": "FreeFontThana/FreeFont-Thaana-Bold.ttf?26aea", "woff": "FreeFontThana/FreeFont-Thaana-Bold.woff?5eb85", "woff2": "FreeFontThana/FreeFont-Thaana-Bold.woff2?eaf55" }, "GentiumPlus": { - "ttf": "GentiumPlus/GentiumPlus-R.ttf?66f17", "woff": "GentiumPlus/GentiumPlus-R.woff?1abc3", "woff2": "GentiumPlus/GentiumPlus-R.woff2?aa576", "variants": { @@ -523,17 +504,14 @@ }, "GentiumPlus Italic": { "fontstyle": "italic", - "ttf": "GentiumPlus/GentiumPlus-I.ttf?23e33", "woff": "GentiumPlus/GentiumPlus-I.woff?ab550", "woff2": "GentiumPlus/GentiumPlus-I.woff2?35b11" }, "Gubbi": { - "ttf": "Gubbi/Gubbi.ttf?75bf7", "woff": "Gubbi/Gubbi.woff?ce807", "woff2": "Gubbi/Gubbi.woff2?66d38" }, "Hanuman": { - "ttf": "Hanuman/Hanuman.ttf?3e11d", "woff": "Hanuman/Hanuman.woff?d5078", "woff2": "Hanuman/Hanuman.woff2?0107a", "variants": { @@ -542,17 +520,14 @@ }, "Hanuman Bold": { "fontweight": "bold", - "ttf": "Hanuman/Hanumanb.ttf?cdaaf", "woff": "Hanuman/Hanumanb.woff?27aeb", "woff2": "Hanuman/Hanumanb.woff2?1b52d" }, "Hussaini Nastaleeq": { - "ttf": "HussainiNastaleeq/hussaini-nastaleeq.ttf?7babb", "woff": "HussainiNastaleeq/hussaini-nastaleeq.woff?5c44b", "woff2": "HussainiNastaleeq/hussaini-nastaleeq.woff2?2b174" }, "Iranian Sans": { - "ttf": "IranianSans/irsans.ttf?e2097", "woff": "IranianSans/irsans.woff?ec963", "woff2": "IranianSans/irsans.woff2?17429", "variants": { @@ -561,22 +536,18 @@ }, "Iranian Sans Bold": { "fontweight": "bold", - "ttf": "IranianSans/irsansb.ttf?730e5", "woff": "IranianSans/irsansb.woff?cf164", "woff2": "IranianSans/irsansb.woff2?d24da" }, "Iranian Serif": { - "ttf": "IranianSerif/irseri.ttf?b9d68", "woff": "IranianSerif/irseri.woff?d153b", "woff2": "IranianSerif/irseri.woff2?2e4dd" }, "Jomolhari": { - "ttf": "Jomolhari/Jomolhari.ttf?75f85", "woff": "Jomolhari/Jomolhari.woff?3a60b", "woff2": "Jomolhari/Jomolhari.woff2?f448a" }, "Junicode": { - "ttf": "Junicode/Junicode.ttf?f1e3e", "woff": "Junicode/Junicode.woff?dc7ef", "woff2": "Junicode/Junicode.woff2?7e6d6", "variants": { @@ -587,40 +558,33 @@ }, "Junicode Bold": { "fontweight": "bold", - "ttf": "Junicode/Junicode-Bold.ttf?65a4f", "woff": "Junicode/Junicode-Bold.woff?f7ef4", "woff2": "Junicode/Junicode-Bold.woff2?d5d04" }, "Junicode Bold Italic": { "fontweight": "bold", "fontstyle": "italic", - "ttf": "Junicode/Junicode-BoldItalic.ttf?89f2f", "woff": "Junicode/Junicode-BoldItalic.woff?3cec9", "woff2": "Junicode/Junicode-BoldItalic.woff2?80351" }, "Junicode Italic": { "fontstyle": "italic", - "ttf": "Junicode/Junicode-Italic.ttf?7f30d", "woff": "Junicode/Junicode-Italic.woff?c458b", "woff2": "Junicode/Junicode-Italic.woff2?3fe39" }, "KhmerOS": { - "ttf": "KhmerOS/KhmerOS.ttf?d2771", "woff": "KhmerOS/KhmerOS.woff?2ef9e", "woff2": "KhmerOS/KhmerOS.woff2?34973" }, "KhmerOSbattambang": { - "ttf": "KhmerOSbattambang/KhmerOSbattambang.ttf?ae981", "woff": "KhmerOSbattambang/KhmerOSbattambang.woff?69379", "woff2": "KhmerOSbattambang/KhmerOSbattambang.woff2?da936" }, "Lateef": { - "ttf": "Lateef/LateefRegOT.ttf?09400", "woff": "Lateef/LateefRegOT.woff?05c72", "woff2": "Lateef/LateefRegOT.woff2?3ce56" }, "Linux Libertine": { - "ttf": "LinuxLibertine/LinLibertine_Rah.ttf?d772b", "woff": "LinuxLibertine/LinLibertine_Rah.woff?c0828", "woff2": "LinuxLibertine/LinLibertine_Rah.woff2?4d59a", "variants": { @@ -631,45 +595,37 @@ }, "Linux Libertine Bold": { "fontweight": "bold", - "ttf": "LinuxLibertine/LinLibertine_RBah.ttf?11d4f", "woff": "LinuxLibertine/LinLibertine_RBah.woff?50e30", "woff2": "LinuxLibertine/LinLibertine_RBah.woff2?fbcf2" }, "Linux Libertine Bold Italic": { "fontweight": "bold", "fontstyle": "italic", - "ttf": "LinuxLibertine/LinLibertine_RBIah.ttf?54922", "woff": "LinuxLibertine/LinLibertine_RBIah.woff?8a853", "woff2": "LinuxLibertine/LinLibertine_RBIah.woff2?e02db" }, "Linux Libertine Italic": { "fontstyle": "italic", - "ttf": "LinuxLibertine/LinLibertine_RIah.ttf?70eb1", "woff": "LinuxLibertine/LinLibertine_RIah.woff?1c058", "woff2": "LinuxLibertine/LinLibertine_RIah.woff2?4e887" }, "Madan": { - "ttf": "madan/madan.ttf?a9297", "woff": "madan/madan.woff?cee7d", "woff2": "madan/madan.woff2?81dd1" }, "Miriam CLM": { - "ttf": "MiriamCLM/MiriamCLM-Book.ttf?a070f", "woff": "MiriamCLM/MiriamCLM-Book.woff?28216", "woff2": "MiriamCLM/MiriamCLM-Book.woff2?f3942" }, "Myanmar3": { - "ttf": "Myanmar3/Myanmar3.ttf?10d5e", "woff": "Myanmar3/Myanmar3.woff?60817", "woff2": "Myanmar3/Myanmar3.woff2?2b586" }, "NafeesWeb": { - "ttf": "NafeesWeb/NafeesWeb.ttf?fc08b", "woff": "NafeesWeb/NafeesWeb.woff?809c8", "woff2": "NafeesWeb/NafeesWeb.woff2?5f501" }, "Nazli": { - "ttf": "Nazli/Nazli.ttf?0d706", "woff": "Nazli/Nazli.woff?6eb79", "woff2": "Nazli/Nazli.woff2?d54a3", "variants": { @@ -678,18 +634,15 @@ }, "Nazli Bold": { "fontweight": "bold", - "ttf": "Nazli/Nazli-bold.ttf?a0084", "woff": "Nazli/Nazli-bold.woff?ae0c3", "woff2": "Nazli/Nazli-bold.woff2?8d27e" }, "Nokora Bold": { "fontweight": "bold", - "woff": "Nokora/Nokora-Regular.woff?36345", - "woff2": "Nokora/Nokora-Regular.woff2?66157", - "ttf": "Nokora/Nokora-Regular.ttf?88c35" + "woff": "Nokora/Nokora-Bold.woff?cf0df", + "woff2": "Nokora/Nokora-Bold.woff2?b50d8" }, "Nokora Regular": { - "ttf": "Nokora/Nokora-Regular.ttf?88c35", "woff": "Nokora/Nokora-Regular.woff?36345", "woff2": "Nokora/Nokora-Regular.woff2?66157", "variants": { @@ -697,17 +650,14 @@ } }, "NotoSansSundanese Regular": { - "ttf": "NotoSansSundanese/NotoSansSundanese-Regular.ttf?e7cec", "woff": "NotoSansSundanese/NotoSansSundanese-Regular.woff?a8907", "woff2": "NotoSansSundanese/NotoSansSundanese-Regular.woff2?97973" }, "Nuosu SIL": { - "ttf": "NuosuSIL/NuosuSIL.ttf?8f309", "woff": "NuosuSIL/NuosuSIL.woff?89513", "woff2": "NuosuSIL/NuosuSIL.woff2?223bb" }, "OpenDyslexic": { - "ttf": "OpenDyslexic/OpenDyslexic-Regular.ttf?3f8ca", "woff": "OpenDyslexic/OpenDyslexic-Regular.woff?7a21f", "woff2": "OpenDyslexic/OpenDyslexic-Regular.woff2?104a3", "variants": { @@ -718,25 +668,21 @@ }, "OpenDyslexic Bold": { "fontweight": "bold", - "ttf": "OpenDyslexic/OpenDyslexic-Bold.ttf?63ff4", "woff": "OpenDyslexic/OpenDyslexic-Bold.woff?75b90", "woff2": "OpenDyslexic/OpenDyslexic-Bold.woff2?42307" }, "OpenDyslexic BoldItalic": { "fontweight": "bold", "fontstyle": "italic", - "ttf": "OpenDyslexic/OpenDyslexic-BoldItalic.ttf?d9b37", "woff": "OpenDyslexic/OpenDyslexic-BoldItalic.woff?570d3", "woff2": "OpenDyslexic/OpenDyslexic-BoldItalic.woff2?12f7e" }, "OpenDyslexic Italic": { "fontstyle": "italic", - "ttf": "OpenDyslexic/OpenDyslexic-Italic.ttf?9e181", "woff": "OpenDyslexic/OpenDyslexic-Italic.woff?9fa06", "woff2": "OpenDyslexic/OpenDyslexic-Italic.woff2?14d96" }, "OskiEast": { - "ttf": "OskiEast/oskie.ttf?43616", "woff": "OskiEast/oskie.woff?10d59", "woff2": "OskiEast/oskie.woff2?a87bf", "variants": { @@ -747,40 +693,33 @@ }, "OskiEast Bold": { "fontweight": "bold", - "ttf": "OskiEast/oskiebold.ttf?5e29e", "woff": "OskiEast/oskiebold.woff?d6ae5", "woff2": "OskiEast/oskiebold.woff2?30d18" }, "OskiEast Bold Italic": { "fontweight": "bold", "fontstyle": "italic", - "ttf": "OskiEast/oskiebolditalic.ttf?75e2c", "woff": "OskiEast/oskiebolditalic.woff?fcee2", "woff2": "OskiEast/oskiebolditalic.woff2?ae266" }, "OskiEast Italic": { "fontstyle": "italic", - "ttf": "OskiEast/oskieitalic.ttf?a6291", "woff": "OskiEast/oskieitalic.woff?ecb14", "woff2": "OskiEast/oskieitalic.woff2?2745f" }, "Padauk": { - "ttf": "Padauk/Padauk-Regular.ttf?03503", "woff": "Padauk/Padauk-Regular.woff?544be", "woff2": "Padauk/Padauk-Regular.woff2?97419" }, "Pagul": { - "ttf": "Pagul/Pagul.ttf?166e1", "woff": "Pagul/Pagul.woff?4d3bf", "woff2": "Pagul/Pagul.woff2?2d88b" }, "Pangururan": { - "ttf": "Pangururan/Pangururan.ttf?6c158", "woff": "Pangururan/Pangururan.woff?b079d", "woff2": "Pangururan/Pangururan.woff2?5fecd" }, "Phetsarath": { - "ttf": "Phetsarath/Phetsarath-Regular.ttf?2a838", "woff": "Phetsarath/Phetsarath-Regular.woff?dee5c", "woff2": "Phetsarath/Phetsarath-Regular.woff2?b9d92", "variants": { @@ -789,77 +728,62 @@ }, "Phetsarath-Bold": { "fontweight": "bold", - "ttf": "Phetsarath/Phetsarath-Bold.ttf?a21f7", "woff": "Phetsarath/Phetsarath-Bold.woff?8c43d", "woff2": "Phetsarath/Phetsarath-Bold.woff2?2d5a1" }, "RailwaySans": { - "ttf": "RailwaySans/RailwaySans.ttf?58963", "woff": "RailwaySans/RailwaySans.woff?fda9a", "woff2": "RailwaySans/RailwaySans.woff2?a6c17" }, "Saab": { - "ttf": "Saab/Saab.ttf?1c75f", "woff": "Saab/Saab.woff?5c0ec", "woff2": "Saab/Saab.woff2?633bb" }, "Saweri": { - "ttf": "saweri/saweri.ttf?f6926", "woff": "saweri/saweri.woff?fe688", "woff2": "saweri/saweri.woff2?fe482" }, "Scheherazade": { - "ttf": "Scheherazade/Scheherazade-R.ttf?8d8ce", "woff": "Scheherazade/Scheherazade-R.woff?286b2", "woff2": "Scheherazade/Scheherazade-R.woff2?b340b" }, "SertoUrhoy": { - "ttf": "SertoUrhoy/SyrCOMUrhoy.ttf?e5196", "woff": "SertoUrhoy/SyrCOMUrhoy.woff?82242", "woff2": "SertoUrhoy/SyrCOMUrhoy.woff2?845a8" }, "Shapour": { - "ttf": "Shapour/Shapour.ttf?1cfce", "woff": "Shapour/Shapour.woff?ad380", "woff2": "Shapour/Shapour.woff2?977a2" }, "Siyam Rupali": { - "ttf": "SiyamRupali/SiyamRupali.ttf?988f3", "woff": "SiyamRupali/SiyamRupali.woff?5d2db", "woff2": "SiyamRupali/SiyamRupali.woff2?035b8" }, "Skeirs II": { - "ttf": "Skeirs/Skeirs-II.ttf?f2a28", "woff": "Skeirs/Skeirs-II.woff?a5fc3", "woff2": "Skeirs/Skeirs-II.woff2?7d27b" }, "Suwannaphum": { - "ttf": "Suwannaphum/Suwannaphum.ttf?4e62d", "woff": "Suwannaphum/Suwannaphum.woff?d5f25", "woff2": "Suwannaphum/Suwannaphum.woff2?d3394" }, "Taamey Frank CLM": { - "ttf": "TaameyFrankCLM/TaameyFrankCLM.ttf?de274", "woff": "TaameyFrankCLM/TaameyFrankCLM.woff?73757", "woff2": "TaameyFrankCLM/TaameyFrankCLM.woff2?23293" }, "TharLon": { - "ttf": "TharLon/TharLon.ttf?91312", "woff": "TharLon/TharLon.woff?0df3e", "woff2": "TharLon/TharLon.woff2?9012f" }, "Tuladha Jejeg": { - "ttf": "TuladhaJejeg/TuladhaJejeg_gr.ttf?210ce", "woff": "TuladhaJejeg/TuladhaJejeg_gr.woff?7ebe2", "woff2": "TuladhaJejeg/TuladhaJejeg_gr.woff2?8d13d" }, "UnifrakturMaguntia": { - "ttf": "UnifrakturMaguntia/UnifrakturMaguntia.ttf?1cf8f", "woff": "UnifrakturMaguntia/UnifrakturMaguntia.woff?6ad8f", "woff2": "UnifrakturMaguntia/UnifrakturMaguntia.woff2?23272" }, "lklug": { - "ttf": "lklug/lklug.ttf?96b2f", "woff": "lklug/lklug.woff?57de7", "woff2": "lklug/lklug.woff2?7d2c4" }