Android: custom font in WebView using CSS issue

4k views Asked by At

I'm currently developing an app using web view. I created some html files along with images and css (inside html file). When I put the files into assests folder the custom font is not loading. Without anychange i put it on server and accessed via mobile browser or accessed it via the app refering the online url (i.e. http://hotwordpresstips.com/japs/Index.html) and it shows properly. what am I missing here?? please find my HTML code below. If you want I'll put the java code too.

<html>
<head>
<style type="text/css">
@font-face {
 font-family: MyCustomFont;
 src: url("Bamini.eot") /* EOT file for IE */
}
@font-face {
 font-family: MyCustomFont;
 src: url("Bamini.ttf") /* TTF file for CSS3 browsers */
}

body {
 font-family: MyCustomFont, Verdana, Arial, sans-serif;
 font-size: medium;
 color: black
}
</style>
</head>
<body>
<div style="border:2px solid black;">
<img src="header.jpg" width=100%>
<h1>,yq;ifiaj; jhf;fpa [g;ghdpau;fs;</h1>
<UL>
<LI><a href="intro.html">cyf Aj;jk; mwpKfk;</a></LI>
<LI><a href="america.html">mnkupf;fhtpd; tUif</a></LI>
<LI><a href="pilot.html">tPuk; epiwe;j tpkhd Xl;b</a></LI>
<LI><a href="colombo.html">nfhOk;G> jpUkiyj; jhf;Fjy;</a></LI>
<LI><a href="end.html">KbTiu</a></LI>
<LI><a href="image.html">gbkq;fs;</a></LI>
<img src="footer_main.jpg" width=100%">
</UL>
</div>
</body>
</html>
1

There are 1 answers

0
Jaya Mayu On BEST ANSWER

I figured it out. we need to put the font file in the assets folder :) and it won't work on android 2.1 as that is a known issue.