# Get Started with the Google Fonts for Android

Android O and AndroidX Library add support for
[Downloadable Fonts](https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts.html).

Google Fonts is shipping a Font Provider in Google Play Services. This means
Google Fonts are available to native apps on Android devices!

## Which fonts can I use?

The entire Google Fonts Open Source collection! Visit
<https://fonts.google.com> to browse.

## What versions of Android are supported?

Our provider supports Jelly Bean (API level 16) and up. This represents 95%+ of
of Android devices in the wild
([platform dashboard](https://developer.android.com/about/dashboards/index.html#Platform)).
It can be accessed using APIs in AndroidX Library
([androidx.core](https://developer.android.com/jetpack/androidx/releases/core))
or Android O (API level 26).

## How can I get started!

- Check out the [demo app](https://github.com/android/user-interface-samples/tree/main/DownloadableFonts).
- Try it in Android Studio 3.0 ([walkthrough with screenshots](https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts.html#via-android-studio))
- Use Google Fonts declaratively or programmatically as shown in [Downloadable Fonts](https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts.html).

## Query Format

To request a font from the Google Fonts provider use the following query format:

| Parameter | Required? | Range | Data Type | Default value |
|---|---|---|---|---|
| name | Yes | Any family from fonts.google.com | string |   |
| width | No | \> 0 | float | 100 |
| weight | No | (0, 1000) exclusive | int | 400 |
| italic | No | \[0, 1\] inclusive | float | 0 |
| besteffort | No | true/false | boolean | true |

If besteffort is true and your query specifies a valid family name but the
requested width/weight/italic value is not supported we will return the best
match we can find within the family. For example, a request for
[Oswald](https://fonts.google.com/specimen/Oswald) at weight 900 would return
Oswald at weight 700.

Sample queries:

    name=Lobster                            # Lobster, 400 weight
    name=Lato&weight=100                    # Lato, 100 weight
    name=Open Sans&weight=800&italic=1      # Open Sans, 800 weight, italic

## Security

For security you must specify the signature of the application exposing the
provider you want to request fonts from. Android Studio will add
the correct signature for you. See
[adding certificates](https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts.html#adding-certificates).