I'm developing an Android app. I already have a font file, but I want to change the font to this font file. What should I do?
android
Changing fonts on Android takes a lot of work. Therefore, I would like to recommend related open source.
https://github.com/tsengvn/Typekit It's an open source called Typekit.
In Build.gradle,
Please add compile 'com.tsengvn:Typekit:1.0.0'
only.
In the application class,
Typekit.getInstance()
.addNormal(Typekit.createFromAsset(this, "fonts/NanumBarunGothic-Regular.otf"))
.addBold(Typekit.createFromAsset(this, "fonts/NanumBarunGothic-Bold.otf"));
write like this. Please put the second parameter to the font you want.
And for each activity,
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(TypekitContextWrapper.wrap(newBase));
}
You can override this method.
© 2024 OneMinuteCode. All rights reserved.