-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtText rendering, possibly libtxtdependency: skiaSkia team may need to help usSkia team may need to help usf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
Steps to Reproduce
const style = TextStyle(height: 11, fontSize: 7);
const simple = TextSpan(text: 'x', style: style);
const emptyString = TextSpan(text: '', style: style);
const emptyParagraph = TextSpan(style: style);
final painter = TextPainter(
textDirection: TextDirection.ltr,
strutStyle: StrutStyle.fromTextStyle(style),
textHeightBehavior: const TextHeightBehavior(applyHeightToFirstAscent: false, applyHeightToLastDescent: false),
);
for (final span in [simple, emptyString, emptyParagraph]) {
painter.text = span;
painter.layout();
final realHeight = painter.height;
final preferredHeight = painter.preferredLineHeight;
print('${span.text} > real height: $realHeight, preferred height: $preferredHeight');
}"real height" should always be the same as "preferred height" (8 px) in all 3 cases. However right now for both "emptyString" and "emptyParagraph" the reported "real height" is 77.0.
Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtText rendering, possibly libtxtdependency: skiaSkia team may need to help usSkia team may need to help usf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.