tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

2d.text.fontVariantCaps4.html (931B)


      1 <!DOCTYPE html>
      2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
      3 <meta charset="UTF-8">
      4 <link rel="match" href="2d.text.fontVariantCaps4-expected.html">
      5 <title>Canvas test: 2d.text.fontVariantCaps4</title>
      6 <h1>2d.text.fontVariantCaps4</h1>
      7 <p class="desc">Testing small caps setting in fontVariant</p>
      8 <canvas id="canvas" width="100" height="50">
      9  <p class="fallback">FAIL (fallback content)</p>
     10 </canvas>
     11 <script>
     12  const canvas = new OffscreenCanvas(100, 50);
     13  const ctx = canvas.getContext('2d');
     14 
     15  ctx.font = "small-caps 32px serif";
     16  // fontVariantCaps overrides the small-caps setting from the font attribute
     17  // (spec unclear, cf. https://github.com/whatwg/html/issues/8103)
     18  ctx.fontVariantCaps = "all-small-caps";
     19  ctx.fillText("Hello World", 20, 100);
     20 
     21  const outputCanvas = document.getElementById("canvas");
     22  outputCanvas.getContext('2d').drawImage(canvas, 0, 0);
     23 </script>