blob: 73759393822d5c2c4bfd4883b49359353ed51979 [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.font = font;
let gradient = context.createLinearGradient(100, 200, 400, 200);
gradient.addColorStop(0, "rgb(255, 0, 128)");
gradient.addColorStop(1, "rgb(255, 153, 51)");
context.fillStyle = gradient;
context.fillText("A\u7EB5B", 100, 100);
context.fillStyle = "white";
context.fillRect(100, 20, 152 / 2, 160 / 2);
context.fillRect(220, 20, 20, 100);
context.fillRect(300, 24, 160 / 2, 152 / 2);
if (window.testRunner)
testRunner.notifyDone();
});
</script>
</body>
</html>