tags:

views:

88

answers:

1

Hello all, I am trying to use custom fonts in a textview:

tv=(TextView)findViewById(res);
Typeface font = Typeface.createFromAsset(this.getAssets(), "fonts/font.ttf"); 
tv.setTypeface(font); 

But when I run I get the following error:

W/System.err(  542): java.lang.RuntimeException: native typeface cannot be made

Whats the issue?

A: 

I would guess that there is a problem with the font itself. That error will be triggered when native code in the OS attempts to load the typeface. I seem to recall that there's a different message if the file is missing, so I think it is finding the file but not liking it for some reason.

CommonsWare