@@ -94,6 +94,42 @@ void testMain() {
94
94
expect (await matchImage (tabImage, tofuImage), isFalse);
95
95
});
96
96
97
+ test ('kTextHeightNone unsets the height multiplier' , () {
98
+ const double fontSize = 10 ;
99
+ const String text = 'A' ;
100
+ final ui.ParagraphBuilder builder = ui.ParagraphBuilder (ui.ParagraphStyle (fontSize: fontSize, height: 10 ));
101
+ builder.pushStyle (ui.TextStyle (height: ui.kTextHeightNone));
102
+ builder.addText (text);
103
+ final ui.Paragraph paragraph = builder.build ()
104
+ ..layout (const ui.ParagraphConstraints (width: 1000 ));
105
+ expect (paragraph.height, fontSize);
106
+ });
107
+
108
+ test ('kTextHeightNone ParagraphStyle' , () {
109
+ const double fontSize = 10 ;
110
+ final ui.ParagraphBuilder builder = ui.ParagraphBuilder (
111
+ ui.ParagraphStyle (fontSize: fontSize, height: ui.kTextHeightNone),
112
+ );
113
+ builder.addText ('A' );
114
+ final ui.Paragraph paragraph = builder.build ()
115
+ ..layout (const ui.ParagraphConstraints (width: 1000 ));
116
+ expect (paragraph.height, fontSize);
117
+ });
118
+
119
+ test ('kTextHeightNone StrutStyle' , () {
120
+ const double fontSize = 10 ;
121
+ final ui.ParagraphBuilder builder = ui.ParagraphBuilder (
122
+ ui.ParagraphStyle (
123
+ fontSize: 100 ,
124
+ strutStyle: ui.StrutStyle (forceStrutHeight: true , height: ui.KTextHeightNone , fontSize: fontSize),
125
+ ),
126
+ );
127
+ builder.addText ('A' );
128
+ final ui.Paragraph paragraph = builder.build ()
129
+ ..layout (const ui.ParagraphConstraints (width: 1000 ));
130
+ expect (paragraph.height, fontSize);
131
+ });
132
+
97
133
group ('test fonts in flutterTester environment' , () {
98
134
final bool resetValue = ui_web.debugEmulateFlutterTesterEnvironment;
99
135
ui_web.debugEmulateFlutterTesterEnvironment = true ;
0 commit comments