fonts rework - start

This commit is contained in:
Azgaar 2021-09-03 00:55:07 +03:00
parent ae75f93174
commit 89b7299eab
7 changed files with 406 additions and 259 deletions

View file

@ -276,9 +276,9 @@ async function getMapURL(type, options = {}) {
}
// load non-standard fonts
const usedFonts = getFontsList(clone);
const webSafe = ["Georgia", "Times+New+Roman", "Comic+Sans+MS", "Lucida+Sans+Unicode", "Courier+New", "Verdana", "Arial", "Impact"];
const fontsToLoad = usedFonts.filter(font => !webSafe.includes(font));
const usedFonts = getUsedFonts(cloneEl);
const websafe = ["Georgia", "Times+New+Roman", "Comic+Sans+MS", "Lucida+Sans+Unicode", "Courier+New", "Verdana", "Arial", "Impact"];
const fontsToLoad = usedFonts.filter(font => !websafe.includes(font));
if (fontsToLoad.length) {
const url = "https://fonts.googleapis.com/css?family=" + fontsToLoad.join("|");
const fontStyle = await convertFontToDataURI(url);