purchases-android icon indicating copy to clipboard operation
purchases-android copied to clipboard

Paywall V2 GoogleFont Provider not working

Open oguzsout opened this issue 8 months ago • 3 comments

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.

  1. Environment
    1. Platform: Android
    2. SDK version: 8.15.0
    3. OS version: Various Android versions (12, 13, 14, 15)
    4. 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),
)

oguzsout avatar Mar 26 '25 02:03 oguzsout

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

RCGitBot avatar Mar 26 '25 02:03 RCGitBot

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.

HaleyRevcat avatar Apr 04 '25 12:04 HaleyRevcat

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

oguzsout avatar Apr 04 '25 13:04 oguzsout

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.

HaleyRevcat avatar Oct 02 '25 23:10 HaleyRevcat

This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.

github-actions[bot] avatar Oct 22 '25 00:10 github-actions[bot]