4 <canvas id='c'
></canvas>
6 var fontNameList
= ["Palatino Linotype", "Georgia", "Times New Roman", "Arial", "Arial Black", "cursive", "Impact", "Tahoma", "Helvetica", "Verdana", "Geneva", "sans-serif", "Courier", "Monaco"]
7 var fontStyleList
= ["", "italic", "oblique"];
8 var fontWeightList
= ["", "bold", "bolder", "lighter"];
9 var fontSizeList
= ["10pt", "15pt", "20pt", "small", "large", "15px", "20mm"];
11 var canvas
= document
.getElementById("c");
12 var ctx
= canvas
.getContext("2d");
16 canvas
.width
= canvas
.width
;
17 fontNameList
.forEach(function(fontName
) {
18 fontStyleList
.forEach(function(fontStyle
) {
19 fontWeightList
.forEach(function(fontWeight
) {
20 fontSizeList
.forEach(function(fontSize
) {
21 ctx
.font
= fontStyle
+ " " + fontWeight
+ " " + fontSize
+ " " + fontName
;
22 // Use the font to make sure the font is completely resolved (has no pending lazy inits)
23 ctx
.fillText("Test", 0, 50);
28 requestAnimationFrame(doFrame
);
30 requestAnimationFrame(doFrame
);