后浪云小程序教程:微信小程序API 绘图setFontSize(设置字号)
绘图接口和方法
canvasContext.setFontSize
定义
设置字体的字号。
参数
| 参数 | 类型 | 说明 |
|---|---|---|
| fontSize | Number | 字体的字号 |
例子
const ctx = wx.createCanvasContext('myCanvas')
ctx.setFontSize(20)
ctx.fillText('20', 20, 20)
ctx.setFontSize(30)
ctx.fillText('30', 40, 40)
ctx.setFontSize(40)
ctx.fillText('40', 60, 60)
ctx.setFontSize(50)
ctx.fillText('50', 90, 90)
ctx.draw()
绘图接口和方法
版权声明:
作者:后浪云
链接:https://www.idc.net/help/185180/
文章版权归作者所有,未经允许请勿转载。
THE END

