-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Add support for leading parameter in TextStyle #24637
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
@@ -313,13 +314,20 @@ class TextStyle extends Diagnosticable { | |||
/// parent text span, or, for the root text spans, with the line box. | |||
final TextBaseline textBaseline; | |||
|
|||
/// The height of this text span, as a multiple of the font size. | |||
/// The height of this text span, as a multiple of the sum of font size and leading. | |||
/// | |||
/// If applied to the root [TextSpan], this value sets the line height, which | |||
/// is the minimum distance between subsequent text baselines, as multiple of | |||
/// the font size. |
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.
either font size and leading
or font size (the root [TextSpan] ignores the [leading])
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 like the latter
/// | ||
/// When null, default font leading will be used. Leading is the additional | ||
/// spacing between lines. | ||
final double leading; |
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 should mention that it's ignored at the paragraph level
This is now waiting for the engine-side to land and roll. Will require a manual roll. |
Holding off on this change, as we will be implementing the 'Strut' system that will allow finer control of line spacing. |
This will be superseded by the changes in flutter/engine#7414 and #26085. It is possible that this feature can be landed alongside it, but that will be attempted later after strut is landed and stable as it provides much but not all of the functionality of this. |
This enables leading as a TextStyle parameter to non-breaking-ly allow users to adjust the line spacing without changing the overall height of the text span and the metrics surrounding it.
Requires an engine roll with the LibTxt changes.
See #23875.