FontMgr

open class FontMgr : RefCnt

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
expect open val isClosed: Boolean

Check if underlying resource is closed.

Link copied to clipboard
expect val refCount: Int

Number of references on underlying native object.

Functions

Link copied to clipboard
expect open fun close()

Free underlying native resource, peer is useless afterwards.

Link copied to clipboard
fun getFamilyName(index: Int): String
Link copied to clipboard
fun makeFromData(data: Data?, ttcIndex: Int = 0): Typeface?

Create a typeface for the specified data and TTC index (pass 0 for none) or null if the data is not recognized. The caller must call close on the returned object if it is not null.

Link copied to clipboard
Link copied to clipboard
fun matchFamiliesStyle(families: Array<String?>, style: FontStyle): Typeface?
Link copied to clipboard
fun matchFamiliesStyleCharacter(families: Array<String?>, style: FontStyle, bcp47: Array<String>?, character: Int): Typeface?
Link copied to clipboard
fun matchFamily(familyName: String?): FontStyleSet

The caller must call close on the returned object. Never returns null; will return an empty set if the name is not found.

Link copied to clipboard
fun matchFamilyStyle(familyName: String?, style: FontStyle): Typeface?

Find the closest matching typeface to the specified familyName and style and return it. The caller must call close on the returned object. Will return null if no 'good' match is found.

Link copied to clipboard
fun matchFamilyStyleCharacter(familyName: String?, style: FontStyle, bcp47: Array<String>?, character: Int): Typeface?

Use the system fallback to find a typeface for the given character. Note that bcp47 is a combination of ISO 639, 15924, and 3166-1 codes, so it is fine to just pass a ISO 639 here.

Link copied to clipboard
expect open override fun toString(): String