2d.text.measure.fillTextCluster-font-change.tentative-expected.html (861B)
1 <!DOCTYPE html> 2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> 3 <meta charset="UTF-8"> 4 <title>Canvas test: 2d.text.measure.fillTextCluster-font-change.tentative</title> 5 <h1>2d.text.measure.fillTextCluster-font-change.tentative</h1> 6 <p class="desc">Test that fillTextCluster() renders in the font used originally when the text was measured, even if the font set on the context has changed since.</p> 7 <canvas id="canvas" width="500" height="200"> 8 <p class="fallback">FAIL (fallback content)</p> 9 </canvas> 10 <script> 11 const canvas = document.getElementById("canvas"); 12 const ctx = canvas.getContext('2d'); 13 14 ctx.font = '50px sans-serif'; 15 const text = 'Hello ♦️ World!'; 16 let tm = ctx.measureText(text); 17 const clusters = tm.getTextClusters(); 18 19 const x = 100; 20 const y = 100; 21 ctx.fillText(text, x, y); 22 </script>