Skip to content

Add system font size as a device attribute#427

Open
claude[bot] wants to merge 6 commits into
developfrom
add-font-scale-device-attribute
Open

Add system font size as a device attribute#427
claude[bot] wants to merge 6 commits into
developfrom
add-font-scale-device-attribute

Conversation

@claude

@claude claude Bot commented Jul 2, 2026

Copy link
Copy Markdown

Requested by Jake Mor · Slack thread

Before

There was no device attribute exposing the user's system font size, so paywalls couldn't adapt to the device's text-size accessibility setting.

After

Adds two device attributes describing the system font size:

  • fontScale: the raw system text-scale multiplier as a Float. The system default is 1.0; larger accessibility text scales report proportionally larger values (e.g. 1.3).
  • fontSize: a normalized integer in px derived from the same scale, using a 16px reference base so that the system default (scale 1.0) reports 16. Larger scales report proportionally larger values (e.g. scale 1.321).

Android has no OS-level content-size category, so no category attribute is reported.

How

  • DeviceHelper.fontScale returns context.resources.configuration.fontScale.
  • DeviceHelper.fontSize computes (context.resources.configuration.fontScale * 16).roundToInt().
  • DeviceTemplate gains fontScale: Float and fontSize: Int fields (JSON keys fontScale and fontSize), populated in getTemplateDevice().
  • DeviceTemplateTest and the CHANGELOG are updated accordingly.

@claude claude Bot changed the title Add system font scale as a device attribute Add system font size as a device attribute Jul 3, 2026
@ianrumac ianrumac marked this pull request as ready for review July 3, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant