FontFamilypublic class FontFamily extends Object A family of typefaces with different styles. |
Fields Summary |
---|
public long | mNativePtr |
Constructors Summary |
---|
public FontFamily()
mNativePtr = nCreateFamily(null, 0);
if (mNativePtr == 0) {
throw new IllegalStateException("error creating native FontFamily");
}
| public FontFamily(String lang, String variant)
int varEnum = 0;
if ("compact".equals(variant)) {
varEnum = 1;
} else if ("elegant".equals(variant)) {
varEnum = 2;
}
mNativePtr = nCreateFamily(lang, varEnum);
if (mNativePtr == 0) {
throw new IllegalStateException("error creating native FontFamily");
}
|
Methods Summary |
---|
public boolean | addFont(java.lang.String path)
return nAddFont(mNativePtr, path);
| public boolean | addFontFromAsset(android.content.res.AssetManager mgr, java.lang.String path)
return nAddFontFromAsset(mNativePtr, mgr, path);
| public boolean | addFontWeightStyle(java.lang.String path, int weight, boolean style)
return nAddFontWeightStyle(mNativePtr, path, weight, style);
| protected void | finalize()
try {
nUnrefFamily(mNativePtr);
} finally {
super.finalize();
}
| private static native boolean | nAddFont(long nativeFamily, java.lang.String path)
| private static native boolean | nAddFontFromAsset(long nativeFamily, android.content.res.AssetManager mgr, java.lang.String path)
| private static native boolean | nAddFontWeightStyle(long nativeFamily, java.lang.String path, int weight, boolean isItalic)
| private static native long | nCreateFamily(java.lang.String lang, int variant)
| private static native void | nUnrefFamily(long nativePtr)
|
|