4 <canvas id='c'
></canvas>
6 var fontNameList
= ["Palatino Linotype", "Times New Roman", "Arial", "sans-serif"]
7 var fontWeightList
= ["", "bold", "bolder", "lighter"];
8 var fontSizeList
= ["10pt", "15pt", "20pt", "small", "large", "15px", "20mm"];
10 var canvas
= document
.getElementById("c");
11 var ctx
= canvas
.getContext("2d");
14 canvas
.width
= canvas
.width
;
15 for (var i
= 0; i
< 20; i
++) {
16 fontNameList
.forEach(function(fontName
) {
17 fontWeightList
.forEach(function(fontWeight
) {
18 fontSizeList
.forEach(function(fontSize
) {
19 ctx
.font
= fontWeight
+ " " + fontSize
+ " " + fontName
;
20 // Use the font to make sure the font is completely resolved (has no pending lazy inits)
21 ctx
.fillText("Test", 0, 50);
26 requestAnimationFrame(doFrame
);
28 requestAnimationFrame(doFrame
);