android - Can't use of Font class in my App -


i want use of font class in android app,i add jre system library in project(every thing ok),but when run,in log cat show error:

java.lang.noclassdeffounderror: java.awt.font

you cannot use awt in android.

the correct way use custom font instantiate typeface. example:

typeface customtypeface = typeface.createfromfile(assets, "fonts/customfont.ttf"); mytextview.settypeface(customtypeface); 

typeface.createfromfile(assetmanager, string)

you can use third party library calligraphy dirty work you. allows set typeface xml layouts , styles


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -