-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Add support for fill, weight, grade, and optical size to Icon
#106896
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
Conversation
Icon
/// | ||
/// Defaults to the current [IconTheme] color, if any. | ||
/// Requires the underlying icon font to support the `FILL` [FontVariation] |
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.
This is a little bit confusing because the developer may not know anything about the default icon font. Can we help them out a little? Here and elsewhere.
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.
Answered elsewhere. I can point out that font file names often include the supported axes
/// The color (whether specified explicitly here or obtained from the | ||
/// [IconTheme]) will be further adjusted by the opacity of the current | ||
/// [IconTheme], if any. | ||
/// Can be used to convey a state transition for animation or interaction. |
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.
Not sure what this means. We support animating an icon's fill property?
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.
Yes. Material Symbols does it starting from the middle, going in/out a square shape.
/// Grade and [weight] both affect a symbol's stroke weight (thickness), but | ||
/// grade has a smaller impact on the size of the symbol. | ||
/// | ||
/// Grade is also available in some text fonts. One can match grade levels |
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.
How does one know if a font supports grade? Similarly, can we make any guarantees about the default text styles (the default Material TextTheme?)
Making sense of this seems particularly difficult for someone who's just reading this bit of API doc. Maybe we could include a link to something that covers the topic in depth?
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.
There's a convention Google Fonts uses to put the axes in the font file name, it's not obligatory but can help, e.g. MaterialSymbolsOutlined[FILL,GRAD,opsz,wght].ttf
. I can't find any docs about it right now.
No guarantees for text yet since this PR concerns only icons. Roboto ⇒ Roboto flex is something to do in the future.
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.
https://fonts.google.com/knowledge/introducing_type/introducing_variable_fonts might be a good link
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.
Looks good. Just a question and request for defaults to be documented.
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.
LGTM. Thx.
…ter#106896) * wip * update documentation * x * remove trailing spaces * x * remove useless CupertinoIconThemeData copyWith override * add tests * remove trailing spaces * fix isConcrete * x * x * x * remove trailing spaces * tweak docs * mention that font filenames often indicate the supported axes * add back cupertino IconThemeData copyWith * update copyWith
This PR adds framework support required for Material Symbols (design doc, #102560).
Also:
debugFillProperties
is completedTests
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.