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

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