This question has already been answered:
How to connect fonts to android?
This question has already been answered:
How to connect fonts to android?
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
Typeface font = Typeface.createFromAsset(getAssets(),"fonts/androidnation.ttf"); textView .setTypeface(font); But it should be borne in mind that referring to the assets folder every time is an "expensive" operation, so I advise you to create a singleton class that will store links to already connected fonts. Or use the Calligraphy library, which already does all this for you. Here is a good article on how to connect fonts
TextView tv = (TextView) findViewById(R.id.appname); Typeface face = Typeface.createFromAsset(getAssets(), "fonts/epimodem.ttf"); tv.setTypeface(face); In the assets folder, put your epimodem.ttf font
Source: https://ru.stackoverflow.com/questions/608210/
All Articles