I want to setTypeFace from url like : https://github.com/anak10thn/frontend-homepage/raw/master/font/helvetica-regular.otf
Do you know if there any way ?
I tried this :
Typeface tf = Typeface.createFromFile("https://github.com/anak10thn/frontend-homepage/raw/master/font/helvetica-regular.otf");
tv.setTypeface(tf);
It doesn't work.
I have this error :
03-24 04:46:59.931 1314-1314/bya.fchps.buildyourapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: bya.fchps.buildyourapp, PID: 1314
java.lang.RuntimeException: Unable to start activity ComponentInfo{bya.fchps.buildyourapp/com.fchps.buildyourapp.views.ClassicView}: java.lang.RuntimeException: native typeface cannot be made
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: native typeface cannot be made
at android.graphics.Typeface.<init>(Typeface.java:175)
at android.graphics.Typeface.createFromFile(Typeface.java:159)
at com.fchps.buildyourapp.views.ClassicView.setClassicLabel(ClassicView.java:178)
at com.fchps.buildyourapp.views.ClassicView.onCreate(ClassicView.java:75)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)