WeChat アプレット開発ドキュメント
/ 微信小程序API 繪圖setFontSize(設(shè)置字號)
微信小程序API 繪圖setFontSize(設(shè)置字號)
setFontSize
定義
設(shè)置字體的字號。
參數(shù)
參數(shù) | 類型 | 說明 |
---|---|---|
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()