Repository navigation
Record that device settings rewrite on-device type measurements - #38
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
wghtaxis: every weight came back with identical glyph metrics. I had static per-weight font files generated andType.ktrewired 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 requestedFontWeight(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.mdwith the two settings to read before trusting any on-device font or layout number:…plus the two habits that would have caught it in minutes instead of an hour:
FontFamily.Defaultalongside, 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.It also notes the
font_scalecounterpart: 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 overrideLocalDensityinstead (asProductFilterSortRowTestnow does).No code changes.