blob: 7c3c9850a55947a3da49af34f74ee1ec1536fc6e [file] [log] [blame]
hyatt@apple.comafe62052008-09-03 18:13:39 +00001<html>
2<body>
3<canvas id="canvas" width=600 height=600 style="border:5px solid black">
4<script>
rniwa@webkit.org38608af2012-06-19 07:23:13 +00005if (window.testRunner)
6 testRunner.dumpAsText(true);
mdelaney@apple.com52b87e22011-03-31 00:00:59 +00007
hyatt@apple.comafe62052008-09-03 18:13:39 +00008var ctx = document.getElementById('canvas').getContext('2d');
9var lingrad = ctx.createLinearGradient(0,0,600,600);
10lingrad.addColorStop(0, '#00ABEB');
11lingrad.addColorStop(1.0, '#fff');
12
13var x = 10;
14var y = 30;
15
16ctx.font = "32px 'Times New Roman'";
17ctx.fillText("Normal Fill Text", x, y);
18
19y += 40;
20
21ctx.lineWidth = 2;
22ctx.strokeText("Normal Stroke Text", x, y);
23
24y += 40;
25
26ctx.fillStyle = lingrad;
27ctx.fillText("Gradient Fill Text", x, y);
28
29y += 40;
30
31ctx.strokeStyle = lingrad;
32ctx.strokeText("Gradient Stroke Text", x, y);
33
34ctx.textAlign = "end";
35
36x = 590;
37y += 40;
38
39ctx.fillStyle = 'black';
40ctx.fillText("Normal Fill Text", x, y);
41
42y += 40;
43
44ctx.strokeStyle = 'black';
45ctx.lineWidth = 2;
46ctx.strokeText("Normal Stroke Text", x, y);
47
48y += 40;
49
50ctx.fillStyle = lingrad;
51ctx.fillText("Gradient Fill Text", x, y);
52
53y += 40;
54
55ctx.strokeStyle = lingrad;
56ctx.strokeText("Gradient Stroke Text", x, y);
57
58y += 40;
59x = 300;
60
61ctx.textAlign = "center";
62
63ctx.fillStyle = 'black';
64ctx.fillText("Normal Fill Text", x, y);
65
66y += 40;
67
68ctx.strokeStyle = 'black';
69ctx.lineWidth = 2;
70ctx.strokeText("Normal Stroke Text", x, y);
71
72y += 40;
73
74ctx.fillStyle = lingrad;
75ctx.fillText("Gradient Fill Text", x, y);
76
77y += 40;
78
79ctx.strokeStyle = lingrad;
80ctx.strokeText("Gradient Stroke Text", x, y);
81
82y += 40;
83
84</script>