Skip to content

Widget Text breaks line when style is fontSize: 12 & letterSpacing: 0.1 #65419

@ghost

Description

Steps to Reproduce

Text('Jan 1', style: TextStyle(fontSize:12, letterSpacing:0.1)) prints text in multiple lines

it happens subtitle2 theme style's default value for letterSpacing is 0.1 which also causes this issue when it has below values

  • fontWeight: FontWeight.normal
  • fontSize: 12
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: Text(
            'Jan 1',
            style: TextStyle(
              fontSize: 12,
              letterSpacing: 0.1
            ),
          ),
        ),
      ),
    );
  }
}

Expected results: Text in single line

Actual results: Text in multiple lines

Logs

flutter doctor -v

[✓] Flutter (Channel master, 1.22.0-10.0.pre.82, on Linux, locale en_GB.UTF-8)
• Flutter version 1.22.0-10.0.pre.82 at /usr/lib/flutter
• Framework revision 9248fda (5 days ago), 2020-09-03 16:08:01 -0700
• Engine revision 3f05b52
• Dart version 2.10.0 (build 2.10.0-86.0.dev)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /usr/lib/android-sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /usr/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] Connected device (1 available)
• SM J600G (mobile) • xxxxxxxxxxxx • android-arm • Android 10 (API 29)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: typographyText rendering, possibly libtxte: device-specificOnly manifests on certain devicesengineflutter/engine related. See also e: labels.found in release: 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions