com.norbsoft.typefacehelper.TypefaceCollection Java Examples

The following examples show how to use com.norbsoft.typefacehelper.TypefaceCollection. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FragmentNavigationDemoApplication.java    From FragmentNavigationPatternDemo with Apache License 2.0 6 votes vote down vote up
private void initLibs() {

        // Initialize dagger
        DaggerManager.getInstance().buildComponentAndInject(this);

        //@formatter:off
        // Initialize typeface helper
        TypefaceCollection typeface = new TypefaceCollection.Builder()
                .set(Typeface.NORMAL, Typeface.createFromAsset(getAssets(), "fonts/Roboto-Light.ttf"))
                .set(Typeface.BOLD, Typeface.createFromAsset(getAssets(), "fonts/Roboto-Medium.ttf"))
                .create();
        TypefaceHelper.init(typeface);
        //@formatter:on

        if (BuildConfig.DEBUG) {
            // Facebook Stetho
            Stetho.initializeWithDefaults(this);
        }
    }
 
Example #2
Source File: AppLifecycleCallbacks.java    From Qiitanium with MIT License 5 votes vote down vote up
protected void setupTypeFace() {
  TypefaceHelper.init(new TypefaceCollection.Builder()
      .set(Typeface.NORMAL, createTypefaceFromAsset(R.string.font_ubuntu_regular))
      .set(Typeface.BOLD, createTypefaceFromAsset(R.string.font_ubuntu_bold))
      .set(Typeface.ITALIC, createTypefaceFromAsset(R.string.font_ubuntu_regular_italic))
      .set(Typeface.BOLD_ITALIC,
          createTypefaceFromAsset(R.string.font_ubuntu_bold_italic))
      .create());
}
 
Example #3
Source File: MyApplication.java    From android-typeface-helper with Apache License 2.0 4 votes vote down vote up
@Override public void onCreate() {
	super.onCreate();

	// Load helper with default custom typeface (single custom typeface)
	TypefaceHelper.init(new TypefaceCollection.Builder()
			.set(Typeface.NORMAL, Typeface.createFromAsset(getAssets(), "fonts/ubuntu/Ubuntu-R.ttf"))
			.set(Typeface.BOLD, Typeface.createFromAsset(getAssets(), "fonts/ubuntu/Ubuntu-B.ttf"))
			.set(Typeface.ITALIC, Typeface.createFromAsset(getAssets(), "fonts/ubuntu/Ubuntu-RI.ttf"))
			.set(Typeface.BOLD_ITALIC, Typeface.createFromAsset(getAssets(), "fonts/ubuntu/Ubuntu-BI.ttf"))
			.create());

	// Multiple custom typefaces support
	mJuiceTypeface = new TypefaceCollection.Builder()
			.set(Typeface.NORMAL, Typeface.createFromAsset(getAssets(), "fonts/Juice/JUICE_Regular.ttf"))
			.set(Typeface.BOLD, Typeface.createFromAsset(getAssets(), "fonts/Juice/JUICE_Bold.ttf"))
			.set(Typeface.ITALIC, Typeface.createFromAsset(getAssets(), "fonts/Juice/JUICE_Italic.ttf"))
			.set(Typeface.BOLD_ITALIC, Typeface.createFromAsset(getAssets(), "fonts/Juice/JUICE_Bold_Italic.ttf"))
			.create();

	// Multiple custom typefaces support
	mArchRivalTypeface = new TypefaceCollection.Builder()
			.set(Typeface.NORMAL, Typeface.createFromAsset(getAssets(), "fonts/arch_rival/SF_Arch_Rival.ttf"))
			.set(Typeface.BOLD, Typeface.createFromAsset(getAssets(), "fonts/arch_rival/SF_Arch_Rival_Bold.ttf"))
			.set(Typeface.ITALIC, Typeface.createFromAsset(getAssets(), "fonts/arch_rival/SF_Arch_Rival_Italic.ttf"))
			.set(Typeface.BOLD_ITALIC, Typeface.createFromAsset(getAssets(), "fonts/arch_rival/SF_Arch_Rival_Bold_Italic.ttf"))
			.create();

	// Multiple custom typefaces support
	mActionManTypeface = new TypefaceCollection.Builder()
			.set(Typeface.NORMAL, Typeface.createFromAsset(getAssets(), "fonts/Action-Man/Action_Man.ttf"))
			.set(Typeface.BOLD, Typeface.createFromAsset(getAssets(), "fonts/Action-Man/Action_Man_Bold.ttf"))
			.set(Typeface.ITALIC, Typeface.createFromAsset(getAssets(), "fonts/Action-Man/Action_Man_Italic.ttf"))
			.set(Typeface.BOLD_ITALIC, Typeface.createFromAsset(getAssets(), "fonts/Action-Man/Action_Man_Bold_Italic.ttf"))
			.create();

	// Multiple custom typefaces support
	mUbuntuTypeface = new TypefaceCollection.Builder()
			.set(Typeface.NORMAL, Typeface.createFromAsset(getAssets(), "fonts/ubuntu/Ubuntu-R.ttf"))
			.set(Typeface.BOLD, Typeface.createFromAsset(getAssets(), "fonts/ubuntu/Ubuntu-B.ttf"))
			.set(Typeface.ITALIC, Typeface.createFromAsset(getAssets(), "fonts/ubuntu/Ubuntu-RI.ttf"))
			.set(Typeface.BOLD_ITALIC, Typeface.createFromAsset(getAssets(), "fonts/ubuntu/Ubuntu-BI.ttf"))
			.create();

	// Multiple custom typefaces support
	mSystemDefaultTypeface = TypefaceCollection.createSystemDefault();
}
 
Example #4
Source File: MyApplication.java    From android-typeface-helper with Apache License 2.0 4 votes vote down vote up
/** Multiple custom typefaces support */
public TypefaceCollection getJuiceTypeface() {
	return mJuiceTypeface;
}
 
Example #5
Source File: MyApplication.java    From android-typeface-helper with Apache License 2.0 4 votes vote down vote up
/** Multiple custom typefaces support */
public TypefaceCollection getArchRivalTypeface() {
	return mArchRivalTypeface;
}
 
Example #6
Source File: MyApplication.java    From android-typeface-helper with Apache License 2.0 4 votes vote down vote up
/** Multiple custom typefaces support */
public TypefaceCollection getActionManTypeface() {
	return mActionManTypeface;
}
 
Example #7
Source File: MyApplication.java    From android-typeface-helper with Apache License 2.0 4 votes vote down vote up
/** Multiple custom typefaces support */
public TypefaceCollection getSystemDefaultTypeface() {
	return mSystemDefaultTypeface;
}
 
Example #8
Source File: MyApplication.java    From android-typeface-helper with Apache License 2.0 4 votes vote down vote up
/** Multiple custom typefaces support */
public TypefaceCollection getUbuntuTypeface() {
	return mUbuntuTypeface;
}