Close

Font

Allows loading fonts from the web and using them in React Native components. See more detailed usage information in the Using Custom Fonts guide.

Expo.Font.loadAsync(name, url)

Load a font from the web and associate it with the given name.

Arguments

  • name (string) — A name by which to identify this font. You can make up any name you want; this will be the name that you use when setting fontFamily. For example, if the name is 'open-sans' then your Text component would look like: <Text style={{fontFamily: 'open-sans'}}>Hello world</Text>

Returns

Doesn’t return anything and simply awaits till the font is available to use.

Expo.Font.loadAsync(map)

Convenience form of Expo.Font.loadAsync() that loads multiple fonts at once.

Arguments

Returns

Doesn’t return anything and simply awaits till all fonts are available to use.

Example

Expo.Font.loadAsync({
  title: 'http://url/to/font1.ttf',
  cursive: 'http://url/to/font2.ttf',
});

This is equivalent to calling Expo.Font.loadAsync() once per name and URL pair.