79241651

Date: 2024-12-01 13:26:56
Score: 0.5
Natty:
Report link

Try npm i expo-dynamic-fonts. You can add custom fonts at runtime and you just pass in a font prop to the text component

https://www.npmjs.com/package/expo-dynamic-fonts

import React from 'react';
import { View } from 'react-native';
import { Text } from 'expo-dynamic-fonts';

const App = () => {
  return (
    <View className="flex-1 justify-center items-center">
      <Text font="Open Sans" className="text-lg">
        Hello, Open Sans!
      </Text>
      <Text font="Roboto" className="text-xl mt-4">
        Hello, Roboto!
      </Text>
    </View>
  );
};

export default App;
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: QueryKiller