FontLoader Library

A tool for convenient loading of roboto typefaces and applying to textviews

License

License

GroupId

GroupId

co.52inc
ArtifactId

ArtifactId

fontloader
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

FontLoader Library
A tool for convenient loading of roboto typefaces and applying to textviews
Project URL

Project URL

https://github.com/52inc/FontLoader
Source Code Management

Source Code Management

https://github.com/52inc/FontLoader

Download fontloader

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

##FontLoader

An easy to use Roboto font loader for Android. Easily apply typefaces to TextView or its subclasses, or just easily load a typeface into memory.

There is also a Span for creating spannable strings with this typeface loader system called TypefaceSpan


Types

Types are string constants used to identify which Roboto typeface you are trying to load and are formated to be as intuitive and easy as possible. Here are all the Types available to you in the Types.java class:

public class Types {

    /**
     * Roboto Types
     */

    public static final String ROBOTO_BLACK = "roboto-black";
    public static final String ROBOTO_BLACK_ITALIC = "roboto-black-italic";
    public static final String ROBOTO_BOLD = "roboto-bold";
    public static final String ROBOTO_BOLD_ITALIC = "roboto-bold-italic";
    public static final String ROBOTO_ITALIC = "roboto-italic";
    public static final String ROBOTO_LIGHT = "roboto-light";
    public static final String ROBOTO_LIGHT_ITALIC = "roboto-light-italic";
    public static final String ROBOTO_MEDIUM = "roboto-medium";
    public static final String ROBOTO_MEDIUM_ITALIC = "roboto-medium-italic";
    public static final String ROBOTO_REGULAR = "roboto-regular";
    public static final String ROBOTO_THIN = "roboto-thin";
    public static final String ROBOTO_THIN_ITALIC = "roboto-thin-italic";

    /**
     * Roboto Condensed Types
     */

    public static final String CONDENSED_BOLD = "condensed-bold";
    public static final String CONDENSED_BOLD_ITALIC = "condensed-bold-italic";
    public static final String CONDENSED_ITALIC = "condensed-italic";
    public static final String CONDENSED_LIGHT = "condensed-light";
    public static final String CONDENSED_LIGHT_ITALIC = "condensed-light-italic";
    public static final String CONDENSED_REGULAR = "condensed-regular";

}

Usage

Here are some example usages of the library.

TextView title = (TextView) findViewById(R.id.title);

FontLoader.applyTypeface(title, "roboto-bold");

// Or...

FontLoader.applyTypeface(title, Types.ROBOTO_BOLD);

Or by applying to a view in layout without having to 'find' it

View parent = LayoutInflater.from(this).inflate(R.layout.something);

FontLoader.applyTypeface(parent, R.id.subtitle, "roboto-light");

// Or

FontLoader.applyTypeface(parent, R.id.subtitle, Types.ROBOTO_LIGHT);

// Or

FontLoader.applyTypeface(this, R.id.subtitle, Types.ROBOTO_LIGHT);

Or just get the Typeface directly

Typeface robotoRegular = FontLoader.getTypeface(this, Types.ROBOTO_REGULAR);

TODO

  • Add support to apply a typeface to an entire layout
  • Add support to easily apply typeface to actionbar
  • Add more static convienence functions

Importing

compile 'co.52inc:fontloader:+'

Author

  • Drew Heavner (r0adkll) @ 52inc

License

Copyright (c) 2014 52inc

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.
co.52inc

52inc

Awesome software developers

Versions

Version
1.0.1
1.0.0