FORUMS

[FTF] Sony Xperia Z Lollipop Release

Sony rolled out a Lollipop update for Xperia Z just yesterday. If you still haven’t gotten … more

Original Moto G Receives Lollipop, OTA Captured

The original Moto G was released almost two years ago. Motorola still continues to … more

Device Review: No.1 X1 Rugged Smartphone

We are almost at the end of Q2 for 2015, and we have seen most of the flagship phones for the … more

When a Friend or Family Member Asks for a Phone Recommendation, What Do You Tell Them?

The majority of us here at XDA would consider … more
Thread Deleted Subscribe to Thread Email Thread

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

Prev Previous Post   Next Post Next
28th June 2014, 06:13 PM |#1  
codekidX's Avatar
OP Senior Member
Flag Mumbai
Thanks Meter: 1,911
 
Donate to Me
More


Video Tutorial :



Android Studio :
This is my first video for XDA :P comment if you dont understand something



Eclipse Tutorial :






-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Written Guide :
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 :

Last edited by codekidX; 4th August 2014 at 01:47 PM.
The Following 39 Users Say Thank You to codekidX For This Useful Post: [ View ]
Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes