微信小程序API繪圖setFontSize,微信小程序字號設置
2017-12-22
導讀:繪圖接口和方法 canvasContext.setFontSize 定義 設置字體的字號。 參數 參數 類型 說明 fontSize Number 字體的字號 例子 const ctx = wx.createCanvasContext( 'myCanvas' )ctx.setFontSize( 20 )ctx.fillText( '20' , 20...
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()
更多微信小程序開發教程,可以關注hi小程序。
第二部分:如何開通一個小商店