From fe55b4012913f0b18480ad523c0d27e5003297b7 Mon Sep 17 00:00:00 2001 From: CPPAlien Date: Thu, 7 Jan 2021 16:54:47 +0800 Subject: [PATCH] fix: font-weight --- lib/pen.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pen.js b/lib/pen.js index 871cdc0..444f318 100644 --- a/lib/pen.js +++ b/lib/pen.js @@ -211,8 +211,8 @@ export default class Painter { textArray[i] = ' '; } } - const fontWeight = view.css.fontWeight === 'bold' ? 'bold' : 'normal'; - const textStyle = view.css.textStyle === 'italic' ? 'italic' : 'normal'; + const fontWeight = view.css.fontWeight || '400'; + const textStyle = view.css.textStyle || 'normal'; if (!view.css.fontSize) { view.css.fontSize = '20rpx'; }