gecko-dev/layout/reftests/bugs/624359-1.html

42 строки
1.2 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Bug 624359</title>
<style type="text/css">
@font-face {
font-family: test;
src: url(../fonts/sil/GenR102.ttf);
};
</style>
<script type="text/javascript">
function draw()
{
/* if clusters are not handled properly, the diacritic will be placed
after the path turns a corner, and clipped from the canvas;
with correct cluster handling, it will appear above the "x" */
var txt = 'x' + String.fromCharCode(0x200c, 0x0308);
var canvas = document.getElementById("foo");
var width = canvas.width;
var height = canvas.height;
var ctx = canvas.getContext('2d');
ctx.font = "150px test";
ctx.fillStyle = 'white';
ctx.fillRect(0, 0, width, height);
ctx.save();
ctx.fillStyle = 'black';
ctx.beginPath();
ctx.translate(25, height / 2);
ctx.moveTo(0,0);
ctx.lineTo(40,0); /* create a corner just beyond where "x" will be placed */
ctx.lineTo(40,200);
ctx.mozTextAlongPath(txt, false);
ctx.restore();
}
</script>
</head>
<body onload="draw();">
<div style="font-family: test;">Cluster in mozTextAlongPath:</div>
<canvas id="foo" width="100" height="500"></canvas>
</body>
</html>