-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
- I have updated Purchases SDK to the latest version
- I have read the Contribution Guidelines
- I have searched the Community
- I have read docs.revenuecat.com
- 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),
)
Metadata
Metadata
Assignees
Labels
No labels