Skip to content

Commit 3bcfe2c

Browse files
chrisbobbegnprice
authored andcommitted
content: Use 17 for base font size (and height 22), like in Figma
Discussion: https://chat.zulip.org/#narrow/stream/48-mobile/topic/density.20in.20message.20list/near/1735140 Fixes: #512
1 parent bac688a commit 3bcfe2c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/widgets/content.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import 'store.dart';
1919
import 'text.dart';
2020

2121
/// The font size for message content in a plain unstyled paragraph.
22-
const double kBaseFontSize = 14;
22+
const double kBaseFontSize = 17;
2323

2424
/// The entire content of a message, aka its body.
2525
///
@@ -112,7 +112,7 @@ class Paragraph extends StatelessWidget {
112112

113113
static const textStyle = TextStyle(
114114
fontSize: kBaseFontSize,
115-
height: (17 / kBaseFontSize),
115+
height: (22 / kBaseFontSize),
116116
);
117117

118118
@override

test/widgets/content_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void main() {
297297
group('LinkNode interactions', () {
298298
// The Flutter test font uses square glyphs, so width equals height:
299299
// https://github.com/flutter/flutter/wiki/Flutter-Test-Fonts
300-
const fontSize = 14.0;
300+
// We use this to simulate taps on specific glyphs.
301301

302302
Future<void> prepareContent(WidgetTester tester, String html) async {
303303
await testBinding.globalStore.add(eg.selfAccount, eg.initialSnapshot());
@@ -323,6 +323,8 @@ void main() {
323323
}, variant: const TargetPlatformVariant({TargetPlatform.android, TargetPlatform.iOS}));
324324

325325
testWidgets('multiple links in paragraph', (tester) async {
326+
final fontSize = Paragraph.textStyle.fontSize!;
327+
326328
await prepareContent(tester,
327329
'<p><a href="https://a/">foo</a> bar <a href="https://b/">baz</a></p>');
328330
final base = tester.getTopLeft(find.text('foo bar baz'))
@@ -349,6 +351,8 @@ void main() {
349351
});
350352

351353
testWidgets('link containing other spans', (tester) async {
354+
final fontSize = Paragraph.textStyle.fontSize!;
355+
352356
await prepareContent(tester,
353357
'<p><a href="https://a/">two <strong><em><code>words</code></em></strong></a></p>');
354358
final base = tester.getTopLeft(find.text('two words'))

0 commit comments

Comments
 (0)