load fonts on .map file open

This commit is contained in:
Azgaar 2021-07-11 00:29:58 +03:00
parent 25de9edb13
commit cfb6e1eeeb
5 changed files with 29 additions and 16 deletions

View file

@ -220,6 +220,15 @@ 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);
}
})();
void (function parseGridData() {
grid = JSON.parse(data[6]);
calculateVoronoi(grid, grid.points);