-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/engine
#15087Closed
Copy link
Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Milestone
Description
Use case
This is the default behavior for TextViews on Android. The lineHeight param only applies between lines. This is useful, for example, when you want to increase the line height in your TextTheme. For multiple lines of text, this will increase the spacing between the lines of text. But, importantly, for single lines of text, they will remain unaffected. This means that if you have single line of text that is vertically aligned with a button or a switch, the text will not be affected (and appear off center).
Proposal
It would be nice to have API in TextStyle for specifying the lineHeight behavior. Maybe it could be an enum, something like:
enum LineHeightBehavior {
betweenLinesOnly,
aboveAndBelowLines,
...
}That way on TextStyle I could do something like
TextTheme(
body1: TextStyle(
height: 1.2,
lineHeightBehavior: LineHeightBehavior.betweenLinesOnly,
),
),.
ds84182 and Binbiubiubiu
Metadata
Metadata
Assignees
Labels
a: typographyText rendering, possibly libtxtText rendering, possibly libtxtc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.