Package org.robolectric.shadows
Class ShadowTypeface
java.lang.Object
org.robolectric.shadows.ShadowTypeface
@Implements(value=android.graphics.Typeface.class, looseSignatures=true) public class ShadowTypeface extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShadowTypeface.FontDesc
static class
ShadowTypeface.ShadowBuilder
Shadow forTypeface.Builder
-
Constructor Summary
Constructors Constructor Description ShadowTypeface()
-
Method Summary
Modifier and Type Method Description protected void
__constructor__(int fontId)
protected void
__constructor__(long fontId)
protected static void
__staticInitializer__()
protected static void
buildSystemFallback(String xmlPath, String fontDir, ArrayMap<String,Typeface> fontMap, ArrayMap<String,FontFamily[]> fallbackMap)
protected static Typeface
create(Typeface family, int style)
protected static Typeface
create(Typeface family, int weight, boolean italic)
protected static Typeface
create(String familyName, int style)
protected static Typeface
createFromAsset(AssetManager mgr, String path)
protected static Typeface
createFromFamilies(Object families)
protected static Typeface
createFromFamiliesWithDefault(Object families)
protected static Typeface
createFromFamiliesWithDefault(Object families, Object weight, Object italic)
protected static Typeface
createFromFamiliesWithDefault(Object families, Object fallbackName, Object weight, Object italic)
protected static Typeface
createFromFile(File path)
protected static Typeface
createFromFile(String path)
protected static Typeface
createFromResources(AssetManager mgr, String path, int cookie)
protected static Typeface
createFromResources(Object entry, Object mgr, Object path)
protected static Typeface
createUnderlyingTypeface(String familyName, int style)
boolean
equals(Object o)
ShadowTypeface.FontDesc
getFontDescription()
Returns the font description.protected int
getStyle()
int
hashCode()
protected static void
init()
Avoid spurious error message about /system/etc/fonts.xmlstatic void
initSystemDefaultTypefaces(Object systemFontMap, Object fallbacks, Object aliases)
protected static long
nativeCreateFromArray(long[] familyArray, int weight, int italic)
protected static long
nativeCreateFromArray(long[] familyArray, long fallbackTypeface, int weight, int italic)
protected static void
nativeForceSetStaticFinalField(String fieldname, Typeface typeface)
static void
reset()
-
Constructor Details
-
ShadowTypeface
public ShadowTypeface()
-
-
Method Details
-
__constructor__
-
__constructor__
-
__staticInitializer__
-
create
@Implementation(minSdk=28) protected static Typeface create(Typeface family, int weight, boolean italic) -
create
-
create
-
createFromAsset
-
createFromResources
@Implementation(minSdk=26, maxSdk=28) protected static Typeface createFromResources(AssetManager mgr, String path, int cookie) -
createFromResources
-
createFromFile
-
createFromFile
-
getStyle
-
equals
-
hashCode
-
createFromFamilies
@HiddenApi @Implementation(minSdk=21) protected static Typeface createFromFamilies(Object families) -
createFromFamiliesWithDefault
@HiddenApi @Implementation(minSdk=21, maxSdk=25) protected static Typeface createFromFamiliesWithDefault(Object families) -
createFromFamiliesWithDefault
-
createFromFamiliesWithDefault
-
buildSystemFallback
-
init
Avoid spurious error message about /system/etc/fonts.xml -
initSystemDefaultTypefaces
@HiddenApi @Implementation(minSdk=29, maxSdk=30) public static void initSystemDefaultTypefaces(Object systemFontMap, Object fallbacks, Object aliases) -
reset
-
createUnderlyingTypeface
-
nativeCreateFromArray
@Implementation(minSdk=26, maxSdk=30) protected static long nativeCreateFromArray(long[] familyArray, int weight, int italic) -
getFontDescription
Returns the font description.- Returns:
- Font description.
-
nativeForceSetStaticFinalField
@Implementation(minSdk=31) protected static void nativeForceSetStaticFinalField(String fieldname, Typeface typeface) -
nativeCreateFromArray
@Implementation(minSdk=31) protected static long nativeCreateFromArray(long[] familyArray, long fallbackTypeface, int weight, int italic)
-