From 6a750eecd27fc85193934709d91f026ea723e9cb Mon Sep 17 00:00:00 2001 From: Ravindra Kumar Date: Tue, 8 Mar 2016 11:28:21 -0500 Subject: [PATCH] Added code syntax highlighting to Readme --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index f19f5a9..46d22a5 100644 --- a/README.md +++ b/README.md @@ -10,24 +10,24 @@ CustomType can be used in two ways: =============== If you would like to mention your Typeface in the XML file itself, you would need to use the in.raveesh.customtype.TextView object in your XML files in place of android.widget.TextView. After that, using a custom typeface in a TextView is as simple as follows (note the custom implementation of a TextView) - - - +```xml + +``` What you're looking to do is set app:typeface to the path to the typeface file inside the assets folder. 2. Via JAVA: ============== The FontManager.getTypeface() method returns a typeface object that you can apply to any view that supports the setTypeface() method. You do not need to use the bundled custom TextView or EditText for this. Example code - - tv.setTypeface(CustomType.getTypeface(this,"folder/typeface.ttf")); - +```java +tv.setTypeface(CustomType.getTypeface(this,"folder/typeface.ttf")); +``` Do note: the font file must be present within your projects assets folder. @@ -39,8 +39,9 @@ How to use the library ===================== Add the following line to your build.gradle dependencies - compile 'in.raveesh:customtype:1.0.0' - +```groovy +compile 'in.raveesh:customtype:1.0.0' +``` Apps Using Customtype ====================== * [Haptik](https://play.google.com/store/apps/details?id=co.haptik)