Skip to content

default Text widget's letter spacing is a bit off #22572

Open

Description

screen shot 2018-10-02 at 8 26 51 pm

The flutter's line seems to be a bit more spaced out, what do you think?

Steps to Reproduce

Create two views, one in flutter with

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'my_app',
      home: Scaffold(
        backgroundColor: Colors.white,
        body: Center(
          child: Text(
            'hello from flutter yay',
            style: TextStyle(
              fontSize: 18.0,
              fontWeight: FontWeight.w400,
              color: Colors.black,
            ),
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {},
          child: Icon(Icons.add),
        ),
      ),
    );
  }
}

and one in swift / objc with

  override func viewDidLoad() {
    super.viewDidLoad()
    view.backgroundColor = .white

    let helloLabel = UILabel()
    helloLabel.text = "hello from ios"
    helloLabel.translatesAutoresizingMaskIntoConstraints = false
    view.addSubview(helloLabel)
    helloLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
    helloLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
  }

Activity

  1. ghost changed the title [-]default Text's widget letter spacing is a bit off[/-] [+]default Text widget's letter spacing is a bit off[/+] on Oct 2, 2018
  2. ghost changed the title [-]default Text widget's letter spacing is a bit off[/-] [+]default Text widget's letter spacing is a bit off imo[/+] on Oct 2, 2018
  3. zoechi commented on Oct 3, 2018

    @zoechi
    Contributor

    Please add the output of flutter doctor -v.

  4. added
    p: cupertino_uicupertino_ui package in flutter/packages
    a: typographyText rendering, possibly libtxt
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 3, 2018
  5. added this to the milestone on Oct 3, 2018
  6. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 3, 2018
  7. saurik commented on Nov 27, 2018

    @saurik
    Contributor

    I am going to agree that the text doesn't even feel like the same weight as native text; I haven't like, taken a screenshot of it to compare, so it could be that something else is doing it, but it just feels less thick/dense.

  8. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Dec 13, 2018
  9. changed the title [-]default Text widget's letter spacing is a bit off imo[/-] [+]default Text widget's letter spacing is a bit off[/+] on Jan 13, 2020
  10. 4 remaining items

  11. removed this from the milestone on Aug 17, 2020
  12. gaaclarke commented on Oct 12, 2020

    @gaaclarke
    Member

    I took the image from #22572 (comment) and pasted the 2 "hello"s next to each other. I think any pixel differences are just tricks of antialiasing and not really representative of a different kern. It would be helpful if we had the companion iOS code that is using to compare.

    Screen Shot 2020-10-12 at 3 16 07 PM

  13. huycozy commented on Dec 29, 2022

    @huycozy
    Member

    This issue seems to be reproducible on the latest master channel.

    Flutter iOS native

    I tried putting 2 screenshots (ios native is red text, flutter is black text) with the first letter matching, the issue will be more visible (not sure if this is the right test):
    Screenshot 2022-12-29 at 17 37 58

    Sample code (Flutter and iOS)
    • Flutter:
    import 'package:flutter/material.dart';
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'my_app',
          home: Scaffold(
            backgroundColor: Colors.white,
            body: Center(
              child: Text(
                'hello from flutter yay',
                style: TextStyle(
                  fontSize: 28.0,
                ),
              ),
            ),
            floatingActionButton: FloatingActionButton(
              onPressed: () {},
              child: Icon(Icons.add),
            ),
          ),
        );
      }
    }
    
    • iOS native:
    class ViewController: UIViewController {
    
        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view.
            
            view.backgroundColor = .white
    
            let helloLabel = UILabel()
            helloLabel.text = "hello from flutter yay"
            helloLabel.font = helloLabel.font.withSize(28)
            helloLabel.textColor = UIColor.red
            helloLabel.translatesAutoresizingMaskIntoConstraints = false
            view.addSubview(helloLabel)
            helloLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
            helloLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
        }
    }
    
    flutter doctor -v (stable and master)
    [✓] Flutter (Channel stable, 3.3.10, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
        • Flutter version 3.3.10 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 135454af32 (13 hours ago), 2022-12-15 07:36:55 -0800
        • Engine revision 3316dd8728
        • Dart version 2.18.6
        • DevTools version 2.15.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-33, build-tools 31.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14B47b
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.3)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    
    [✓] IntelliJ IDEA Community Edition (version 2022.1.1)
        • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
    
    [✓] VS Code (version 1.73.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.54.0
    
    [✓] Connected device (3 available)
        • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 12 (API 31)
        • macOS (desktop)  • macos       • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
        • Chrome (web)     • chrome      • web-javascript • Google Chrome 108.0.5359.124
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    [!] Flutter (Channel master, 3.7.0-13.0.pre.92, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
        • Flutter version 3.7.0-13.0.pre.92 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 4e08ebb2bf (2 hours ago), 2022-12-27 19:31:24 -0500
        • Engine revision 8294e2693a
        • Dart version 3.0.0 (build 3.0.0-66.0.dev)
        • DevTools version 2.20.0
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-33, build-tools 31.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14B47b
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.3)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    
    [✓] IntelliJ IDEA Community Edition (version 2022.1.1)
        • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
    
    [✓] VS Code (version 1.74.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.56.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 108.0.5359.124
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
  14. paaspaas00 commented on May 16, 2024

    @paaspaas00

    Hi all, is this being worked on? The issue still persists on master

  15. cse-ariful commented on Oct 26, 2025

    @cse-ariful

    I have been watching this issue from
    years. This is the main reason I can't choose flutter as a alternative to native. Anyone know if there is any solution exists as a temp fix until the issue is resolved

  16. m41w4r3exe commented on Dec 4, 2025

    @m41w4r3exe

    Wow 6 years without solution, I'm shocked. Also eagerly waiting for a solution here

  17. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms bettera: typographyText rendering, possibly libtxtfound in release: 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions