canvasContext.font真机无效
1、第一个设置了粗体,第二个不设置粗体,第二个还是显示粗体
ctx.setFillStyle(‘#000000’);
ctx.beginPath();
ctx.font = ‘normal bold 20px sans-serif’;
ctx.fillText(‘test code’, 0, 20);
ctx.beginPath();
ctx.font = ‘normal normal 20px sans-serif’;
ctx.fillText(‘test code’, 0, 60);
2、不设置粗体的情况下,设置斜体无效
ctx.setFillStyle('#000000');
ctx.beginPath();
ctx.font = 'italic normal20px sans-serif';
ctx.fillText('test code', 0, 20);
3、英文数字设置斜体有效,中文无效
ctx.setFillStyle('#000000');
ctx.beginPath();
ctx.font = 'italic bold 20px sans-serif';
ctx.fillText('测试代码', 0, 20);

