-
Notifications
You must be signed in to change notification settings - Fork 314
text: Add and use proportionalLetterSpacing #629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
text: Add and use proportionalLetterSpacing #629
Conversation
a500b0b
to
bb5e0e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM; one suggestion below. Please go ahead and merge when ready.
test/widgets/text_test.dart
Outdated
} | ||
|
||
// From trying the options on an iPhone 13 Pro running iOS 16.6.1: | ||
const textScaleFactors = <double>[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the tests, the `textScaleFactors` list is copied from
emoji_reaction_test. Perhaps there's a convenient place to define it
centrally.
I think probably most convenient would be to put it at the top level of this file text_test.dart
, and then emoji_reaction_test.dart
can import from there.
It feels slightly messy to have one file be importing from another file that has its own main
function; but it works fine, and it makes a low-fuss solution here.
This is now the natural thing to do for tooltipTheme, following recommendations in the upstream docs (thanks to my PR flutter/flutter#135879!) and doesn't need an explicit comment explaining it.
As Greg suggests: zulip#629 (comment)
To confirm that [TextStyle.letterSpacing] is taken literally as logical pixels, as its dartdoc suggests it is, I rendered the text "||" with an extreme [TextStyle.letterSpacing] value of 40. Then it was easy to see that the letter spacing -- the horizontal distance between the two "|" characters -- wasn't changing as I adjusted the text-size slider in my iPhone settings. In the tests, the `textScaleFactors` list is copied from emoji_reaction_test. Perhaps there's a convenient place to define it centrally.
…ant it The letter spacings in these pieces of text hasn't been responding to system font-size adjustments. Now they do. There might not be any other instances of this problem in the app, because we widely apply 0 for [TextStyle.letterSpacing] (since 0065954), and when we do that, it shouldn't matter whether zero is considered as logical pixels or as a proportion the surrounding text size.
bb5e0e9
to
70ca30d
Compare
As Greg suggests: #629 (comment)
Thanks! Done. |
This could be helpful for #548, but I'm sending it now so we can see if we like the logic and want to reuse it for that. It does make a small adjustment to some letter spacing, to better follow the user's device-level text size setting, so I'll post some screenshots.