Để scale font, xem ví dụ.
Canvas: 800px Font Size: 60px
Bạn cần dùng mã sau để scale font size dựa trên canvas −
var fontBase = 800; var fontSize = 60; function getFont() { var ratio = fontSize / fontBase; var cSize = canvas.width * ratio; return (cSize |0) + 'px sans-serif'; }