tor-browser

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

text-lang-worker-en.js (607B)


      1 self.onmessage = function(e) {
      2  const offscreen = e.data.canvas;
      3  offscreen_ctx = offscreen.getContext('2d');
      4 
      5  let test_font = new FontFace(
      6    // Lato-Medium is a font with language specific ligatures.
      7    "Lato-Medium",
      8    "url(/fonts/Lato-Medium.ttf)"
      9  );
     10 
     11  test_font.load().then((font) => {
     12    self.fonts.add(font);
     13    offscreen_ctx.font = '25px Lato-Medium';
     14    offscreen_ctx.lang = 'en';
     15    offscreen_ctx.fillText('fi', 5, 50);
     16 
     17    // Draw a single pixel, used to detect that the worker has completed.
     18    offscreen_ctx.fillStyle = '#0f0';
     19    offscreen_ctx.fillRect(0, 0, 1, 1);
     20  });
     21 }