blob: 83e5fd3ec1510eba70d90179ce4cedf87709a34b [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
@font-face {
font-family: "WebFont";
src: url("resources/Ahem-sbix.ttf") format("truetype");
}
</style>
</head>
<body>
<canvas id="canvas" width="700" height="500" style="width: 700px; height: 500px;"></canvas>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
let font = "100px 'WebFont'";
document.fonts.load(font).then(function() {
let canvas = document.getElementById("canvas");
let context = canvas.getContext("2d");
context.lineWidth = 2;
context.font = font;
context.fillText("A B", 200, 200);
context.fillStyle = "green";
context.strokeStyle = "green";
context.fillRect(300, 225, 152 / 2, 160 / 2);
context.strokeRect(420, 225, 20, 100);
context.fillRect(500, 229, 160 / 2, 152 / 2);
if (window.testRunner)
testRunner.notifyDone();
});
</script>
</body>
</html>