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 classShadowTypeface.FontDescstatic classShadowTypeface.ShadowBuilderShadow forTypeface.Builder
-
Constructor Summary
Constructors Constructor Description ShadowTypeface()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void__constructor__(int fontId)protected void__constructor__(long fontId)protected static void__staticInitializer__()protected static voidbuildSystemFallback(String xmlPath, String fontDir, ArrayMap<String,Typeface> fontMap, ArrayMap<String,FontFamily[]> fallbackMap)protected static Typefacecreate(Typeface family, int style)protected static Typefacecreate(Typeface family, int weight, boolean italic)protected static Typefacecreate(String familyName, int style)protected static TypefacecreateFromAsset(AssetManager mgr, String path)protected static TypefacecreateFromFamilies(Object families)protected static TypefacecreateFromFamiliesWithDefault(Object families)protected static TypefacecreateFromFamiliesWithDefault(Object families, Object weight, Object italic)protected static TypefacecreateFromFamiliesWithDefault(Object families, Object fallbackName, Object weight, Object italic)protected static TypefacecreateFromFile(File path)protected static TypefacecreateFromFile(String path)protected static TypefacecreateFromResources(AssetManager mgr, String path, int cookie)protected static TypefacecreateFromResources(Object entry, Object mgr, Object path)protected static TypefacecreateUnderlyingTypeface(String familyName, int style)booleanequals(Object o)ShadowTypeface.FontDescgetFontDescription()Returns the font description.protected intgetStyle()inthashCode()protected static voidinit()Avoid spurious error message about /system/etc/fonts.xmlstatic voidinitSystemDefaultTypefaces(Object systemFontMap, Object fallbacks, Object aliases)protected static longnativeCreateFromArray(long[] familyArray, int weight, int italic)protected static longnativeCreateFromArray(long[] familyArray, long fallbackTypeface, int weight, int italic)protected static voidnativeForceSetStaticFinalField(String fieldname, Typeface typeface)static voidreset()
-
-
-
Method Detail
-
__constructor__
@HiddenApi @Implementation protected void __constructor__(int fontId)
-
__constructor__
@HiddenApi @Implementation protected void __constructor__(long fontId)
-
__staticInitializer__
@Implementation protected static void __staticInitializer__()
-
create
@Implementation(minSdk=28) protected static Typeface create(Typeface family, int weight, boolean italic)
-
create
@Implementation protected static Typeface create(String familyName, int style)
-
create
@Implementation protected static Typeface create(Typeface family, int style)
-
createFromAsset
@Implementation protected static Typeface createFromAsset(AssetManager mgr, String path)
-
createFromResources
@Implementation(minSdk=26, maxSdk=28) protected static Typeface createFromResources(AssetManager mgr, String path, int cookie)
-
createFromResources
@Implementation(minSdk=26) protected static Typeface createFromResources(Object entry, Object mgr, Object path)
-
createFromFile
@Implementation protected static Typeface createFromFile(File path)
-
createFromFile
@Implementation protected static Typeface createFromFile(String path)
-
getStyle
@Implementation protected int getStyle()
-
equals
@Implementation public boolean equals(Object o)
-
hashCode
@Implementation public int 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
@Implementation(minSdk=26, maxSdk=27) protected static Typeface createFromFamiliesWithDefault(Object families, Object weight, Object italic)
-
createFromFamiliesWithDefault
@Implementation(minSdk=28) protected static Typeface createFromFamiliesWithDefault(Object families, Object fallbackName, Object weight, Object italic)
-
buildSystemFallback
@Implementation(minSdk=28, maxSdk=28) protected static void buildSystemFallback(String xmlPath, String fontDir, ArrayMap<String,Typeface> fontMap, ArrayMap<String,FontFamily[]> fallbackMap)
-
init
@Implementation(minSdk=21, maxSdk=27) protected static void 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
@Resetter public static void reset()
-
createUnderlyingTypeface
protected static Typeface createUnderlyingTypeface(String familyName, int style)
-
nativeCreateFromArray
@Implementation(minSdk=26, maxSdk=30) protected static long nativeCreateFromArray(long[] familyArray, int weight, int italic)
-
getFontDescription
public ShadowTypeface.FontDesc 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)
-
-