Android O and Android Support Library 26 add support forDownloadable Fonts.
Google Fonts is shipping a Font Provider in Google Play Services. This meansGoogle Fonts are available to native apps on Android devices!
Which fonts can I use?
The entire Google Fonts Open Source collection! Visithttps://fonts.google.com to browse.
Making the web more beautiful, fast, and open through great typography. Android will use the font name but in IOS it will use the “PostScript name”. It is tricky part let me explain to you. It is tricky part let me explain to you. Suppose i have above font files and i am using “SFUIDisplayBold” in my react native code it will work in ANDROID but not in IOS because the “postscript name” is “SFUIDisplay. Download AlgerianTrueType font. Download 186,286 Free fonts at ufonts.com.
What versions of Android are supported?
Our provider supports Jelly Bean (API level 16) and up. This represents 95%+ ofof Android devices in the wild(platform dashboard).It can be accessed using APIs in Android Support Library 26 or Android O (API level 26).
How can I get started!
- Check out thedemo app.
- Try it in Android Studio 3.0 (walkthrough with screenshots)
- Use Google Fonts declaratively or programmatically as shown inDownloadable Fonts.
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 therequested width/weight/italic value is not supported we will return the bestmatch we can find within the family. For example, a request forOswald at weight 900 would returnOswald at weight 700.
Sample queries:
Security
Algerian Font For Android Phone
For security you must specify the signature of the application exposing theprovider you want to request fonts from. Android Studio will addthe correct signature for you. Seeadding certificates.