@@ -3,7 +3,7 @@ Calligraphy
3
3
4
4
[ ![ Android Arsenal] ( https://img.shields.io/badge/Android%20Arsenal-Calligraphy-blue.svg?style=flat )] ( http://android-arsenal.com/details/1/163 )
5
5
6
- Custom fonts in Android the easy way.
6
+ Custom fonts in Android an OK way.
7
7
8
8
Are you fed up of Custom views to set fonts? Or traversing the ViewTree to find TextViews? Yeah me too.
9
9
@@ -13,33 +13,27 @@ Are you fed up of Custom views to set fonts? Or traversing the ViewTree to find
13
13
14
14
### Dependency
15
15
16
- [ Download from Maven Central (.aar)] ( http://search.maven.org/remotecontent?filepath=uk/co/chrisjenx/calligraphy/2.0.1/calligraphy-2.0.1.aar )
17
-
18
- __ OR__
19
-
20
- Include the dependency:
16
+ Include the dependency [ Download (.aar)] ( http://search.maven.org/remotecontent?filepath=uk/co/chrisjenx/calligraphy/2.0.1/calligraphy-2.0.1.aar ) :
21
17
22
18
``` groovy
23
19
dependencies {
24
20
compile 'uk.co.chrisjenx:calligraphy:2.0.1'
25
21
}
26
22
```
27
- ### Fonts
28
-
29
- Add your custom fonts to ` assets/fonts/ ` all font definitions are relative to this path.
23
+ ### Add Fonts
30
24
31
- ### Custom Attribute
25
+ Add your custom fonts to ` assets/ ` all font definitions are relative to this path.
32
26
33
- We ship with ` R.attr.fontPath ` .
27
+ ### Usage
34
28
35
- This can be used in such a way: ` <TextView fontPath="fonts/MyFont.ttf"/> ` Please note the missing
36
- namespace, this IS intention.
29
+ ``` xml
30
+ <TextView fontPath =" fonts/MyFont.ttf" />
31
+ ```
32
+ ** Note: The missing namespace, this __ IS__ intention.**
37
33
38
- ### Configuration
34
+ ### Installation
39
35
40
- Define your default font using ` CalligraphyConfig ` , in your ` Application ` class.
41
- Unfortunately ` Activity#onCreate(Bundle) ` is called _ after_ ` Activity#attachBaseContext(Context) ` so
42
- the config needs to be defined before that.
36
+ Define your default font using ` CalligraphyConfig ` , in your ` Application ` class in the ` #onCreate() ` method.
43
37
44
38
``` java
45
39
@Override
@@ -53,12 +47,13 @@ public void onCreate() {
53
47
// ....
54
48
}
55
49
```
50
+
56
51
_ Note: You don't need to define ` CalligraphyConfig ` but the library will apply
57
- no default font and use ` R.id.fontPath ` ._
52
+ no default font and use the default attribute of ` R.id.fontPath ` ._
58
53
59
54
### Inject into Context
60
55
61
- Wrap the Activity Context:
56
+ Wrap the ` Activity ` Context:
62
57
63
58
``` java
64
59
@Override
0 commit comments