Skip to content

Record that device settings rewrite on-device type measurements - #38

Merged
spdotdev merged 1 commit into
mainfrom
docs/device-settings-confound-measurements
Jul 12, 2026
Merged

spdotdev merged 1 commit into
mainfrom
docs/device-settings-confound-measurements

Conversation

@spdotdev

Copy link
Copy Markdown
Owner

Docs only — no issue to link (this is a working-agreement note, not a reported bug).

Why

While verifying #31 I measured type on the Pixel and concluded the app's variable font was ignoring its wght axis: every weight came back with identical glyph metrics. I had static per-weight font files generated and Type.kt rewired before running the control — at which point the original variable font passed too.

The phone had Android's Bold text setting on (font_weight_adjustment: 300). Compose adds that to every requested FontWeight (400→700, 500→800, …) and clamps at the family's heaviest weight, so several distinct weights collapse onto one and measure the same. It looks exactly like a broken font.

It's also the whole of #32: the tester's two phones differ by that setting, not by build. Same app, same font — one phone has Bold text on.

What this adds

A section in CLAUDE.md with the two settings to read before trusting any on-device font or layout number:

adb shell settings get system font_scale               # 1.0 = unscaled
adb shell settings get secure font_weight_adjustment   # 0 = none; 300 = "Bold text" ON

…plus the two habits that would have caught it in minutes instead of an hour:

  • Run the control — measure FontFamily.Default alongside, and re-measure with the setting neutralised. A number that only misbehaves under one device config is a device-config finding, not a code finding.
  • Neutralise, then restore — these are the phone owner's accessibility preferences, not test knobs.

It also notes the font_scale counterpart: flow tests inherit whatever scale the device is on, so they can't catch a label that only ellipsizes at 1.6 — render the composable in isolation and override LocalDensity instead (as ProductFilterSortRowTest now does).

No code changes.

font_weight_adjustment is added to every requested FontWeight and then clamps
at the family's heaviest weight, so with "Bold text" on, distinct weights
collapse and glyph metrics come back identical. That reads exactly like a
broken font: it cost a session diagnosing the variable font as ignoring its
wght axis and nearly swapping it for five static files, when the axis was fine
and the phone simply had the setting on. It is also all of #32 — the tester's
two phones differ by that setting, not by build.

Write down the two settings to check, the control experiment that catches this
(measure FontFamily.Default too; re-measure neutralised), and the reminder to
restore the phone owner's accessibility prefs afterwards. Same note covers
font_scale, which flow tests inherit from the device and so cannot catch.
@spdotdev spdotdev self-assigned this Jul 12, 2026
@spdotdev spdotdev added the documentation Improvements or additions to documentation label Jul 12, 2026
@spdotdev spdotdev linked an issue Jul 12, 2026 that may be closed by this pull request
@spdotdev
spdotdev merged commit 2bb5c93 into main Jul 12, 2026
1 check passed
@spdotdev
spdotdev deleted the docs/device-settings-confound-measurements branch July 12, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Different view on Pixel and Samsung phones

1 participant