3

I have ListView which contains many records with TextViews and WebViews. And i want to make them looks identical. But font size in TextView and WebView looks different on some devices (depends on screen size). For TextView I use sp units for WebView I tried to use setDefaultFontSize and setTextSize.

Thanks

1 Answers1

0

To set Custom font(s) in your Android application

To do this, simply create an assets/ folder in the project root, and put your fonts (in TrueType, or TTF, form) in the assets. You might, for example, create assets/fonts/ and put your TTF files in there:

 TextView tv=(TextView)findViewById(R.id.custom); 
  Typeface face=Typeface.createFromAsset(getAssets(), "fonts/HandmadeTypewriter.ttf"); 
  tv.setTypeface(face); 

Refer this link to change the font in webview.

Community
  • 1
  • 1
Shankar Agarwal
  • 34,573
  • 7
  • 66
  • 64