Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat Apple API Drawing SetFontSize (Set Font Size)


May 19, 2021 WeChat Mini Program Development Document


Table of contents


WeChat Apple API Drawing SetFontSize (Set Font Size) Drawing interfaces and methods

canvasContext.setFontSize


Defined

Set the font size.

Parameters

Parameters Type Description
fontSize Number The font size

Example

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()

WeChat Apple API Drawing SetFontSize (Set Font Size)

WeChat Apple API Drawing SetFontSize (Set Font Size) Drawing interfaces and methods