tor-browser

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

colrv1-05.html (593B)


      1 <!DOCTYPE html>
      2 <html>
      3 <meta charset=utf-8>
      4 <title>COLRv1 font test: compositing operators</title>
      5 <style>
      6 @font-face {
      7  font-family: CAhem;
      8  src: url("CAhem.ttf");
      9 }
     10 .test { margin: 10px; padding: 10px; }
     11 span { font: 100px/1 CAhem; }
     12 </style>
     13 
     14 <p>Some glyphs using PAINT_COMPOSITE:</p>
     15 <div class="test">
     16 <span>ghijkl</span>
     17 </div>
     18 
     19 <p>And painting them to a canvas element:</p>
     20 <canvas id=c width=600 height=100></canvas>
     21 <script>
     22 document.fonts.load("100px CAhem").then(function () {
     23  ctx = c.getContext("2d");
     24  ctx.font = "100px CAhem";
     25  ctx.fillText("ghijkl", 0, 80);
     26 });
     27 </script>