How to use the expo.Font.loadAsync function in expo

To help you get started, we’ve selected a few expo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github anpigon / rn_instagram_clone / App.js View on Github external
loadAssets = async() => {
		// Font Preloading
    await Font.loadAsync({
      Roboto: require("native-base/Fonts/Roboto.ttf"),
      Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
      'Sweet Sensations Persona Use': require('./assets/Sweet_Sensations_Persona_Use.ttf'),
      'Noto Sans KR': require('./assets/NotoSansKR-Regular.otf'),
      'Noto Sans KR Bold': require('./assets/NotoSansKR-Bold.otf'),
      'Noto Serif KR': require('./assets/NotoSerifKR-Regular.otf'),
      'Noto Serif KR Bold': require('./assets/NotoSerifKR-Bold.otf'),
    });

		// Images Preloading
    // await Asset.loadAsync([
    //   require("./assets/icon.png")
    // ])

    console.log('loadAssets complete!!!');
  }
github appbaseio / reactivesearch / packages / native / example / App.js View on Github external
async componentWillMount() {
		await Font.loadAsync({
			Roboto: require('native-base/Fonts/Roboto.ttf'), // eslint-disable-line global-require
			Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'), // eslint-disable-line global-require
			Ionicons: require('@expo/vector-icons/fonts/Ionicons.ttf'), // eslint-disable-line global-require
		});

		this.setState({ isReady: true });
	}
github hussain-t / fast-learner-mobile / src / index.js View on Github external
_loadResourcesAsync = async () => Promise.all([
    Asset.loadAsync([
      require('../assets/images/robot-dev.png'),
      require('../assets/images/robot-prod.png'),
    ]),
    Font.loadAsync({
      // This is the font that we are using for our tab bar
      ...Icon.Ionicons.font,
      // We include SpaceMono because we use it in HomeScreen.js. Feel free
      // to remove this if you are not using it in your app
      // 'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
      'open-sans-regular': require('../assets/fonts/OpenSans-Regular.ttf'),
      'open-sans-bold': require('../assets/fonts/OpenSans-Bold.ttf'),
      'open-sans-semi-bold': require('../assets/fonts/OpenSans-SemiBold.ttf'),
    }),
  ]);
github vonovak / react-navigation-mst-demo / App.js View on Github external
_loadResourcesAsync = async () => {
    return Promise.all([
      Asset.loadAsync([
        require('./assets/images/robot-dev.png'),
        require('./assets/images/robot-prod.png'),
      ]),
      Font.loadAsync({
        // This is the font that we are using for our tab bar
        ...Icon.Ionicons.font,
        // We include SpaceMono because we use it in HomeScreen.js. Feel free
        // to remove this if you are not using it in your app
        'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
      }),
      this._loadPersistedState(),
    ]);
  };
github RisingStack / colorblinder / App.js View on Github external
async componentDidMount() {
    await Font.loadAsync({
      dogbyte: require('./assets/fonts/dogbyte.otf'),
    });
    this.setState({ isFontLoaded: true });
  }
github Mike82co / TheGoldenChore / TheGoldenChore / App.js View on Github external
async componentWillMount() {
    await Font.loadAsync({
      Roboto: require("native-base/Fonts/Roboto.ttf"),
      Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf")
    });
    this.setState({ loading: false });
  }
github EvanBacon / expo-three-demo / utils / cacheAssetsAsync.js View on Github external
  return fonts.map(font => Font.loadAsync(font));
}
github expo / harvard-cs50-app / App.js View on Github external
    return fonts.map(font => Font.loadAsync(font));
  }