Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<meta charset="UTF-8">
<title>Canvas test: 2d.text.shape.fillGlyphRun-direction-change.tentative</title>
<h1>2d.text.shape.fillGlyphRun-direction-change.tentative</h1>
<p class="desc">Test that fillGlyphRun() and fillGlyphRuns() render with the direction used when the text was shaped, even if the direction set on the context has changed since.</p>
<canvas id="canvas" width="500" height="200">
<p class="fallback">FAIL (fallback content)</p>
</canvas>
<script>
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d');
ctx.font = '30px serif';
ctx.textAlign = 'left';
ctx.direction = 'rtl';
const texts = ['ab (', 'א (b)', 'Test ☺️ א World'];
for (let i = 0; i < texts.length; ++i) {
const y = 40 + i * 60;
ctx.fillText(texts[i], 10, y);
ctx.fillText(texts[i], 260, y);
}
</script>