mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
load fonts on .map file open
This commit is contained in:
parent
25de9edb13
commit
cfb6e1eeeb
5 changed files with 29 additions and 16 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue