1

Hi am using webview ,i need to use custom font(verdana.ttf) how can i do this.(AM using honeycomb)

Am using following code for setting font

 "<html><body><span style=\"font-size : 12pt;color : #333333;font-family: verdana; src: url('fonts/verdana.ttf');\" >"+data+"</span></body></html>" 
Bytecode
  • 6,551
  • 16
  • 54
  • 101
  • For More details you can refer [this](http://stackoverflow.com/questions/3900658/how-to-change-font-face-of-webview-in-android/5417710#5417710) – binary Mar 24 '11 at 10:34

2 Answers2

1

to get custom font in Webview we need to specify url as follows ,we need to put the fonts in assets folder ,and webview check in files folder of application, ie it's like file:/data/data/packgname/files

"<html><body><span style=\"font-size : 12pt;color : #333333;font-family: verdana; src: url('file://"+ context.getFilesDir().getAbsolutePath()+ "/verdana.ttf');\" >"+data+"</span></body></html>" 
Bytecode
  • 6,551
  • 16
  • 54
  • 101
0

you can use @font-face....

 @font-face { font-family: verdana; src: url('verdana.ttf'); }
Brandon Frohbieter
  • 17,563
  • 3
  • 40
  • 62