Paywall V2 GoogleFont Provider not working
- [x] I have updated Purchases SDK to the latest version
- [x] I have read the Contribution Guidelines
- [x] I have searched the Community
- [x] I have read docs.revenuecat.com
- [x] I have searched for existing Github issues
Although I use Google Fonts in RevenueCat Paywall, the fonts do not change. I use Jetpack Compose and have the latest version of the SDK. When I specify custom fonts for Paywall, the default fonts keep showing.
- Environment
- Platform: Android
- SDK version: 8.15.0
- OS version: Various Android versions (12, 13, 14, 15)
- Android Studio version: Meerkat
@Composable
fun PaywallScreenRevenueCat(onDismiss: () -> Unit) {
PaywallDialog(
PaywallDialogOptions(
builder = PaywallDialogOptions.Builder()
.setDismissRequest { onDismiss() }
.setFontProvider(CustomFontProvider(displayFontFamily))
.setRequiredEntitlementIdentifier("premium")
.setListener(object : PaywallListener {
override fun onPurchaseCompleted(
customerInfo: CustomerInfo,
storeTransaction: StoreTransaction
) {
super.onPurchaseCompleted(customerInfo, storeTransaction)
Log.d("TAG", "Completed!")
}
override fun onPurchaseError(error: PurchasesError) {
super.onPurchaseError(error)
Log.d("TAG", error.message)
}
override fun onRestoreError(error: PurchasesError) {
super.onRestoreError(error)
Log.d("TAG", error.message)
}
override fun onRestoreCompleted(customerInfo: CustomerInfo) {
super.onRestoreCompleted(customerInfo)
Log.d("TAG", "On Restore Completed!")
}
override fun onPurchaseStarted(rcPackage: Package) {
super.onPurchaseStarted(rcPackage)
Log.d("TAG", "On Purchase Started!")
}
})
)
)
}
val provider = GoogleFont.Provider(
providerAuthority = "com.google.android.gms.fonts",
providerPackage = "com.google.android.gms",
certificates = R.array.com_google_android_gms_fonts_certs
)
val displayFontFamily = FontFamily(
Font(
googleFont = GoogleFont("DM Sans"),
fontProvider = provider,
)
)
val baseline = Typography()
val AppTypography = Typography(
displayLarge = baseline.displayLarge.copy(fontFamily = displayFontFamily),
displayMedium = baseline.displayMedium.copy(fontFamily = displayFontFamily),
displaySmall = baseline.displaySmall.copy(fontFamily = displayFontFamily),
headlineLarge = baseline.headlineLarge.copy(fontFamily = displayFontFamily),
headlineMedium = baseline.headlineMedium.copy(fontFamily = displayFontFamily),
headlineSmall = baseline.headlineSmall.copy(fontFamily = displayFontFamily),
titleLarge = baseline.titleLarge.copy(fontFamily = displayFontFamily),
titleMedium = baseline.titleMedium.copy(fontFamily = displayFontFamily),
titleSmall = baseline.titleSmall.copy(fontFamily = displayFontFamily),
bodyLarge = baseline.bodyLarge.copy(fontFamily = displayFontFamily),
bodyMedium = baseline.bodyMedium.copy(fontFamily = displayFontFamily),
bodySmall = baseline.bodySmall.copy(fontFamily = displayFontFamily),
labelLarge = baseline.labelLarge.copy(fontFamily = displayFontFamily),
labelMedium = baseline.labelMedium.copy(fontFamily = displayFontFamily),
labelSmall = baseline.labelSmall.copy(fontFamily = displayFontFamily),
)
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hi @oguzsout this isn't working because you are using the custom font method for paywalls v1 but paywalls v2 uses a different way. See our docs here for how to do this.
Yes, I already know that. My goal was to be able to change the paywall font without adding a ttf file to my project. Do you plan to develop for V2 in the near future?, thank you so much @HaleyRevcat
Hi @oguzsout apologies for the delay here. We've been auditing our ticketing system and found that your ticket was never resolved. At this time we do not have plans for being able to change the paywall font without adding a ttf file but I can pass this along as feedback to the team.
This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.