在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):expo/google-fonts开源软件地址(OpenSource Url):https://github.com/expo/google-fonts开源编程语言(OpenSource Language):JavaScript 96.6%开源软件介绍(OpenSource Introduction):Use any of the 1052 fonts and variants from fonts.google.com in your Expo app expo-google-fontsThe These packages and all these fonts work across web, iOS, and Android and are free to use and open source. UsageHere is an example of using the Inter font family in a very simple project. Install the package for the font you wantexpo install @expo-google-fonts/inter expo-font In your appimport React, { useState, useEffect } from 'react';
import { Text, View, StyleSheet } from 'react-native';
import AppLoading from 'expo-app-loading';
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 ProjectHere is a minimal but complete example. Each individual font family package README includes a complete example of using that font family. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论