文字渲染基础
context.font = "bold 40px Arial";粗体 字号 字体
context.fillText(string,x,y,[maxlen]);字符 起始坐标
context.strokeText(string,x,y,[maxlen]);
font 默认值 20px sans-serif
context.font = font-style font-veriant font-weight font-size font-family
font-style normal(默认) italic(斜体) oblique(倾斜字体)
font-variant normal(默认) small-caps
font-weight lighter normal(默认) blod bolder
100 200 300 400
500 600 700
800 900
font-size 20px 2rem 150%
font-size xx-small x-small medium large
x-large xx-large
font-family 设置多种字体备用
支持@font-face
文本水平对齐
context.textAlign = left center right
文本垂直对齐方式
context.textBaseline = top middle bottom
alphifraphic(默认)拉丁语 ideographic 汉字日本字方块字 hanging 印度语
文本的度量
context.measureText(string).width