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
Post a Comment