当前位置:K88软件开发文章中心编程全书微信小程序 → 文章内容

微信小程序API 绘图setFontSize(设置字号)

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-15 15:00:54

由 ?﹏???ζ???﹏﹏? 创建,youj 最后一次修改 2016-12-26 绘图接口和方法canvasContext.setFontSize定义设置字体的字号。参数参数类型说明fontSizeNumber字体的字号例子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()绘图接口和方法

微信小程序API 绘图setFontSize(设置字号)