MCPcopy Index your code
hub / github.com/EngrAhsanAli/AACustomFont

github.com/EngrAhsanAli/AACustomFont @1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.1 ↗ · + Follow
14 symbols 37 edges 3 files 13 documented · 93%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Android Arsenal

Table of Contents

AACustomFont

Description

AACustomFont is a lightweight custom font binder in XML directly in TextView, Button, EditText, RadioButton, CheckBox tags. The library is aimed to avoid custom views for custom fonts in XML and to minimize the JAVA code for setting the TypeFaces for each view.

Demonstration

You can use AACustomFont in any view that's extended from TextView. For example, TextView Button EditText RadioButton CheckBox

Requirements

  • Android Studio
  • Android 2.3+
  • JAVA 7+
  • Gradle 3.0

Installation

AACustomFont can be installed using Maven, Gradle, or manually.

Maven

Step 1. Add the JitPack repository to your build file

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Step 2. Add the dependency

<dependency>
      <groupId>com.github.EngrAhsanAli</groupId>
      <artifactId>AACustomFont</artifactId>
      <version>1.0.0</version>
</dependency>

Gradle

Step 1. Add the JitPack repository to your build file

allprojects {
    repositories {
      ...
      maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
  compile 'com.github.EngrAhsanAli:AACustomFont:1.0.0'
}

Manual Installation

If you prefer not to use either of the above mentioned dependency managers, you can integrate AACustomFont into your project manually by adding the files contained in the java folder to your project.

Getting Started


Enable data binding

You need to enable data binding in order to bind custom fonts with your views. Add the following in your build.gradle.

android {
  dataBinding {
        enabled = true
    }
}

Add font files

You can add the font files in assets/fonts directory. AACustomFont will automatically grab your fonts from that directory, automatically. The font files may have .ttf or .otf extensions.

Start embedding the fonts!

You need to change your layout parent tag to layout tag and put the rest in that tag.

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">




</layout>

Now set your fonts like:


<TextView

    app:font="@{`budidaya-italic`}" />

Note that the font name will always be in lowercase.

Bind the views!

You need to bind the views in java:

DataBindingUtil.setContentView(this, R.layout.your_layout);

You can set alias to your font name using the following method

AACustomFont.getInstance(this).setAlias("myfont", "Font-File.otf");

Contributions & License

AACustomFont is available under the MIT license. See the LICENSE file for more info.

Pull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.

I would love to know if you are using AACustomFont in your app, send an email to Engr. Ahsan Ali

Core symbols most depended-on inside this repo

get
called by 3
aacustomfont/src/main/java/com/aacreations/aacustomfont/AACustomFont.java
getInstance
called by 2
aacustomfont/src/main/java/com/aacreations/aacustomfont/AACustomFont.java
setCustomFont
called by 2
aacustomfont/src/main/java/com/aacreations/aacustomfont/AACustomFont.java
getFonts
called by 1
aacustomfont/src/main/java/com/aacreations/aacustomfont/AACustomFont.java
setDefaultFontName
called by 1
aacustomfont/src/main/java/com/aacreations/aacustomfont/AACustomFont.java
setAlias
called by 1
aacustomfont/src/main/java/com/aacreations/aacustomfont/AACustomFont.java
getFont
called by 1
aacustomfont/src/main/java/com/aacreations/aacustomfont/AACustomFont.java
onCreate
called by 0
app/src/main/java/demo/aacreations/aacustomfont/MainActivity.java

Shape

Method 11
Class 3

Languages

Java100%

Modules by API surface

aacustomfont/src/main/java/com/aacreations/aacustomfont/AACustomFont.java10 symbols
app/src/main/java/demo/aacreations/aacustomfont/MainActivity.java2 symbols
aacustomfont/src/main/java/com/aacreations/aacustomfont/AAHelper.java2 symbols

For agents

$ claude mcp add AACustomFont \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact