Tuesday, September 11, 2018

Android Studio: How to use custom font in an Android project

Step 1: Right-click the res folder and go to New > Android Resource Directory.

Step 2: From Resource type list, select font, and then click OK.

Step 3: Copy your font files (.ttf) and paste it in the font directory created in Step 2. (file name of the fonts should must contain only lowercase a-z, 0-9, or underscore)

Step 4: Now you can assign your font in the xml file using @font/font_name