FEAT: Allow disabling of automatic font scaling#6727
Conversation
Introduce optional allowFontScaling on PaywallData (JSON allowFontScaling) for Paywalls V2. Pass it into UIConfigProvider so resolveFont and text styling respect Dynamic Type when true and use fixed sizes when false. Thread from Offering.paywall through PaywallsV2View and WorkflowPaywallView. Update swiftinterface API snapshots and Swift API tester. Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Matches preferred naming; JSON key updated to automaticallyScaleFontSize. Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
…he value is not present during decode
| /// Dashboard flag: Dynamic Type only when `automatically_scale_font_size` is true on paywall components. | ||
| private let automaticallyScaleFontSizeOverride: Bool |
There was a problem hiding this comment.
I think using override might be confusing, implying it comes in the overrides field for a specific component 🤔
What about. scaleFontSizeAutomatically?
| useDynamicType: Bool? = nil | ||
| ) -> Font? { | ||
|
|
||
| let useDynamicType = useDynamicType ?? self.useDynamicType() |
There was a problem hiding this comment.
Why having both the func parameter and the static function? Is it for testing purposes?
There was a problem hiding this comment.
Nope… Just forgot to change this line after updating things to be non-optional
facumenzella
left a comment
There was a problem hiding this comment.
Just a few nits. Haven't manually tested it but looks 👍
| familyName: familyName, | ||
| automaticallyScaleFontSize: automaticallyScaleFontSize | ||
| ) | ||
| return Font(platformFont) |
There was a problem hiding this comment.
Modified function is never called anywhere in codebase
Low Severity
PaywallComponent.FontSize.makeFont(familyName:automaticallyScaleFontSize:) and its private helper makePlatformFont are never called anywhere in the codebase. The automaticallyScaleFontSize parameter was added to dead code, so the conditional dynamic-type logic on lines 76–79 is unreachable in production. The actual font scaling feature flows through TextComponentStyle.makeFont → GenericFont.makeFont / UIConfigProvider.resolveFont, none of which call this function.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c04dc0d. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 332f200. Configure here.
| let textStyle = GenericFont.textStyle(for: fontSize) | ||
| return Font.custom(fontName, size: fontSize, relativeTo: textStyle) | ||
| } else { | ||
| return Font.custom(fontName, size: fontSize) |
There was a problem hiding this comment.
Default parameter on resolveFont ignores provider's stored setting
Low Severity
The resolveFont method on UIConfigProvider takes useDynamicType: Bool = true as a parameter, but the provider already stores the correct value in self.automaticallyScaleFontSize. The default of true means any caller that omits the parameter will get font scaling enabled regardless of the dashboard setting. The separate useDynamicType() function that just returns the stored property adds unnecessary indirection. The developer acknowledged in the PR discussion this was unintentional — "Just forgot to change this line after updating things to be non-optional." The method could simply read self.automaticallyScaleFontSize internally instead of requiring callers to pass it.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 332f200. Configure here.


Checklist
purchases-androidand hybridsMotivation
Description
Note
Medium Risk
Changes paywall component decoding and font construction to optionally bypass Dynamic Type, which can affect text layout and accessibility behavior across templates.
Overview
Adds a new paywall-components flag,
automatically_scale_font_size, that controls whether Paywalls V2 text respects Dynamic Type.Threads this value from
PaywallComponentsDataintoUIConfigProviderand down into text/font creation so custom and generic fonts use fixed sizing when scaling is disabled (including usingFont.custom(..., fixedSize:)). Updates encoding/decoding and tests to default the behavior to enabled when the flag is absent.Reviewed by Cursor Bugbot for commit 332f200. Bugbot is set up for automated code reviews on this repo. Configure here.