Provides a set of views which allows to adjust the spacing between the characters of that view, AKA, Kerning effect.

Overview

KerningViews

Download API License Android Arsenal

KerningViews

KerningViews provides a set of views (currently only TextView and Button) which lets you adjust the spacing between the characters in the text of that view also know as Kerning.

Kerning is a common feature in design apps like Photoshop or Sketch, but Android natively doesn't allow Kerning. From API level 21, Android allows you to do this using setLetterSpacing attribute , but there is no way to achieve this in pre-21 devices.

KerningViews provides a simple API to achieve this feature in TextView and Button text across all API levels in Android.

Screenshot

This screenshot is from the sample app showing different text with different spacing (kerning factor). Screenshot

Download

This library is available in jCenter which is the default Maven repository used in Android Studio.

dependencies {
    // other dependencies here
    implementation 'com.andrognito.kerningview:kerningview:x.y.z'
}

Usage

You should see the sample app for complete usage details. You can either use these views and set the attribute via XML or programmatically change the kerning factor as required.

XML

Just use the KerningTextView or KerningButton in your XML layouts. If you do not put the kv_spacing attribute then it will behave as a normal TextView with no letter spacing.

You can customize the letter spacing by using the kv_spacing attribute with different kerning factor (supports floating point values).

<com.andrognito.kerningview.KerningTextView
       android:id="@+id/text1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:fontFamily="sans-serif"
       android:text="@string/sample_text_1"
       android:textSize="@dimen/text_size_xlarge"
       app:kv_spacing="10" />

JAVA

Just reference the views from your layout and use the setter to change the letter spacing of the texts.

KerningTextView mText = (KerningTextView) findViewById(R.id.text);
mText.setKerningFactor(3.5f);

Contribution

This is a very simple and tiny library that solves one simple use case.But I would love to accept contributions to improve or add functionality to it. It is my first library too.

About The Author

Aritra Roy

Design-focussed Engineer. Full-stack Developer. Hardcore Android Geek. UI/UX Designer. Part-time Blogger.

License

Copyright 2016 aritraroy

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
A Material Android password view that toggles password visibility via an eye icon.
A Material Android password view that toggles password visibility via an eye icon.

8/17/2016: As of about an hour ago, this library is deprecated! Support for password visibility is now included in the Design Support Library in TextI

Library project with a custom view that implements the Float Label pattern

AndroidFloatLabel This repository contains an Android library project for Android 4.0+ with a custom view that implements the Float Label pattern (htt

RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo
RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

Light-weighted, convenient implementation of expandable text view that supports expanding & collapsing animations for Android projects

ExpandableTextView Light-weighted, convenient implementation of expandable text view that supports expanding & collapsing animations for Android proje

ActionsContentView is an standalone library implements actions/content swiping view (AKA Side Navigation UI Pattern, AKA Facebook side menu).  The library doesn't use any specific code introduced in new Android SDK versions. This allows develop an application with an action/content swiping view for every version of Android from 2.2 and up. LiveEdgeDetection is an Android document detection library built on top of OpenCV. It scans documents from camera live mode and allows you to adjust crop using the detected 4 edges and performs perspective transformation of the cropped image.  It works best with a dark background.
** A slide-out menu implementation, which allows users to navigate between views in your app.

MenuDrawer A slide-out menu implementation, which allows users to navigate between views in your app. Most commonly the menu is revealed by either dra

SquircleView is a library which provides you with Squircle views to use for buttons, views, etc.
SquircleView is a library which provides you with Squircle views to use for buttons, views, etc.

SquircleView SquircleView is a library which provides you with Squircle views to use for buttons, views, etc. Screenshots Different kinds of buttons,

SquircleView is a library which provides you with Squircle views to use for buttons, views, etc.
SquircleView is a library which provides you with Squircle views to use for buttons, views, etc.

SquircleView is a library which provides you with Squircle views to use for buttons, views, etc.

A RatingBar library for android, you can customize size, spacing, color and image easily, and support right to left.
A RatingBar library for android, you can customize size, spacing, color and image easily, and support right to left.

A RatingBar library for android, you can customize size, spacing, color and image easily, and support right to left.

A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds.
A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds.

SecretTextView A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds. How To Use Use it just l

A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds.
A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds.

SecretTextView A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds. How To Use Use it just l

This application is used to adjust the scaling of kubernetes deployments depending on the message-count of given RabbitMQ queues.

PodAutoScaler This application is used to adjust the scaling of kubernetes deployments depending on the message-count of given RabbitMQ queues. It use

This library provides advance views for lists and stacks. Some of the views are build on top of RecyclerView and others are written in their own. Annotations are compiled by annotation processor to generate bind classes. DOCS -->
This library provides advance views for lists and stacks. Some of the views are build on top of RecyclerView and others are written in their own. Annotations are compiled by annotation processor to generate bind classes. DOCS --

PlaceHolderView An advance view for lists and stacks Some Implementations Documentation You can find the PlaceHolderView documentation here which has

btrace(AKA RheaTrace) is a high performance Android trace tool which is based on Systrace
btrace(AKA RheaTrace) is a high performance Android trace tool which is based on Systrace

btrace README 中文版 btrace(AKA RheaTrace) is a high performance Android trace tool

FragmentTransactionExtended is a library which provide us a set of custom animations between fragments.

FragmentTransactionExtended FragmentTransactionExtended is a library which provide us a set of custom animations between fragments. FragmentTransactio

The CustomCalendarView provides an easy and customizable calendar to create a Calendar. It dispaly the days of a month in a grid layout and allows to navigate between months

Custom-Calendar-View To use the CustomCalendarView in your application, you first need to add the library to your application. You can do this by eith

Xposed module which will set location where you want without effect mock location.
Xposed module which will set location where you want without effect mock location.

GPS Setter Support/Discussion: XDA thread As most of GPS spoof app not working anymore coz some are old and some are not proper implement with current

LiteGo is a Java-based asynchronous concurrency library. It has a smart executor, which can be freely set the maximum number of concurrent at same time , and the number of threads in waiting queue. It can also set waiting policies and overload strategies.

LiteGo:「迷你」的Android异步并发类库 LiteGo是一款基于Java语言的「异步并发类库」,它的核心是一枚「迷你」并发器,它可以自由地设置同一时段的最大「并发」数量,等待「排队」线程数量,还可以设置「排队策略」和「超载策略」。 LiteGo可以直接投入Runnable、Callable

Comments
  • how to remove top and bottom padding?

    how to remove top and bottom padding?

    Hello arita; thanks for making awesome library. I have faced some issues. I need to remove top and bottom padding for each text to achieve my design.

    Here is my code. and Image is also a attached. <com.andrognito.kerningview.KerningTextView android:id="@+id/appCompatTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="@font/titillium_web_bold" android:text="@string/welcome" android:textColor="@color/colorWhite" android:textSize="30sp" app:fontFamily="@font/titillium_web_bold" app:kv_spacing="4" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.50" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/imageView_app_logo" app:layout_constraintVertical_bias="0.149" /> Screen Shot 2019-10-24 at 6 15 30 PM

    Hope you see this on your free time.

    opened by shihabmi7 0
  • Closes #1 Don't allow `originalText` field to be null

    Closes #1 Don't allow `originalText` field to be null

    TextView#init calls setText with the value "". Our init method then overrides this by checking attributes, which can be null, replacing originalText value "" with null. This causes getText() to return null when TextView implementation would return "".

    opened by JoshuaJamesOng 0
  • KerningTextView#getText returns `null`

    KerningTextView#getText returns `null`

    It seems KerningTextView#getText returns null in cases where TextView#getText would return "". This causes Espresso to crash as it never expects a null CharSequence.

    opened by JoshuaJamesOng 0
Releases(v1.1.0)
Owner
Aritra Roy
Design-focused Engineer | Android Developer | Open-Source Enthusiast | Part-time Blogger
Aritra Roy
Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.

android-formidable-validation Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Pr

Linden 147 Nov 20, 2022
Path effect for text.

Screenshot Please waiting for loading the gif... ![] (/path4.gif) How to use Step 1: add denpendence compile('com.dk.view.patheffect:Library:0.1.1@aar

Dean Ding 108 Feb 5, 2022
() An Android TextView with a shimmering effect

Shimmer for Android This library is DEPRECATED, as I don't have time to mainatin it anymore. But feel free to go through the code and copy that into y

Romain Piel 2k Jan 7, 2023
Custom view to expand long text with view more,less action , you can customize min lines , action color

ExpandableTextView Custom expadable text view Examples : <mostafa.projects.expandabletextview.ExpandableTextView android:layout_wi

Mostafa Gad 8 Jan 25, 2022
Android Custom View for prevent the view behind on-screen keyboard when edit text is focused

Group Focusable Prevent the view behind on-screen keyboard when edit text is focused in Android UI Download Gradle implementation 'com.akexorcist:grou

Akexorcist 8 Jun 22, 2022
An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually.

⚠️ Archived: this repository is no longer going to be maintained. SectionedRecyclerViewAdapter An Adapter that allows a RecyclerView to be split into

Gustavo Pagani 1.7k Dec 21, 2022
A TextView library that allows the user to increase/decrease font size with a two finger gesture by the user.

PinchZoomTextView Library This library allows you to have a TextView that will grow/shrink the font size using gestures from the user. Usage To have a

null 311 Nov 23, 2022
A little animation framework which could help you to show message in a nice looking way

TextSurface A little animation framework which could help you to show message in a nice looking way. Usage Create TextSurface instance or add it in yo

Eugene Levenetc 2.3k Dec 30, 2022
A custom EditText with a switchable icon which shows or hides the password

Deprecated This library is deprecated now as there is an official way to use the password toggle with the TextInputLayout (inside the support library

Maksim 430 Nov 20, 2022
Android Bubble View

BubbleTextView Custom arrow position Custom fillet radius Custom background color Can be placed anywhere Two default style Two default theme Snapshot

null 669 Nov 11, 2022