Skip to main content
Question

Custom Fonts for a Paywall - Expo

  • November 11, 2024
  • 2 replies
  • 330 views

Forum|alt.badge.img+2

We tried to get the font family working for a paywall, however we are using expo react native and it was not working no matter what i did. I tried to follow expo tutorial on how to use custom fonts and did it the react native way and nothing worked for iOS.

Is there a way we can do it using expo: https://docs.expo.dev/develop/user-interface/fonts/

This post has been closed for comments

2 replies

wes_clark
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 299 replies
  • November 13, 2024

Hi! Here is our documentation on using custom fonts for paywalls just in case. Can you share the code snippet that you are using in order to present the paywalls with the fonts so that we can take a closer look?


Forum|alt.badge.img+2
  • Author
  • New Member
  • 1 reply
  • November 13, 2024

We use the `useFonts` hook to load our fonts in expo. See here for the official documentation. 

In our code, we initialize our fonts below.

const [fontsLoaded] = useFonts({
		'Inter-Light': Inter_300Light,
		'Inter-Regular': Inter_400Regular,
		'Inter-Medium': Inter_500Medium,
		'Inter-SemiBold': Inter_600SemiBold,
		'Inter-Bold': Inter_700Bold,
		'Prompt-Bold-Italic': Prompt_700Bold_Italic
	});

  For our paywall, we try to setup the `fontFamily` in the paywall component as so
 

<RevenueCatUI.Paywall
				options={{
					displayCloseButton: true,
					fontFamily: 'Prompt-Bold-Italic'
				}}
			/>


The fonts work when setting styles in the app but doesn’t work for fontFamily of paywall. Any ideas how to get it working with expo?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings