Expo Google Fonts is released!
Tags: expo, fonts, react, reactnative
Published: 2020-05-14 00:50:35

I wanted to use Google Fonts more easily in my Expo projects and so for the last week or two, I've been working on a library that has support for every font available on Google Fonts, and I'm excited to announce its release today!

![Expo Google Fonts](https://raw.githubusercontent.com/expo/google-fonts/master/gifs/title.gif)


The `@expo-google-fonts` packages for Expo allow you to easily use 
any of 991 fonts (and their variants) from 
[fonts.google.com](https://fonts.google.com) in your Expo app.

These packages and all these fonts work across web, iOS, and Android and 
are free to use and open source.

## Usage

Here is an example of using the [Inter font family](https://fonts.google.com/specimen/Inter) in a very simple project.

#### Install the package for the font you want

```sh
expo install @expo-google-fonts/inter expo-font
```

#### In your app

```js
import React, { useState, useEffect } from 'react';

import { Text, View, StyleSheet } from 'react-native';
import { AppLoading } from 'expo';
import {
  useFonts,
  Inter_900Black,
} from '@expo-google-fonts/inter';

export default () => {
  let [fontsLoaded] = useFonts({
    Inter_900Black,
  });

  if (!fontsLoaded) {
    return <AppLoading />;
  } else {
    return (
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>

        <Text style={{ fontFamily: 'Inter_900Black' }}>
          Inter Black
        </Text>

      </View>
    );
  }
};

```


### Example Project

Here is a [minimal but complete example](https://github.com/expo/google-fonts/tree/master/example).

Each individual font family package README includes a complete example of using that font family.

## 🔡 Available Fonts

You can browse all available Google Fonts on [fonts.google.com](https://fonts.google.com). You can get the Expo Google Fonts package npm package name from the font family name on Google Fonts. Just make everything lowercase and turn spaces into dashes, like you normally would with an npm package name. So, `Source San Pro` would turn into `@expo-google-fonts/source-sans-pro`

My friend Leandro Favre made a [directory / search engine](https://directory.now.sh/) where you can browse and search through the complete list of fonts and it will give you the appropriate import statements.

Here are a few examples of the 3020 variants of 991 fonts available:


||||
|-|-|-|
|[![Inter](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/inter/Inter_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/inter#readme)|[![Manrope](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/manrope/Manrope_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/manrope#readme)|[![Allan](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/allan/Allan_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/allan#readme)|
|[![Roboto](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/roboto/Roboto_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/roboto#readme)|[![Lusitana](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/lusitana/Lusitana_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/lusitana#readme)|[![Nunito](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/nunito/Nunito_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/nunito#readme)|
|[![Bangers](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/bangers/Bangers_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/bangers#readme)|[![SourceSansPro](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/source-sans-pro/SourceSansPro_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/source-sans-pro#readme)|[![RobotoCondensed](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/roboto-condensed/RobotoCondensed_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/roboto-condensed#readme)|
|[![PlayfairDisplay](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/playfair-display/PlayfairDisplay_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/playfair-display#readme)|[![Ubuntu](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/ubuntu/Ubuntu_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/ubuntu#readme)|[![Oswald](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/oswald/Oswald_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/oswald#readme)|
|[![BalsamiqSans](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/balsamiq-sans/BalsamiqSans_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/balsamiq-sans#readme)|[![Jost](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/jost/Jost_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/jost#readme)|[![Lato](https://raw.githubusercontent.com/expo/google-fonts/master/font-packages/lato/Lato_400Regular.ttf.png)](https://github.com/expo/google-fonts/tree/master/font-packages/lato#readme)|


## 👩‍💻 @expo-google-fonts/dev


If you are trying out lots of different fonts, you can try using the [`@expo-google-fonts/dev` package](https://github.com/expo/google-fonts/tree/master/font-packages/dev#readme).

You can import *any* font style from any Expo Google Fonts package from it. It will load the fonts
over the network at runtime instead of adding the asset as a file to your project, so it may take longer
for your app to get to interactivity at startup, but it is extremely convenient
for playing around with any style that you want.

## 📖 Licensing

The Expo Google Fonts project and its code are licensed under the MIT License.

All the fonts in the Google Fonts catalog are free and open source.

Individual fonts have their own licenses. Many are licensed using the
[Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL). 
For example, [Nunito](https://fonts.google.com/specimen/Nunito) uses the OFL. 
Check the Google Fonts pages of the font families you are using and add those licenses to
your project's licenses list when you publish.

#### Q: Can I use these fonts commercially: to make a logo, in my app, on my website, etc.?

A: You can use these fonts freely in your products & projects - print or digital, commercial or otherwise. However, you can't sell the fonts on their own. This isn't legal advice, please consider consulting a lawyer and see the full license for all details.

## Code

The source code for the project is at:

https://github.com/expo/google-fonts#readme

Contributions welcome!

![announcement](https://github.com/expo/google-fonts/blob/master/gifs/announcement.gif?raw=true)