class GoogleFont


A downloadable font from fonts.google.com

To learn more about the features supported by Google Fonts, see Get Started with the Google Fonts for Android

For a full list of fonts available on Android, see the Google Fonts Directory For Android XML.

Throws
kotlin.IllegalArgumentException

if name is empty

Summary

Nested types

Attributes used to create a FontRequest for a GoogleFont based Font.

Public constructors

GoogleFont(name: String, bestEffort: Boolean)

Public properties

Boolean

If besteffort is true and your query specifies a valid family name but the requested width/weight/italic value is not supported Google Fonts will return the best match it can find within the family.

String

Name of a font on Google fonts, such as "Roboto" or "Open Sans"

Public constructors

GoogleFont

Added in 1.2.0
GoogleFont(name: String, bestEffort: Boolean = true)
Parameters
name: String

Name of a font on Google fonts, such as "Roboto" or "Open Sans"

bestEffort: Boolean = true

If besteffort is true and your query specifies a valid family name but the requested width/weight/italic value is not supported Google Fonts will return the best match it can find within the family. If false, exact matches will be returned only.

Public properties

bestEffort

Added in 1.2.0
val bestEffortBoolean

If besteffort is true and your query specifies a valid family name but the requested width/weight/italic value is not supported Google Fonts will return the best match it can find within the family. If false, exact matches will be returned only.

name

Added in 1.2.0
val nameString

Name of a font on Google fonts, such as "Roboto" or "Open Sans"