Source code

Revision control

Copy as Markdown

Other Tools

<!doctype HTML>
<html class="reftest-wait">
<meta charset="utf-8">
<title>HTML5 Canvas Test Reference: The lang attribute.</title>
<link rel="author" href="mailto:schenney@chromium.org"/>
<script src="/common/reftest-wait.js"></script>
<script>
function generateReference() {
let test_font = new FontFace(
// Lato-Medium is a font with language specific ligatures.
"Lato-Medium",
"url(/fonts/Lato-Medium.ttf)"
);
test_font.load().then((font) => {
document.fonts.add(font);
var canvas = document.getElementById('canvas1');
var ctx = canvas.getContext('2d');
// With no lang defined anywhere, this reference will use the unknown
// language, whatever that might produce on the platform.
ctx.font = '25px Lato-Medium';
ctx.fillText('fi', 5, 50);
takeScreenshot();
});
}
</script>
<body onload="generateReference()">
<canvas id="canvas1" width="300" height="150">
Browser does not support HTML5 Canvas.
</canvas>
</body>
</html>