项目作者: AmanChugh

项目描述 :
Custom View to add Custom fonts from xml
高级语言: Java
项目地址: git://github.com/AmanChugh/FontiView.git
创建时间: 2017-05-19T05:20:01Z
项目社区:https://github.com/AmanChugh/FontiView

开源协议:

下载


FontiView

Custom View to add Custom fonts from xml

FontiViews

FontiViews

Use custom fonts to xml layout views.

Are you fed up to set custom fonts to your textviews,Button and EditText or implkementing your HTML code to textview then this library is for you.



Getting started

Dependency

  1. dependencies {
  2. compile 'compile 'com.aman.fontilib:fontilib:1.0.0'
  3. }

Add Fonts

Add your fonts files to assets/fonts. All font definitions are relative to this path.

alt text

Usage

  1. <com.aman.fontilib.FontiEditText
  2. app:font="titi.ttf" ></com.aman.fontilib.FontiEditText>
  3. <com.aman.fontilib.FontiTextView
  4. android:text="@string/html_text"
  5. app:font="titi.ttf"
  6. app:html="true">
  7. </com.aman.fontilib.FontiTextView>
  8. <com.aman.fontilib.FontiButton
  9. app:font="titi.ttf" ></com.aman.fontilib.FontiButton>

Usage

Add Custom view to set font bind HTML text

  1. <com.aman.fontilib.FontiEditText
  2. android:layout_width="368dp"
  3. android:layout_height="wrap_content"
  4. android:hint="This is EditText."
  5. app:font="titi.ttf" ></com.aman.fontilib.FontiEditText>
  6. <com.aman.fontilib.FontiTextView
  7. android:layout_width="368dp"
  8. android:layout_height="wrap_content"
  9. android:text="@string/html_text"
  10. android:textSize="22sp"
  11. app:font="titi.ttf"
  12. app:html="true">
  13. </com.aman.fontilib.FontiTextView>
  14. <com.aman.fontilib.FontiButton
  15. android:layout_width="wrap_content"
  16. android:layout_height="wrap_content"
  17. android:ems="10"
  18. android:text="Button with Custom Typeface."
  19. app:font="titi.ttf" ></com.aman.fontilib.FontiButton>

Licence

  1. Copyright 2017 Aman Deep
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.