blob: 425e884e2cddfa2023d179f20f5d2ccbc0282a15 [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 = "50px 'WebFont'";
document.fonts.load(font).then(function() {
let canvas = document.getElementById("canvas");
let context = canvas.getContext("2d");
context.scale(2, 2);
context.font = font;
context.fillText("A\u7EB5B", 100, 100);
context.fillStyle = "white";
context.fillRect(100, 40 + 100 - 160 / 2, 152 / 2 / 2, 160 / 2 / 2);
context.fillRect(160, 40 + 100 - 160 / 2, 20 / 2, 100 / 2);
context.fillRect(200, 38 + 100 - 152 / 2, 160 / 2 / 2, 152 / 2 / 2);
if (window.testRunner)
testRunner.notifyDone();
});
</script>
</body>
</html>