Skip to content

Commit 06cd795

Browse files
committed
fix errors
1 parent 6b5981b commit 06cd795

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/App.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ export default {
263263
selectedFontName: null,
264264
useCustomFont: false,
265265
customFontInput: null,
266+
customFont: null,
266267
strokeWeight: 1,
267268
fontScale: 1,
268269
enableFontSimplification: false,
@@ -349,10 +350,11 @@ export default {
349350
// fileName: file.name,
350351
displayName: svgFontRenderer.getFontData(fontName).info['font-family'],
351352
// basePath: basePath
353+
fontName : fontName
352354
}
353-
this.fonts.push(font);
355+
// this.fonts.push(font);
354356
this.selectedFontName = font.displayName;
355-
this.$set(this.selectedFont, "fontName", fontName);
357+
this.customFont = font;
356358
this.render();
357359
} else {
358360
this.error = true;
@@ -366,7 +368,7 @@ export default {
366368
this.displayedSvgContent = this.rawSvgContent = svgFontRenderer.renderTextSVG(
367369
this.text,
368370
{
369-
font: this.selectedFont.fontName,
371+
font: this.useCustomFont && this.customFont?.fontName? this.customFont.fontName : this.selectedFont.fontName,
370372
scale: 0.1,
371373
}
372374
);

0 commit comments

Comments
 (0)