title: Access CSS fonts from Android 'Assets' folder
body: <p>I'm trying to change the font of web pages loaded in to a Browser app developed for Android. Currently my custom font is hosted in a URL &amp; I access the font from there by injecting a JavaScript to the page to change the style sheet (CSS) font face.</p>
  
  <p>Here is the current code:</p>
  
  <pre><code>var css = '@font-face {font-family: "dhanika"; src: url(http://www.sample.lk/DhanikaWeb.ttf);} si {font-family: "dhanika"}';
  var style = document.getElementsByTagName("style")[0];
  style.appendChild(document.createTextNode(css));
  </code></pre>
  
  <p>This code works perfectly. But it takes some time to load the font from the URL. And also it is not good to load the font each time since it may incur data charges.</p>
  
  <p>Therefore I wanna know weather there is a method to access my custom font from the JavaScript, if I place my font in my app's 'Assets' folder. Glad if anyone can provide the code.</p>
  
  <p>Any help is appreciated!</p>