mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
fix local fonts
This commit is contained in:
parent
e8ae713398
commit
566a811d1f
2 changed files with 5 additions and 8 deletions
|
|
@ -136,18 +136,15 @@ declareDefaultFonts(); // execute once on load
|
|||
|
||||
function declareFont(font) {
|
||||
const {family, src, ...rest} = font;
|
||||
if (!src) return;
|
||||
addFontOption(family);
|
||||
|
||||
if (!src) return;
|
||||
const fontFace = new FontFace(family, src, {...rest, display: "block"});
|
||||
document.fonts.add(fontFace);
|
||||
addFontOption(family);
|
||||
}
|
||||
|
||||
function declareDefaultFonts() {
|
||||
fonts.forEach(font => {
|
||||
if (font.src) declareFont(font);
|
||||
else addFontOption(font.family);
|
||||
});
|
||||
fonts.forEach(font => declareFont(font));
|
||||
}
|
||||
|
||||
function getUsedFonts(svg) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue