Default [DETAILED GUIDE][CM11] Build your own Font app

Hello guys, as everyone insisted me to write a guide on how to make CyanogenMod compatible fonts. I'll explain it in steps. I will be using Android Studio as the IDE for explaining, you can use Eclipse too. It will include the same procedure

STEP 1 : Initial Setup

*1* First we need to Create New Project
 


*2* Now follow the Image below

 


Add icon if you want.



STEP 2 : Editing Manifest File

*1* Now After the Project is set up you will see your font name above in top left corner. Now click on your fontname --> app --> src --> main --> AndroidManifest.xml. Replace everything with code given below.

Code:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="Your package name"
    android:versionCode="1"
    android:versionName="1.0" android:installLocation="internalOnly">
    <uses-sdk android:targetSdkVersion="19" android:minSdkVersion="19"></uses-sdk>
    <uses-feature android:name="org.cyanogenmod.theme" android:required="true" />
    <meta-data android:name="org.cyanogenmod.theme.name" android:value="fontname"/>
    <meta-data android:name="org.cyanogenmod.theme.author" android:value="Your/Author name" />
    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:hasCode="false" android:allowBackup="false">
    </application>
</manifest>
Now replace your details in red line of above code.

STEP 3 : Adding Font and creating xml

Let's add font to the app. Double click on the fontname(top left). Now you'll see a hierarchical view like this :


Right click on the main folder and click on "Show in Explorer". You need to go inside main folder create assets folder and create fonts folder inside it and place your font there. Follow Image below :
 






Lets go back to Android Studio. Click on fonts folder and go to New --> File as shown in image below.

Name the file as fonts.xml and place the below code inside it:

 





Code:
<?xml version="1.0" encoding="utf-8"?>
<familyset>
    <family>
        <nameset>
            <name>sans-serif</name>
            <name>arial</name>
            <name>helvetica</name>
            <name>tahoma</name>
            <name>verdana</name>
        </nameset>
        <fileset>
            <file>Crayon-Regular.ttf</file>
        </fileset>

    </family>
</familyset>
Replace red text with your font name and save it.[ CTRL + S ]

STEP 4 : Build app

Go to Build --> Make Project or CTRL + F9. At bottom there will be a text saying " Gradle invocation successfull" That means your app compiled well.
Now you need to find the app. See the image below :

 


EXTRA STEP : Font Family

Credits :

djdarkknight96 for creating template and teaching me how to do this on my own

Additional Links :