Stay organized with collections
Save and categorize content based on your preferences.
FontsContract.FontInfo
public
static
class
FontsContract.FontInfo
extends Object
This class was deprecated
in API level 31.
Use the FontsContractCompat.FontInfo
for
consistent behavior across all devices
Object represent a font entry in the family returned from FontsContract.fetchFonts(Context, CancellationSignal, FontRequest)
.
Summary
Public methods |
FontVariationAxis[]
|
getAxes()
Returns the list of axes associated to this font.
|
int
|
getResultCode()
Returns result code.
|
int
|
getTtcIndex()
Returns the index to be used to access this font when accessing a TTC file.
|
Uri
|
getUri()
Returns a URI associated to this record.
|
int
|
getWeight()
Returns the weight value for this font.
|
boolean
|
isItalic()
Returns whether this font is italic.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public methods
getAxes
public FontVariationAxis[] getAxes ()
Returns the list of axes associated to this font.
getTtcIndex
public int getTtcIndex ()
Returns the index to be used to access this font when accessing a TTC file.
Returns |
int |
Value is 0 or greater |
getUri
public Uri getUri ()
Returns a URI associated to this record.
Returns |
Uri |
This value cannot be null . |
getWeight
public int getWeight ()
Returns the weight value for this font.
Returns |
int |
Value is between 1 and 1000 inclusive |
isItalic
public boolean isItalic ()
Returns whether this font is italic.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# FontsContract.FontInfo\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nDeprecated in [API level\n31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nFontsContract.FontInfo\n======================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/provider/FontsContract.FontInfo \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\nclass\nFontsContract.FontInfo\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|-----------------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.provider.FontsContract.FontInfo |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This class was deprecated\nin API level 31.** \n\nUse the [FontsContractCompat.FontInfo](https://developer.android.com/reference/androidx/core/provider/FontsContractCompat.FontInfo.html) for\nconsistent behavior across all devices\n\nObject represent a font entry in the family returned from [FontsContract.fetchFonts(Context, CancellationSignal, FontRequest)](/reference/android/provider/FontsContract#fetchFonts(android.content.Context,%20android.os.CancellationSignal,%20android.provider.FontRequest)).\n\nSummary\n-------\n\n| ### Public methods ||\n|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` `[FontVariationAxis[]](/reference/android/graphics/fonts/FontVariationAxis) | ` `[getAxes](/reference/android/provider/FontsContract.FontInfo#getAxes())`() ` Returns the list of axes associated to this font. |\n| ` int` | ` `[getResultCode](/reference/android/provider/FontsContract.FontInfo#getResultCode())`() ` Returns result code. |\n| ` int` | ` `[getTtcIndex](/reference/android/provider/FontsContract.FontInfo#getTtcIndex())`() ` Returns the index to be used to access this font when accessing a TTC file. |\n| ` `[Uri](/reference/android/net/Uri) | ` `[getUri](/reference/android/provider/FontsContract.FontInfo#getUri())`() ` Returns a URI associated to this record. |\n| ` int` | ` `[getWeight](/reference/android/provider/FontsContract.FontInfo#getWeight())`() ` Returns the weight value for this font. |\n| ` boolean` | ` `[isItalic](/reference/android/provider/FontsContract.FontInfo#isItalic())`() ` Returns whether this font is italic. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nPublic methods\n--------------\n\n### getAxes\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic FontVariationAxis[] getAxes ()\n```\n\nReturns the list of axes associated to this font.\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------------------------------------------------------------------------|----------------------------------|\n| [FontVariationAxis[]](/reference/android/graphics/fonts/FontVariationAxis) | This value may be `null`. \u003cbr /\u003e |\n\n### getResultCode\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic int getResultCode ()\n```\n\nReturns result code.\n\n[FontsContract.Columns.RESULT_CODE](/reference/android/provider/FontsContract.Columns#RESULT_CODE)\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getTtcIndex\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic int getTtcIndex ()\n```\n\nReturns the index to be used to access this font when accessing a TTC file.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|------------------------------|\n| `int` | Value is 0 or greater \u003cbr /\u003e |\n\n### getUri\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic Uri getUri ()\n```\n\nReturns a URI associated to this record.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------|-------------------------------------|\n| [Uri](/reference/android/net/Uri) | This value cannot be `null`. \u003cbr /\u003e |\n\n### getWeight\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic int getWeight ()\n```\n\nReturns the weight value for this font.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|----------------------------------------------|\n| `int` | Value is between 1 and 1000 inclusive \u003cbr /\u003e |\n\n### isItalic\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic boolean isItalic ()\n```\n\nReturns whether this font is italic.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |"]]