load fonts on style set change

This commit is contained in:
Azgaar 2021-07-11 19:35:43 +03:00
parent cf269b775c
commit 99dd005e5c
5 changed files with 68 additions and 65 deletions

View file

@ -221,14 +221,7 @@ function parseLoadedData(data) {
burgLabels = labels.select("#burgLabels");
})();
void (function loadUsedFonts() {
const fontsInUse = getFontsList(svg);
const fontsToLoad = fontsInUse.filter(font => !fonts.includes(font));
if (fontsToLoad) {
const url = "https://fonts.googleapis.com/css?family=" + fontsToLoad.join("|");
addFonts(url);
}
})();
loadUsedFonts();
void (function parseGridData() {
grid = JSON.parse(data[6]);