Skip to main content

PaywallFontProvider does not have any affect on iOS v2 paywalls.

 

I’ve implemeted a custom PaywallFooterProvider as below:

 

class MyPaywallFontProvider: PaywallFontProvider {

    func font(for textStyle: Font.TextStyle) -> Font {

        switch textStyle {

        case .largeTitle:

                .custom("PlayfairDisplay-Regular", size: 34, relativeTo: .largeTitle)

        case .title:

                .custom("PlayfairDisplay-Regular", size: 28, relativeTo: .title)

        case .title2:

                .custom("PlayfairDisplay-Regular", size: 22, relativeTo: .title2)

        case .title3:

                .custom("PlayfairDisplay-Regular", size: 20, relativeTo: .title3)

        case .headline:

                .custom("Jost-Semibold", size: 17, relativeTo: .headline)

        case .subheadline:

                .custom("Jost-Regular", size: 15, relativeTo: .subheadline)

        case .body:

                .custom("Jost-Regular", size: 17, relativeTo: .body)

        case .callout:

                .custom("Jost-Regular", size: 16, relativeTo: .callout)

        case .footnote:

                .custom("Jost-Regular", size: 13, relativeTo: .footnote)

        case .caption:

                .custom("Jost-Regular", size: 12, relativeTo: .caption)

        case .caption2:

                .custom("Jost-Regular", size: 11, relativeTo: .caption2)

        @unknown default:

            fatalError()

        }

    }

}

This provider is passed to paywall like below:

 

            .sheet(isPresented: $showPaywall, content: {

                PaywallView(fonts: MyPaywallFontProvider())

            })

 

This code does not have any affect on the paywall. I’m still seeing Apple’s default font on the paywall screen.

I’m using one of the paywall templates and did not change anything in the web paywall editor.

I’m wondering if there is a hidden step in the editor to make this work?

Thanks

 

Hi ​@berk,

In Paywalls V2, the SDK’s PaywallFontProvider is not used. Instead, each text component in the paywall editor has a "Font Family" setting with a gear icon, where you can specify your preferred font. To add a custom font, follow the steps outlined in our documentation here.

 

Best,


Reply