Android Font Library (font aware native TextViews)

Font library for Android with xml, style and textAppearance support. fontlib-native contains font aware subclasses of TextView and its subclasses.

Лицензия

Лицензия

Категории

Категории

Native Инструменты разработки
Группа

Группа

com.innovattic
Идентификатор

Идентификатор

fontlib-native
Последняя версия

Последняя версия

5.1.0
Дата

Дата

Тип

Тип

aar
Описание

Описание

Android Font Library (font aware native TextViews)
Font library for Android with xml, style and textAppearance support. fontlib-native contains font aware subclasses of TextView and its subclasses.
Ссылка на сайт

Ссылка на сайт

https://github.com/Innovattic/Android-Font-Library
Система контроля версий

Система контроля версий

https://github.com/Innovattic/Android-Font-Library

Скачать fontlib-native

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.innovattic/fontlib-native/ -->
<dependency>
    <groupId>com.innovattic</groupId>
    <artifactId>fontlib-native</artifactId>
    <version>5.1.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.innovattic/fontlib-native/
implementation 'com.innovattic:fontlib-native:5.1.0'
// https://jarcasting.com/artifacts/com.innovattic/fontlib-native/
implementation ("com.innovattic:fontlib-native:5.1.0")
'com.innovattic:fontlib-native:aar:5.1.0'
<dependency org="com.innovattic" name="fontlib-native" rev="5.1.0">
  <artifact name="fontlib-native" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.innovattic', module='fontlib-native', version='5.1.0')
)
libraryDependencies += "com.innovattic" % "fontlib-native" % "5.1.0"
[com.innovattic/fontlib-native "5.1.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.innovattic : fontlib-core jar 5.1.0

Модули Проекта

Данный проект не имеет модулей.

Android-Font-Library

This is a library that makes it easy for you to add custom fonts to your Android application. For a detailed description of why we made this library and how it works, please read this blogpost. For those that want a quickstart, read on below.

Gradle dependency

If you are using the Android Support Library, use this dependency to use font aware TextView's that extend from their AppCompat versions of the support library. The support library is not a transitive dependency, so you have to add it by yourself.

compile 'com.innovattic:fontlib-support:5.0.0'

Otherwise, use the following variant to use the font aware TextView's that extend from the native counterparts:

compile 'com.innovattic:fontlib-native:5.0.0'

Usage

To use the library, add it to your project as a gradle dependency, specify your font xml file, call TypefaceManager.init() (typically in your Application class' onCreate) and use any of the font aware TextViews.

A font xml file is placed in app/res/xml and can look like this:

<?xml version="1.0" encoding="utf-8"?>
<familyset>
	<family>
		<nameset>
			<name>aspergit</name>
			<name>any-alias</name>
		</nameset>
		<fileset>
			<file>aspergit/Aspergit.ttf</file>
			<file>aspergit/Aspergit Bold.ttf</file>
			<file>aspergit/Aspergit Italic.ttf</file>
			<file>aspergit/Aspergit Bold Italic.ttf</file>
		</fileset>
	</family>
</familyset>

In your layout xml files, use any of the font aware TextViews and set its flFont attribute to your font's name, like this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:gravity="center_vertical"
	android:orientation="vertical">

	<com.innovattic.font.FontTextView
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:text="I am a text view with the font aspergit"
		app:flFont="aspergit" />

	<com.innovattic.font.FontTextView
		style="@style/AspergitStyle"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:text="I am a bold-italic text view with the font aspergit"
		android:textStyle="bold|italic" />

	<com.innovattic.font.FontTextView
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:textAppearance="@style/AspergitTextAppearance"
		android:text="I am a bold text view with the font aspergit" />
		
</LinearLayout>

Where the styles used in the last two FontTextView's are defined like this:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android" >

	<style name="AspergitStyle">
		<item name="flFont">aspergit</item>
	</style>

	<style name="AspergitTextAppearance">
		<item name="flFont">aspergit</item>
		<item name="android:textStyle">bold</item>
	</style>

</resources>
com.innovattic

Innovattic

Версии библиотеки

Версия
5.1.0
5.0.0