Skip to content

Font weight is too light in light mode and too heavy in dark mode #120857

Open

Description

@anthonymoretti

Steps to Reproduce

  1. Execute flutter run on the code sample.
  2. Take a screenshot of the Flutter app.
  3. Compose a new message in iOS Mail with the same text.
  4. Take screenshots of iOS Mail in light mode and dark mode.
  5. Compare the text in the screenshots to the screenshot of the Flutter app.

Expected results:
The font weights look the same.

Actual results:
The font weight in Flutter is too light in light mode and too heavy in dark mode. This makes the app look quite different in one mode compared to the other.

Font weight is too light in light mode, and too heavy in dark mode

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              alignment: Alignment.center,
              height: 56.0,
              child: const Text(
                'The quick brown fox jumps over the lazy dog',
                style: TextStyle(
                  color: Colors.black,
                  fontSize: 17.0,
                  letterSpacing: -0.43,
                ),
              ),
            ),
            Container(
              alignment: Alignment.center,
              color: const Color.fromRGBO(28, 28, 30, 1),
              height: 56.0,
              child: const Text(
                'The quick brown fox jumps over the lazy dog',
                style: TextStyle(
                  color: Colors.white,
                  fontSize: 17.0,
                  letterSpacing: -0.43,
                ),
              ),
            ),
          ],
        ),
        backgroundColor: Colors.white,
      ),
    );
  }
}
Details
[flutter] flutter doctor -v
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.2.1 22D68 darwin-x64, locale en-US)
    • Flutter version 3.7.3 on channel stable at /Users/anthonymoretti/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9944297138 (7 days ago), 2023-02-08 15:46:04 -0800
    • Engine revision 248290d6d5
    • Dart version 2.19.2
    • DevTools version 2.20.1

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] 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/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.75.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (3 available)
    • iPhone 14 Pro (mobile) • ED506CAA-EB76-47D8-BBDC-751CB0EE7EC8 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64     • macOS 13.2.1 22D68 darwin-x64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 110.0.5481.100

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
exit code 0

Activity

  1. HylkeReinders commented on Feb 16, 2023

    @HylkeReinders

    Hi Anthony,

    Just checked your screenshot and i didn't see a difference when checking the widths in Figma.

    For the black:
    Screenshot 2023-02-16 at 09 50 06

    For the White:
    Screenshot 2023-02-16 at 09 51 39

    What I do see is that with the black text we have a dark border and that is the same for the white text color. That could be lighter? So it looks like the same width?

  2. anthonymoretti commented on Feb 16, 2023

    @anthonymoretti
    Author

    Hi Hylke

    Thanks for looking into it. Yeah the border color in both light and dark modes needs to be darker, otherwise it looks like the weights are off. The change is especially noticeable when switching from light mode to dark mode and vice versa.

    The border color of the letter "h" is a good example. If you compare the border color of each "h" to the one below it you can see how the border color of the bottom one is too light in both cases. If it could be changed to match the border color of the "h" above it that would fix it I think.

    h - light mode

    h - dark mode

  3. added
    in triagePresently being triaged by the triage team
    on Feb 16, 2023
  4. huycozy commented on Feb 16, 2023

    @huycozy
    Member

    Hi @anthonymoretti
    Can you please provide screenshots for the comparison between Flutter and iOS native? Honestly, I've tried to look closely but haven't noticed the difference yet. Should I pay attention to the border of the letters?

  5. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 16, 2023
  6. anthonymoretti commented on Feb 16, 2023

    @anthonymoretti
    Author

    Hi @huycozy
    Yes, it's the border of the letters, which is too light in both light and dark modes. It creates the effect that text is too thin in light mode and too bold in dark mode.

    Here are the screenshots:

    iOS Mail - light mode iOS Mail - dark mode Flutter
  7. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 16, 2023
  8. delfme commented on Feb 16, 2023

    @delfme

    @huycozy please focus on the leg of "i" or on "k". First row (the thicker one) is native.

    Screenshot 2023-02-16 at 14 22 03

    I couldn't test and it is not clear if the issue affects only skia, impeller or both engines.
    However, I remembered this fix landed lately and it would be worth double-checking things work properly on Impeller #118613

  9. anthonymoretti commented on Feb 16, 2023

    @anthonymoretti
    Author

    Hi @delfme. This is with Impeller enabled, but I think it existed before too.

  10. anthonymoretti commented on Feb 16, 2023

    @anthonymoretti
    Author

    I realize it might be hard to see, so thought I'd try to make it easier. This is with Impeller, but I think it might have existed before too.

    Border color comparison

  11. huycozy commented on Feb 17, 2023

    @huycozy
    Member

    Thank you guys for more information. I double-check this and see that it's easier to see this issue in dark mode especially.

    Demo

    Screenshot 2023-02-17 at 12 01 52

    Demo (raw images)
    iOS light iOS dark Flutter
    Demo video
    RPReplay_Final1676610434.MP4

    But as @delfme mentioned above, this seems to be fixed with Impeller:

    Flutter Skia Flutter Impeller

    @anthonymoretti Can you retry on the latest master channel with Impeller and check if see the same result?

  12. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 17, 2023
  13. anthonymoretti commented on Feb 17, 2023

    @anthonymoretti
    Author

    Thanks for looking. I tried on the latest master with Impeller now but it's identical to stable. A second very minor thing, in Flutter there appears to be an extra pixel between "k" and "b", so the total line length is different by one pixel.

    The reason I noticed the problem in the first place is because the text in my app appears thinned out in light mode compared to dark mode, and it seems to be because of a font weight imbalance between the modes.

    Native, Master, Stable

    flutter doctor -v
    [flutter] flutter doctor -v
    [✓] Flutter (Channel master, 3.8.0-13.0.pre.74, on macOS 13.2.1 22D68 darwin-x64, locale en-US)
        • Flutter version 3.8.0-13.0.pre.74 on channel master at /Users/anthonymoretti/Development/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 298d8c76ba (89 minutes ago), 2023-02-16 21:28:30 -0800
        • Engine revision 6e92c0c284
        • Dart version 3.0.0 (build 3.0.0-245.0.dev)
        • DevTools version 2.21.1
    
    [✗] Android toolchain - develop for Android devices
        ✗ Unable to locate Android SDK.
          Install Android Studio from: https://developer.android.com/studio/index.html
          On first launch it will assist you in installing the Android SDK components.
          (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
          If the Android SDK has been installed to a custom location, please use
          `flutter config --android-sdk` to update to that location.
    
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.2)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14C18
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [!] 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/macos#android-setup for detailed instructions).
    
    [✓] VS Code (version 1.75.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.58.0
    
    [✓] Connected device (3 available)
        • iPhone 14 Pro (mobile) • ED506CAA-EB76-47D8-BBDC-751CB0EE7EC8 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
        • macOS (desktop)        • macos                                • darwin-x64     • macOS 13.2.1 22D68 darwin-x64
        • Chrome (web)           • chrome                               • web-javascript • Google Chrome 110.0.5481.100
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 2 categories.
    exit code 0
    
  14. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 17, 2023
  15. huycozy commented on Feb 17, 2023

    @huycozy
    Member

    Labeling the issue for the team's attention since the issue is also happening on skia (see #120857 (comment) or above comments for the demo)

    flutter doctor -v (stable and master)
    [✓] Flutter (Channel stable, 3.7.3, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
        • Flutter version 3.7.3 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 9944297138 (17 hours ago), 2023-02-08 15:46:04 -0800
        • Engine revision 248290d6d5
        • Dart version 2.19.2
        • DevTools version 2.20.1
    
    [✓] 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: /Users/huynq/Library/Java/JavaVirtualMachines/corretto-1.8.0_302/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment Corretto-8.302.08.1 (build 1.8.0_302-b08)
        • 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 2022.1)
        • 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
        ✗ Unable to find bundled Java version.
        • Try updating or re-installing Android Studio.
    
    [✓] 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.75.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.58.0
    
    [✓] Connected device (3 available)
        • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 13 (API 33)
        • macOS (desktop)  • macos       • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
        • Chrome (web)     • chrome      • web-javascript • Google Chrome 110.0.5481.77
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    [!] Flutter (Channel master, 3.8.0-13.0.pre.51, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
        • Flutter version 3.8.0-13.0.pre.51 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 efde350812 (15 minutes ago), 2023-02-15 21:49:06 -0500
        • Engine revision a966cf878f
        • Dart version 3.0.0 (build 3.0.0-240.0.dev)
        • DevTools version 2.21.1
        • 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/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
        • 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 2022.1)
        • 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.15+0-b2043.56-8887301)
    
    [✓] 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.75.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.58.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 110.0.5481.100
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
  16. 27 remaining items

  17. delfme commented on Oct 17, 2024

    @delfme

    @anthonymoretti I lately had a closer look at Inter font suggested by @ManuelRauber and it seems it might be a good patch on iOS while waiting for a fix.
    https://mattwestcott.org/blog/an-ode-to-the-inter-typeface
    I still didnt try it on phone though.

  18. delfme commented on Oct 17, 2024

    @delfme

    @anthonymoretti if you made time to test it, would you be so kind as to create a reference table to related what weight on iOS compare with Inter, both light and dark mode.
    For example, on dark mode, SF 500 == Inter 480, just guessing.

  19. delfme commented on Oct 17, 2024

    @delfme

    Quick report on this.

    Download Inter font from here https://rsms.me/inter/
    Add it to pubspec:

        - family: InterVariable
          fonts:
            - asset: assets/fonts/InterVariable.ttf
            - asset: assets/fonts/InterVariable-Italic.ttf
    

    In my case, I got a native look with dark theme by setting wght to 450 (instead of SF 500) but it feels like this needs test. However, this is a valid workaround because font looks very similar to SF.

     Text(
          text,
          style: theme.textStyleForChatTileContent.copyWith(
              //  fontWeight: FontWeight.w500,
               fontFamily: 'InterVariable',
               fontVariations: [FontVariation('wght', 450)]
      ),
    

    Hope this helps.

  20. delfme commented on Nov 22, 2024

    @delfme

    Unfortunately, the workaround above isn’t a solution, as some emojis will be rendered without color on both Android and iOS. This issue may be related to this GitHub issue.

    To recap:

    • With the system font, emoji color is correct, but fontWeight on iOS is broken, causing text to appear thinner in light mode and ticker in dark mode.
    • With a variable font (I tested with Inter), we can adjust the font weight to look like native, but some emojis will be rendered without color.
  21. davidgreyme commented on Dec 12, 2024

    @davidgreyme

    @delfme did you find any new usable workaround for this?

  22. delfme commented on Dec 12, 2024

    @delfme

    @delfme did you find any new usable workaround for this?

    This works #120857 (comment)
    Make sure to adjust strokeWidth accordingly.
    The downside of this approach is that it will result in double texts appearing on the scene, but for now, this is the only viable solution.

    If you are aiming to make your texts look native, keep in mind that there are other issues, including incorrect text height and fontSize, letterSpacing, emojis size and emoji offset. To observe them, display a multiline text—one using UILabel and the other with Flutter Text widget. You will be able to spot the discrepancies visually. #28894 (comment)

  23. davidgreyme commented on Dec 12, 2024

    @davidgreyme

    Thanks @delfme!

    @MitchellGoodwin @jonahwilliams you seem to be the ones working on the native Cupertino font. Are you aware of these inconsistencies compared to the native iOS font?

  24. jodinathan commented on Feb 25, 2025

    @jodinathan

    any news for this?

    we are trying to reproduce a Figma file in Flutter but this is messing with the layout.

  25. delfme commented on Feb 27, 2025

    @delfme

    Thanks @delfme!

    @MitchellGoodwin @jonahwilliams you seem to be the ones working on the native Cupertino font. Are you aware of these inconsistencies compared to the native iOS font?

    I also mentioned our solutions to address the issue in the cupertino widgets
    #120857 (comment)

    It would be great if a fix could land sometime soon. Text fidelity is the most frequent complain we receive from iOS users. For the well-known emoji issue they report issue precisely, for this issue they described it vaguely with phrases like "texts look weird" or "things look weird". As soon as we applied our patch, they confirmed that "things look good".

    If this can help, we also noticed a big difference between iOS and android users. The android users tend to tolerate issues, while iOS users don't.

  26. dkwingsmt commented on Feb 27, 2025

    @dkwingsmt
    Contributor

    It seems that this thread is discussing two topics simultaneously. I recommend focusing the topic here on the fond weight of text.

    For letter spacing and line spacing, I recommend discussing under #150824.

  27. delfme commented on Feb 27, 2025

    @delfme

    @dkwingsmt my patch suggested above refers to the fontwieght issue only. But yes we also patched letter spacing and I shared our knowledge at the issue you linked above. Hope this helps.

  28. delfme commented on Jun 20, 2025

    @delfme

    @bdero hope you don't mind the mention, but this critical bug seems unfixable after 2 years, and I was wondering if you might have any ideas for a solution at the engine level. Until it's resolved, Flutter texts rendering on iOS looks noticeably off: FontWeight.normal appears too light, almost like FontWeight.w300, while FontWeight.medium looks like an "thicker" normal. This makes it impossible to display text that looks truly ‘normal’ to users. Not sure why this is marked as P2, as it arguably accounts for about 60% of why text looks non-native on iOS.

  29. delfme commented on Jun 25, 2025

    @delfme

    Could we get an explanation of what causes the fontWeight rendering to be inconsistent between Skia and Impeller?

    Also, is there anything that could be done at the engine level to at least mitigate the issue? For example, could adjusting values like opacity, border, or anti-aliasing help?

  30. delfme commented on Jun 25, 2025

    @delfme

    At first glance, the borders appear correct but lighter. Take a look at this zoomed-in image - the bottom row shows Flutter. The lighter border color makes the text appear to have a thinner fontWeight.
    Perhaps a fix could involve adjusting the opacity - reducing it in light theme (to make the text appear ticker) and increasing it in dark theme (to make the text appear thinner).

    CC: @jonahwilliams

    Image

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: typographyText rendering, possibly libtxtengineflutter/engine related. See also e: labels.found in release: 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions