# CanvasContext.setFontSize(number fontSize)

设置字体的字号

# 参数

# number fontSize

字体的字号

# 示例代码

const ctx = qa.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()
1
2
3
4
5
6
7
8
9
10
11
12

在线客服