From 22255149219b7b3a2ea5329c297ec63d5c2964c2 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 15 Jan 2020 09:55:00 +0800 Subject: [PATCH] web:support text font style --- doric-web/src/shader/DoricTextNode.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/doric-web/src/shader/DoricTextNode.ts b/doric-web/src/shader/DoricTextNode.ts index de24393f..3168fdef 100644 --- a/doric-web/src/shader/DoricTextNode.ts +++ b/doric-web/src/shader/DoricTextNode.ts @@ -41,7 +41,24 @@ export class DoricTextNode extends DoricViewNode { } break case "fontStyle": - v.style.fontWeight = "" + switch (prop) { + case "bold": + v.style.fontWeight = "bold" + v.style.fontStyle = "normal" + break + case "italic": + v.style.fontWeight = "normal" + v.style.fontStyle = "italic" + break + case "bold_italic": + v.style.fontWeight = "bold" + v.style.fontStyle = "italic" + break + default: + v.style.fontWeight = "normal" + v.style.fontStyle = "normal" + break + } break default: super.blendProps(v, propName, prop)