tor-browser

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

canvas.2d.lang-ref.html (1348B)


      1 <!doctype HTML>
      2 <html class="reftest-wait">
      3  <meta charset="utf-8">
      4  <title>HTML5 Canvas Test Reference: The lang attribute.</title>
      5  <link rel="author" href="mailto:schenney@chromium.org"/>
      6  <script src="/common/reftest-wait.js"></script>
      7  <style>
      8    #canvas-en {
      9      position: absolute;
     10      top: 10px;
     11      left: 10px;
     12    }
     13    #canvas-tr {
     14      position: absolute;
     15      top: 120px;
     16      left: 10px;
     17    }
     18  </style>
     19  <script>
     20    function drawText(language) {
     21      var canvas = document.getElementById('canvas-' + language);
     22      var ctx = canvas.getContext('2d');
     23 
     24      ctx.font = '25px Lato-Medium';
     25      ctx.fillText('fi', 5, 50);
     26    }
     27    function generateReference() {
     28      let test_font = new FontFace(
     29        // Lato-Medium is a font with language specific ligatures.
     30        "Lato-Medium",
     31        "url(/fonts/Lato-Medium.ttf)"
     32      );
     33 
     34      test_font.load().then((font) => {
     35        document.fonts.add(font);
     36        drawText('tr');
     37        drawText('en');
     38        takeScreenshot();
     39      });
     40    }
     41  </script>
     42  <body onload="generateReference()">
     43    <canvas lang="en" id="canvas-tr" width="300" height="100">
     44      Browser does not support HTML5 Canvas.
     45    </canvas>
     46    <canvas lang="tr" id="canvas-en" width="300" height="100">
     47      Browser does not support HTML5 Canvas.
     48    </canvas>
     49  </body>
     50 </html>