public final class CalligraphyUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int[] |
ANDROID_ATTR_TEXT_APPEARANCE |
| Modifier and Type | Method and Description |
|---|---|
static void |
applyFontToTextView(android.content.Context context,
android.widget.TextView textView,
CalligraphyConfig config,
java.lang.String textViewFont)
Applies font to TextView.
|
static boolean |
applyFontToTextView(android.content.Context context,
android.widget.TextView textView,
java.lang.String filePath)
Useful for manually fonts to a TextView.
|
static boolean |
applyFontToTextView(android.widget.TextView textView,
android.graphics.Typeface typeface)
Applies a Typeface to a TextView.
|
static boolean |
applyFontToTextView(android.widget.TextView textView,
android.graphics.Typeface typeface,
boolean deferred)
Applies a Typeface to a TextView, if deferred,its recommend you don't call this multiple
times, as this adds a TextWatcher.
|
static java.lang.CharSequence |
applyTypefaceSpan(java.lang.CharSequence s,
android.graphics.Typeface typeface)
Applies a custom typeface span to the text.
|
public static java.lang.CharSequence applyTypefaceSpan(java.lang.CharSequence s,
android.graphics.Typeface typeface)
s - text to apply it too.typeface - typeface to apply.public static boolean applyFontToTextView(android.widget.TextView textView,
android.graphics.Typeface typeface)
applyFontToTextView(android.widget.TextView, android.graphics.Typeface, boolean)textView - Not null, TextView or child of.typeface - Not null, Typeface to apply to the TextView.applyFontToTextView(android.widget.TextView, android.graphics.Typeface, boolean)public static boolean applyFontToTextView(android.widget.TextView textView,
android.graphics.Typeface typeface,
boolean deferred)
textView - Not null, TextView or child of.typeface - Not null, Typeface to apply to the TextView.deferred - If true we use Typefaces and TextChange listener to make sure font is always
applied, but this sometimes conflicts with other
Spannable's.applyFontToTextView(android.widget.TextView, android.graphics.Typeface)public static boolean applyFontToTextView(android.content.Context context,
android.widget.TextView textView,
java.lang.String filePath)
CalligraphyConfigcontext - ContexttextView - Not null, TextView to apply to.filePath - if null/empty will do nothing.public static void applyFontToTextView(android.content.Context context,
android.widget.TextView textView,
CalligraphyConfig config,
java.lang.String textViewFont)
context - contexttextView - textView to apply to.config - Default ConfigtextViewFont - nullable, will use Default Config if null or fails to find the
defined font.