Skip to content

Commit fc47556

Browse files
committed
fix: font-weight
1 parent c66dc70 commit fc47556

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export default class ImageExample {
294294
| color | 字体颜色 | black |
295295
| maxLines | 最大行数 | 不限,根据 width 来 |
296296
| lineHeight | 行高(上下两行文字 baseline 的距离) | fontSize 大小 |
297-
| fontWeight | 字体粗细。仅支持 normal, bold | normal |
297+
| fontWeight | 字体粗细。 | normal |
298298
| textDecoration | 文本修饰,支持 underline、 overline、 line-through,也可组合使用 | 无效果 |
299299
| textStyle | fill: 填充样式,stroke:镂空样式 | fill |
300300
| background | 文字背景颜色 ||

components/painter/lib/pen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ export default class Painter {
211211
textArray[i] = ' ';
212212
}
213213
}
214-
const fontWeight = view.css.fontWeight === 'bold' ? 'bold' : 'normal';
215-
const textStyle = view.css.textStyle === 'italic' ? 'italic' : 'normal';
214+
const fontWeight = view.css.fontWeight || '400';
215+
const textStyle = view.css.textStyle || 'normal';
216216
if (!view.css.fontSize) {
217217
view.css.fontSize = '20rpx';
218218
}

pages/example/example.wxml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
<button bind:tap='saveImage'>保存</button>
66
</view>
77
<painter
8-
customStyle='margin-left: 40rpx; height: 1000rpx;'
98
customActionStyle="{{customActionStyle}}"
10-
dancePalette="{{template}}"
119
palette="{{paintPallette}}"
1210
bind:imgOK="onImgOK"
1311
bind:touchEnd="touchEnd"
1412
action="{{action}}"
15-
use2D="{{true}}"
1613
widthPixels="1000"
17-
/>
18-
<!-- <image src="{{image}}" style="width: 654rpx; height: 1000rpx; margin-left:40rpx;"/> -->
19-
14+
/>
15+
<image src="{{image}}" style="width: 654rpx; height: 1000rpx; margin-left:40rpx;"/>
2016
</view>

0 commit comments

Comments
 (0)