summaryrefslogtreecommitdiff
path: root/graphics/java/android/graphics/FontFamily.java
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/java/android/graphics/FontFamily.java')
-rw-r--r--graphics/java/android/graphics/FontFamily.java39
1 files changed, 32 insertions, 7 deletions
diff --git a/graphics/java/android/graphics/FontFamily.java b/graphics/java/android/graphics/FontFamily.java
index 229923ca8202..5d8ba938f6d5 100644
--- a/graphics/java/android/graphics/FontFamily.java
+++ b/graphics/java/android/graphics/FontFamily.java
@@ -36,7 +36,10 @@ import java.nio.channels.FileChannel;
* A family of typefaces with different styles.
*
* @hide
+ *
+ * @deprecated Use {@link android.graphics.fonts.FontFamily} instead.
*/
+@Deprecated
public class FontFamily {
private static String TAG = "FontFamily";
@@ -51,20 +54,28 @@ public class FontFamily {
/**
* @hide
+ *
+ * This cannot be deleted because it's in use by AndroidX.
*/
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 123768928)
public long mNativePtr;
// Points native font family builder. Must be zero after freezing this family.
private long mBuilderPtr;
- @UnsupportedAppUsage
+ /**
+ * This cannot be deleted because it's in use by AndroidX.
+ */
+ @UnsupportedAppUsage(trackingBug = 123768928)
public FontFamily() {
mBuilderPtr = nInitBuilder(null, 0);
mNativeBuilderCleaner = sBuilderRegistry.registerNativeAllocation(this, mBuilderPtr);
}
- @UnsupportedAppUsage
+ /**
+ * This cannot be deleted because it's in use by AndroidX.
+ */
+ @UnsupportedAppUsage(trackingBug = 123768928)
public FontFamily(@Nullable String[] langs, int variant) {
final String langsString;
if (langs == null || langs.length == 0) {
@@ -83,8 +94,10 @@ public class FontFamily {
*
* @return boolean returns false if some error happens in native code, e.g. broken font file is
* passed, etc.
+ *
+ * This cannot be deleted because it's in use by AndroidX.
*/
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 123768928)
public boolean freeze() {
if (mBuilderPtr == 0) {
throw new IllegalStateException("This FontFamily is already frozen");
@@ -98,7 +111,10 @@ public class FontFamily {
return mNativePtr != 0;
}
- @UnsupportedAppUsage
+ /**
+ * This cannot be deleted because it's in use by AndroidX.
+ */
+ @UnsupportedAppUsage(trackingBug = 123768928)
public void abortCreation() {
if (mBuilderPtr == 0) {
throw new IllegalStateException("This FontFamily is already frozen or abandoned");
@@ -107,6 +123,10 @@ public class FontFamily {
mBuilderPtr = 0;
}
+ /**
+ * This cannot be deleted because it's in use by AndroidX.
+ */
+ @UnsupportedAppUsage(trackingBug = 123768928)
public boolean addFont(String path, int ttcIndex, FontVariationAxis[] axes, int weight,
int italic) {
if (mBuilderPtr == 0) {
@@ -128,7 +148,10 @@ public class FontFamily {
}
}
- @UnsupportedAppUsage
+ /**
+ * This cannot be deleted because it's in use by AndroidX.
+ */
+ @UnsupportedAppUsage(trackingBug = 123768928)
public boolean addFontFromBuffer(ByteBuffer font, int ttcIndex, FontVariationAxis[] axes,
int weight, int italic) {
if (mBuilderPtr == 0) {
@@ -153,8 +176,10 @@ public class FontFamily {
* @param isItalic Whether this font is italic. If the weight is set to 0, this will be resolved
* using the OS/2 table in the font.
* @return
+ *
+ * This cannot be deleted because it's in use by AndroidX.
*/
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(trackingBug = 123768928)
public boolean addFontFromAssetManager(AssetManager mgr, String path, int cookie,
boolean isAsset, int ttcIndex, int weight, int isItalic,
FontVariationAxis[] axes) {