public static class CalligraphyConfig.Builder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
INVALID_ATTR_ID
Default AttrID if not set.
|
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
CalligraphyConfig.Builder |
addCustomStyle(java.lang.Class<? extends android.widget.TextView> styleClass,
int styleResourceAttribute)
Add a custom style to get looked up.
|
CalligraphyConfig.Builder |
addCustomViewWithSetTypeface(java.lang.Class<?> clazz)
Register custom non-
TextView's which implement setTypeface so they can have the Typeface applied during inflation. |
CalligraphyConfig |
build() |
CalligraphyConfig.Builder |
setDefaultFontPath(java.lang.String defaultFontAssetPath)
Set the default font if you don't define one else where in your styles.
|
CalligraphyConfig.Builder |
setFontAttrId(int fontAssetAttrId)
This defaults to R.attr.fontPath.
|
CalligraphyConfig.Builder |
setFontMapper(FontMapper fontMapper) |
public static final int INVALID_ATTR_ID
public CalligraphyConfig.Builder setFontAttrId(int fontAssetAttrId)
fontAssetAttrId - the custom attribute to look for fonts in assets.public CalligraphyConfig.Builder setDefaultFontPath(java.lang.String defaultFontAssetPath)
defaultFontAssetPath - a path to a font file in the assets folder, e.g. "fonts/Roboto-light.ttf",
passing null will default to the device font-family.public CalligraphyConfig.Builder addCustomStyle(java.lang.Class<? extends android.widget.TextView> styleClass, int styleResourceAttribute)
MyTextField.class which looked up it's default style as
R.attr.textFieldStyle you would add those here.
builder.addCustomStyle(MyTextField.class,R.attr.textFieldStylestyleClass - the class that related to the parent styleResource. null is ignored.styleResourceAttribute - e.g. R.attr.textFieldStyle, 0 is ignored.public CalligraphyConfig.Builder addCustomViewWithSetTypeface(java.lang.Class<?> clazz)
TextView's which implement setTypeface so they can have the Typeface applied during inflation.public CalligraphyConfig.Builder setFontMapper(FontMapper fontMapper)
public CalligraphyConfig build()