|
|
@@ -143,6 +143,10 @@ export const useProjectStore = defineStore('project', () => {
|
|
|
|
|
|
const loadedFontKeys = new Set<string>()
|
|
|
|
|
|
+ const getCssUrl = (url: string) => {
|
|
|
+ return `url("${url.replace(/\\/g, '/').replace(/"/g, '\\"')}")`
|
|
|
+ }
|
|
|
+
|
|
|
const hasLoadedFont = async (fontName: string) => {
|
|
|
await document.fonts.ready
|
|
|
let loaded = false
|
|
|
@@ -172,7 +176,7 @@ export const useProjectStore = defineStore('project', () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- const fontFace = new FontFace(font.fileName, `url('${fontUrl}')`)
|
|
|
+ const fontFace = new FontFace(font.fileName, getCssUrl(fontUrl))
|
|
|
try {
|
|
|
const loadedFont = await fontFace.load()
|
|
|
loadedFontKeys.add(fontKey)
|