feat: web text support custom font

This commit is contained in:
钱泽虹 2023-08-31 17:43:27 +08:00 committed by osborn
parent af2072ef25
commit d70cc9c28e
3 changed files with 3 additions and 11 deletions

View File

@ -7203,11 +7203,7 @@ var doric_web = (function (exports, axios, sandbox) {
} }
break; break;
case "font": case "font":
const fontLink = document.createElement('link'); this.view.style.fontFamily = prop;
fontLink.rel = 'stylesheet';
fontLink.href = `${prop}.css`;
document.head.appendChild(fontLink);
this.view.classList.add(prop);
break; break;
case "fontStyle": case "fontStyle":
switch (prop) { switch (prop) {

File diff suppressed because one or more lines are too long

View File

@ -43,11 +43,7 @@ export class DoricTextNode extends DoricViewNode {
} }
break break
case "font": case "font":
const fontLink = document.createElement('link') this.view.style.fontFamily = prop
fontLink.rel = 'stylesheet'
fontLink.href = `${prop}.css`
document.head.appendChild(fontLink)
this.view.classList.add(prop)
break break
case "fontStyle": case "fontStyle":
switch (prop) { switch (prop) {